Last active
April 17, 2024 14:52
-
-
Save erdemyerebasmaz/ada313543571f4df378d6cc2a5b4c146 to your computer and use it in GitHub Desktop.
RUST_LOG=debug flutter_rust_bridge_codegen generate
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2024-04-17T14:47:30.020Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/main.rs:24] cli=Cli { verbose: false, command: Generate(GenerateCommandArgs { watch: false, primary: GenerateCommandArgsPrimary { config_file: None, rust_input: None, dart_output: None, c_output: None, duplicated_c_output: None, rust_root: None, rust_output: None, dart_entrypoint_class_name: None, dart_format_line_length: None, no_dart_enums_style: false, no_add_mod_to_lib: false, llvm_path: None, llvm_compiler_opts: None, dart_root: None, no_build_runner: false, extra_headers: None, no_web: false, no_deps_check: false, default_external_library_loader_web_prefix: None, no_dart3: false, full_dep: false, local: false, dump: None, dump_all: false } }) } | |
[2024-04-17T14:47:30.023Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/binary/commands_parser.rs:8] compute_codegen_config: mode=from_files_auto | |
[2024-04-17T14:47:30.023Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/codegen/config/config_parser.rs:45] Found config file flutter_rust_bridge.yaml | |
[2024-04-17T14:47:30.025Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/codegen/mod.rs:24] config=Config { base_dir: Some(""), rust_input: "../sdk-core/src/binding.rs", dart_output: "lib/generated/", c_output: Some("ios/Classes/frb_generated.h"), duplicated_c_output: None, rust_root: None, rust_output: None, dart_entrypoint_class_name: Some("BreezSdkBindings"), dart_format_line_length: Some(110), dart_enums_style: Some(false), add_mod_to_lib: Some(false), llvm_path: None, llvm_compiler_opts: None, dart_root: None, build_runner: None, extra_headers: None, web: Some(false), deps_check: None, dart3: None, full_dep: Some(true), local: None, default_external_library_loader_web_prefix: None, dump: None, dump_all: None } meta_config=MetaConfig { watch: false } | |
[2024-04-17T14:47:30.025Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/codegen/config/internal_config_parser.rs:42] InternalConfig.parse base_dir="/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter" | |
[2024-04-17T14:47:30.522Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/codegen/mod.rs:27] internal_config=InternalConfig { controller: ControllerInternalConfig { watch: false, watching_paths: ["/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src"], exclude_paths: ["/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/frb_generated.rs", "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/frb_generated.io.rs", "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/frb_generated.web.rs"], max_count: None }, preparer: PreparerInternalConfig { dart_root: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter", deps_check: true, needs_ffigen: true }, parser: ParserInternalConfig { rust_input_path_pack: RustInputPathPack { rust_input_paths: ["/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/binding.rs"] }, rust_crate_dir: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core", force_codec_mode_pack: None, default_stream_sink_codec: Dco, default_rust_opaque_codec: Nom }, generator: GeneratorInternalConfig { api_dart: GeneratorApiDartInternalConfig { dart_enums_style: false, dart3: true, dart_decl_base_output_path: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter/lib/generated", dart_entrypoint_class_name: "BreezSdkBindings" }, wire: GeneratorWireInternalConfig { dart: GeneratorWireDartInternalConfig { has_ffigen: true, web_enabled: false, llvm_path: ["/opt/homebrew/opt/llvm", "/usr/local/opt/llvm", "/usr/lib/llvm-9", "/usr/lib/llvm-10", "/usr/lib/llvm-11", "/usr/lib/llvm-12", "/usr/lib/llvm-13", "/usr/lib/llvm-14", "/usr/lib/", "/usr/lib64/", "C:/Program Files/llvm", "C:/msys64/mingw64"], llvm_compiler_opts: "", dart_root: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter", extra_headers: "", dart_impl_output_path: TargetOrCommonMap { common: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter/lib/generated/frb_generated.dart", io: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter/lib/generated/frb_generated.io.dart", web: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter/lib/generated/frb_generated.web.dart" }, dart_output_class_name_pack: DartOutputClassNamePack { entrypoint_class_name: "BreezSdkBindings", api_class_name: "BreezSdkBindingsApi", api_impl_class_name: "BreezSdkBindingsApiImpl", api_impl_platform_class_name: "BreezSdkBindingsApiImplPlatform", wire_class_name: "BreezSdkBindingsWire", wasm_module_name: "BreezSdkBindingsWasmModule" }, default_external_library_loader: GeneratorWireDartDefaultExternalLibraryLoaderInternalConfig { stem: "breez_sdk_core", io_directory: "../sdk-core/target/release/", web_prefix: "pkg/" }, c_symbol_prefix: "frbgen_breez_sdk_" }, rust: GeneratorWireRustInternalConfig { rust_input_path_pack: RustInputPathPack { rust_input_paths: ["/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/binding.rs"] }, rust_crate_dir: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core", web_enabled: false, rust_output_path: TargetOrCommonMap { common: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/frb_generated.rs", io: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/frb_generated.io.rs", web: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/frb_generated.web.rs" }, c_symbol_prefix: "frbgen_breez_sdk_", has_ffigen: true, default_stream_sink_codec: Dco, default_rust_opaque_codec: Nom }, c: GeneratorWireCInternalConfig { enable: true, rust_crate_dir: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core", rust_output_path: TargetOrCommonMap { common: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/frb_generated.rs", io: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/frb_generated.io.rs", web: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/frb_generated.web.rs" }, c_output_path: Some("/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter/ios/Classes/frb_generated.h"), c_symbol_prefix: "frbgen_breez_sdk_" } } }, polisher: PolisherInternalConfig { duplicated_c_output_path: [], dart_format_line_length: 110, add_mod_to_lib: false, build_runner: true, web_enabled: false, dart_root: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter", rust_crate_dir: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core", rust_output_path: TargetOrCommonMap { common: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/frb_generated.rs", io: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/frb_generated.io.rs", web: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/frb_generated.web.rs" }, c_output_path: Some("/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter/ios/Classes/frb_generated.h"), enable_auto_upgrade: true }, dumper: DumperInternalConfig { dump_contents: [], dump_directory: "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/target/frb_dump" } } | |
[2024-04-17T14:47:30.522Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/utils/dart_repository/dart_repo.rs:22] Guessing toolchain the runner is run into | |
[2024-04-17T14:47:30.523Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/commands/command_runner.rs:129] execute command: bin=sh args="-c \"flutter\" \"--version\"" current_dir=None cmd="sh" "-c" "\"flutter\" \"--version\"" | |
[2024-04-17T14:47:30.930Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/commands/command_runner.rs:140] command="sh" "-c" "\"flutter\" \"--version\"" stdout=Flutter 3.19.5 • channel stable • https://github.com/flutter/flutter.git | |
Framework • revision 300451adae (3 weeks ago) • 2024-03-27 21:54:07 -0500 | |
Engine • revision e76c956498 | |
Tools • Dart 3.3.3 • DevTools 2.31.1 | |
stderr=[2024-04-17T14:47:30Z INFO fenv::context] Config::from(): Found `$FENV_ROOT`: /Users/erdem/.fenv | |
[2024-04-17T14:47:30Z INFO fenv::context] Config::from(): Could not find `$FENV_DIR`. Fallback to `$PWD` | |
[2024-04-17T14:47:30Z INFO fenv::context] Config::from(): Could not find `$PUB_CACHE`. Fallback to `$HOME/.pub-cache` | |
[2024-04-17T14:47:30Z DEBUG fenv] context = RealFenvContext { home: PathLike { inner: FromString("/Users/erdem") }, default_shell: "/bin/zsh", fenv_root: PathLike { inner: FromString("/Users/erdem/.fenv") }, fenv_dir: PathLike { inner: FromString("/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter") }, pub_cache: PathLike { inner: FromString("/Users/erdem/.pub-cache") } } | |
[2024-04-17T14:47:30Z DEBUG fenv] arguments = FenvArgs { debug: false, info: false, command: Which(FenvWhichArgs { executable: "flutter" }) } | |
[2024-04-17T14:47:30Z DEBUG fenv] arguments = FenvArgs { debug: false, info: false, command: VersionName(FenvStartDirArgs { dir: None }) } | |
[2024-04-17T14:47:30Z DEBUG fenv::sdk_service::local_repository] Looking up version file in `/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter` | |
[2024-04-17T14:47:30Z DEBUG fenv::sdk_service::local_repository] Found version file in `/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter` | |
[2024-04-17T14:47:30Z DEBUG fenv] arguments = FenvArgs { debug: false, info: false, command: Prefix(FenvPrefixArgs { prefix: Some("stable") }) } | |
[2024-04-17T14:47:30Z DEBUG fenv] arguments = FenvArgs { debug: false, info: false, command: Latest(FenvLatestArgs { from_remote: false, known: false, quiet: false, prefix: "stable" }) } | |
[2024-04-17T14:47:30Z INFO fenv::context] Config::from(): Found `$FENV_ROOT`: /Users/erdem/.fenv | |
[2024-04-17T14:47:30Z INFO fenv::context] Config::from(): Could not find `$FENV_DIR`. Fallback to `$PWD` | |
[2024-04-17T14:47:30Z INFO fenv::context] Config::from(): Could not find `$PUB_CACHE`. Fallback to `$HOME/.pub-cache` | |
[2024-04-17T14:47:30Z DEBUG fenv] context = RealFenvContext { home: PathLike { inner: FromString("/Users/erdem") }, default_shell: "/bin/zsh", fenv_root: PathLike { inner: FromString("/Users/erdem/.fenv") }, fenv_dir: PathLike { inner: FromString("/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter") }, pub_cache: PathLike { inner: FromString("/Users/erdem/.pub-cache") } } | |
[2024-04-17T14:47:30Z DEBUG fenv] arguments = FenvArgs { debug: false, info: false, command: VersionName(FenvStartDirArgs { dir: None }) } | |
[2024-04-17T14:47:30Z DEBUG fenv::sdk_service::local_repository] Looking up version file in `/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter` | |
[2024-04-17T14:47:30Z DEBUG fenv::sdk_service::local_repository] Found version file in `/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter` | |
[2024-04-17T14:47:30.930Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/utils/dart_repository/dart_repo.rs:71] Checking presence of ffigen in dev_dependencies at /Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter | |
[2024-04-17T14:47:30.931Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/utils/dart_repository/dart_repo.rs:103] Checking presence of ffigen in dev_dependencies at /Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-flutter | |
[2024-04-17T14:47:30.932Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/codegen/parser/reader.rs:22] read_rust_file rust_file_path="/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core/src/binding.rs" module=Some("binding") | |
[2024-04-17T14:47:30.932Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/commands/cargo_expand.rs:31] CachedCargoExpand execute manifest_dir= rust_crate_dir="/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core" | |
[2024-04-17T14:47:30.932Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/commands/cargo_expand.rs:118] Running cargo expand in '"/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core"' | |
[2024-04-17T14:47:30.932Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/commands/command_runner.rs:129] execute command: bin=cargo args="expand --lib --theme=none --ugly" current_dir=Some("/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core") cmd=cd "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core" && RUSTFLAGS="--cfg frb_expand" "cargo" "expand" "--lib" "--theme=none" "--ugly" | |
[2024-04-17T14:47:54.623Z DEBUG /Users/erdem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.32/src/library/commands/command_runner.rs:140] command=cd "/Users/erdem/Documents/GitHub/breez-sdk/libs/sdk-core" && RUSTFLAGS="--cfg frb_expand" "cargo" "expand" "--lib" "--theme=none" "--ugly" stdout=#![feature(prelude_import)] | |
//! # Breez SDK | |
//! | |
//! The Breez SDK enables mobile developers to integrate Lightning and bitcoin payments into their | |
//! apps with a very shallow learning curve. The use cases are endless – from social apps that want | |
//! to integrate tipping between users to content-creation apps interested in adding bitcoin monetization. | |
//! Crucially, this SDK is an end-to-end, non-custodial, drop-in solution powered by Greenlight, | |
//! a built-in LSP, on-chain interoperability, third-party fiat on-ramps, and other services users | |
//! and operators need. | |
//! | |
//! The Breez SDK provides the following services: | |
//! * Sending payments (via various protocols such as: bolt11, keysend, lnurl-pay, lightning address, etc.) | |
//! * Receiving payments (via various protocols such as: bolt11, lnurl-withdraw, etc.) | |
//! * Fetching node status (e.g. balance, max allow to pay, max allow to receive, on-chain balance, etc.) | |
//! * Connecting to a new or existing node. | |
//! | |
//! ## Getting Started | |
//! | |
//! First, make sure you have your API Key and Invite Code ready (see [API Key and Invite Code](#api-key-and-invite-code) section below). | |
//! | |
//! The following code initialize the SDK and make it ready to be used: | |
//! | |
//! ```ignore | |
//! let mnemonic = Mnemonic::generate_in(Language::English, 12)?; | |
//! let seed = mnemonic.to_seed(""); | |
//! let invite_code = Some("...".into()); | |
//! | |
//! let mut config = BreezServices::default_config( | |
//! EnvironmentType::Production, | |
//! "your API key".into(), | |
//! breez_sdk_core::NodeConfig::Greenlight { | |
//! config: GreenlightNodeConfig { partner_credentials: None, invite_code }, | |
//! }, | |
//! ); | |
//! | |
//! // Customize the config object according to your needs | |
//! config.working_dir = "path to an existing directory".into(); | |
//! | |
//! // Connect to the Breez SDK make it ready for use | |
//! let sdk = BreezServices::connect( | |
//! config, | |
//! seed.to_vec(), | |
//! Box::new(AppEventListener {}), | |
//! ) | |
//! .await?; | |
//! | |
//! ``` | |
//! | |
//! We can now receive payments | |
//! | |
//! ```ignore | |
//! let invoice = sdk.receive_payment(3000, "Invoice for 3000 sats".into()).await?; | |
//! ``` | |
//! | |
//! or make payments | |
//! ```ignore | |
//! let bolt11 = "..."; | |
//! sdk.send_payment(bolt11.into(), Some(3000)).await?; | |
//! ``` | |
//! | |
//! At any point we can fetch our balance from the Greenlight node | |
//! ```ignore | |
//! if let Some(node_state) = sdk.node_info()? { | |
//! let balance_ln = node_state.channels_balance_msat; | |
//! let balance_onchain = node_state.onchain_balance_msat; | |
//! } | |
//! ``` | |
//! | |
//! or fetch other useful infos, like the current mempool [RecommendedFees] | |
//! ```ignore | |
//! let fees: RecommendedFees = sdk.recommended_fees().await?; | |
//! ``` | |
//! | |
//! These different types of operations are described below in more detail. | |
//! | |
//! ### A. Initializing the SDK | |
//! | |
//! There are two simple steps necessary to initialize the SDK: | |
//! | |
//! 1. [BreezServices::default_config] to construct the sdk configuration | |
//! 2. [BreezServices::connect] to connect to your node and start all required Breez SDK services | |
//! | |
//! The first step takes the [EnvironmentType] and [NodeConfig] as arguments. Although you can create | |
//! your own config from scratch it is recommended to use the [BreezServices::default_config] method and | |
//! customize it according to your needs. | |
//! Once the [NodeConfig] is created it is passed to the [BreezServices::connect] method along with the seed and and implementation of [EventListener] which is used to | |
//! notify the caller of SDK events. | |
//! | |
//! Now your SDK is ready to be used. | |
//! | |
//! ### B. Sending and receiving Lightning payments | |
//! | |
//! Supported BOLT11 operations are | |
//! | |
//! * [BreezServices::receive_payment] to create an invoice | |
//! * [BreezServices::send_payment] to pay an invoice | |
//! * [BreezServices::send_spontaneous_payment] for keysend payments | |
//! | |
//! ### C. Receiving an on-chain transaction (swap-in) | |
//! | |
//! * [BreezServices::receive_onchain] accepting an optional user-selected [OpeningFeeParams] for | |
//! the case when the operation requires a new channel with the LSP | |
//! * [BreezServices::in_progress_swap] | |
//! * [BreezServices::list_refundables] to get a list of swaps | |
//! * [BreezServices::refund] to broadcast a transaction for failed or expired swaps | |
//! | |
//! ### D. Sending to an on-chain address (swap-out) | |
//! | |
//! * [BreezServices::fetch_reverse_swap_fees] to get the current swap-out fees | |
//! * [BreezServices::send_onchain] to start the swap-out | |
//! * [BreezServices::in_progress_reverse_swaps] to see any in-progress swaps | |
//! | |
//! ### E. Using LNURL | |
//! | |
//! 1. [parse] the LNURL endpoint URL to get the workflow parameters. | |
//! 2. After getting the user input or confirmation, complete the workflow with [BreezServices::lnurl_pay] or | |
//! [BreezServices::lnurl_withdraw]. | |
//! | |
//! ### F. Supporting fiat currencies | |
//! | |
//! * [BreezServices::list_fiat_currencies] to get the supported fiat currencies | |
//! * [BreezServices::fetch_fiat_rates] to get the current exchange rates | |
//! * [BreezServices::recommended_fees] for the recommended mempool fees | |
//! | |
//! ### G. Connecting to an LSP | |
//! | |
//! * [BreezServices::list_lsps] to get a list of available LSPs | |
//! * [BreezServices::connect_lsp] to connect to a chosen LSP | |
//! * [BreezServices::lsp_info] to get [LspInformation] on the currently selected LSP | |
//! | |
//! ### H. Utilities | |
//! | |
//! Use [parse] to parse generic input. The input can come from the user, from a clicked link or from a QR code. | |
//! The resulting [InputType] will tell you what the input is and how to treat it, as well as present relevant payload data | |
//! in a structured form. | |
//! | |
//! | |
//! ## Bindings | |
//! | |
//! * C# | |
//! * Dart | |
//! * Go | |
//! * Kotlin | |
//! * Python | |
//! * React-Native | |
//! * Swift | |
//! | |
//! | |
//! ## API Key and Invite Code | |
//! | |
//! You will need an API Key to use the SDK, as well as an Invite Code when you create a new node. | |
//! | |
//! To get both of them, please contact Breez via email at <contact@breez.technology> or at <https://breez.technology/#contact-us-form> | |
//! | |
//! ## Support | |
//! | |
//! Join this [telegram group](https://t.me/breezsdk). | |
#[prelude_import] | |
use std::prelude::rust_2021::*; | |
#[macro_use] | |
extern crate std; | |
mod frb_generated { | |
/* AUTO INJECTED BY flutter_rust_bridge. This line may not be accurate, and you can change it according to your needs. */ | |
// flutter_rust_bridge_codegen: has to be defined before breez_services | |
// flutter_rust_bridge_codegen: has to be defined before greenlight; greenlight::node_api | |
// GRPC structs are documented as follows: | |
// - if they are mirrored in Rust model structs, documented in the model structs | |
// - if there is no corresponding model struct, documented in breez.proto | |
// flutter_rust_bridge_codegen: has to be defined after grpc; grpc::Rate | |
// Re-use crates from gl_client for consistency | |
#![allow(non_camel_case_types, unused, non_snake_case, clippy :: | |
needless_return, clippy :: redundant_closure_call, clippy :: | |
redundant_closure, clippy :: useless_conversion, clippy :: unit_arg, | |
clippy :: unused_unit, clippy :: double_parens, clippy :: let_and_return, | |
clippy :: too_many_arguments, clippy :: match_single_binding)] | |
use flutter_rust_bridge::for_generated::byteorder::{ | |
NativeEndian, ReadBytesExt, WriteBytesExt, | |
}; | |
use flutter_rust_bridge::for_generated::transform_result_dco; | |
use flutter_rust_bridge::{Handler, IntoIntoDart}; | |
#[doc(hidden)] | |
pub(crate) struct FrbWrapper<T>(T); | |
impl<T: Clone> Clone for FrbWrapper<T> { | |
fn clone(&self) -> Self { FrbWrapper(self.0.clone()) } | |
} | |
impl<T: PartialEq> PartialEq for FrbWrapper<T> { | |
fn eq(&self, other: &Self) -> bool { self.0.eq(&other.0) } | |
} | |
impl<T: Eq> Eq for FrbWrapper<T> {} | |
impl<T: std::hash::Hash> std::hash::Hash for FrbWrapper<T> { | |
fn hash<H: std::hash::Hasher>(&self, state: &mut H) { | |
self.0.hash(state) | |
} | |
} | |
impl<T> From<T> for FrbWrapper<T> { | |
fn from(t: T) -> Self { FrbWrapper(t) } | |
} | |
use std::collections::HashMap; | |
use std::marker::PhantomData; | |
use std::sync::Arc; | |
pub struct MoiArc<T: ?Sized + MoiArcValue> { | |
object_id: Option<ObjectId>, | |
value: Option<Arc<T>>, | |
_phantom: PhantomData<T>, | |
} | |
#[automatically_derived] | |
impl<T: ::core::fmt::Debug + ?Sized + MoiArcValue> ::core::fmt::Debug for | |
MoiArc<T> { | |
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { | |
::core::fmt::Formatter::debug_struct_field3_finish(f, "MoiArc", | |
"object_id", &self.object_id, "value", &self.value, | |
"_phantom", &&self._phantom) | |
} | |
} | |
impl<T: ?Sized + MoiArcValue> Drop for MoiArc<T> { | |
fn drop(&mut self) { | |
if let Some(object_id) = self.object_id { | |
Self::decrement_strong_count(object_id); | |
} | |
} | |
} | |
impl<T: ?Sized + MoiArcValue> AsRef<T> for MoiArc<T> { | |
fn as_ref(&self) -> &T { self.value.as_ref().unwrap().as_ref() } | |
} | |
impl<T: ?Sized + MoiArcValue> | |
::flutter_rust_bridge::for_generated::BaseArc<T> for MoiArc<T> { | |
fn new(value: T) -> Self where T: Sized { | |
let mut pool = T::get_pool().write().unwrap(); | |
let object_id = pool.id_generator.next_id(); | |
let value = Arc::new(value); | |
let old_value = | |
pool.map.insert(object_id, | |
MoiArcPoolValue { ref_count: 1, value: value.clone() }); | |
if !old_value.is_none() { | |
::core::panicking::panic("assertion failed: old_value.is_none()") | |
}; | |
Self { | |
object_id: Some(object_id), | |
value: Some(value), | |
_phantom: PhantomData, | |
} | |
} | |
fn try_unwrap(mut self) -> Result<T, Self> where T: Sized { | |
let pool = &mut T::get_pool().write().unwrap(); | |
if pool.map.get(&self.object_id.unwrap()).unwrap().ref_count == 1 | |
{ | |
Self::decrement_strong_count_raw(self.object_id.unwrap(), | |
pool); | |
self.object_id.take().unwrap(); | |
Ok(Arc::into_inner(self.value.take().unwrap()).unwrap()) | |
} else { Err(self) } | |
} | |
fn into_inner(self) -> Option<T> where T: Sized { | |
self.try_unwrap().ok() | |
} | |
fn into_raw(mut self) -> usize { self.object_id.take().unwrap() } | |
} | |
impl<T: ?Sized + MoiArcValue> Clone for MoiArc<T> { | |
fn clone(&self) -> Self { | |
Self::increment_strong_count(self.object_id.unwrap()); | |
Self { | |
object_id: self.object_id, | |
value: self.value.clone(), | |
_phantom: PhantomData, | |
} | |
} | |
} | |
impl<T: ?Sized + MoiArcValue> MoiArc<T> { | |
pub(crate) fn from_raw(raw: usize) -> Self where T: Sized { | |
let map = &T::get_pool().read().unwrap().map; | |
Self { | |
object_id: Some(raw), | |
value: Some(map.get(&raw).unwrap().value.clone()), | |
_phantom: PhantomData, | |
} | |
} | |
pub fn increment_strong_count(raw: usize) { | |
let map = &mut T::get_pool().write().unwrap().map; | |
map.get_mut(&raw).unwrap().ref_count += 1; | |
} | |
pub fn decrement_strong_count(raw: usize) { | |
Self::decrement_strong_count_raw(raw, | |
&mut T::get_pool().write().unwrap()) | |
} | |
fn decrement_strong_count_raw(raw: usize, | |
pool: &mut MoiArcPoolInner<T>) { | |
let value = pool.map.get_mut(&raw).unwrap(); | |
value.ref_count -= 1; | |
if value.ref_count == 0 { pool.map.remove(&raw).unwrap(); } | |
} | |
} | |
pub trait MoiArcValue: 'static { | |
fn get_pool() | |
-> &'static MoiArcPool<Self>; | |
} | |
type ObjectId = usize; | |
pub type MoiArcPool<T> = std::sync::RwLock<MoiArcPoolInner<T>>; | |
pub struct MoiArcPoolInner<T: ?Sized> { | |
map: HashMap<ObjectId, MoiArcPoolValue<T>>, | |
id_generator: IdGenerator, | |
} | |
impl<T: ?Sized> Default for MoiArcPoolInner<T> { | |
fn default() -> Self { | |
Self { map: HashMap::new(), id_generator: Default::default() } | |
} | |
} | |
struct IdGenerator { | |
next_id: ObjectId, | |
} | |
impl Default for IdGenerator { | |
fn default() -> Self { Self { next_id: Self::MIN_ID } } | |
} | |
impl IdGenerator { | |
const MIN_ID: ObjectId = 1; | |
const MAX_ID: ObjectId = 2147483600; | |
fn next_id(&mut self) -> ObjectId { | |
let ans = self.next_id; | |
self.next_id = | |
if self.next_id >= Self::MAX_ID { | |
Self::MIN_ID | |
} else { self.next_id + 1 }; | |
ans | |
} | |
} | |
impl<T: ?Sized> MoiArcPoolInner<T> {} | |
struct MoiArcPoolValue<T: ?Sized> { | |
ref_count: i32, | |
value: Arc<T>, | |
} | |
use ::flutter_rust_bridge::for_generated::decode_rust_opaque_nom; | |
fn decode_rust_opaque_moi<T: MoiArcValue + Send + Sync>(ptr: usize) | |
-> RustOpaqueMoi<T> { | |
RustOpaqueMoi::from_arc(MoiArc::<T>::from_raw(ptr)) | |
} | |
use ::flutter_rust_bridge::for_generated::StdArc; | |
use ::flutter_rust_bridge::RustOpaqueNom; | |
/// Please refer to `RustOpaque` for doc. | |
pub type RustOpaqueMoi<T> = | |
::flutter_rust_bridge::for_generated::RustOpaqueBase<T, MoiArc<T>>; | |
/// A wrapper to support [arbitrary Rust types](https://cjycode.com/flutter_rust_bridge/guides/types/arbitrary). | |
pub type RustOpaque<T> = RustOpaqueNom<T>; | |
use ::flutter_rust_bridge::RustAutoOpaqueNom; | |
/// Please refer to `RustAutoOpaque` for doc. | |
pub type RustAutoOpaqueMoi<T> = | |
::flutter_rust_bridge::for_generated::RustAutoOpaqueBase<T, | |
MoiArc<::flutter_rust_bridge::for_generated::rust_async::RwLock<T>>>; | |
/// Usually this is unneeded, and just write down arbitrary types. | |
/// However, when you need arbitrary types at places that are not supported yet, | |
/// use `RustOpaqueOpaque<YourArbitraryType>`. | |
pub type RustAutoOpaque<T> = RustAutoOpaqueNom<T>; | |
pub trait CstDecode<T> { | |
fn cst_decode(self) | |
-> T; | |
} | |
impl<T, S> CstDecode<Option<T>> for *mut S where *mut S: CstDecode<T> { | |
fn cst_decode(self) -> Option<T> { | |
(!self.is_null()).then(|| self.cst_decode()) | |
} | |
} | |
pub trait SseDecode { | |
fn sse_decode(deserializer: | |
&mut ::flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self; | |
fn sse_decode_single(message: | |
::flutter_rust_bridge::for_generated::Dart2RustMessageSse) | |
-> Self where Self: Sized { | |
let mut deserializer = | |
::flutter_rust_bridge::for_generated::SseDeserializer::new(message); | |
let ans = Self::sse_decode(&mut deserializer); | |
deserializer.end(); | |
ans | |
} | |
} | |
pub trait SseEncode { | |
fn sse_encode(self, | |
serializer: &mut ::flutter_rust_bridge::for_generated::SseSerializer); | |
} | |
fn transform_result_sse<T, E>(raw: Result<T, E>) | |
-> | |
Result<::flutter_rust_bridge::for_generated::Rust2DartMessageSse, | |
::flutter_rust_bridge::for_generated::Rust2DartMessageSse> where | |
T: SseEncode, E: SseEncode { | |
use ::flutter_rust_bridge::for_generated::{Rust2DartAction, SseCodec}; | |
match raw { | |
Ok(raw) => | |
Ok(SseCodec::encode(Rust2DartAction::Success, | |
|serializer| { raw.sse_encode(serializer) })), | |
Err(raw) => | |
Err(SseCodec::encode(Rust2DartAction::Error, | |
|serializer| { raw.sse_encode(serializer) })), | |
} | |
} | |
pub struct StreamSink<T, | |
Rust2DartCodec: ::flutter_rust_bridge::for_generated::BaseCodec = | |
::flutter_rust_bridge::for_generated::DcoCodec> { | |
base: ::flutter_rust_bridge::for_generated::StreamSinkBase<T, | |
Rust2DartCodec>, | |
} | |
#[automatically_derived] | |
impl<T: ::core::clone::Clone, Rust2DartCodec: ::core::clone::Clone + | |
::flutter_rust_bridge::for_generated::BaseCodec> ::core::clone::Clone | |
for StreamSink<T, Rust2DartCodec> { | |
#[inline] | |
fn clone(&self) -> StreamSink<T, Rust2DartCodec> { | |
StreamSink { base: ::core::clone::Clone::clone(&self.base) } | |
} | |
} | |
impl<T, Rust2DartCodec: ::flutter_rust_bridge::for_generated::BaseCodec> | |
StreamSink<T, Rust2DartCodec> { | |
pub fn deserialize(raw: String) -> Self { | |
Self { | |
base: ::flutter_rust_bridge::for_generated::StreamSinkBase::deserialize(raw), | |
} | |
} | |
} | |
impl<T> StreamSink<T, ::flutter_rust_bridge::for_generated::DcoCodec> { | |
pub fn add<T2>(&self, value: T) | |
-> Result<(), ::flutter_rust_bridge::Rust2DartSendError> where | |
T: ::flutter_rust_bridge::IntoIntoDart<T2>, | |
T2: ::flutter_rust_bridge::IntoDart { | |
self.base.add(::flutter_rust_bridge::for_generated::DcoCodec::encode(::flutter_rust_bridge::for_generated::Rust2DartAction::Success, | |
value.into_into_dart())) | |
} | |
} | |
impl<T> StreamSink<T, ::flutter_rust_bridge::for_generated::SseCodec> | |
where T: SseEncode { | |
pub fn add(&self, value: T) | |
-> Result<(), ::flutter_rust_bridge::Rust2DartSendError> { | |
self.base.add(::flutter_rust_bridge::for_generated::SseCodec::encode(::flutter_rust_bridge::for_generated::Rust2DartAction::Success, | |
|serializer| value.sse_encode(serializer))) | |
} | |
} | |
impl<T, Rust2DartCodec: ::flutter_rust_bridge::for_generated::BaseCodec> | |
::flutter_rust_bridge::IntoIntoDart<StreamSink<T, Rust2DartCodec>> for | |
StreamSink<T, Rust2DartCodec> { | |
fn into_into_dart(self) -> StreamSink<T, Rust2DartCodec> { | |
::core::panicking::panic("internal error: entered unreachable code") | |
} | |
} | |
impl<T, Rust2DartCodec: ::flutter_rust_bridge::for_generated::BaseCodec> | |
::flutter_rust_bridge::IntoDart for StreamSink<T, Rust2DartCodec> { | |
fn into_dart(self) -> ::flutter_rust_bridge::for_generated::DartAbi { | |
::core::panicking::panic("internal error: entered unreachable code") | |
} | |
} | |
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = | |
"2.0.0-dev.32"; | |
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = | |
-924313952; | |
#[allow(missing_copy_implementations)] | |
#[allow(non_camel_case_types)] | |
#[allow(dead_code)] | |
pub struct FLUTTER_RUST_BRIDGE_HANDLER { | |
__private_field: (), | |
} | |
#[doc(hidden)] | |
pub static FLUTTER_RUST_BRIDGE_HANDLER: FLUTTER_RUST_BRIDGE_HANDLER = | |
FLUTTER_RUST_BRIDGE_HANDLER { __private_field: () }; | |
impl ::lazy_static::__Deref for FLUTTER_RUST_BRIDGE_HANDLER { | |
type Target = | |
::flutter_rust_bridge::DefaultHandler<::flutter_rust_bridge::for_generated::SimpleThreadPool>; | |
fn deref(&self) | |
-> | |
&::flutter_rust_bridge::DefaultHandler<::flutter_rust_bridge::for_generated::SimpleThreadPool> { | |
#[inline(always)] | |
fn __static_ref_initialize() | |
-> | |
::flutter_rust_bridge::DefaultHandler<::flutter_rust_bridge::for_generated::SimpleThreadPool> { | |
{ | |
match (&FLUTTER_RUST_BRIDGE_CODEGEN_VERSION, | |
&flutter_rust_bridge::for_generated::FLUTTER_RUST_BRIDGE_RUNTIME_VERSION) | |
{ | |
(left_val, right_val) => { | |
if !(*left_val == *right_val) { | |
let kind = ::core::panicking::AssertKind::Eq; | |
::core::panicking::assert_failed(kind, &*left_val, | |
&*right_val, | |
::core::option::Option::Some(format_args!("Please ensure flutter_rust_bridge\'s codegen ({0}) and runtime ({1}) versions are the same", | |
FLUTTER_RUST_BRIDGE_CODEGEN_VERSION, | |
flutter_rust_bridge::for_generated::FLUTTER_RUST_BRIDGE_RUNTIME_VERSION))); | |
} | |
} | |
}; | |
::flutter_rust_bridge::DefaultHandler::new_simple(Default::default()) | |
} | |
} | |
#[inline(always)] | |
fn __stability() | |
-> | |
&'static ::flutter_rust_bridge::DefaultHandler<::flutter_rust_bridge::for_generated::SimpleThreadPool> { | |
static LAZY: | |
::lazy_static::lazy::Lazy<::flutter_rust_bridge::DefaultHandler<::flutter_rust_bridge::for_generated::SimpleThreadPool>> | |
= | |
::lazy_static::lazy::Lazy::INIT; | |
LAZY.get(__static_ref_initialize) | |
} | |
__stability() | |
} | |
} | |
impl ::lazy_static::LazyStatic for FLUTTER_RUST_BRIDGE_HANDLER { | |
fn initialize(lazy: &Self) { let _ = &**lazy; } | |
} | |
fn wire_backup_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "backup", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || crate::binding::backup())())) | |
} | |
fn wire_backup_status_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "backup_status", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || | |
crate::binding::backup_status())())) | |
} | |
fn wire_breez_events_stream_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
s: | |
impl CstDecode<StreamSink<crate::breez_services::BreezEvent, | |
flutter_rust_bridge::for_generated::DcoCodec>>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "breez_events_stream", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_s = s.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::breez_events_stream(api_s))()) | |
} | |
}) | |
} | |
fn wire_breez_log_stream_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
s: | |
impl CstDecode<StreamSink<crate::models::LogEntry, | |
flutter_rust_bridge::for_generated::DcoCodec>>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "breez_log_stream", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_s = s.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::breez_log_stream(api_s))()) | |
}) | |
} | |
fn wire_buy_bitcoin_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::BuyBitcoinRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "buy_bitcoin", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::buy_bitcoin(api_req))()) | |
}) | |
} | |
fn wire_check_message_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::breez_services::CheckMessageRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "check_message", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::check_message(api_req))()) | |
}) | |
} | |
fn wire_close_lsp_channels_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "close_lsp_channels", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
move |context| | |
transform_result_dco((move || | |
crate::binding::close_lsp_channels())()) | |
}) | |
} | |
fn wire_configure_node_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::ConfigureNodeRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "configure_node", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::configure_node(api_req))()) | |
}) | |
} | |
fn wire_connect_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::ConnectRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "connect", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::connect(api_req))()) | |
}) | |
} | |
fn wire_connect_lsp_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
lsp_id: impl CstDecode<String>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "connect_lsp", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_lsp_id = lsp_id.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::connect_lsp(api_lsp_id))()) | |
}) | |
} | |
fn wire_default_config_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
env_type: impl CstDecode<crate::models::EnvironmentType>, | |
api_key: impl CstDecode<String>, | |
node_config: impl CstDecode<crate::models::NodeConfig>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "default_config", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_env_type = env_type.cst_decode(); | |
let api_api_key = api_key.cst_decode(); | |
let api_node_config = node_config.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
{ | |
Result::<_, | |
()>::Ok(crate::binding::default_config(api_env_type, | |
api_api_key, api_node_config)) | |
})()) | |
} | |
}) | |
} | |
fn wire_disconnect_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "disconnect", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || | |
crate::binding::disconnect())())) | |
} | |
fn wire_execute_command_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
command: impl CstDecode<String>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "execute_command", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_command = command.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::execute_command(api_command))()) | |
} | |
}) | |
} | |
fn wire_fetch_fiat_rates_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "fetch_fiat_rates", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || | |
crate::binding::fetch_fiat_rates())())) | |
} | |
fn wire_fetch_lsp_info_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
id: impl CstDecode<String>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "fetch_lsp_info", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_id = id.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::fetch_lsp_info(api_id))()) | |
}) | |
} | |
fn wire_fetch_reverse_swap_fees_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::ReverseSwapFeesRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "fetch_reverse_swap_fees", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::fetch_reverse_swap_fees(api_req))()) | |
} | |
}) | |
} | |
fn wire_generate_diagnostic_data_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "generate_diagnostic_data", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::generate_diagnostic_data())()) | |
} | |
}) | |
} | |
fn wire_in_progress_onchain_payments_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "in_progress_onchain_payments", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::in_progress_onchain_payments())()) | |
} | |
}) | |
} | |
fn wire_in_progress_reverse_swaps_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "in_progress_reverse_swaps", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::in_progress_reverse_swaps())()) | |
} | |
}) | |
} | |
fn wire_in_progress_swap_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "in_progress_swap", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || | |
crate::binding::in_progress_swap())())) | |
} | |
fn wire_is_initialized_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "is_initialized", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
move |context| | |
{ | |
transform_result_dco((move || | |
{ | |
Result::<_, ()>::Ok(crate::binding::is_initialized()) | |
})()) | |
} | |
}) | |
} | |
fn wire_list_fiat_currencies_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "list_fiat_currencies", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
move |context| | |
transform_result_dco((move || | |
crate::binding::list_fiat_currencies())()) | |
}) | |
} | |
fn wire_list_lsps_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "list_lsps", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || | |
crate::binding::list_lsps())())) | |
} | |
fn wire_list_payments_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::ListPaymentsRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "list_payments", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::list_payments(api_req))()) | |
}) | |
} | |
fn wire_list_refundables_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "list_refundables", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || | |
crate::binding::list_refundables())())) | |
} | |
fn wire_lnurl_auth_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req_data: impl CstDecode<crate::input_parser::LnUrlAuthRequestData>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "lnurl_auth", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req_data = req_data.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
{ crate::binding::lnurl_auth(api_req_data) })()) | |
} | |
}) | |
} | |
fn wire_lnurl_pay_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::LnUrlPayRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "lnurl_pay", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::lnurl_pay(api_req))()) | |
}) | |
} | |
fn wire_lnurl_withdraw_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::LnUrlWithdrawRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "lnurl_withdraw", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::lnurl_withdraw(api_req))()) | |
}) | |
} | |
fn wire_lsp_id_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "lsp_id", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || crate::binding::lsp_id())())) | |
} | |
fn wire_lsp_info_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "lsp_info", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || | |
crate::binding::lsp_info())())) | |
} | |
fn wire_max_reverse_swap_amount_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "max_reverse_swap_amount", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::max_reverse_swap_amount())()) | |
} | |
}) | |
} | |
fn wire_mnemonic_to_seed_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
phrase: impl CstDecode<String>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "mnemonic_to_seed", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_phrase = phrase.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::mnemonic_to_seed(api_phrase))()) | |
} | |
}) | |
} | |
fn wire_node_credentials_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "node_credentials", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || | |
crate::binding::node_credentials())())) | |
} | |
fn wire_node_info_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "node_info", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || | |
crate::binding::node_info())())) | |
} | |
fn wire_onchain_payment_limits_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "onchain_payment_limits", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
move |context| | |
{ | |
transform_result_dco((move || | |
{ crate::binding::onchain_payment_limits() })()) | |
} | |
}) | |
} | |
fn wire_open_channel_fee_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::OpenChannelFeeRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "open_channel_fee", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::open_channel_fee(api_req))()) | |
} | |
}) | |
} | |
fn wire_parse_input_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
input: impl CstDecode<String>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "parse_input", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_input = input.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::parse_input(api_input))()) | |
}) | |
} | |
fn wire_parse_invoice_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
invoice: impl CstDecode<String>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "parse_invoice", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_invoice = invoice.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::parse_invoice(api_invoice))()) | |
} | |
}) | |
} | |
fn wire_pay_onchain_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::PayOnchainRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "pay_onchain", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::pay_onchain(api_req))()) | |
}) | |
} | |
fn wire_payment_by_hash_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
hash: impl CstDecode<String>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "payment_by_hash", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_hash = hash.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::payment_by_hash(api_hash))()) | |
} | |
}) | |
} | |
fn wire_prepare_onchain_payment_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::PrepareOnchainPaymentRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "prepare_onchain_payment", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::prepare_onchain_payment(api_req))()) | |
} | |
}) | |
} | |
fn wire_prepare_redeem_onchain_funds_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: | |
impl CstDecode<crate::models::PrepareRedeemOnchainFundsRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "prepare_redeem_onchain_funds", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
{ | |
crate::binding::prepare_redeem_onchain_funds(api_req) | |
})()) | |
} | |
}) | |
} | |
fn wire_prepare_refund_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::PrepareRefundRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "prepare_refund", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::prepare_refund(api_req))()) | |
}) | |
} | |
fn wire_receive_onchain_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::ReceiveOnchainRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "receive_onchain", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
{ crate::binding::receive_onchain(api_req) })()) | |
} | |
}) | |
} | |
fn wire_receive_payment_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::ReceivePaymentRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "receive_payment", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
{ crate::binding::receive_payment(api_req) })()) | |
} | |
}) | |
} | |
fn wire_recommended_fees_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "recommended_fees", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || | |
crate::binding::recommended_fees())())) | |
} | |
fn wire_redeem_onchain_funds_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::RedeemOnchainFundsRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "redeem_onchain_funds", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::redeem_onchain_funds(api_req))()) | |
} | |
}) | |
} | |
fn wire_redeem_swap_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
swap_address: impl CstDecode<String>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "redeem_swap", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_swap_address = swap_address.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::redeem_swap(api_swap_address))()) | |
} | |
}) | |
} | |
fn wire_refund_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::RefundRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "refund", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::refund(api_req))()) | |
}) | |
} | |
fn wire_register_webhook_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
webhook_url: impl CstDecode<String>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "register_webhook", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_webhook_url = webhook_url.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::register_webhook(api_webhook_url))()) | |
} | |
}) | |
} | |
fn wire_report_issue_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::ReportIssueRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "report_issue", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::report_issue(api_req))()) | |
}) | |
} | |
fn wire_rescan_swaps_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "rescan_swaps", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || | |
crate::binding::rescan_swaps())())) | |
} | |
fn wire_send_onchain_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::SendOnchainRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "send_onchain", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::send_onchain(api_req))()) | |
}) | |
} | |
fn wire_send_payment_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::SendPaymentRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "send_payment", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::send_payment(api_req))()) | |
}) | |
} | |
fn wire_send_spontaneous_payment_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::SendSpontaneousPaymentRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "send_spontaneous_payment", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::send_spontaneous_payment(api_req))()) | |
} | |
}) | |
} | |
fn wire_service_health_check_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
api_key: impl CstDecode<String>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "service_health_check", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_api_key = api_key.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
crate::binding::service_health_check(api_api_key))()) | |
} | |
}) | |
} | |
fn wire_set_payment_metadata_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
hash: impl CstDecode<String>, metadata: impl CstDecode<String>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "set_payment_metadata", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_hash = hash.cst_decode(); | |
let api_metadata = metadata.cst_decode(); | |
move |context| | |
{ | |
transform_result_dco((move || | |
{ | |
crate::binding::set_payment_metadata(api_hash, api_metadata) | |
})()) | |
} | |
}) | |
} | |
fn wire_sign_message_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::breez_services::SignMessageRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "sign_message", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::sign_message(api_req))()) | |
}) | |
} | |
fn wire_static_backup_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort, | |
req: impl CstDecode<crate::models::StaticBackupRequest>) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "static_backup", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
{ | |
let api_req = req.cst_decode(); | |
move |context| | |
transform_result_dco((move || | |
crate::binding::static_backup(api_req))()) | |
}) | |
} | |
fn wire_sync_impl(port_: | |
flutter_rust_bridge::for_generated::MessagePort) { | |
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, | |
_, | |
_>(flutter_rust_bridge::for_generated::TaskInfo { | |
debug_name: "sync", | |
port: Some(port_), | |
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, | |
}, | |
move || | |
move |context| | |
transform_result_dco((move || crate::binding::sync())())) | |
} | |
impl CstDecode<bool> for bool { | |
fn cst_decode(self) -> bool { self } | |
} | |
impl CstDecode<crate::models::BuyBitcoinProvider> for i32 { | |
fn cst_decode(self) -> crate::models::BuyBitcoinProvider { | |
match self { | |
0 => crate::models::BuyBitcoinProvider::Moonpay, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for BuyBitcoinProvider: {0}", | |
self))); | |
} | |
} | |
} | |
} | |
impl CstDecode<crate::models::ChannelState> for i32 { | |
fn cst_decode(self) -> crate::models::ChannelState { | |
match self { | |
0 => crate::models::ChannelState::PendingOpen, | |
1 => crate::models::ChannelState::Opened, | |
2 => crate::models::ChannelState::PendingClose, | |
3 => crate::models::ChannelState::Closed, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for ChannelState: {0}", | |
self))); | |
} | |
} | |
} | |
} | |
impl CstDecode<crate::models::EnvironmentType> for i32 { | |
fn cst_decode(self) -> crate::models::EnvironmentType { | |
match self { | |
0 => crate::models::EnvironmentType::Production, | |
1 => crate::models::EnvironmentType::Staging, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for EnvironmentType: {0}", | |
self))); | |
} | |
} | |
} | |
} | |
impl CstDecode<f64> for f64 { | |
fn cst_decode(self) -> f64 { self } | |
} | |
impl CstDecode<crate::models::HealthCheckStatus> for i32 { | |
fn cst_decode(self) -> crate::models::HealthCheckStatus { | |
match self { | |
0 => crate::models::HealthCheckStatus::Operational, | |
1 => crate::models::HealthCheckStatus::Maintenance, | |
2 => crate::models::HealthCheckStatus::ServiceDisruption, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for HealthCheckStatus: {0}", | |
self))); | |
} | |
} | |
} | |
} | |
impl CstDecode<i32> for i32 { | |
fn cst_decode(self) -> i32 { self } | |
} | |
impl CstDecode<i64> for i64 { | |
fn cst_decode(self) -> i64 { self } | |
} | |
impl CstDecode<crate::models::Network> for i32 { | |
fn cst_decode(self) -> crate::models::Network { | |
match self { | |
0 => crate::models::Network::Bitcoin, | |
1 => crate::models::Network::Testnet, | |
2 => crate::models::Network::Signet, | |
3 => crate::models::Network::Regtest, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for Network: {0}", self))); | |
} | |
} | |
} | |
} | |
impl CstDecode<crate::models::PaymentStatus> for i32 { | |
fn cst_decode(self) -> crate::models::PaymentStatus { | |
match self { | |
0 => crate::models::PaymentStatus::Pending, | |
1 => crate::models::PaymentStatus::Complete, | |
2 => crate::models::PaymentStatus::Failed, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for PaymentStatus: {0}", | |
self))); | |
} | |
} | |
} | |
} | |
impl CstDecode<crate::models::PaymentType> for i32 { | |
fn cst_decode(self) -> crate::models::PaymentType { | |
match self { | |
0 => crate::models::PaymentType::Sent, | |
1 => crate::models::PaymentType::Received, | |
2 => crate::models::PaymentType::ClosedChannel, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for PaymentType: {0}", | |
self))); | |
} | |
} | |
} | |
} | |
impl CstDecode<crate::models::PaymentTypeFilter> for i32 { | |
fn cst_decode(self) -> crate::models::PaymentTypeFilter { | |
match self { | |
0 => crate::models::PaymentTypeFilter::Sent, | |
1 => crate::models::PaymentTypeFilter::Received, | |
2 => crate::models::PaymentTypeFilter::ClosedChannel, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for PaymentTypeFilter: {0}", | |
self))); | |
} | |
} | |
} | |
} | |
impl CstDecode<crate::models::ReverseSwapStatus> for i32 { | |
fn cst_decode(self) -> crate::models::ReverseSwapStatus { | |
match self { | |
0 => crate::models::ReverseSwapStatus::Initial, | |
1 => crate::models::ReverseSwapStatus::InProgress, | |
2 => crate::models::ReverseSwapStatus::Cancelled, | |
3 => crate::models::ReverseSwapStatus::CompletedSeen, | |
4 => crate::models::ReverseSwapStatus::CompletedConfirmed, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for ReverseSwapStatus: {0}", | |
self))); | |
} | |
} | |
} | |
} | |
impl CstDecode<crate::models::SwapAmountType> for i32 { | |
fn cst_decode(self) -> crate::models::SwapAmountType { | |
match self { | |
0 => crate::models::SwapAmountType::Send, | |
1 => crate::models::SwapAmountType::Receive, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for SwapAmountType: {0}", | |
self))); | |
} | |
} | |
} | |
} | |
impl CstDecode<crate::models::SwapStatus> for i32 { | |
fn cst_decode(self) -> crate::models::SwapStatus { | |
match self { | |
0 => crate::models::SwapStatus::Initial, | |
1 => crate::models::SwapStatus::WaitingConfirmation, | |
2 => crate::models::SwapStatus::Redeemable, | |
3 => crate::models::SwapStatus::Redeemed, | |
4 => crate::models::SwapStatus::Refundable, | |
5 => crate::models::SwapStatus::Completed, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for SwapStatus: {0}", self))); | |
} | |
} | |
} | |
} | |
impl CstDecode<u16> for u16 { | |
fn cst_decode(self) -> u16 { self } | |
} | |
impl CstDecode<u32> for u32 { | |
fn cst_decode(self) -> u32 { self } | |
} | |
impl CstDecode<u64> for u64 { | |
fn cst_decode(self) -> u64 { self } | |
} | |
impl CstDecode<u8> for u8 { | |
fn cst_decode(self) -> u8 { self } | |
} | |
impl SseDecode for flutter_rust_bridge::for_generated::anyhow::Error { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
{ | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!(""))); | |
}; | |
} | |
} | |
impl SseDecode for | |
StreamSink<crate::breez_services::BreezEvent, | |
flutter_rust_bridge::for_generated::DcoCodec> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <String>::sse_decode(deserializer); | |
return StreamSink::deserialize(inner); | |
} | |
} | |
impl SseDecode for | |
StreamSink<crate::models::LogEntry, | |
flutter_rust_bridge::for_generated::DcoCodec> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <String>::sse_decode(deserializer); | |
return StreamSink::deserialize(inner); | |
} | |
} | |
impl SseDecode for String { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <Vec<u8>>::sse_decode(deserializer); | |
return String::from_utf8(inner).unwrap(); | |
} | |
} | |
impl SseDecode for crate::lnurl::pay::model::AesSuccessActionDataDecrypted | |
{ | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_description = <String>::sse_decode(deserializer); | |
let mut var_plaintext = <String>::sse_decode(deserializer); | |
return crate::lnurl::pay::model::AesSuccessActionDataDecrypted { | |
description: var_description, | |
plaintext: var_plaintext, | |
}; | |
} | |
} | |
impl SseDecode for crate::lnurl::pay::model::AesSuccessActionDataResult { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut tag_ = <i32>::sse_decode(deserializer); | |
match tag_ { | |
0 => { | |
let mut var_data = | |
<crate::lnurl::pay::model::AesSuccessActionDataDecrypted>::sse_decode(deserializer); | |
return crate::lnurl::pay::model::AesSuccessActionDataResult::Decrypted { | |
data: var_data, | |
}; | |
} | |
1 => { | |
let mut var_reason = <String>::sse_decode(deserializer); | |
return crate::lnurl::pay::model::AesSuccessActionDataResult::ErrorStatus { | |
reason: var_reason, | |
}; | |
} | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
} | |
} | |
} | |
impl SseDecode for crate::breez_services::BackupFailedData { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_error = <String>::sse_decode(deserializer); | |
return crate::breez_services::BackupFailedData { | |
error: var_error, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::BackupStatus { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_backedUp = <bool>::sse_decode(deserializer); | |
let mut var_lastBackupTime = | |
<Option<u64>>::sse_decode(deserializer); | |
return crate::models::BackupStatus { | |
backed_up: var_backedUp, | |
last_backup_time: var_lastBackupTime, | |
}; | |
} | |
} | |
impl SseDecode for crate::input_parser::BitcoinAddressData { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_address = <String>::sse_decode(deserializer); | |
let mut var_network = | |
<crate::models::Network>::sse_decode(deserializer); | |
let mut var_amountSat = <Option<u64>>::sse_decode(deserializer); | |
let mut var_label = <Option<String>>::sse_decode(deserializer); | |
let mut var_message = <Option<String>>::sse_decode(deserializer); | |
return crate::input_parser::BitcoinAddressData { | |
address: var_address, | |
network: var_network, | |
amount_sat: var_amountSat, | |
label: var_label, | |
message: var_message, | |
}; | |
} | |
} | |
impl SseDecode for bool { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
deserializer.cursor.read_u8().unwrap() != 0 | |
} | |
} | |
impl SseDecode for crate::breez_services::BreezEvent { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut tag_ = <i32>::sse_decode(deserializer); | |
match tag_ { | |
0 => { | |
let mut var_block = <u32>::sse_decode(deserializer); | |
return crate::breez_services::BreezEvent::NewBlock { | |
block: var_block, | |
}; | |
} | |
1 => { | |
let mut var_details = | |
<crate::breez_services::InvoicePaidDetails>::sse_decode(deserializer); | |
return crate::breez_services::BreezEvent::InvoicePaid { | |
details: var_details, | |
}; | |
} | |
2 => { return crate::breez_services::BreezEvent::Synced; } | |
3 => { | |
let mut var_details = | |
<crate::models::Payment>::sse_decode(deserializer); | |
return crate::breez_services::BreezEvent::PaymentSucceed { | |
details: var_details, | |
}; | |
} | |
4 => { | |
let mut var_details = | |
<crate::breez_services::PaymentFailedData>::sse_decode(deserializer); | |
return crate::breez_services::BreezEvent::PaymentFailed { | |
details: var_details, | |
}; | |
} | |
5 => { | |
return crate::breez_services::BreezEvent::BackupStarted; | |
} | |
6 => { | |
return crate::breez_services::BreezEvent::BackupSucceeded; | |
} | |
7 => { | |
let mut var_details = | |
<crate::breez_services::BackupFailedData>::sse_decode(deserializer); | |
return crate::breez_services::BreezEvent::BackupFailed { | |
details: var_details, | |
}; | |
} | |
8 => { | |
let mut var_details = | |
<crate::models::SwapInfo>::sse_decode(deserializer); | |
return crate::breez_services::BreezEvent::SwapUpdated { | |
details: var_details, | |
}; | |
} | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
} | |
} | |
} | |
impl SseDecode for crate::models::BuyBitcoinProvider { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <i32>::sse_decode(deserializer); | |
return match inner { | |
0 => crate::models::BuyBitcoinProvider::Moonpay, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for BuyBitcoinProvider: {0}", | |
inner))); | |
} | |
}; | |
} | |
} | |
impl SseDecode for crate::models::BuyBitcoinRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_provider = | |
<crate::models::BuyBitcoinProvider>::sse_decode(deserializer); | |
let mut var_openingFeeParams = | |
<Option<crate::models::OpeningFeeParams>>::sse_decode(deserializer); | |
return crate::models::BuyBitcoinRequest { | |
provider: var_provider, | |
opening_fee_params: var_openingFeeParams, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::BuyBitcoinResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_url = <String>::sse_decode(deserializer); | |
let mut var_openingFeeParams = | |
<Option<crate::models::OpeningFeeParams>>::sse_decode(deserializer); | |
return crate::models::BuyBitcoinResponse { | |
url: var_url, | |
opening_fee_params: var_openingFeeParams, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::ChannelState { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <i32>::sse_decode(deserializer); | |
return match inner { | |
0 => crate::models::ChannelState::PendingOpen, | |
1 => crate::models::ChannelState::Opened, | |
2 => crate::models::ChannelState::PendingClose, | |
3 => crate::models::ChannelState::Closed, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for ChannelState: {0}", | |
inner))); | |
} | |
}; | |
} | |
} | |
impl SseDecode for crate::breez_services::CheckMessageRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_message = <String>::sse_decode(deserializer); | |
let mut var_pubkey = <String>::sse_decode(deserializer); | |
let mut var_signature = <String>::sse_decode(deserializer); | |
return crate::breez_services::CheckMessageRequest { | |
message: var_message, | |
pubkey: var_pubkey, | |
signature: var_signature, | |
}; | |
} | |
} | |
impl SseDecode for crate::breez_services::CheckMessageResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_isValid = <bool>::sse_decode(deserializer); | |
return crate::breez_services::CheckMessageResponse { | |
is_valid: var_isValid, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::ClosedChannelPaymentDetails { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_state = | |
<crate::models::ChannelState>::sse_decode(deserializer); | |
let mut var_fundingTxid = <String>::sse_decode(deserializer); | |
let mut var_shortChannelId = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_closingTxid = | |
<Option<String>>::sse_decode(deserializer); | |
return crate::models::ClosedChannelPaymentDetails { | |
state: var_state, | |
funding_txid: var_fundingTxid, | |
short_channel_id: var_shortChannelId, | |
closing_txid: var_closingTxid, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::Config { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_breezserver = <String>::sse_decode(deserializer); | |
let mut var_chainnotifierUrl = <String>::sse_decode(deserializer); | |
let mut var_mempoolspaceUrl = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_workingDir = <String>::sse_decode(deserializer); | |
let mut var_network = | |
<crate::models::Network>::sse_decode(deserializer); | |
let mut var_paymentTimeoutSec = <u32>::sse_decode(deserializer); | |
let mut var_defaultLspId = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_apiKey = <Option<String>>::sse_decode(deserializer); | |
let mut var_maxfeePercent = <f64>::sse_decode(deserializer); | |
let mut var_exemptfeeMsat = <u64>::sse_decode(deserializer); | |
let mut var_nodeConfig = | |
<crate::models::NodeConfig>::sse_decode(deserializer); | |
return crate::models::Config { | |
breezserver: var_breezserver, | |
chainnotifier_url: var_chainnotifierUrl, | |
mempoolspace_url: var_mempoolspaceUrl, | |
working_dir: var_workingDir, | |
network: var_network, | |
payment_timeout_sec: var_paymentTimeoutSec, | |
default_lsp_id: var_defaultLspId, | |
api_key: var_apiKey, | |
maxfee_percent: var_maxfeePercent, | |
exemptfee_msat: var_exemptfeeMsat, | |
node_config: var_nodeConfig, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::ConfigureNodeRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_closeToAddress = | |
<Option<String>>::sse_decode(deserializer); | |
return crate::models::ConfigureNodeRequest { | |
close_to_address: var_closeToAddress, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::ConnectRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_config = | |
<crate::models::Config>::sse_decode(deserializer); | |
let mut var_seed = <Vec<u8>>::sse_decode(deserializer); | |
let mut var_restoreOnly = | |
<Option<bool>>::sse_decode(deserializer); | |
return crate::models::ConnectRequest { | |
config: var_config, | |
seed: var_seed, | |
restore_only: var_restoreOnly, | |
}; | |
} | |
} | |
impl SseDecode for crate::fiat::CurrencyInfo { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_name = <String>::sse_decode(deserializer); | |
let mut var_fractionSize = <u32>::sse_decode(deserializer); | |
let mut var_spacing = <Option<u32>>::sse_decode(deserializer); | |
let mut var_symbol = | |
<Option<crate::fiat::Symbol>>::sse_decode(deserializer); | |
let mut var_uniqSymbol = | |
<Option<crate::fiat::Symbol>>::sse_decode(deserializer); | |
let mut var_localizedName = | |
<Option<Vec<crate::fiat::LocalizedName>>>::sse_decode(deserializer); | |
let mut var_localeOverrides = | |
<Option<Vec<crate::fiat::LocaleOverrides>>>::sse_decode(deserializer); | |
return crate::fiat::CurrencyInfo { | |
name: var_name, | |
fraction_size: var_fractionSize, | |
spacing: var_spacing, | |
symbol: var_symbol, | |
uniq_symbol: var_uniqSymbol, | |
localized_name: var_localizedName, | |
locale_overrides: var_localeOverrides, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::EnvironmentType { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <i32>::sse_decode(deserializer); | |
return match inner { | |
0 => crate::models::EnvironmentType::Production, | |
1 => crate::models::EnvironmentType::Staging, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for EnvironmentType: {0}", | |
inner))); | |
} | |
}; | |
} | |
} | |
impl SseDecode for f64 { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
deserializer.cursor.read_f64::<NativeEndian>().unwrap() | |
} | |
} | |
impl SseDecode for crate::fiat::FiatCurrency { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_id = <String>::sse_decode(deserializer); | |
let mut var_info = | |
<crate::fiat::CurrencyInfo>::sse_decode(deserializer); | |
return crate::fiat::FiatCurrency { id: var_id, info: var_info }; | |
} | |
} | |
impl SseDecode for crate::models::GreenlightCredentials { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_deviceKey = <Vec<u8>>::sse_decode(deserializer); | |
let mut var_deviceCert = <Vec<u8>>::sse_decode(deserializer); | |
return crate::models::GreenlightCredentials { | |
device_key: var_deviceKey, | |
device_cert: var_deviceCert, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::GreenlightNodeConfig { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_partnerCredentials = | |
<Option<crate::models::GreenlightCredentials>>::sse_decode(deserializer); | |
let mut var_inviteCode = | |
<Option<String>>::sse_decode(deserializer); | |
return crate::models::GreenlightNodeConfig { | |
partner_credentials: var_partnerCredentials, | |
invite_code: var_inviteCode, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::HealthCheckStatus { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <i32>::sse_decode(deserializer); | |
return match inner { | |
0 => crate::models::HealthCheckStatus::Operational, | |
1 => crate::models::HealthCheckStatus::Maintenance, | |
2 => crate::models::HealthCheckStatus::ServiceDisruption, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for HealthCheckStatus: {0}", | |
inner))); | |
} | |
}; | |
} | |
} | |
impl SseDecode for i32 { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
deserializer.cursor.read_i32::<NativeEndian>().unwrap() | |
} | |
} | |
impl SseDecode for i64 { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
deserializer.cursor.read_i64::<NativeEndian>().unwrap() | |
} | |
} | |
impl SseDecode for crate::input_parser::InputType { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut tag_ = <i32>::sse_decode(deserializer); | |
match tag_ { | |
0 => { | |
let mut var_address = | |
<crate::input_parser::BitcoinAddressData>::sse_decode(deserializer); | |
return crate::input_parser::InputType::BitcoinAddress { | |
address: var_address, | |
}; | |
} | |
1 => { | |
let mut var_invoice = | |
<crate::invoice::LNInvoice>::sse_decode(deserializer); | |
return crate::input_parser::InputType::Bolt11 { | |
invoice: var_invoice, | |
}; | |
} | |
2 => { | |
let mut var_nodeId = <String>::sse_decode(deserializer); | |
return crate::input_parser::InputType::NodeId { | |
node_id: var_nodeId, | |
}; | |
} | |
3 => { | |
let mut var_url = <String>::sse_decode(deserializer); | |
return crate::input_parser::InputType::Url { url: var_url }; | |
} | |
4 => { | |
let mut var_data = | |
<crate::input_parser::LnUrlPayRequestData>::sse_decode(deserializer); | |
return crate::input_parser::InputType::LnUrlPay { | |
data: var_data, | |
}; | |
} | |
5 => { | |
let mut var_data = | |
<crate::input_parser::LnUrlWithdrawRequestData>::sse_decode(deserializer); | |
return crate::input_parser::InputType::LnUrlWithdraw { | |
data: var_data, | |
}; | |
} | |
6 => { | |
let mut var_data = | |
<crate::input_parser::LnUrlAuthRequestData>::sse_decode(deserializer); | |
return crate::input_parser::InputType::LnUrlAuth { | |
data: var_data, | |
}; | |
} | |
7 => { | |
let mut var_data = | |
<crate::input_parser::LnUrlErrorData>::sse_decode(deserializer); | |
return crate::input_parser::InputType::LnUrlError { | |
data: var_data, | |
}; | |
} | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
} | |
} | |
} | |
impl SseDecode for crate::breez_services::InvoicePaidDetails { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_paymentHash = <String>::sse_decode(deserializer); | |
let mut var_bolt11 = <String>::sse_decode(deserializer); | |
let mut var_payment = | |
<Option<crate::models::Payment>>::sse_decode(deserializer); | |
return crate::breez_services::InvoicePaidDetails { | |
payment_hash: var_paymentHash, | |
bolt11: var_bolt11, | |
payment: var_payment, | |
}; | |
} | |
} | |
impl SseDecode for Vec<String> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<String>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::fiat::FiatCurrency> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::fiat::FiatCurrency>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::fiat::LocaleOverrides> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::fiat::LocaleOverrides>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::fiat::LocalizedName> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::fiat::LocalizedName>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::lsp::LspInformation> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::lsp::LspInformation>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::models::MetadataFilter> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::models::MetadataFilter>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::models::OpeningFeeParams> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::models::OpeningFeeParams>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::models::Payment> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::models::Payment>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::models::PaymentTypeFilter> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::models::PaymentTypeFilter>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for crate::models::ListPaymentsRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_filters = | |
<Option<Vec<crate::models::PaymentTypeFilter>>>::sse_decode(deserializer); | |
let mut var_metadataFilters = | |
<Option<Vec<crate::models::MetadataFilter>>>::sse_decode(deserializer); | |
let mut var_fromTimestamp = | |
<Option<i64>>::sse_decode(deserializer); | |
let mut var_toTimestamp = <Option<i64>>::sse_decode(deserializer); | |
let mut var_includeFailures = | |
<Option<bool>>::sse_decode(deserializer); | |
let mut var_offset = <Option<u32>>::sse_decode(deserializer); | |
let mut var_limit = <Option<u32>>::sse_decode(deserializer); | |
return crate::models::ListPaymentsRequest { | |
filters: var_filters, | |
metadata_filters: var_metadataFilters, | |
from_timestamp: var_fromTimestamp, | |
to_timestamp: var_toTimestamp, | |
include_failures: var_includeFailures, | |
offset: var_offset, | |
limit: var_limit, | |
}; | |
} | |
} | |
impl SseDecode for Vec<u8> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { ans_.push(<u8>::sse_decode(deserializer)); } | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::fiat::Rate> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::fiat::Rate>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::models::ReverseSwapInfo> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::models::ReverseSwapInfo>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::invoice::RouteHint> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::invoice::RouteHint>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::invoice::RouteHintHop> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::invoice::RouteHintHop>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::models::SwapInfo> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::models::SwapInfo>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::models::TlvEntry> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::models::TlvEntry>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for Vec<crate::models::UnspentTransactionOutput> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut len_ = <i32>::sse_decode(deserializer); | |
let mut ans_ = ::alloc::vec::Vec::new(); | |
for idx_ in 0..len_ { | |
ans_.push(<crate::models::UnspentTransactionOutput>::sse_decode(deserializer)); | |
} | |
return ans_; | |
} | |
} | |
impl SseDecode for crate::invoice::LNInvoice { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_bolt11 = <String>::sse_decode(deserializer); | |
let mut var_network = | |
<crate::models::Network>::sse_decode(deserializer); | |
let mut var_payeePubkey = <String>::sse_decode(deserializer); | |
let mut var_paymentHash = <String>::sse_decode(deserializer); | |
let mut var_description = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_descriptionHash = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_amountMsat = <Option<u64>>::sse_decode(deserializer); | |
let mut var_timestamp = <u64>::sse_decode(deserializer); | |
let mut var_expiry = <u64>::sse_decode(deserializer); | |
let mut var_routingHints = | |
<Vec<crate::invoice::RouteHint>>::sse_decode(deserializer); | |
let mut var_paymentSecret = <Vec<u8>>::sse_decode(deserializer); | |
let mut var_minFinalCltvExpiryDelta = | |
<u64>::sse_decode(deserializer); | |
return crate::invoice::LNInvoice { | |
bolt11: var_bolt11, | |
network: var_network, | |
payee_pubkey: var_payeePubkey, | |
payment_hash: var_paymentHash, | |
description: var_description, | |
description_hash: var_descriptionHash, | |
amount_msat: var_amountMsat, | |
timestamp: var_timestamp, | |
expiry: var_expiry, | |
routing_hints: var_routingHints, | |
payment_secret: var_paymentSecret, | |
min_final_cltv_expiry_delta: var_minFinalCltvExpiryDelta, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::LnPaymentDetails { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_paymentHash = <String>::sse_decode(deserializer); | |
let mut var_label = <String>::sse_decode(deserializer); | |
let mut var_destinationPubkey = | |
<String>::sse_decode(deserializer); | |
let mut var_paymentPreimage = <String>::sse_decode(deserializer); | |
let mut var_keysend = <bool>::sse_decode(deserializer); | |
let mut var_bolt11 = <String>::sse_decode(deserializer); | |
let mut var_openChannelBolt11 = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_lnurlSuccessAction = | |
<Option<crate::lnurl::pay::model::SuccessActionProcessed>>::sse_decode(deserializer); | |
let mut var_lnurlPayDomain = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_lnAddress = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_lnurlMetadata = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_lnurlWithdrawEndpoint = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_swapInfo = | |
<Option<crate::models::SwapInfo>>::sse_decode(deserializer); | |
let mut var_reverseSwapInfo = | |
<Option<crate::models::ReverseSwapInfo>>::sse_decode(deserializer); | |
let mut var_pendingExpirationBlock = | |
<Option<u32>>::sse_decode(deserializer); | |
return crate::models::LnPaymentDetails { | |
payment_hash: var_paymentHash, | |
label: var_label, | |
destination_pubkey: var_destinationPubkey, | |
payment_preimage: var_paymentPreimage, | |
keysend: var_keysend, | |
bolt11: var_bolt11, | |
open_channel_bolt11: var_openChannelBolt11, | |
lnurl_success_action: var_lnurlSuccessAction, | |
lnurl_pay_domain: var_lnurlPayDomain, | |
ln_address: var_lnAddress, | |
lnurl_metadata: var_lnurlMetadata, | |
lnurl_withdraw_endpoint: var_lnurlWithdrawEndpoint, | |
swap_info: var_swapInfo, | |
reverse_swap_info: var_reverseSwapInfo, | |
pending_expiration_block: var_pendingExpirationBlock, | |
}; | |
} | |
} | |
impl SseDecode for crate::input_parser::LnUrlAuthRequestData { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_k1 = <String>::sse_decode(deserializer); | |
let mut var_action = <Option<String>>::sse_decode(deserializer); | |
let mut var_domain = <String>::sse_decode(deserializer); | |
let mut var_url = <String>::sse_decode(deserializer); | |
return crate::input_parser::LnUrlAuthRequestData { | |
k1: var_k1, | |
action: var_action, | |
domain: var_domain, | |
url: var_url, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::LnUrlCallbackStatus { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut tag_ = <i32>::sse_decode(deserializer); | |
match tag_ { | |
0 => { return crate::models::LnUrlCallbackStatus::Ok; } | |
1 => { | |
let mut var_data = | |
<crate::input_parser::LnUrlErrorData>::sse_decode(deserializer); | |
return crate::models::LnUrlCallbackStatus::ErrorStatus { | |
data: var_data, | |
}; | |
} | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
} | |
} | |
} | |
impl SseDecode for crate::input_parser::LnUrlErrorData { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_reason = <String>::sse_decode(deserializer); | |
return crate::input_parser::LnUrlErrorData { reason: var_reason }; | |
} | |
} | |
impl SseDecode for crate::lnurl::pay::model::LnUrlPayErrorData { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_paymentHash = <String>::sse_decode(deserializer); | |
let mut var_reason = <String>::sse_decode(deserializer); | |
return crate::lnurl::pay::model::LnUrlPayErrorData { | |
payment_hash: var_paymentHash, | |
reason: var_reason, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::LnUrlPayRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_data = | |
<crate::input_parser::LnUrlPayRequestData>::sse_decode(deserializer); | |
let mut var_amountMsat = <u64>::sse_decode(deserializer); | |
let mut var_comment = <Option<String>>::sse_decode(deserializer); | |
let mut var_paymentLabel = | |
<Option<String>>::sse_decode(deserializer); | |
return crate::models::LnUrlPayRequest { | |
data: var_data, | |
amount_msat: var_amountMsat, | |
comment: var_comment, | |
payment_label: var_paymentLabel, | |
}; | |
} | |
} | |
impl SseDecode for crate::input_parser::LnUrlPayRequestData { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_callback = <String>::sse_decode(deserializer); | |
let mut var_minSendable = <u64>::sse_decode(deserializer); | |
let mut var_maxSendable = <u64>::sse_decode(deserializer); | |
let mut var_metadataStr = <String>::sse_decode(deserializer); | |
let mut var_commentAllowed = <u16>::sse_decode(deserializer); | |
let mut var_domain = <String>::sse_decode(deserializer); | |
let mut var_allowsNostr = <bool>::sse_decode(deserializer); | |
let mut var_nostrPubkey = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_lnAddress = | |
<Option<String>>::sse_decode(deserializer); | |
return crate::input_parser::LnUrlPayRequestData { | |
callback: var_callback, | |
min_sendable: var_minSendable, | |
max_sendable: var_maxSendable, | |
metadata_str: var_metadataStr, | |
comment_allowed: var_commentAllowed, | |
domain: var_domain, | |
allows_nostr: var_allowsNostr, | |
nostr_pubkey: var_nostrPubkey, | |
ln_address: var_lnAddress, | |
}; | |
} | |
} | |
impl SseDecode for crate::lnurl::pay::model::LnUrlPayResult { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut tag_ = <i32>::sse_decode(deserializer); | |
match tag_ { | |
0 => { | |
let mut var_data = | |
<crate::lnurl::pay::model::LnUrlPaySuccessData>::sse_decode(deserializer); | |
return crate::lnurl::pay::model::LnUrlPayResult::EndpointSuccess { | |
data: var_data, | |
}; | |
} | |
1 => { | |
let mut var_data = | |
<crate::input_parser::LnUrlErrorData>::sse_decode(deserializer); | |
return crate::lnurl::pay::model::LnUrlPayResult::EndpointError { | |
data: var_data, | |
}; | |
} | |
2 => { | |
let mut var_data = | |
<crate::lnurl::pay::model::LnUrlPayErrorData>::sse_decode(deserializer); | |
return crate::lnurl::pay::model::LnUrlPayResult::PayError { | |
data: var_data, | |
}; | |
} | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
} | |
} | |
} | |
impl SseDecode for crate::lnurl::pay::model::LnUrlPaySuccessData { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_payment = | |
<crate::models::Payment>::sse_decode(deserializer); | |
let mut var_successAction = | |
<Option<crate::lnurl::pay::model::SuccessActionProcessed>>::sse_decode(deserializer); | |
return crate::lnurl::pay::model::LnUrlPaySuccessData { | |
payment: var_payment, | |
success_action: var_successAction, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::LnUrlWithdrawRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_data = | |
<crate::input_parser::LnUrlWithdrawRequestData>::sse_decode(deserializer); | |
let mut var_amountMsat = <u64>::sse_decode(deserializer); | |
let mut var_description = | |
<Option<String>>::sse_decode(deserializer); | |
return crate::models::LnUrlWithdrawRequest { | |
data: var_data, | |
amount_msat: var_amountMsat, | |
description: var_description, | |
}; | |
} | |
} | |
impl SseDecode for crate::input_parser::LnUrlWithdrawRequestData { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_callback = <String>::sse_decode(deserializer); | |
let mut var_k1 = <String>::sse_decode(deserializer); | |
let mut var_defaultDescription = | |
<String>::sse_decode(deserializer); | |
let mut var_minWithdrawable = <u64>::sse_decode(deserializer); | |
let mut var_maxWithdrawable = <u64>::sse_decode(deserializer); | |
return crate::input_parser::LnUrlWithdrawRequestData { | |
callback: var_callback, | |
k1: var_k1, | |
default_description: var_defaultDescription, | |
min_withdrawable: var_minWithdrawable, | |
max_withdrawable: var_maxWithdrawable, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::LnUrlWithdrawResult { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut tag_ = <i32>::sse_decode(deserializer); | |
match tag_ { | |
0 => { | |
let mut var_data = | |
<crate::models::LnUrlWithdrawSuccessData>::sse_decode(deserializer); | |
return crate::models::LnUrlWithdrawResult::Ok { | |
data: var_data, | |
}; | |
} | |
1 => { | |
let mut var_data = | |
<crate::input_parser::LnUrlErrorData>::sse_decode(deserializer); | |
return crate::models::LnUrlWithdrawResult::ErrorStatus { | |
data: var_data, | |
}; | |
} | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
} | |
} | |
} | |
impl SseDecode for crate::models::LnUrlWithdrawSuccessData { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_invoice = | |
<crate::invoice::LNInvoice>::sse_decode(deserializer); | |
return crate::models::LnUrlWithdrawSuccessData { | |
invoice: var_invoice, | |
}; | |
} | |
} | |
impl SseDecode for crate::fiat::LocaleOverrides { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_locale = <String>::sse_decode(deserializer); | |
let mut var_spacing = <Option<u32>>::sse_decode(deserializer); | |
let mut var_symbol = | |
<crate::fiat::Symbol>::sse_decode(deserializer); | |
return crate::fiat::LocaleOverrides { | |
locale: var_locale, | |
spacing: var_spacing, | |
symbol: var_symbol, | |
}; | |
} | |
} | |
impl SseDecode for crate::fiat::LocalizedName { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_locale = <String>::sse_decode(deserializer); | |
let mut var_name = <String>::sse_decode(deserializer); | |
return crate::fiat::LocalizedName { | |
locale: var_locale, | |
name: var_name, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::LogEntry { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_line = <String>::sse_decode(deserializer); | |
let mut var_level = <String>::sse_decode(deserializer); | |
return crate::models::LogEntry { | |
line: var_line, | |
level: var_level, | |
}; | |
} | |
} | |
impl SseDecode for crate::lsp::LspInformation { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_id = <String>::sse_decode(deserializer); | |
let mut var_name = <String>::sse_decode(deserializer); | |
let mut var_widgetUrl = <String>::sse_decode(deserializer); | |
let mut var_pubkey = <String>::sse_decode(deserializer); | |
let mut var_host = <String>::sse_decode(deserializer); | |
let mut var_baseFeeMsat = <i64>::sse_decode(deserializer); | |
let mut var_feeRate = <f64>::sse_decode(deserializer); | |
let mut var_timeLockDelta = <u32>::sse_decode(deserializer); | |
let mut var_minHtlcMsat = <i64>::sse_decode(deserializer); | |
let mut var_lspPubkey = <Vec<u8>>::sse_decode(deserializer); | |
let mut var_openingFeeParamsList = | |
<crate::models::OpeningFeeParamsMenu>::sse_decode(deserializer); | |
return crate::lsp::LspInformation { | |
id: var_id, | |
name: var_name, | |
widget_url: var_widgetUrl, | |
pubkey: var_pubkey, | |
host: var_host, | |
base_fee_msat: var_baseFeeMsat, | |
fee_rate: var_feeRate, | |
time_lock_delta: var_timeLockDelta, | |
min_htlc_msat: var_minHtlcMsat, | |
lsp_pubkey: var_lspPubkey, | |
opening_fee_params_list: var_openingFeeParamsList, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::MaxReverseSwapAmountResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_totalSat = <u64>::sse_decode(deserializer); | |
return crate::models::MaxReverseSwapAmountResponse { | |
total_sat: var_totalSat, | |
}; | |
} | |
} | |
impl SseDecode for crate::lnurl::pay::model::MessageSuccessActionData { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_message = <String>::sse_decode(deserializer); | |
return crate::lnurl::pay::model::MessageSuccessActionData { | |
message: var_message, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::MetadataFilter { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_jsonPath = <String>::sse_decode(deserializer); | |
let mut var_jsonValue = <String>::sse_decode(deserializer); | |
return crate::models::MetadataFilter { | |
json_path: var_jsonPath, | |
json_value: var_jsonValue, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::Network { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <i32>::sse_decode(deserializer); | |
return match inner { | |
0 => crate::models::Network::Bitcoin, | |
1 => crate::models::Network::Testnet, | |
2 => crate::models::Network::Signet, | |
3 => crate::models::Network::Regtest, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for Network: {0}", inner))); | |
} | |
}; | |
} | |
} | |
impl SseDecode for crate::models::NodeConfig { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut tag_ = <i32>::sse_decode(deserializer); | |
match tag_ { | |
0 => { | |
let mut var_config = | |
<crate::models::GreenlightNodeConfig>::sse_decode(deserializer); | |
return crate::models::NodeConfig::Greenlight { | |
config: var_config, | |
}; | |
} | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
} | |
} | |
} | |
impl SseDecode for crate::models::NodeCredentials { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut tag_ = <i32>::sse_decode(deserializer); | |
match tag_ { | |
0 => { | |
let mut var_credentials = | |
<crate::models::GreenlightCredentials>::sse_decode(deserializer); | |
return crate::models::NodeCredentials::Greenlight { | |
credentials: var_credentials, | |
}; | |
} | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
} | |
} | |
} | |
impl SseDecode for crate::models::NodeState { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_id = <String>::sse_decode(deserializer); | |
let mut var_blockHeight = <u32>::sse_decode(deserializer); | |
let mut var_channelsBalanceMsat = <u64>::sse_decode(deserializer); | |
let mut var_onchainBalanceMsat = <u64>::sse_decode(deserializer); | |
let mut var_pendingOnchainBalanceMsat = | |
<u64>::sse_decode(deserializer); | |
let mut var_utxos = | |
<Vec<crate::models::UnspentTransactionOutput>>::sse_decode(deserializer); | |
let mut var_maxPayableMsat = <u64>::sse_decode(deserializer); | |
let mut var_maxReceivableMsat = <u64>::sse_decode(deserializer); | |
let mut var_maxSinglePaymentAmountMsat = | |
<u64>::sse_decode(deserializer); | |
let mut var_maxChanReserveMsats = <u64>::sse_decode(deserializer); | |
let mut var_connectedPeers = | |
<Vec<String>>::sse_decode(deserializer); | |
let mut var_inboundLiquidityMsats = | |
<u64>::sse_decode(deserializer); | |
return crate::models::NodeState { | |
id: var_id, | |
block_height: var_blockHeight, | |
channels_balance_msat: var_channelsBalanceMsat, | |
onchain_balance_msat: var_onchainBalanceMsat, | |
pending_onchain_balance_msat: var_pendingOnchainBalanceMsat, | |
utxos: var_utxos, | |
max_payable_msat: var_maxPayableMsat, | |
max_receivable_msat: var_maxReceivableMsat, | |
max_single_payment_amount_msat: var_maxSinglePaymentAmountMsat, | |
max_chan_reserve_msats: var_maxChanReserveMsats, | |
connected_peers: var_connectedPeers, | |
inbound_liquidity_msats: var_inboundLiquidityMsats, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::OnchainPaymentLimitsResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_minSat = <u64>::sse_decode(deserializer); | |
let mut var_maxSat = <u64>::sse_decode(deserializer); | |
return crate::models::OnchainPaymentLimitsResponse { | |
min_sat: var_minSat, | |
max_sat: var_maxSat, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::OpenChannelFeeRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_amountMsat = <Option<u64>>::sse_decode(deserializer); | |
let mut var_expiry = <Option<u32>>::sse_decode(deserializer); | |
return crate::models::OpenChannelFeeRequest { | |
amount_msat: var_amountMsat, | |
expiry: var_expiry, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::OpenChannelFeeResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_feeMsat = <Option<u64>>::sse_decode(deserializer); | |
let mut var_feeParams = | |
<crate::models::OpeningFeeParams>::sse_decode(deserializer); | |
return crate::models::OpenChannelFeeResponse { | |
fee_msat: var_feeMsat, | |
fee_params: var_feeParams, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::OpeningFeeParams { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_minMsat = <u64>::sse_decode(deserializer); | |
let mut var_proportional = <u32>::sse_decode(deserializer); | |
let mut var_validUntil = <String>::sse_decode(deserializer); | |
let mut var_maxIdleTime = <u32>::sse_decode(deserializer); | |
let mut var_maxClientToSelfDelay = | |
<u32>::sse_decode(deserializer); | |
let mut var_promise = <String>::sse_decode(deserializer); | |
return crate::models::OpeningFeeParams { | |
min_msat: var_minMsat, | |
proportional: var_proportional, | |
valid_until: var_validUntil, | |
max_idle_time: var_maxIdleTime, | |
max_client_to_self_delay: var_maxClientToSelfDelay, | |
promise: var_promise, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::OpeningFeeParamsMenu { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_values = | |
<Vec<crate::models::OpeningFeeParams>>::sse_decode(deserializer); | |
return crate::models::OpeningFeeParamsMenu { values: var_values }; | |
} | |
} | |
impl SseDecode for Option<String> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<String>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<bool> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<bool>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<crate::models::GreenlightCredentials> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<crate::models::GreenlightCredentials>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<i64> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<i64>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<crate::invoice::LNInvoice> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<crate::invoice::LNInvoice>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<crate::lsp::LspInformation> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<crate::lsp::LspInformation>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<crate::models::NodeCredentials> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<crate::models::NodeCredentials>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<crate::models::OpeningFeeParams> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<crate::models::OpeningFeeParams>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<crate::models::Payment> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<crate::models::Payment>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<crate::models::ReverseSwapInfo> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<crate::models::ReverseSwapInfo>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for | |
Option<crate::lnurl::pay::model::SuccessActionProcessed> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<crate::lnurl::pay::model::SuccessActionProcessed>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<crate::models::SwapInfo> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<crate::models::SwapInfo>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<crate::fiat::Symbol> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<crate::fiat::Symbol>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<u32> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<u32>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<u64> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<u64>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<Vec<String>> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<Vec<String>>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<Vec<crate::fiat::LocaleOverrides>> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<Vec<crate::fiat::LocaleOverrides>>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<Vec<crate::fiat::LocalizedName>> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<Vec<crate::fiat::LocalizedName>>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<Vec<crate::models::MetadataFilter>> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<Vec<crate::models::MetadataFilter>>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<Vec<crate::models::PaymentTypeFilter>> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<Vec<crate::models::PaymentTypeFilter>>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<Vec<u8>> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<Vec<u8>>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for Option<Vec<crate::models::TlvEntry>> { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
if (<bool>::sse_decode(deserializer)) { | |
return Some(<Vec<crate::models::TlvEntry>>::sse_decode(deserializer)); | |
} else { return None; } | |
} | |
} | |
impl SseDecode for crate::models::PayOnchainRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_recipientAddress = <String>::sse_decode(deserializer); | |
let mut var_prepareRes = | |
<crate::models::PrepareOnchainPaymentResponse>::sse_decode(deserializer); | |
return crate::models::PayOnchainRequest { | |
recipient_address: var_recipientAddress, | |
prepare_res: var_prepareRes, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::PayOnchainResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_reverseSwapInfo = | |
<crate::models::ReverseSwapInfo>::sse_decode(deserializer); | |
return crate::models::PayOnchainResponse { | |
reverse_swap_info: var_reverseSwapInfo, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::Payment { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_id = <String>::sse_decode(deserializer); | |
let mut var_paymentType = | |
<crate::models::PaymentType>::sse_decode(deserializer); | |
let mut var_paymentTime = <i64>::sse_decode(deserializer); | |
let mut var_amountMsat = <u64>::sse_decode(deserializer); | |
let mut var_feeMsat = <u64>::sse_decode(deserializer); | |
let mut var_status = | |
<crate::models::PaymentStatus>::sse_decode(deserializer); | |
let mut var_error = <Option<String>>::sse_decode(deserializer); | |
let mut var_description = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_details = | |
<crate::models::PaymentDetails>::sse_decode(deserializer); | |
let mut var_metadata = <Option<String>>::sse_decode(deserializer); | |
return crate::models::Payment { | |
id: var_id, | |
payment_type: var_paymentType, | |
payment_time: var_paymentTime, | |
amount_msat: var_amountMsat, | |
fee_msat: var_feeMsat, | |
status: var_status, | |
error: var_error, | |
description: var_description, | |
details: var_details, | |
metadata: var_metadata, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::PaymentDetails { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut tag_ = <i32>::sse_decode(deserializer); | |
match tag_ { | |
0 => { | |
let mut var_data = | |
<crate::models::LnPaymentDetails>::sse_decode(deserializer); | |
return crate::models::PaymentDetails::Ln { data: var_data }; | |
} | |
1 => { | |
let mut var_data = | |
<crate::models::ClosedChannelPaymentDetails>::sse_decode(deserializer); | |
return crate::models::PaymentDetails::ClosedChannel { | |
data: var_data, | |
}; | |
} | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
} | |
} | |
} | |
impl SseDecode for crate::breez_services::PaymentFailedData { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_error = <String>::sse_decode(deserializer); | |
let mut var_nodeId = <String>::sse_decode(deserializer); | |
let mut var_invoice = | |
<Option<crate::invoice::LNInvoice>>::sse_decode(deserializer); | |
return crate::breez_services::PaymentFailedData { | |
error: var_error, | |
node_id: var_nodeId, | |
invoice: var_invoice, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::PaymentStatus { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <i32>::sse_decode(deserializer); | |
return match inner { | |
0 => crate::models::PaymentStatus::Pending, | |
1 => crate::models::PaymentStatus::Complete, | |
2 => crate::models::PaymentStatus::Failed, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for PaymentStatus: {0}", | |
inner))); | |
} | |
}; | |
} | |
} | |
impl SseDecode for crate::models::PaymentType { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <i32>::sse_decode(deserializer); | |
return match inner { | |
0 => crate::models::PaymentType::Sent, | |
1 => crate::models::PaymentType::Received, | |
2 => crate::models::PaymentType::ClosedChannel, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for PaymentType: {0}", | |
inner))); | |
} | |
}; | |
} | |
} | |
impl SseDecode for crate::models::PaymentTypeFilter { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <i32>::sse_decode(deserializer); | |
return match inner { | |
0 => crate::models::PaymentTypeFilter::Sent, | |
1 => crate::models::PaymentTypeFilter::Received, | |
2 => crate::models::PaymentTypeFilter::ClosedChannel, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for PaymentTypeFilter: {0}", | |
inner))); | |
} | |
}; | |
} | |
} | |
impl SseDecode for crate::models::PrepareOnchainPaymentRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_amountSat = <u64>::sse_decode(deserializer); | |
let mut var_amountType = | |
<crate::models::SwapAmountType>::sse_decode(deserializer); | |
let mut var_claimTxFeerate = <u32>::sse_decode(deserializer); | |
return crate::models::PrepareOnchainPaymentRequest { | |
amount_sat: var_amountSat, | |
amount_type: var_amountType, | |
claim_tx_feerate: var_claimTxFeerate, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::PrepareOnchainPaymentResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_feesHash = <String>::sse_decode(deserializer); | |
let mut var_feesPercentage = <f64>::sse_decode(deserializer); | |
let mut var_feesLockup = <u64>::sse_decode(deserializer); | |
let mut var_feesClaim = <u64>::sse_decode(deserializer); | |
let mut var_senderAmountSat = <u64>::sse_decode(deserializer); | |
let mut var_recipientAmountSat = <u64>::sse_decode(deserializer); | |
let mut var_totalFees = <u64>::sse_decode(deserializer); | |
return crate::models::PrepareOnchainPaymentResponse { | |
fees_hash: var_feesHash, | |
fees_percentage: var_feesPercentage, | |
fees_lockup: var_feesLockup, | |
fees_claim: var_feesClaim, | |
sender_amount_sat: var_senderAmountSat, | |
recipient_amount_sat: var_recipientAmountSat, | |
total_fees: var_totalFees, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::PrepareRedeemOnchainFundsRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_toAddress = <String>::sse_decode(deserializer); | |
let mut var_satPerVbyte = <u32>::sse_decode(deserializer); | |
return crate::models::PrepareRedeemOnchainFundsRequest { | |
to_address: var_toAddress, | |
sat_per_vbyte: var_satPerVbyte, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::PrepareRedeemOnchainFundsResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_txWeight = <u64>::sse_decode(deserializer); | |
let mut var_txFeeSat = <u64>::sse_decode(deserializer); | |
return crate::models::PrepareRedeemOnchainFundsResponse { | |
tx_weight: var_txWeight, | |
tx_fee_sat: var_txFeeSat, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::PrepareRefundRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_swapAddress = <String>::sse_decode(deserializer); | |
let mut var_toAddress = <String>::sse_decode(deserializer); | |
let mut var_satPerVbyte = <u32>::sse_decode(deserializer); | |
return crate::models::PrepareRefundRequest { | |
swap_address: var_swapAddress, | |
to_address: var_toAddress, | |
sat_per_vbyte: var_satPerVbyte, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::PrepareRefundResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_refundTxWeight = <u32>::sse_decode(deserializer); | |
let mut var_refundTxFeeSat = <u64>::sse_decode(deserializer); | |
return crate::models::PrepareRefundResponse { | |
refund_tx_weight: var_refundTxWeight, | |
refund_tx_fee_sat: var_refundTxFeeSat, | |
}; | |
} | |
} | |
impl SseDecode for crate::fiat::Rate { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_coin = <String>::sse_decode(deserializer); | |
let mut var_value = <f64>::sse_decode(deserializer); | |
return crate::fiat::Rate { coin: var_coin, value: var_value }; | |
} | |
} | |
impl SseDecode for crate::models::ReceiveOnchainRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_openingFeeParams = | |
<Option<crate::models::OpeningFeeParams>>::sse_decode(deserializer); | |
return crate::models::ReceiveOnchainRequest { | |
opening_fee_params: var_openingFeeParams, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::ReceivePaymentRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_amountMsat = <u64>::sse_decode(deserializer); | |
let mut var_description = <String>::sse_decode(deserializer); | |
let mut var_preimage = | |
<Option<Vec<u8>>>::sse_decode(deserializer); | |
let mut var_openingFeeParams = | |
<Option<crate::models::OpeningFeeParams>>::sse_decode(deserializer); | |
let mut var_useDescriptionHash = | |
<Option<bool>>::sse_decode(deserializer); | |
let mut var_expiry = <Option<u32>>::sse_decode(deserializer); | |
let mut var_cltv = <Option<u32>>::sse_decode(deserializer); | |
return crate::models::ReceivePaymentRequest { | |
amount_msat: var_amountMsat, | |
description: var_description, | |
preimage: var_preimage, | |
opening_fee_params: var_openingFeeParams, | |
use_description_hash: var_useDescriptionHash, | |
expiry: var_expiry, | |
cltv: var_cltv, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::ReceivePaymentResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_lnInvoice = | |
<crate::invoice::LNInvoice>::sse_decode(deserializer); | |
let mut var_openingFeeParams = | |
<Option<crate::models::OpeningFeeParams>>::sse_decode(deserializer); | |
let mut var_openingFeeMsat = | |
<Option<u64>>::sse_decode(deserializer); | |
return crate::models::ReceivePaymentResponse { | |
ln_invoice: var_lnInvoice, | |
opening_fee_params: var_openingFeeParams, | |
opening_fee_msat: var_openingFeeMsat, | |
}; | |
} | |
} | |
impl SseDecode for crate::chain::RecommendedFees { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_fastestFee = <u64>::sse_decode(deserializer); | |
let mut var_halfHourFee = <u64>::sse_decode(deserializer); | |
let mut var_hourFee = <u64>::sse_decode(deserializer); | |
let mut var_economyFee = <u64>::sse_decode(deserializer); | |
let mut var_minimumFee = <u64>::sse_decode(deserializer); | |
return crate::chain::RecommendedFees { | |
fastest_fee: var_fastestFee, | |
half_hour_fee: var_halfHourFee, | |
hour_fee: var_hourFee, | |
economy_fee: var_economyFee, | |
minimum_fee: var_minimumFee, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::RedeemOnchainFundsRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_toAddress = <String>::sse_decode(deserializer); | |
let mut var_satPerVbyte = <u32>::sse_decode(deserializer); | |
return crate::models::RedeemOnchainFundsRequest { | |
to_address: var_toAddress, | |
sat_per_vbyte: var_satPerVbyte, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::RedeemOnchainFundsResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_txid = <Vec<u8>>::sse_decode(deserializer); | |
return crate::models::RedeemOnchainFundsResponse { | |
txid: var_txid, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::RefundRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_swapAddress = <String>::sse_decode(deserializer); | |
let mut var_toAddress = <String>::sse_decode(deserializer); | |
let mut var_satPerVbyte = <u32>::sse_decode(deserializer); | |
return crate::models::RefundRequest { | |
swap_address: var_swapAddress, | |
to_address: var_toAddress, | |
sat_per_vbyte: var_satPerVbyte, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::RefundResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_refundTxId = <String>::sse_decode(deserializer); | |
return crate::models::RefundResponse { | |
refund_tx_id: var_refundTxId, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::ReportIssueRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut tag_ = <i32>::sse_decode(deserializer); | |
match tag_ { | |
0 => { | |
let mut var_data = | |
<crate::models::ReportPaymentFailureDetails>::sse_decode(deserializer); | |
return crate::models::ReportIssueRequest::PaymentFailure { | |
data: var_data, | |
}; | |
} | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
} | |
} | |
} | |
impl SseDecode for crate::models::ReportPaymentFailureDetails { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_paymentHash = <String>::sse_decode(deserializer); | |
let mut var_comment = <Option<String>>::sse_decode(deserializer); | |
return crate::models::ReportPaymentFailureDetails { | |
payment_hash: var_paymentHash, | |
comment: var_comment, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::ReverseSwapFeesRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_sendAmountSat = | |
<Option<u64>>::sse_decode(deserializer); | |
let mut var_claimTxFeerate = | |
<Option<u32>>::sse_decode(deserializer); | |
return crate::models::ReverseSwapFeesRequest { | |
send_amount_sat: var_sendAmountSat, | |
claim_tx_feerate: var_claimTxFeerate, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::ReverseSwapInfo { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_id = <String>::sse_decode(deserializer); | |
let mut var_claimPubkey = <String>::sse_decode(deserializer); | |
let mut var_lockupTxid = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_claimTxid = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_onchainAmountSat = <u64>::sse_decode(deserializer); | |
let mut var_status = | |
<crate::models::ReverseSwapStatus>::sse_decode(deserializer); | |
return crate::models::ReverseSwapInfo { | |
id: var_id, | |
claim_pubkey: var_claimPubkey, | |
lockup_txid: var_lockupTxid, | |
claim_txid: var_claimTxid, | |
onchain_amount_sat: var_onchainAmountSat, | |
status: var_status, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::ReverseSwapPairInfo { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_min = <u64>::sse_decode(deserializer); | |
let mut var_max = <u64>::sse_decode(deserializer); | |
let mut var_feesHash = <String>::sse_decode(deserializer); | |
let mut var_feesPercentage = <f64>::sse_decode(deserializer); | |
let mut var_feesLockup = <u64>::sse_decode(deserializer); | |
let mut var_feesClaim = <u64>::sse_decode(deserializer); | |
let mut var_totalFees = <Option<u64>>::sse_decode(deserializer); | |
return crate::models::ReverseSwapPairInfo { | |
min: var_min, | |
max: var_max, | |
fees_hash: var_feesHash, | |
fees_percentage: var_feesPercentage, | |
fees_lockup: var_feesLockup, | |
fees_claim: var_feesClaim, | |
total_fees: var_totalFees, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::ReverseSwapStatus { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <i32>::sse_decode(deserializer); | |
return match inner { | |
0 => crate::models::ReverseSwapStatus::Initial, | |
1 => crate::models::ReverseSwapStatus::InProgress, | |
2 => crate::models::ReverseSwapStatus::Cancelled, | |
3 => crate::models::ReverseSwapStatus::CompletedSeen, | |
4 => crate::models::ReverseSwapStatus::CompletedConfirmed, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for ReverseSwapStatus: {0}", | |
inner))); | |
} | |
}; | |
} | |
} | |
impl SseDecode for crate::invoice::RouteHint { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_hops = | |
<Vec<crate::invoice::RouteHintHop>>::sse_decode(deserializer); | |
return crate::invoice::RouteHint { hops: var_hops }; | |
} | |
} | |
impl SseDecode for crate::invoice::RouteHintHop { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_srcNodeId = <String>::sse_decode(deserializer); | |
let mut var_shortChannelId = <u64>::sse_decode(deserializer); | |
let mut var_feesBaseMsat = <u32>::sse_decode(deserializer); | |
let mut var_feesProportionalMillionths = | |
<u32>::sse_decode(deserializer); | |
let mut var_cltvExpiryDelta = <u64>::sse_decode(deserializer); | |
let mut var_htlcMinimumMsat = | |
<Option<u64>>::sse_decode(deserializer); | |
let mut var_htlcMaximumMsat = | |
<Option<u64>>::sse_decode(deserializer); | |
return crate::invoice::RouteHintHop { | |
src_node_id: var_srcNodeId, | |
short_channel_id: var_shortChannelId, | |
fees_base_msat: var_feesBaseMsat, | |
fees_proportional_millionths: var_feesProportionalMillionths, | |
cltv_expiry_delta: var_cltvExpiryDelta, | |
htlc_minimum_msat: var_htlcMinimumMsat, | |
htlc_maximum_msat: var_htlcMaximumMsat, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::SendOnchainRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_amountSat = <u64>::sse_decode(deserializer); | |
let mut var_onchainRecipientAddress = | |
<String>::sse_decode(deserializer); | |
let mut var_pairHash = <String>::sse_decode(deserializer); | |
let mut var_satPerVbyte = <u32>::sse_decode(deserializer); | |
return crate::models::SendOnchainRequest { | |
amount_sat: var_amountSat, | |
onchain_recipient_address: var_onchainRecipientAddress, | |
pair_hash: var_pairHash, | |
sat_per_vbyte: var_satPerVbyte, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::SendOnchainResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_reverseSwapInfo = | |
<crate::models::ReverseSwapInfo>::sse_decode(deserializer); | |
return crate::models::SendOnchainResponse { | |
reverse_swap_info: var_reverseSwapInfo, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::SendPaymentRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_bolt11 = <String>::sse_decode(deserializer); | |
let mut var_amountMsat = <Option<u64>>::sse_decode(deserializer); | |
let mut var_label = <Option<String>>::sse_decode(deserializer); | |
return crate::models::SendPaymentRequest { | |
bolt11: var_bolt11, | |
amount_msat: var_amountMsat, | |
label: var_label, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::SendPaymentResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_payment = | |
<crate::models::Payment>::sse_decode(deserializer); | |
return crate::models::SendPaymentResponse { | |
payment: var_payment, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::SendSpontaneousPaymentRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_nodeId = <String>::sse_decode(deserializer); | |
let mut var_amountMsat = <u64>::sse_decode(deserializer); | |
let mut var_extraTlvs = | |
<Option<Vec<crate::models::TlvEntry>>>::sse_decode(deserializer); | |
let mut var_label = <Option<String>>::sse_decode(deserializer); | |
return crate::models::SendSpontaneousPaymentRequest { | |
node_id: var_nodeId, | |
amount_msat: var_amountMsat, | |
extra_tlvs: var_extraTlvs, | |
label: var_label, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::ServiceHealthCheckResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_status = | |
<crate::models::HealthCheckStatus>::sse_decode(deserializer); | |
return crate::models::ServiceHealthCheckResponse { | |
status: var_status, | |
}; | |
} | |
} | |
impl SseDecode for crate::breez_services::SignMessageRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_message = <String>::sse_decode(deserializer); | |
return crate::breez_services::SignMessageRequest { | |
message: var_message, | |
}; | |
} | |
} | |
impl SseDecode for crate::breez_services::SignMessageResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_signature = <String>::sse_decode(deserializer); | |
return crate::breez_services::SignMessageResponse { | |
signature: var_signature, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::StaticBackupRequest { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_workingDir = <String>::sse_decode(deserializer); | |
return crate::models::StaticBackupRequest { | |
working_dir: var_workingDir, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::StaticBackupResponse { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_backup = | |
<Option<Vec<String>>>::sse_decode(deserializer); | |
return crate::models::StaticBackupResponse { backup: var_backup }; | |
} | |
} | |
impl SseDecode for crate::lnurl::pay::model::SuccessActionProcessed { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut tag_ = <i32>::sse_decode(deserializer); | |
match tag_ { | |
0 => { | |
let mut var_result = | |
<crate::lnurl::pay::model::AesSuccessActionDataResult>::sse_decode(deserializer); | |
return crate::lnurl::pay::model::SuccessActionProcessed::Aes { | |
result: var_result, | |
}; | |
} | |
1 => { | |
let mut var_data = | |
<crate::lnurl::pay::model::MessageSuccessActionData>::sse_decode(deserializer); | |
return crate::lnurl::pay::model::SuccessActionProcessed::Message { | |
data: var_data, | |
}; | |
} | |
2 => { | |
let mut var_data = | |
<crate::lnurl::pay::model::UrlSuccessActionData>::sse_decode(deserializer); | |
return crate::lnurl::pay::model::SuccessActionProcessed::Url { | |
data: var_data, | |
}; | |
} | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
} | |
} | |
} | |
impl SseDecode for crate::models::SwapAmountType { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <i32>::sse_decode(deserializer); | |
return match inner { | |
0 => crate::models::SwapAmountType::Send, | |
1 => crate::models::SwapAmountType::Receive, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for SwapAmountType: {0}", | |
inner))); | |
} | |
}; | |
} | |
} | |
impl SseDecode for crate::models::SwapInfo { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_bitcoinAddress = <String>::sse_decode(deserializer); | |
let mut var_createdAt = <i64>::sse_decode(deserializer); | |
let mut var_lockHeight = <i64>::sse_decode(deserializer); | |
let mut var_paymentHash = <Vec<u8>>::sse_decode(deserializer); | |
let mut var_preimage = <Vec<u8>>::sse_decode(deserializer); | |
let mut var_privateKey = <Vec<u8>>::sse_decode(deserializer); | |
let mut var_publicKey = <Vec<u8>>::sse_decode(deserializer); | |
let mut var_swapperPublicKey = | |
<Vec<u8>>::sse_decode(deserializer); | |
let mut var_script = <Vec<u8>>::sse_decode(deserializer); | |
let mut var_bolt11 = <Option<String>>::sse_decode(deserializer); | |
let mut var_paidMsat = <u64>::sse_decode(deserializer); | |
let mut var_totalIncomingTxs = <u64>::sse_decode(deserializer); | |
let mut var_confirmedSats = <u64>::sse_decode(deserializer); | |
let mut var_unconfirmedSats = <u64>::sse_decode(deserializer); | |
let mut var_status = | |
<crate::models::SwapStatus>::sse_decode(deserializer); | |
let mut var_refundTxIds = <Vec<String>>::sse_decode(deserializer); | |
let mut var_unconfirmedTxIds = | |
<Vec<String>>::sse_decode(deserializer); | |
let mut var_confirmedTxIds = | |
<Vec<String>>::sse_decode(deserializer); | |
let mut var_minAllowedDeposit = <i64>::sse_decode(deserializer); | |
let mut var_maxAllowedDeposit = <i64>::sse_decode(deserializer); | |
let mut var_maxSwapperPayable = <i64>::sse_decode(deserializer); | |
let mut var_lastRedeemError = | |
<Option<String>>::sse_decode(deserializer); | |
let mut var_channelOpeningFees = | |
<Option<crate::models::OpeningFeeParams>>::sse_decode(deserializer); | |
let mut var_confirmedAt = <Option<u32>>::sse_decode(deserializer); | |
return crate::models::SwapInfo { | |
bitcoin_address: var_bitcoinAddress, | |
created_at: var_createdAt, | |
lock_height: var_lockHeight, | |
payment_hash: var_paymentHash, | |
preimage: var_preimage, | |
private_key: var_privateKey, | |
public_key: var_publicKey, | |
swapper_public_key: var_swapperPublicKey, | |
script: var_script, | |
bolt11: var_bolt11, | |
paid_msat: var_paidMsat, | |
total_incoming_txs: var_totalIncomingTxs, | |
confirmed_sats: var_confirmedSats, | |
unconfirmed_sats: var_unconfirmedSats, | |
status: var_status, | |
refund_tx_ids: var_refundTxIds, | |
unconfirmed_tx_ids: var_unconfirmedTxIds, | |
confirmed_tx_ids: var_confirmedTxIds, | |
min_allowed_deposit: var_minAllowedDeposit, | |
max_allowed_deposit: var_maxAllowedDeposit, | |
max_swapper_payable: var_maxSwapperPayable, | |
last_redeem_error: var_lastRedeemError, | |
channel_opening_fees: var_channelOpeningFees, | |
confirmed_at: var_confirmedAt, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::SwapStatus { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut inner = <i32>::sse_decode(deserializer); | |
return match inner { | |
0 => crate::models::SwapStatus::Initial, | |
1 => crate::models::SwapStatus::WaitingConfirmation, | |
2 => crate::models::SwapStatus::Redeemable, | |
3 => crate::models::SwapStatus::Redeemed, | |
4 => crate::models::SwapStatus::Refundable, | |
5 => crate::models::SwapStatus::Completed, | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("Invalid variant for SwapStatus: {0}", | |
inner))); | |
} | |
}; | |
} | |
} | |
impl SseDecode for crate::fiat::Symbol { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_grapheme = <Option<String>>::sse_decode(deserializer); | |
let mut var_template = <Option<String>>::sse_decode(deserializer); | |
let mut var_rtl = <Option<bool>>::sse_decode(deserializer); | |
let mut var_position = <Option<u32>>::sse_decode(deserializer); | |
return crate::fiat::Symbol { | |
grapheme: var_grapheme, | |
template: var_template, | |
rtl: var_rtl, | |
position: var_position, | |
}; | |
} | |
} | |
impl SseDecode for crate::models::TlvEntry { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_fieldNumber = <u64>::sse_decode(deserializer); | |
let mut var_value = <Vec<u8>>::sse_decode(deserializer); | |
return crate::models::TlvEntry { | |
field_number: var_fieldNumber, | |
value: var_value, | |
}; | |
} | |
} | |
impl SseDecode for u16 { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
deserializer.cursor.read_u16::<NativeEndian>().unwrap() | |
} | |
} | |
impl SseDecode for u32 { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
deserializer.cursor.read_u32::<NativeEndian>().unwrap() | |
} | |
} | |
impl SseDecode for u64 { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
deserializer.cursor.read_u64::<NativeEndian>().unwrap() | |
} | |
} | |
impl SseDecode for u8 { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
deserializer.cursor.read_u8().unwrap() | |
} | |
} | |
impl SseDecode for () { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self {} | |
} | |
impl SseDecode for crate::models::UnspentTransactionOutput { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_txid = <Vec<u8>>::sse_decode(deserializer); | |
let mut var_outnum = <u32>::sse_decode(deserializer); | |
let mut var_amountMillisatoshi = <u64>::sse_decode(deserializer); | |
let mut var_address = <String>::sse_decode(deserializer); | |
let mut var_reserved = <bool>::sse_decode(deserializer); | |
return crate::models::UnspentTransactionOutput { | |
txid: var_txid, | |
outnum: var_outnum, | |
amount_millisatoshi: var_amountMillisatoshi, | |
address: var_address, | |
reserved: var_reserved, | |
}; | |
} | |
} | |
impl SseDecode for crate::lnurl::pay::model::UrlSuccessActionData { | |
fn sse_decode(deserializer: | |
&mut flutter_rust_bridge::for_generated::SseDeserializer) | |
-> Self { | |
let mut var_description = <String>::sse_decode(deserializer); | |
let mut var_url = <String>::sse_decode(deserializer); | |
return crate::lnurl::pay::model::UrlSuccessActionData { | |
description: var_description, | |
url: var_url, | |
}; | |
} | |
} | |
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) { | |
match func_id { | |
_ => | |
::core::panicking::panic("internal error: entered unreachable code"), | |
} | |
} | |
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 { | |
match func_id { | |
_ => | |
::core::panicking::panic("internal error: entered unreachable code"), | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::lnurl::pay::model::AesSuccessActionDataDecrypted { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.description.into_into_dart().into_dart(), | |
self.plaintext.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::lnurl::pay::model::AesSuccessActionDataDecrypted {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::lnurl::pay::model::AesSuccessActionDataDecrypted> | |
for crate::lnurl::pay::model::AesSuccessActionDataDecrypted { | |
fn into_into_dart(self) | |
-> crate::lnurl::pay::model::AesSuccessActionDataDecrypted { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::lnurl::pay::model::AesSuccessActionDataResult { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
crate::lnurl::pay::model::AesSuccessActionDataResult::Decrypted { | |
data } => { | |
[0.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
crate::lnurl::pay::model::AesSuccessActionDataResult::ErrorStatus { | |
reason } => { | |
[1.into_dart(), | |
reason.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::lnurl::pay::model::AesSuccessActionDataResult {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::lnurl::pay::model::AesSuccessActionDataResult> | |
for crate::lnurl::pay::model::AesSuccessActionDataResult { | |
fn into_into_dart(self) | |
-> crate::lnurl::pay::model::AesSuccessActionDataResult { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::breez_services::BackupFailedData { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.error.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::breez_services::BackupFailedData {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::breez_services::BackupFailedData> | |
for crate::breez_services::BackupFailedData { | |
fn into_into_dart(self) -> crate::breez_services::BackupFailedData { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::BackupStatus { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.backed_up.into_into_dart().into_dart(), | |
self.last_backup_time.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::BackupStatus {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::BackupStatus> for | |
crate::models::BackupStatus { | |
fn into_into_dart(self) -> crate::models::BackupStatus { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::input_parser::BitcoinAddressData { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.address.into_into_dart().into_dart(), | |
self.network.into_into_dart().into_dart(), | |
self.amount_sat.into_into_dart().into_dart(), | |
self.label.into_into_dart().into_dart(), | |
self.message.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::input_parser::BitcoinAddressData {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::input_parser::BitcoinAddressData> | |
for crate::input_parser::BitcoinAddressData { | |
fn into_into_dart(self) -> crate::input_parser::BitcoinAddressData { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::breez_services::BreezEvent { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
crate::breez_services::BreezEvent::NewBlock { block } => { | |
[0.into_dart(), | |
block.into_into_dart().into_dart()].into_dart() | |
} | |
crate::breez_services::BreezEvent::InvoicePaid { details } => | |
{ | |
[1.into_dart(), | |
details.into_into_dart().into_dart()].into_dart() | |
} | |
crate::breez_services::BreezEvent::Synced => | |
[2.into_dart()].into_dart(), | |
crate::breez_services::BreezEvent::PaymentSucceed { details } | |
=> { | |
[3.into_dart(), | |
details.into_into_dart().into_dart()].into_dart() | |
} | |
crate::breez_services::BreezEvent::PaymentFailed { details } | |
=> { | |
[4.into_dart(), | |
details.into_into_dart().into_dart()].into_dart() | |
} | |
crate::breez_services::BreezEvent::BackupStarted => | |
[5.into_dart()].into_dart(), | |
crate::breez_services::BreezEvent::BackupSucceeded => | |
[6.into_dart()].into_dart(), | |
crate::breez_services::BreezEvent::BackupFailed { details } => | |
{ | |
[7.into_dart(), | |
details.into_into_dart().into_dart()].into_dart() | |
} | |
crate::breez_services::BreezEvent::SwapUpdated { details } => | |
{ | |
[8.into_dart(), | |
details.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::breez_services::BreezEvent {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::breez_services::BreezEvent> | |
for crate::breez_services::BreezEvent { | |
fn into_into_dart(self) -> crate::breez_services::BreezEvent { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::BuyBitcoinProvider { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { Self::Moonpay => 0.into_dart(), } | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::BuyBitcoinProvider {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::BuyBitcoinProvider> | |
for crate::models::BuyBitcoinProvider { | |
fn into_into_dart(self) -> crate::models::BuyBitcoinProvider { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::BuyBitcoinRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.provider.into_into_dart().into_dart(), | |
self.opening_fee_params.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::BuyBitcoinRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::BuyBitcoinRequest> | |
for crate::models::BuyBitcoinRequest { | |
fn into_into_dart(self) -> crate::models::BuyBitcoinRequest { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::BuyBitcoinResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.url.into_into_dart().into_dart(), | |
self.opening_fee_params.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::BuyBitcoinResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::BuyBitcoinResponse> | |
for crate::models::BuyBitcoinResponse { | |
fn into_into_dart(self) -> crate::models::BuyBitcoinResponse { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::ChannelState { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
Self::PendingOpen => 0.into_dart(), | |
Self::Opened => 1.into_dart(), | |
Self::PendingClose => 2.into_dart(), | |
Self::Closed => 3.into_dart(), | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ChannelState {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ChannelState> for | |
crate::models::ChannelState { | |
fn into_into_dart(self) -> crate::models::ChannelState { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::breez_services::CheckMessageRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.message.into_into_dart().into_dart(), | |
self.pubkey.into_into_dart().into_dart(), | |
self.signature.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::breez_services::CheckMessageRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::breez_services::CheckMessageRequest> | |
for crate::breez_services::CheckMessageRequest { | |
fn into_into_dart(self) | |
-> crate::breez_services::CheckMessageRequest { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::breez_services::CheckMessageResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.is_valid.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::breez_services::CheckMessageResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::breez_services::CheckMessageResponse> | |
for crate::breez_services::CheckMessageResponse { | |
fn into_into_dart(self) | |
-> crate::breez_services::CheckMessageResponse { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::ClosedChannelPaymentDetails { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.state.into_into_dart().into_dart(), | |
self.funding_txid.into_into_dart().into_dart(), | |
self.short_channel_id.into_into_dart().into_dart(), | |
self.closing_txid.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ClosedChannelPaymentDetails {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ClosedChannelPaymentDetails> | |
for crate::models::ClosedChannelPaymentDetails { | |
fn into_into_dart(self) | |
-> crate::models::ClosedChannelPaymentDetails { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::Config { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.breezserver.into_into_dart().into_dart(), | |
self.chainnotifier_url.into_into_dart().into_dart(), | |
self.mempoolspace_url.into_into_dart().into_dart(), | |
self.working_dir.into_into_dart().into_dart(), | |
self.network.into_into_dart().into_dart(), | |
self.payment_timeout_sec.into_into_dart().into_dart(), | |
self.default_lsp_id.into_into_dart().into_dart(), | |
self.api_key.into_into_dart().into_dart(), | |
self.maxfee_percent.into_into_dart().into_dart(), | |
self.exemptfee_msat.into_into_dart().into_dart(), | |
self.node_config.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::Config {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::Config> for | |
crate::models::Config { | |
fn into_into_dart(self) -> crate::models::Config { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::ConfigureNodeRequest | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.close_to_address.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ConfigureNodeRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ConfigureNodeRequest> | |
for crate::models::ConfigureNodeRequest { | |
fn into_into_dart(self) -> crate::models::ConfigureNodeRequest { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::ConnectRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.config.into_into_dart().into_dart(), | |
self.seed.into_into_dart().into_dart(), | |
self.restore_only.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ConnectRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ConnectRequest> for | |
crate::models::ConnectRequest { | |
fn into_into_dart(self) -> crate::models::ConnectRequest { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::fiat::CurrencyInfo { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.name.into_into_dart().into_dart(), | |
self.fraction_size.into_into_dart().into_dart(), | |
self.spacing.into_into_dart().into_dart(), | |
self.symbol.into_into_dart().into_dart(), | |
self.uniq_symbol.into_into_dart().into_dart(), | |
self.localized_name.into_into_dart().into_dart(), | |
self.locale_overrides.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::fiat::CurrencyInfo {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::fiat::CurrencyInfo> for | |
crate::fiat::CurrencyInfo { | |
fn into_into_dart(self) -> crate::fiat::CurrencyInfo { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::EnvironmentType { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
Self::Production => 0.into_dart(), | |
Self::Staging => 1.into_dart(), | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::EnvironmentType {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::EnvironmentType> for | |
crate::models::EnvironmentType { | |
fn into_into_dart(self) -> crate::models::EnvironmentType { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::fiat::FiatCurrency { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.id.into_into_dart().into_dart(), | |
self.info.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::fiat::FiatCurrency {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::fiat::FiatCurrency> for | |
crate::fiat::FiatCurrency { | |
fn into_into_dart(self) -> crate::fiat::FiatCurrency { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::GreenlightCredentials { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.device_key.into_into_dart().into_dart(), | |
self.device_cert.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::GreenlightCredentials {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::GreenlightCredentials> | |
for crate::models::GreenlightCredentials { | |
fn into_into_dart(self) -> crate::models::GreenlightCredentials { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::GreenlightNodeConfig | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.partner_credentials.into_into_dart().into_dart(), | |
self.invite_code.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::GreenlightNodeConfig {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::GreenlightNodeConfig> | |
for crate::models::GreenlightNodeConfig { | |
fn into_into_dart(self) -> crate::models::GreenlightNodeConfig { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::HealthCheckStatus { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
Self::Operational => 0.into_dart(), | |
Self::Maintenance => 1.into_dart(), | |
Self::ServiceDisruption => 2.into_dart(), | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::HealthCheckStatus {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::HealthCheckStatus> | |
for crate::models::HealthCheckStatus { | |
fn into_into_dart(self) -> crate::models::HealthCheckStatus { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::input_parser::InputType { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
crate::input_parser::InputType::BitcoinAddress { address } => | |
{ | |
[0.into_dart(), | |
address.into_into_dart().into_dart()].into_dart() | |
} | |
crate::input_parser::InputType::Bolt11 { invoice } => { | |
[1.into_dart(), | |
invoice.into_into_dart().into_dart()].into_dart() | |
} | |
crate::input_parser::InputType::NodeId { node_id } => { | |
[2.into_dart(), | |
node_id.into_into_dart().into_dart()].into_dart() | |
} | |
crate::input_parser::InputType::Url { url } => { | |
[3.into_dart(), | |
url.into_into_dart().into_dart()].into_dart() | |
} | |
crate::input_parser::InputType::LnUrlPay { data } => { | |
[4.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
crate::input_parser::InputType::LnUrlWithdraw { data } => { | |
[5.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
crate::input_parser::InputType::LnUrlAuth { data } => { | |
[6.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
crate::input_parser::InputType::LnUrlError { data } => { | |
[7.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::input_parser::InputType {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::input_parser::InputType> for | |
crate::input_parser::InputType { | |
fn into_into_dart(self) -> crate::input_parser::InputType { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::breez_services::InvoicePaidDetails { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.payment_hash.into_into_dart().into_dart(), | |
self.bolt11.into_into_dart().into_dart(), | |
self.payment.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::breez_services::InvoicePaidDetails {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::breez_services::InvoicePaidDetails> | |
for crate::breez_services::InvoicePaidDetails { | |
fn into_into_dart(self) -> crate::breez_services::InvoicePaidDetails { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::ListPaymentsRequest | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.filters.into_into_dart().into_dart(), | |
self.metadata_filters.into_into_dart().into_dart(), | |
self.from_timestamp.into_into_dart().into_dart(), | |
self.to_timestamp.into_into_dart().into_dart(), | |
self.include_failures.into_into_dart().into_dart(), | |
self.offset.into_into_dart().into_dart(), | |
self.limit.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ListPaymentsRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ListPaymentsRequest> | |
for crate::models::ListPaymentsRequest { | |
fn into_into_dart(self) -> crate::models::ListPaymentsRequest { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::invoice::LNInvoice { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.bolt11.into_into_dart().into_dart(), | |
self.network.into_into_dart().into_dart(), | |
self.payee_pubkey.into_into_dart().into_dart(), | |
self.payment_hash.into_into_dart().into_dart(), | |
self.description.into_into_dart().into_dart(), | |
self.description_hash.into_into_dart().into_dart(), | |
self.amount_msat.into_into_dart().into_dart(), | |
self.timestamp.into_into_dart().into_dart(), | |
self.expiry.into_into_dart().into_dart(), | |
self.routing_hints.into_into_dart().into_dart(), | |
self.payment_secret.into_into_dart().into_dart(), | |
self.min_final_cltv_expiry_delta.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::invoice::LNInvoice {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::invoice::LNInvoice> for | |
crate::invoice::LNInvoice { | |
fn into_into_dart(self) -> crate::invoice::LNInvoice { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::LnPaymentDetails { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.payment_hash.into_into_dart().into_dart(), | |
self.label.into_into_dart().into_dart(), | |
self.destination_pubkey.into_into_dart().into_dart(), | |
self.payment_preimage.into_into_dart().into_dart(), | |
self.keysend.into_into_dart().into_dart(), | |
self.bolt11.into_into_dart().into_dart(), | |
self.open_channel_bolt11.into_into_dart().into_dart(), | |
self.lnurl_success_action.into_into_dart().into_dart(), | |
self.lnurl_pay_domain.into_into_dart().into_dart(), | |
self.ln_address.into_into_dart().into_dart(), | |
self.lnurl_metadata.into_into_dart().into_dart(), | |
self.lnurl_withdraw_endpoint.into_into_dart().into_dart(), | |
self.swap_info.into_into_dart().into_dart(), | |
self.reverse_swap_info.into_into_dart().into_dart(), | |
self.pending_expiration_block.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::LnPaymentDetails {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::LnPaymentDetails> | |
for crate::models::LnPaymentDetails { | |
fn into_into_dart(self) -> crate::models::LnPaymentDetails { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::input_parser::LnUrlAuthRequestData { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.k1.into_into_dart().into_dart(), | |
self.action.into_into_dart().into_dart(), | |
self.domain.into_into_dart().into_dart(), | |
self.url.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::input_parser::LnUrlAuthRequestData {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::input_parser::LnUrlAuthRequestData> | |
for crate::input_parser::LnUrlAuthRequestData { | |
fn into_into_dart(self) -> crate::input_parser::LnUrlAuthRequestData { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::LnUrlCallbackStatus | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
crate::models::LnUrlCallbackStatus::Ok => | |
[0.into_dart()].into_dart(), | |
crate::models::LnUrlCallbackStatus::ErrorStatus { data } => { | |
[1.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::LnUrlCallbackStatus {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::LnUrlCallbackStatus> | |
for crate::models::LnUrlCallbackStatus { | |
fn into_into_dart(self) -> crate::models::LnUrlCallbackStatus { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::input_parser::LnUrlErrorData | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.reason.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::input_parser::LnUrlErrorData {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::input_parser::LnUrlErrorData> | |
for crate::input_parser::LnUrlErrorData { | |
fn into_into_dart(self) -> crate::input_parser::LnUrlErrorData { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::lnurl::pay::model::LnUrlPayErrorData { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.payment_hash.into_into_dart().into_dart(), | |
self.reason.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::lnurl::pay::model::LnUrlPayErrorData {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::lnurl::pay::model::LnUrlPayErrorData> | |
for crate::lnurl::pay::model::LnUrlPayErrorData { | |
fn into_into_dart(self) | |
-> crate::lnurl::pay::model::LnUrlPayErrorData { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::LnUrlPayRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.data.into_into_dart().into_dart(), | |
self.amount_msat.into_into_dart().into_dart(), | |
self.comment.into_into_dart().into_dart(), | |
self.payment_label.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::LnUrlPayRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::LnUrlPayRequest> for | |
crate::models::LnUrlPayRequest { | |
fn into_into_dart(self) -> crate::models::LnUrlPayRequest { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::input_parser::LnUrlPayRequestData { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.callback.into_into_dart().into_dart(), | |
self.min_sendable.into_into_dart().into_dart(), | |
self.max_sendable.into_into_dart().into_dart(), | |
self.metadata_str.into_into_dart().into_dart(), | |
self.comment_allowed.into_into_dart().into_dart(), | |
self.domain.into_into_dart().into_dart(), | |
self.allows_nostr.into_into_dart().into_dart(), | |
self.nostr_pubkey.into_into_dart().into_dart(), | |
self.ln_address.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::input_parser::LnUrlPayRequestData {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::input_parser::LnUrlPayRequestData> | |
for crate::input_parser::LnUrlPayRequestData { | |
fn into_into_dart(self) -> crate::input_parser::LnUrlPayRequestData { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::lnurl::pay::model::LnUrlPayResult { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
crate::lnurl::pay::model::LnUrlPayResult::EndpointSuccess { | |
data } => { | |
[0.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
crate::lnurl::pay::model::LnUrlPayResult::EndpointError { data | |
} => { | |
[1.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
crate::lnurl::pay::model::LnUrlPayResult::PayError { data } => | |
{ | |
[2.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::lnurl::pay::model::LnUrlPayResult {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::lnurl::pay::model::LnUrlPayResult> | |
for crate::lnurl::pay::model::LnUrlPayResult { | |
fn into_into_dart(self) -> crate::lnurl::pay::model::LnUrlPayResult { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::lnurl::pay::model::LnUrlPaySuccessData { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.payment.into_into_dart().into_dart(), | |
self.success_action.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::lnurl::pay::model::LnUrlPaySuccessData {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::lnurl::pay::model::LnUrlPaySuccessData> | |
for crate::lnurl::pay::model::LnUrlPaySuccessData { | |
fn into_into_dart(self) | |
-> crate::lnurl::pay::model::LnUrlPaySuccessData { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::LnUrlWithdrawRequest | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.data.into_into_dart().into_dart(), | |
self.amount_msat.into_into_dart().into_dart(), | |
self.description.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::LnUrlWithdrawRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::LnUrlWithdrawRequest> | |
for crate::models::LnUrlWithdrawRequest { | |
fn into_into_dart(self) -> crate::models::LnUrlWithdrawRequest { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::input_parser::LnUrlWithdrawRequestData { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.callback.into_into_dart().into_dart(), | |
self.k1.into_into_dart().into_dart(), | |
self.default_description.into_into_dart().into_dart(), | |
self.min_withdrawable.into_into_dart().into_dart(), | |
self.max_withdrawable.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::input_parser::LnUrlWithdrawRequestData {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::input_parser::LnUrlWithdrawRequestData> | |
for crate::input_parser::LnUrlWithdrawRequestData { | |
fn into_into_dart(self) | |
-> crate::input_parser::LnUrlWithdrawRequestData { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::LnUrlWithdrawResult | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
crate::models::LnUrlWithdrawResult::Ok { data } => { | |
[0.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
crate::models::LnUrlWithdrawResult::ErrorStatus { data } => { | |
[1.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::LnUrlWithdrawResult {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::LnUrlWithdrawResult> | |
for crate::models::LnUrlWithdrawResult { | |
fn into_into_dart(self) -> crate::models::LnUrlWithdrawResult { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::LnUrlWithdrawSuccessData { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.invoice.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::LnUrlWithdrawSuccessData {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::LnUrlWithdrawSuccessData> | |
for crate::models::LnUrlWithdrawSuccessData { | |
fn into_into_dart(self) -> crate::models::LnUrlWithdrawSuccessData { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::fiat::LocaleOverrides { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.locale.into_into_dart().into_dart(), | |
self.spacing.into_into_dart().into_dart(), | |
self.symbol.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::fiat::LocaleOverrides {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::fiat::LocaleOverrides> for | |
crate::fiat::LocaleOverrides { | |
fn into_into_dart(self) -> crate::fiat::LocaleOverrides { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::fiat::LocalizedName { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.locale.into_into_dart().into_dart(), | |
self.name.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::fiat::LocalizedName {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::fiat::LocalizedName> for | |
crate::fiat::LocalizedName { | |
fn into_into_dart(self) -> crate::fiat::LocalizedName { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::LogEntry { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.line.into_into_dart().into_dart(), | |
self.level.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::LogEntry {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::LogEntry> for | |
crate::models::LogEntry { | |
fn into_into_dart(self) -> crate::models::LogEntry { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::lsp::LspInformation { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.id.into_into_dart().into_dart(), | |
self.name.into_into_dart().into_dart(), | |
self.widget_url.into_into_dart().into_dart(), | |
self.pubkey.into_into_dart().into_dart(), | |
self.host.into_into_dart().into_dart(), | |
self.base_fee_msat.into_into_dart().into_dart(), | |
self.fee_rate.into_into_dart().into_dart(), | |
self.time_lock_delta.into_into_dart().into_dart(), | |
self.min_htlc_msat.into_into_dart().into_dart(), | |
self.lsp_pubkey.into_into_dart().into_dart(), | |
self.opening_fee_params_list.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::lsp::LspInformation {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::lsp::LspInformation> for | |
crate::lsp::LspInformation { | |
fn into_into_dart(self) -> crate::lsp::LspInformation { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::MaxReverseSwapAmountResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.total_sat.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::MaxReverseSwapAmountResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::MaxReverseSwapAmountResponse> | |
for crate::models::MaxReverseSwapAmountResponse { | |
fn into_into_dart(self) | |
-> crate::models::MaxReverseSwapAmountResponse { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::lnurl::pay::model::MessageSuccessActionData { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.message.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::lnurl::pay::model::MessageSuccessActionData {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::lnurl::pay::model::MessageSuccessActionData> | |
for crate::lnurl::pay::model::MessageSuccessActionData { | |
fn into_into_dart(self) | |
-> crate::lnurl::pay::model::MessageSuccessActionData { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::MetadataFilter { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.json_path.into_into_dart().into_dart(), | |
self.json_value.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::MetadataFilter {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::MetadataFilter> for | |
crate::models::MetadataFilter { | |
fn into_into_dart(self) -> crate::models::MetadataFilter { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::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::models::Network {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::Network> for | |
crate::models::Network { | |
fn into_into_dart(self) -> crate::models::Network { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::NodeConfig { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
crate::models::NodeConfig::Greenlight { config } => { | |
[0.into_dart(), | |
config.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::NodeConfig {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::NodeConfig> for | |
crate::models::NodeConfig { | |
fn into_into_dart(self) -> crate::models::NodeConfig { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::NodeCredentials { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
crate::models::NodeCredentials::Greenlight { credentials } => | |
{ | |
[0.into_dart(), | |
credentials.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::NodeCredentials {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::NodeCredentials> for | |
crate::models::NodeCredentials { | |
fn into_into_dart(self) -> crate::models::NodeCredentials { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::NodeState { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.id.into_into_dart().into_dart(), | |
self.block_height.into_into_dart().into_dart(), | |
self.channels_balance_msat.into_into_dart().into_dart(), | |
self.onchain_balance_msat.into_into_dart().into_dart(), | |
self.pending_onchain_balance_msat.into_into_dart().into_dart(), | |
self.utxos.into_into_dart().into_dart(), | |
self.max_payable_msat.into_into_dart().into_dart(), | |
self.max_receivable_msat.into_into_dart().into_dart(), | |
self.max_single_payment_amount_msat.into_into_dart().into_dart(), | |
self.max_chan_reserve_msats.into_into_dart().into_dart(), | |
self.connected_peers.into_into_dart().into_dart(), | |
self.inbound_liquidity_msats.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::NodeState {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::NodeState> for | |
crate::models::NodeState { | |
fn into_into_dart(self) -> crate::models::NodeState { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::OnchainPaymentLimitsResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.min_sat.into_into_dart().into_dart(), | |
self.max_sat.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::OnchainPaymentLimitsResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::OnchainPaymentLimitsResponse> | |
for crate::models::OnchainPaymentLimitsResponse { | |
fn into_into_dart(self) | |
-> crate::models::OnchainPaymentLimitsResponse { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::OpenChannelFeeRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.amount_msat.into_into_dart().into_dart(), | |
self.expiry.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::OpenChannelFeeRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::OpenChannelFeeRequest> | |
for crate::models::OpenChannelFeeRequest { | |
fn into_into_dart(self) -> crate::models::OpenChannelFeeRequest { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::OpenChannelFeeResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.fee_msat.into_into_dart().into_dart(), | |
self.fee_params.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::OpenChannelFeeResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::OpenChannelFeeResponse> | |
for crate::models::OpenChannelFeeResponse { | |
fn into_into_dart(self) -> crate::models::OpenChannelFeeResponse { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::OpeningFeeParams { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.min_msat.into_into_dart().into_dart(), | |
self.proportional.into_into_dart().into_dart(), | |
self.valid_until.into_into_dart().into_dart(), | |
self.max_idle_time.into_into_dart().into_dart(), | |
self.max_client_to_self_delay.into_into_dart().into_dart(), | |
self.promise.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::OpeningFeeParams {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::OpeningFeeParams> | |
for crate::models::OpeningFeeParams { | |
fn into_into_dart(self) -> crate::models::OpeningFeeParams { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::OpeningFeeParamsMenu | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.values.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::OpeningFeeParamsMenu {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::OpeningFeeParamsMenu> | |
for crate::models::OpeningFeeParamsMenu { | |
fn into_into_dart(self) -> crate::models::OpeningFeeParamsMenu { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::PayOnchainRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.recipient_address.into_into_dart().into_dart(), | |
self.prepare_res.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::PayOnchainRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::PayOnchainRequest> | |
for crate::models::PayOnchainRequest { | |
fn into_into_dart(self) -> crate::models::PayOnchainRequest { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::PayOnchainResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.reverse_swap_info.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::PayOnchainResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::PayOnchainResponse> | |
for crate::models::PayOnchainResponse { | |
fn into_into_dart(self) -> crate::models::PayOnchainResponse { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::Payment { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.id.into_into_dart().into_dart(), | |
self.payment_type.into_into_dart().into_dart(), | |
self.payment_time.into_into_dart().into_dart(), | |
self.amount_msat.into_into_dart().into_dart(), | |
self.fee_msat.into_into_dart().into_dart(), | |
self.status.into_into_dart().into_dart(), | |
self.error.into_into_dart().into_dart(), | |
self.description.into_into_dart().into_dart(), | |
self.details.into_into_dart().into_dart(), | |
self.metadata.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::Payment {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::Payment> for | |
crate::models::Payment { | |
fn into_into_dart(self) -> crate::models::Payment { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::PaymentDetails { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
crate::models::PaymentDetails::Ln { data } => { | |
[0.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
crate::models::PaymentDetails::ClosedChannel { data } => { | |
[1.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::PaymentDetails {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::PaymentDetails> for | |
crate::models::PaymentDetails { | |
fn into_into_dart(self) -> crate::models::PaymentDetails { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::breez_services::PaymentFailedData { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.error.into_into_dart().into_dart(), | |
self.node_id.into_into_dart().into_dart(), | |
self.invoice.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::breez_services::PaymentFailedData {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::breez_services::PaymentFailedData> | |
for crate::breez_services::PaymentFailedData { | |
fn into_into_dart(self) -> crate::breez_services::PaymentFailedData { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::PaymentStatus { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
Self::Pending => 0.into_dart(), | |
Self::Complete => 1.into_dart(), | |
Self::Failed => 2.into_dart(), | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::PaymentStatus {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::PaymentStatus> for | |
crate::models::PaymentStatus { | |
fn into_into_dart(self) -> crate::models::PaymentStatus { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::PaymentType { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
Self::Sent => 0.into_dart(), | |
Self::Received => 1.into_dart(), | |
Self::ClosedChannel => 2.into_dart(), | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::PaymentType {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::PaymentType> for | |
crate::models::PaymentType { | |
fn into_into_dart(self) -> crate::models::PaymentType { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::PaymentTypeFilter { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
Self::Sent => 0.into_dart(), | |
Self::Received => 1.into_dart(), | |
Self::ClosedChannel => 2.into_dart(), | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::PaymentTypeFilter {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::PaymentTypeFilter> | |
for crate::models::PaymentTypeFilter { | |
fn into_into_dart(self) -> crate::models::PaymentTypeFilter { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::PrepareOnchainPaymentRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.amount_sat.into_into_dart().into_dart(), | |
self.amount_type.into_into_dart().into_dart(), | |
self.claim_tx_feerate.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::PrepareOnchainPaymentRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::PrepareOnchainPaymentRequest> | |
for crate::models::PrepareOnchainPaymentRequest { | |
fn into_into_dart(self) | |
-> crate::models::PrepareOnchainPaymentRequest { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::PrepareOnchainPaymentResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.fees_hash.into_into_dart().into_dart(), | |
self.fees_percentage.into_into_dart().into_dart(), | |
self.fees_lockup.into_into_dart().into_dart(), | |
self.fees_claim.into_into_dart().into_dart(), | |
self.sender_amount_sat.into_into_dart().into_dart(), | |
self.recipient_amount_sat.into_into_dart().into_dart(), | |
self.total_fees.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::PrepareOnchainPaymentResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::PrepareOnchainPaymentResponse> | |
for crate::models::PrepareOnchainPaymentResponse { | |
fn into_into_dart(self) | |
-> crate::models::PrepareOnchainPaymentResponse { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::PrepareRedeemOnchainFundsRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.to_address.into_into_dart().into_dart(), | |
self.sat_per_vbyte.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::PrepareRedeemOnchainFundsRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::PrepareRedeemOnchainFundsRequest> | |
for crate::models::PrepareRedeemOnchainFundsRequest { | |
fn into_into_dart(self) | |
-> crate::models::PrepareRedeemOnchainFundsRequest { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::PrepareRedeemOnchainFundsResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.tx_weight.into_into_dart().into_dart(), | |
self.tx_fee_sat.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::PrepareRedeemOnchainFundsResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::PrepareRedeemOnchainFundsResponse> | |
for crate::models::PrepareRedeemOnchainFundsResponse { | |
fn into_into_dart(self) | |
-> crate::models::PrepareRedeemOnchainFundsResponse { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::PrepareRefundRequest | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.swap_address.into_into_dart().into_dart(), | |
self.to_address.into_into_dart().into_dart(), | |
self.sat_per_vbyte.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::PrepareRefundRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::PrepareRefundRequest> | |
for crate::models::PrepareRefundRequest { | |
fn into_into_dart(self) -> crate::models::PrepareRefundRequest { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::PrepareRefundResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.refund_tx_weight.into_into_dart().into_dart(), | |
self.refund_tx_fee_sat.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::PrepareRefundResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::PrepareRefundResponse> | |
for crate::models::PrepareRefundResponse { | |
fn into_into_dart(self) -> crate::models::PrepareRefundResponse { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::fiat::Rate { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.coin.into_into_dart().into_dart(), | |
self.value.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::fiat::Rate {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::fiat::Rate> for | |
crate::fiat::Rate { | |
fn into_into_dart(self) -> crate::fiat::Rate { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::ReceiveOnchainRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.opening_fee_params.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ReceiveOnchainRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ReceiveOnchainRequest> | |
for crate::models::ReceiveOnchainRequest { | |
fn into_into_dart(self) -> crate::models::ReceiveOnchainRequest { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::ReceivePaymentRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.amount_msat.into_into_dart().into_dart(), | |
self.description.into_into_dart().into_dart(), | |
self.preimage.into_into_dart().into_dart(), | |
self.opening_fee_params.into_into_dart().into_dart(), | |
self.use_description_hash.into_into_dart().into_dart(), | |
self.expiry.into_into_dart().into_dart(), | |
self.cltv.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ReceivePaymentRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ReceivePaymentRequest> | |
for crate::models::ReceivePaymentRequest { | |
fn into_into_dart(self) -> crate::models::ReceivePaymentRequest { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::ReceivePaymentResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.ln_invoice.into_into_dart().into_dart(), | |
self.opening_fee_params.into_into_dart().into_dart(), | |
self.opening_fee_msat.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ReceivePaymentResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ReceivePaymentResponse> | |
for crate::models::ReceivePaymentResponse { | |
fn into_into_dart(self) -> crate::models::ReceivePaymentResponse { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::chain::RecommendedFees { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.fastest_fee.into_into_dart().into_dart(), | |
self.half_hour_fee.into_into_dart().into_dart(), | |
self.hour_fee.into_into_dart().into_dart(), | |
self.economy_fee.into_into_dart().into_dart(), | |
self.minimum_fee.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::chain::RecommendedFees {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::chain::RecommendedFees> for | |
crate::chain::RecommendedFees { | |
fn into_into_dart(self) -> crate::chain::RecommendedFees { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::RedeemOnchainFundsRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.to_address.into_into_dart().into_dart(), | |
self.sat_per_vbyte.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::RedeemOnchainFundsRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::RedeemOnchainFundsRequest> | |
for crate::models::RedeemOnchainFundsRequest { | |
fn into_into_dart(self) -> crate::models::RedeemOnchainFundsRequest { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::RedeemOnchainFundsResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.txid.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::RedeemOnchainFundsResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::RedeemOnchainFundsResponse> | |
for crate::models::RedeemOnchainFundsResponse { | |
fn into_into_dart(self) -> crate::models::RedeemOnchainFundsResponse { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::RefundRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.swap_address.into_into_dart().into_dart(), | |
self.to_address.into_into_dart().into_dart(), | |
self.sat_per_vbyte.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::RefundRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::RefundRequest> for | |
crate::models::RefundRequest { | |
fn into_into_dart(self) -> crate::models::RefundRequest { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::RefundResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.refund_tx_id.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::RefundResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::RefundResponse> for | |
crate::models::RefundResponse { | |
fn into_into_dart(self) -> crate::models::RefundResponse { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::ReportIssueRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
crate::models::ReportIssueRequest::PaymentFailure { data } => | |
{ | |
[0.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ReportIssueRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ReportIssueRequest> | |
for crate::models::ReportIssueRequest { | |
fn into_into_dart(self) -> crate::models::ReportIssueRequest { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::ReportPaymentFailureDetails { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.payment_hash.into_into_dart().into_dart(), | |
self.comment.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ReportPaymentFailureDetails {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ReportPaymentFailureDetails> | |
for crate::models::ReportPaymentFailureDetails { | |
fn into_into_dart(self) | |
-> crate::models::ReportPaymentFailureDetails { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::ReverseSwapFeesRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.send_amount_sat.into_into_dart().into_dart(), | |
self.claim_tx_feerate.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ReverseSwapFeesRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ReverseSwapFeesRequest> | |
for crate::models::ReverseSwapFeesRequest { | |
fn into_into_dart(self) -> crate::models::ReverseSwapFeesRequest { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::ReverseSwapInfo { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.id.into_into_dart().into_dart(), | |
self.claim_pubkey.into_into_dart().into_dart(), | |
self.lockup_txid.into_into_dart().into_dart(), | |
self.claim_txid.into_into_dart().into_dart(), | |
self.onchain_amount_sat.into_into_dart().into_dart(), | |
self.status.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ReverseSwapInfo {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ReverseSwapInfo> for | |
crate::models::ReverseSwapInfo { | |
fn into_into_dart(self) -> crate::models::ReverseSwapInfo { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::ReverseSwapPairInfo | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.min.into_into_dart().into_dart(), | |
self.max.into_into_dart().into_dart(), | |
self.fees_hash.into_into_dart().into_dart(), | |
self.fees_percentage.into_into_dart().into_dart(), | |
self.fees_lockup.into_into_dart().into_dart(), | |
self.fees_claim.into_into_dart().into_dart(), | |
self.total_fees.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ReverseSwapPairInfo {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ReverseSwapPairInfo> | |
for crate::models::ReverseSwapPairInfo { | |
fn into_into_dart(self) -> crate::models::ReverseSwapPairInfo { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::ReverseSwapStatus { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
Self::Initial => 0.into_dart(), | |
Self::InProgress => 1.into_dart(), | |
Self::Cancelled => 2.into_dart(), | |
Self::CompletedSeen => 3.into_dart(), | |
Self::CompletedConfirmed => 4.into_dart(), | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ReverseSwapStatus {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ReverseSwapStatus> | |
for crate::models::ReverseSwapStatus { | |
fn into_into_dart(self) -> crate::models::ReverseSwapStatus { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::invoice::RouteHint { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.hops.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::invoice::RouteHint {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::invoice::RouteHint> for | |
crate::invoice::RouteHint { | |
fn into_into_dart(self) -> crate::invoice::RouteHint { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::invoice::RouteHintHop { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.src_node_id.into_into_dart().into_dart(), | |
self.short_channel_id.into_into_dart().into_dart(), | |
self.fees_base_msat.into_into_dart().into_dart(), | |
self.fees_proportional_millionths.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()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::invoice::RouteHintHop {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::invoice::RouteHintHop> for | |
crate::invoice::RouteHintHop { | |
fn into_into_dart(self) -> crate::invoice::RouteHintHop { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::SendOnchainRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.amount_sat.into_into_dart().into_dart(), | |
self.onchain_recipient_address.into_into_dart().into_dart(), | |
self.pair_hash.into_into_dart().into_dart(), | |
self.sat_per_vbyte.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::SendOnchainRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::SendOnchainRequest> | |
for crate::models::SendOnchainRequest { | |
fn into_into_dart(self) -> crate::models::SendOnchainRequest { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::SendOnchainResponse | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.reverse_swap_info.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::SendOnchainResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::SendOnchainResponse> | |
for crate::models::SendOnchainResponse { | |
fn into_into_dart(self) -> crate::models::SendOnchainResponse { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::SendPaymentRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.bolt11.into_into_dart().into_dart(), | |
self.amount_msat.into_into_dart().into_dart(), | |
self.label.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::SendPaymentRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::SendPaymentRequest> | |
for crate::models::SendPaymentRequest { | |
fn into_into_dart(self) -> crate::models::SendPaymentRequest { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::SendPaymentResponse | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.payment.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::SendPaymentResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::SendPaymentResponse> | |
for crate::models::SendPaymentResponse { | |
fn into_into_dart(self) -> crate::models::SendPaymentResponse { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::SendSpontaneousPaymentRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.node_id.into_into_dart().into_dart(), | |
self.amount_msat.into_into_dart().into_dart(), | |
self.extra_tlvs.into_into_dart().into_dart(), | |
self.label.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::SendSpontaneousPaymentRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::SendSpontaneousPaymentRequest> | |
for crate::models::SendSpontaneousPaymentRequest { | |
fn into_into_dart(self) | |
-> crate::models::SendSpontaneousPaymentRequest { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::ServiceHealthCheckResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.status.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::ServiceHealthCheckResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::ServiceHealthCheckResponse> | |
for crate::models::ServiceHealthCheckResponse { | |
fn into_into_dart(self) -> crate::models::ServiceHealthCheckResponse { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::breez_services::SignMessageRequest { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.message.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::breez_services::SignMessageRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::breez_services::SignMessageRequest> | |
for crate::breez_services::SignMessageRequest { | |
fn into_into_dart(self) -> crate::breez_services::SignMessageRequest { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::breez_services::SignMessageResponse { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.signature.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::breez_services::SignMessageResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::breez_services::SignMessageResponse> | |
for crate::breez_services::SignMessageResponse { | |
fn into_into_dart(self) | |
-> crate::breez_services::SignMessageResponse { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::StaticBackupRequest | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.working_dir.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::StaticBackupRequest {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::StaticBackupRequest> | |
for crate::models::StaticBackupRequest { | |
fn into_into_dart(self) -> crate::models::StaticBackupRequest { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::StaticBackupResponse | |
{ | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.backup.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::StaticBackupResponse {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::StaticBackupResponse> | |
for crate::models::StaticBackupResponse { | |
fn into_into_dart(self) -> crate::models::StaticBackupResponse { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::lnurl::pay::model::SuccessActionProcessed { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
crate::lnurl::pay::model::SuccessActionProcessed::Aes { result | |
} => { | |
[0.into_dart(), | |
result.into_into_dart().into_dart()].into_dart() | |
} | |
crate::lnurl::pay::model::SuccessActionProcessed::Message { | |
data } => { | |
[1.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
crate::lnurl::pay::model::SuccessActionProcessed::Url { data } | |
=> { | |
[2.into_dart(), | |
data.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::lnurl::pay::model::SuccessActionProcessed {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::lnurl::pay::model::SuccessActionProcessed> | |
for crate::lnurl::pay::model::SuccessActionProcessed { | |
fn into_into_dart(self) | |
-> crate::lnurl::pay::model::SuccessActionProcessed { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::SwapAmountType { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
Self::Send => 0.into_dart(), | |
Self::Receive => 1.into_dart(), | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::SwapAmountType {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::SwapAmountType> for | |
crate::models::SwapAmountType { | |
fn into_into_dart(self) -> crate::models::SwapAmountType { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::SwapInfo { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.bitcoin_address.into_into_dart().into_dart(), | |
self.created_at.into_into_dart().into_dart(), | |
self.lock_height.into_into_dart().into_dart(), | |
self.payment_hash.into_into_dart().into_dart(), | |
self.preimage.into_into_dart().into_dart(), | |
self.private_key.into_into_dart().into_dart(), | |
self.public_key.into_into_dart().into_dart(), | |
self.swapper_public_key.into_into_dart().into_dart(), | |
self.script.into_into_dart().into_dart(), | |
self.bolt11.into_into_dart().into_dart(), | |
self.paid_msat.into_into_dart().into_dart(), | |
self.total_incoming_txs.into_into_dart().into_dart(), | |
self.confirmed_sats.into_into_dart().into_dart(), | |
self.unconfirmed_sats.into_into_dart().into_dart(), | |
self.status.into_into_dart().into_dart(), | |
self.refund_tx_ids.into_into_dart().into_dart(), | |
self.unconfirmed_tx_ids.into_into_dart().into_dart(), | |
self.confirmed_tx_ids.into_into_dart().into_dart(), | |
self.min_allowed_deposit.into_into_dart().into_dart(), | |
self.max_allowed_deposit.into_into_dart().into_dart(), | |
self.max_swapper_payable.into_into_dart().into_dart(), | |
self.last_redeem_error.into_into_dart().into_dart(), | |
self.channel_opening_fees.into_into_dart().into_dart(), | |
self.confirmed_at.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::SwapInfo {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::SwapInfo> for | |
crate::models::SwapInfo { | |
fn into_into_dart(self) -> crate::models::SwapInfo { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::SwapStatus { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
match self { | |
Self::Initial => 0.into_dart(), | |
Self::WaitingConfirmation => 1.into_dart(), | |
Self::Redeemable => 2.into_dart(), | |
Self::Redeemed => 3.into_dart(), | |
Self::Refundable => 4.into_dart(), | |
Self::Completed => 5.into_dart(), | |
} | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::SwapStatus {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::SwapStatus> for | |
crate::models::SwapStatus { | |
fn into_into_dart(self) -> crate::models::SwapStatus { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::fiat::Symbol { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.grapheme.into_into_dart().into_dart(), | |
self.template.into_into_dart().into_dart(), | |
self.rtl.into_into_dart().into_dart(), | |
self.position.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::fiat::Symbol {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::fiat::Symbol> for | |
crate::fiat::Symbol { | |
fn into_into_dart(self) -> crate::fiat::Symbol { self } | |
} | |
impl flutter_rust_bridge::IntoDart for crate::models::TlvEntry { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.field_number.into_into_dart().into_dart(), | |
self.value.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::TlvEntry {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::TlvEntry> for | |
crate::models::TlvEntry { | |
fn into_into_dart(self) -> crate::models::TlvEntry { self } | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::models::UnspentTransactionOutput { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.txid.into_into_dart().into_dart(), | |
self.outnum.into_into_dart().into_dart(), | |
self.amount_millisatoshi.into_into_dart().into_dart(), | |
self.address.into_into_dart().into_dart(), | |
self.reserved.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::models::UnspentTransactionOutput {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::models::UnspentTransactionOutput> | |
for crate::models::UnspentTransactionOutput { | |
fn into_into_dart(self) -> crate::models::UnspentTransactionOutput { | |
self | |
} | |
} | |
impl flutter_rust_bridge::IntoDart for | |
crate::lnurl::pay::model::UrlSuccessActionData { | |
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { | |
[self.description.into_into_dart().into_dart(), | |
self.url.into_into_dart().into_dart()].into_dart() | |
} | |
} | |
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for | |
crate::lnurl::pay::model::UrlSuccessActionData {} | |
impl flutter_rust_bridge::IntoIntoDart<crate::lnurl::pay::model::UrlSuccessActionData> | |
for crate::lnurl::pay::model::UrlSuccessActionData { | |
fn into_into_dart(self) | |
-> crate::lnurl::pay::model::UrlSuccessActionData { | |
self | |
} | |
} | |
impl SseEncode for flutter_rust_bridge::for_generated::anyhow::Error { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode({ | |
let res = ::alloc::fmt::format(format_args!("{0:?}", self)); | |
res | |
}, serializer); | |
} | |
} | |
impl SseEncode for | |
StreamSink<crate::breez_services::BreezEvent, | |
flutter_rust_bridge::for_generated::DcoCodec> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
} | |
} | |
} | |
impl SseEncode for | |
StreamSink<crate::models::LogEntry, | |
flutter_rust_bridge::for_generated::DcoCodec> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
} | |
} | |
} | |
impl SseEncode for String { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Vec<u8>>::sse_encode(self.into_bytes(), serializer); | |
} | |
} | |
impl SseEncode for crate::lnurl::pay::model::AesSuccessActionDataDecrypted | |
{ | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.description, serializer); | |
<String>::sse_encode(self.plaintext, serializer); | |
} | |
} | |
impl SseEncode for crate::lnurl::pay::model::AesSuccessActionDataResult { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
match self { | |
crate::lnurl::pay::model::AesSuccessActionDataResult::Decrypted { | |
data } => { | |
<i32>::sse_encode(0, serializer); | |
<crate::lnurl::pay::model::AesSuccessActionDataDecrypted>::sse_encode(data, | |
serializer); | |
} | |
crate::lnurl::pay::model::AesSuccessActionDataResult::ErrorStatus { | |
reason } => { | |
<i32>::sse_encode(1, serializer); | |
<String>::sse_encode(reason, serializer); | |
} | |
} | |
} | |
} | |
impl SseEncode for crate::breez_services::BackupFailedData { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.error, serializer); | |
} | |
} | |
impl SseEncode for crate::models::BackupStatus { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.backed_up, serializer); | |
<Option<u64>>::sse_encode(self.last_backup_time, serializer); | |
} | |
} | |
impl SseEncode for crate::input_parser::BitcoinAddressData { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.address, serializer); | |
<crate::models::Network>::sse_encode(self.network, serializer); | |
<Option<u64>>::sse_encode(self.amount_sat, serializer); | |
<Option<String>>::sse_encode(self.label, serializer); | |
<Option<String>>::sse_encode(self.message, serializer); | |
} | |
} | |
impl SseEncode for bool { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
serializer.cursor.write_u8(self as _).unwrap(); | |
} | |
} | |
impl SseEncode for crate::breez_services::BreezEvent { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
match self { | |
crate::breez_services::BreezEvent::NewBlock { block } => { | |
<i32>::sse_encode(0, serializer); | |
<u32>::sse_encode(block, serializer); | |
} | |
crate::breez_services::BreezEvent::InvoicePaid { details } => | |
{ | |
<i32>::sse_encode(1, serializer); | |
<crate::breez_services::InvoicePaidDetails>::sse_encode(details, | |
serializer); | |
} | |
crate::breez_services::BreezEvent::Synced => { | |
<i32>::sse_encode(2, serializer); | |
} | |
crate::breez_services::BreezEvent::PaymentSucceed { details } | |
=> { | |
<i32>::sse_encode(3, serializer); | |
<crate::models::Payment>::sse_encode(details, serializer); | |
} | |
crate::breez_services::BreezEvent::PaymentFailed { details } | |
=> { | |
<i32>::sse_encode(4, serializer); | |
<crate::breez_services::PaymentFailedData>::sse_encode(details, | |
serializer); | |
} | |
crate::breez_services::BreezEvent::BackupStarted => { | |
<i32>::sse_encode(5, serializer); | |
} | |
crate::breez_services::BreezEvent::BackupSucceeded => { | |
<i32>::sse_encode(6, serializer); | |
} | |
crate::breez_services::BreezEvent::BackupFailed { details } => | |
{ | |
<i32>::sse_encode(7, serializer); | |
<crate::breez_services::BackupFailedData>::sse_encode(details, | |
serializer); | |
} | |
crate::breez_services::BreezEvent::SwapUpdated { details } => | |
{ | |
<i32>::sse_encode(8, serializer); | |
<crate::models::SwapInfo>::sse_encode(details, serializer); | |
} | |
} | |
} | |
} | |
impl SseEncode for crate::models::BuyBitcoinProvider { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(match self { | |
crate::models::BuyBitcoinProvider::Moonpay => 0, | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
}, serializer); | |
} | |
} | |
impl SseEncode for crate::models::BuyBitcoinRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<crate::models::BuyBitcoinProvider>::sse_encode(self.provider, | |
serializer); | |
<Option<crate::models::OpeningFeeParams>>::sse_encode(self.opening_fee_params, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::models::BuyBitcoinResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.url, serializer); | |
<Option<crate::models::OpeningFeeParams>>::sse_encode(self.opening_fee_params, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::models::ChannelState { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(match self { | |
crate::models::ChannelState::PendingOpen => 0, | |
crate::models::ChannelState::Opened => 1, | |
crate::models::ChannelState::PendingClose => 2, | |
crate::models::ChannelState::Closed => 3, | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
}, serializer); | |
} | |
} | |
impl SseEncode for crate::breez_services::CheckMessageRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.message, serializer); | |
<String>::sse_encode(self.pubkey, serializer); | |
<String>::sse_encode(self.signature, serializer); | |
} | |
} | |
impl SseEncode for crate::breez_services::CheckMessageResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_valid, serializer); | |
} | |
} | |
impl SseEncode for crate::models::ClosedChannelPaymentDetails { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<crate::models::ChannelState>::sse_encode(self.state, serializer); | |
<String>::sse_encode(self.funding_txid, serializer); | |
<Option<String>>::sse_encode(self.short_channel_id, serializer); | |
<Option<String>>::sse_encode(self.closing_txid, serializer); | |
} | |
} | |
impl SseEncode for crate::models::Config { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.breezserver, serializer); | |
<String>::sse_encode(self.chainnotifier_url, serializer); | |
<Option<String>>::sse_encode(self.mempoolspace_url, serializer); | |
<String>::sse_encode(self.working_dir, serializer); | |
<crate::models::Network>::sse_encode(self.network, serializer); | |
<u32>::sse_encode(self.payment_timeout_sec, serializer); | |
<Option<String>>::sse_encode(self.default_lsp_id, serializer); | |
<Option<String>>::sse_encode(self.api_key, serializer); | |
<f64>::sse_encode(self.maxfee_percent, serializer); | |
<u64>::sse_encode(self.exemptfee_msat, serializer); | |
<crate::models::NodeConfig>::sse_encode(self.node_config, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::models::ConfigureNodeRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Option<String>>::sse_encode(self.close_to_address, serializer); | |
} | |
} | |
impl SseEncode for crate::models::ConnectRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<crate::models::Config>::sse_encode(self.config, serializer); | |
<Vec<u8>>::sse_encode(self.seed, serializer); | |
<Option<bool>>::sse_encode(self.restore_only, serializer); | |
} | |
} | |
impl SseEncode for crate::fiat::CurrencyInfo { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.name, serializer); | |
<u32>::sse_encode(self.fraction_size, serializer); | |
<Option<u32>>::sse_encode(self.spacing, serializer); | |
<Option<crate::fiat::Symbol>>::sse_encode(self.symbol, | |
serializer); | |
<Option<crate::fiat::Symbol>>::sse_encode(self.uniq_symbol, | |
serializer); | |
<Option<Vec<crate::fiat::LocalizedName>>>::sse_encode(self.localized_name, | |
serializer); | |
<Option<Vec<crate::fiat::LocaleOverrides>>>::sse_encode(self.locale_overrides, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::models::EnvironmentType { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(match self { | |
crate::models::EnvironmentType::Production => 0, | |
crate::models::EnvironmentType::Staging => 1, | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
}, serializer); | |
} | |
} | |
impl SseEncode for f64 { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
serializer.cursor.write_f64::<NativeEndian>(self).unwrap(); | |
} | |
} | |
impl SseEncode for crate::fiat::FiatCurrency { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.id, serializer); | |
<crate::fiat::CurrencyInfo>::sse_encode(self.info, serializer); | |
} | |
} | |
impl SseEncode for crate::models::GreenlightCredentials { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Vec<u8>>::sse_encode(self.device_key, serializer); | |
<Vec<u8>>::sse_encode(self.device_cert, serializer); | |
} | |
} | |
impl SseEncode for crate::models::GreenlightNodeConfig { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Option<crate::models::GreenlightCredentials>>::sse_encode(self.partner_credentials, | |
serializer); | |
<Option<String>>::sse_encode(self.invite_code, serializer); | |
} | |
} | |
impl SseEncode for crate::models::HealthCheckStatus { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(match self { | |
crate::models::HealthCheckStatus::Operational => 0, | |
crate::models::HealthCheckStatus::Maintenance => 1, | |
crate::models::HealthCheckStatus::ServiceDisruption => 2, | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
}, serializer); | |
} | |
} | |
impl SseEncode for i32 { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
serializer.cursor.write_i32::<NativeEndian>(self).unwrap(); | |
} | |
} | |
impl SseEncode for i64 { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
serializer.cursor.write_i64::<NativeEndian>(self).unwrap(); | |
} | |
} | |
impl SseEncode for crate::input_parser::InputType { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
match self { | |
crate::input_parser::InputType::BitcoinAddress { address } => | |
{ | |
<i32>::sse_encode(0, serializer); | |
<crate::input_parser::BitcoinAddressData>::sse_encode(address, | |
serializer); | |
} | |
crate::input_parser::InputType::Bolt11 { invoice } => { | |
<i32>::sse_encode(1, serializer); | |
<crate::invoice::LNInvoice>::sse_encode(invoice, | |
serializer); | |
} | |
crate::input_parser::InputType::NodeId { node_id } => { | |
<i32>::sse_encode(2, serializer); | |
<String>::sse_encode(node_id, serializer); | |
} | |
crate::input_parser::InputType::Url { url } => { | |
<i32>::sse_encode(3, serializer); | |
<String>::sse_encode(url, serializer); | |
} | |
crate::input_parser::InputType::LnUrlPay { data } => { | |
<i32>::sse_encode(4, serializer); | |
<crate::input_parser::LnUrlPayRequestData>::sse_encode(data, | |
serializer); | |
} | |
crate::input_parser::InputType::LnUrlWithdraw { data } => { | |
<i32>::sse_encode(5, serializer); | |
<crate::input_parser::LnUrlWithdrawRequestData>::sse_encode(data, | |
serializer); | |
} | |
crate::input_parser::InputType::LnUrlAuth { data } => { | |
<i32>::sse_encode(6, serializer); | |
<crate::input_parser::LnUrlAuthRequestData>::sse_encode(data, | |
serializer); | |
} | |
crate::input_parser::InputType::LnUrlError { data } => { | |
<i32>::sse_encode(7, serializer); | |
<crate::input_parser::LnUrlErrorData>::sse_encode(data, | |
serializer); | |
} | |
} | |
} | |
} | |
impl SseEncode for crate::breez_services::InvoicePaidDetails { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.payment_hash, serializer); | |
<String>::sse_encode(self.bolt11, serializer); | |
<Option<crate::models::Payment>>::sse_encode(self.payment, | |
serializer); | |
} | |
} | |
impl SseEncode for Vec<String> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { <String>::sse_encode(item, serializer); } | |
} | |
} | |
impl SseEncode for Vec<crate::fiat::FiatCurrency> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::fiat::FiatCurrency>::sse_encode(item, serializer); | |
} | |
} | |
} | |
impl SseEncode for Vec<crate::fiat::LocaleOverrides> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::fiat::LocaleOverrides>::sse_encode(item, serializer); | |
} | |
} | |
} | |
impl SseEncode for Vec<crate::fiat::LocalizedName> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::fiat::LocalizedName>::sse_encode(item, serializer); | |
} | |
} | |
} | |
impl SseEncode for Vec<crate::lsp::LspInformation> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::lsp::LspInformation>::sse_encode(item, serializer); | |
} | |
} | |
} | |
impl SseEncode for Vec<crate::models::MetadataFilter> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::models::MetadataFilter>::sse_encode(item, serializer); | |
} | |
} | |
} | |
impl SseEncode for Vec<crate::models::OpeningFeeParams> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::models::OpeningFeeParams>::sse_encode(item, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for Vec<crate::models::Payment> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::models::Payment>::sse_encode(item, serializer); | |
} | |
} | |
} | |
impl SseEncode for Vec<crate::models::PaymentTypeFilter> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::models::PaymentTypeFilter>::sse_encode(item, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for crate::models::ListPaymentsRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Option<Vec<crate::models::PaymentTypeFilter>>>::sse_encode(self.filters, | |
serializer); | |
<Option<Vec<crate::models::MetadataFilter>>>::sse_encode(self.metadata_filters, | |
serializer); | |
<Option<i64>>::sse_encode(self.from_timestamp, serializer); | |
<Option<i64>>::sse_encode(self.to_timestamp, serializer); | |
<Option<bool>>::sse_encode(self.include_failures, serializer); | |
<Option<u32>>::sse_encode(self.offset, serializer); | |
<Option<u32>>::sse_encode(self.limit, serializer); | |
} | |
} | |
impl SseEncode for Vec<u8> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { <u8>::sse_encode(item, serializer); } | |
} | |
} | |
impl SseEncode for Vec<crate::fiat::Rate> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::fiat::Rate>::sse_encode(item, serializer); | |
} | |
} | |
} | |
impl SseEncode for Vec<crate::models::ReverseSwapInfo> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::models::ReverseSwapInfo>::sse_encode(item, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for Vec<crate::invoice::RouteHint> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::invoice::RouteHint>::sse_encode(item, serializer); | |
} | |
} | |
} | |
impl SseEncode for Vec<crate::invoice::RouteHintHop> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::invoice::RouteHintHop>::sse_encode(item, serializer); | |
} | |
} | |
} | |
impl SseEncode for Vec<crate::models::SwapInfo> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::models::SwapInfo>::sse_encode(item, serializer); | |
} | |
} | |
} | |
impl SseEncode for Vec<crate::models::TlvEntry> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::models::TlvEntry>::sse_encode(item, serializer); | |
} | |
} | |
} | |
impl SseEncode for Vec<crate::models::UnspentTransactionOutput> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(self.len() as _, serializer); | |
for item in self { | |
<crate::models::UnspentTransactionOutput>::sse_encode(item, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for crate::invoice::LNInvoice { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.bolt11, serializer); | |
<crate::models::Network>::sse_encode(self.network, serializer); | |
<String>::sse_encode(self.payee_pubkey, serializer); | |
<String>::sse_encode(self.payment_hash, serializer); | |
<Option<String>>::sse_encode(self.description, serializer); | |
<Option<String>>::sse_encode(self.description_hash, serializer); | |
<Option<u64>>::sse_encode(self.amount_msat, serializer); | |
<u64>::sse_encode(self.timestamp, serializer); | |
<u64>::sse_encode(self.expiry, serializer); | |
<Vec<crate::invoice::RouteHint>>::sse_encode(self.routing_hints, | |
serializer); | |
<Vec<u8>>::sse_encode(self.payment_secret, serializer); | |
<u64>::sse_encode(self.min_final_cltv_expiry_delta, serializer); | |
} | |
} | |
impl SseEncode for crate::models::LnPaymentDetails { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.payment_hash, serializer); | |
<String>::sse_encode(self.label, serializer); | |
<String>::sse_encode(self.destination_pubkey, serializer); | |
<String>::sse_encode(self.payment_preimage, serializer); | |
<bool>::sse_encode(self.keysend, serializer); | |
<String>::sse_encode(self.bolt11, serializer); | |
<Option<String>>::sse_encode(self.open_channel_bolt11, | |
serializer); | |
<Option<crate::lnurl::pay::model::SuccessActionProcessed>>::sse_encode(self.lnurl_success_action, | |
serializer); | |
<Option<String>>::sse_encode(self.lnurl_pay_domain, serializer); | |
<Option<String>>::sse_encode(self.ln_address, serializer); | |
<Option<String>>::sse_encode(self.lnurl_metadata, serializer); | |
<Option<String>>::sse_encode(self.lnurl_withdraw_endpoint, | |
serializer); | |
<Option<crate::models::SwapInfo>>::sse_encode(self.swap_info, | |
serializer); | |
<Option<crate::models::ReverseSwapInfo>>::sse_encode(self.reverse_swap_info, | |
serializer); | |
<Option<u32>>::sse_encode(self.pending_expiration_block, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::input_parser::LnUrlAuthRequestData { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.k1, serializer); | |
<Option<String>>::sse_encode(self.action, serializer); | |
<String>::sse_encode(self.domain, serializer); | |
<String>::sse_encode(self.url, serializer); | |
} | |
} | |
impl SseEncode for crate::models::LnUrlCallbackStatus { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
match self { | |
crate::models::LnUrlCallbackStatus::Ok => { | |
<i32>::sse_encode(0, serializer); | |
} | |
crate::models::LnUrlCallbackStatus::ErrorStatus { data } => { | |
<i32>::sse_encode(1, serializer); | |
<crate::input_parser::LnUrlErrorData>::sse_encode(data, | |
serializer); | |
} | |
} | |
} | |
} | |
impl SseEncode for crate::input_parser::LnUrlErrorData { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.reason, serializer); | |
} | |
} | |
impl SseEncode for crate::lnurl::pay::model::LnUrlPayErrorData { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.payment_hash, serializer); | |
<String>::sse_encode(self.reason, serializer); | |
} | |
} | |
impl SseEncode for crate::models::LnUrlPayRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<crate::input_parser::LnUrlPayRequestData>::sse_encode(self.data, | |
serializer); | |
<u64>::sse_encode(self.amount_msat, serializer); | |
<Option<String>>::sse_encode(self.comment, serializer); | |
<Option<String>>::sse_encode(self.payment_label, serializer); | |
} | |
} | |
impl SseEncode for crate::input_parser::LnUrlPayRequestData { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.callback, serializer); | |
<u64>::sse_encode(self.min_sendable, serializer); | |
<u64>::sse_encode(self.max_sendable, serializer); | |
<String>::sse_encode(self.metadata_str, serializer); | |
<u16>::sse_encode(self.comment_allowed, serializer); | |
<String>::sse_encode(self.domain, serializer); | |
<bool>::sse_encode(self.allows_nostr, serializer); | |
<Option<String>>::sse_encode(self.nostr_pubkey, serializer); | |
<Option<String>>::sse_encode(self.ln_address, serializer); | |
} | |
} | |
impl SseEncode for crate::lnurl::pay::model::LnUrlPayResult { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
match self { | |
crate::lnurl::pay::model::LnUrlPayResult::EndpointSuccess { | |
data } => { | |
<i32>::sse_encode(0, serializer); | |
<crate::lnurl::pay::model::LnUrlPaySuccessData>::sse_encode(data, | |
serializer); | |
} | |
crate::lnurl::pay::model::LnUrlPayResult::EndpointError { data | |
} => { | |
<i32>::sse_encode(1, serializer); | |
<crate::input_parser::LnUrlErrorData>::sse_encode(data, | |
serializer); | |
} | |
crate::lnurl::pay::model::LnUrlPayResult::PayError { data } => | |
{ | |
<i32>::sse_encode(2, serializer); | |
<crate::lnurl::pay::model::LnUrlPayErrorData>::sse_encode(data, | |
serializer); | |
} | |
} | |
} | |
} | |
impl SseEncode for crate::lnurl::pay::model::LnUrlPaySuccessData { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<crate::models::Payment>::sse_encode(self.payment, serializer); | |
<Option<crate::lnurl::pay::model::SuccessActionProcessed>>::sse_encode(self.success_action, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::models::LnUrlWithdrawRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<crate::input_parser::LnUrlWithdrawRequestData>::sse_encode(self.data, | |
serializer); | |
<u64>::sse_encode(self.amount_msat, serializer); | |
<Option<String>>::sse_encode(self.description, serializer); | |
} | |
} | |
impl SseEncode for crate::input_parser::LnUrlWithdrawRequestData { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.callback, serializer); | |
<String>::sse_encode(self.k1, serializer); | |
<String>::sse_encode(self.default_description, serializer); | |
<u64>::sse_encode(self.min_withdrawable, serializer); | |
<u64>::sse_encode(self.max_withdrawable, serializer); | |
} | |
} | |
impl SseEncode for crate::models::LnUrlWithdrawResult { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
match self { | |
crate::models::LnUrlWithdrawResult::Ok { data } => { | |
<i32>::sse_encode(0, serializer); | |
<crate::models::LnUrlWithdrawSuccessData>::sse_encode(data, | |
serializer); | |
} | |
crate::models::LnUrlWithdrawResult::ErrorStatus { data } => { | |
<i32>::sse_encode(1, serializer); | |
<crate::input_parser::LnUrlErrorData>::sse_encode(data, | |
serializer); | |
} | |
} | |
} | |
} | |
impl SseEncode for crate::models::LnUrlWithdrawSuccessData { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<crate::invoice::LNInvoice>::sse_encode(self.invoice, serializer); | |
} | |
} | |
impl SseEncode for crate::fiat::LocaleOverrides { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.locale, serializer); | |
<Option<u32>>::sse_encode(self.spacing, serializer); | |
<crate::fiat::Symbol>::sse_encode(self.symbol, serializer); | |
} | |
} | |
impl SseEncode for crate::fiat::LocalizedName { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.locale, serializer); | |
<String>::sse_encode(self.name, serializer); | |
} | |
} | |
impl SseEncode for crate::models::LogEntry { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.line, serializer); | |
<String>::sse_encode(self.level, serializer); | |
} | |
} | |
impl SseEncode for crate::lsp::LspInformation { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.id, serializer); | |
<String>::sse_encode(self.name, serializer); | |
<String>::sse_encode(self.widget_url, serializer); | |
<String>::sse_encode(self.pubkey, serializer); | |
<String>::sse_encode(self.host, serializer); | |
<i64>::sse_encode(self.base_fee_msat, serializer); | |
<f64>::sse_encode(self.fee_rate, serializer); | |
<u32>::sse_encode(self.time_lock_delta, serializer); | |
<i64>::sse_encode(self.min_htlc_msat, serializer); | |
<Vec<u8>>::sse_encode(self.lsp_pubkey, serializer); | |
<crate::models::OpeningFeeParamsMenu>::sse_encode(self.opening_fee_params_list, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::models::MaxReverseSwapAmountResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<u64>::sse_encode(self.total_sat, serializer); | |
} | |
} | |
impl SseEncode for crate::lnurl::pay::model::MessageSuccessActionData { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.message, serializer); | |
} | |
} | |
impl SseEncode for crate::models::MetadataFilter { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.json_path, serializer); | |
<String>::sse_encode(self.json_value, serializer); | |
} | |
} | |
impl SseEncode for crate::models::Network { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(match self { | |
crate::models::Network::Bitcoin => 0, | |
crate::models::Network::Testnet => 1, | |
crate::models::Network::Signet => 2, | |
crate::models::Network::Regtest => 3, | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
}, serializer); | |
} | |
} | |
impl SseEncode for crate::models::NodeConfig { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
match self { | |
crate::models::NodeConfig::Greenlight { config } => { | |
<i32>::sse_encode(0, serializer); | |
<crate::models::GreenlightNodeConfig>::sse_encode(config, | |
serializer); | |
} | |
} | |
} | |
} | |
impl SseEncode for crate::models::NodeCredentials { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
match self { | |
crate::models::NodeCredentials::Greenlight { credentials } => | |
{ | |
<i32>::sse_encode(0, serializer); | |
<crate::models::GreenlightCredentials>::sse_encode(credentials, | |
serializer); | |
} | |
} | |
} | |
} | |
impl SseEncode for crate::models::NodeState { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.id, serializer); | |
<u32>::sse_encode(self.block_height, serializer); | |
<u64>::sse_encode(self.channels_balance_msat, serializer); | |
<u64>::sse_encode(self.onchain_balance_msat, serializer); | |
<u64>::sse_encode(self.pending_onchain_balance_msat, serializer); | |
<Vec<crate::models::UnspentTransactionOutput>>::sse_encode(self.utxos, | |
serializer); | |
<u64>::sse_encode(self.max_payable_msat, serializer); | |
<u64>::sse_encode(self.max_receivable_msat, serializer); | |
<u64>::sse_encode(self.max_single_payment_amount_msat, | |
serializer); | |
<u64>::sse_encode(self.max_chan_reserve_msats, serializer); | |
<Vec<String>>::sse_encode(self.connected_peers, serializer); | |
<u64>::sse_encode(self.inbound_liquidity_msats, serializer); | |
} | |
} | |
impl SseEncode for crate::models::OnchainPaymentLimitsResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<u64>::sse_encode(self.min_sat, serializer); | |
<u64>::sse_encode(self.max_sat, serializer); | |
} | |
} | |
impl SseEncode for crate::models::OpenChannelFeeRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Option<u64>>::sse_encode(self.amount_msat, serializer); | |
<Option<u32>>::sse_encode(self.expiry, serializer); | |
} | |
} | |
impl SseEncode for crate::models::OpenChannelFeeResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Option<u64>>::sse_encode(self.fee_msat, serializer); | |
<crate::models::OpeningFeeParams>::sse_encode(self.fee_params, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::models::OpeningFeeParams { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<u64>::sse_encode(self.min_msat, serializer); | |
<u32>::sse_encode(self.proportional, serializer); | |
<String>::sse_encode(self.valid_until, serializer); | |
<u32>::sse_encode(self.max_idle_time, serializer); | |
<u32>::sse_encode(self.max_client_to_self_delay, serializer); | |
<String>::sse_encode(self.promise, serializer); | |
} | |
} | |
impl SseEncode for crate::models::OpeningFeeParamsMenu { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Vec<crate::models::OpeningFeeParams>>::sse_encode(self.values, | |
serializer); | |
} | |
} | |
impl SseEncode for Option<String> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<String>::sse_encode(value, serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<bool> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<bool>::sse_encode(value, serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<crate::models::GreenlightCredentials> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<crate::models::GreenlightCredentials>::sse_encode(value, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<i64> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<i64>::sse_encode(value, serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<crate::invoice::LNInvoice> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<crate::invoice::LNInvoice>::sse_encode(value, serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<crate::lsp::LspInformation> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<crate::lsp::LspInformation>::sse_encode(value, serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<crate::models::NodeCredentials> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<crate::models::NodeCredentials>::sse_encode(value, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<crate::models::OpeningFeeParams> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<crate::models::OpeningFeeParams>::sse_encode(value, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<crate::models::Payment> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<crate::models::Payment>::sse_encode(value, serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<crate::models::ReverseSwapInfo> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<crate::models::ReverseSwapInfo>::sse_encode(value, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for | |
Option<crate::lnurl::pay::model::SuccessActionProcessed> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<crate::lnurl::pay::model::SuccessActionProcessed>::sse_encode(value, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<crate::models::SwapInfo> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<crate::models::SwapInfo>::sse_encode(value, serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<crate::fiat::Symbol> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<crate::fiat::Symbol>::sse_encode(value, serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<u32> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<u32>::sse_encode(value, serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<u64> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<u64>::sse_encode(value, serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<Vec<String>> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<Vec<String>>::sse_encode(value, serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<Vec<crate::fiat::LocaleOverrides>> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<Vec<crate::fiat::LocaleOverrides>>::sse_encode(value, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<Vec<crate::fiat::LocalizedName>> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<Vec<crate::fiat::LocalizedName>>::sse_encode(value, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<Vec<crate::models::MetadataFilter>> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<Vec<crate::models::MetadataFilter>>::sse_encode(value, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<Vec<crate::models::PaymentTypeFilter>> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<Vec<crate::models::PaymentTypeFilter>>::sse_encode(value, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<Vec<u8>> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<Vec<u8>>::sse_encode(value, serializer); | |
} | |
} | |
} | |
impl SseEncode for Option<Vec<crate::models::TlvEntry>> { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<bool>::sse_encode(self.is_some(), serializer); | |
if let Some(value) = self { | |
<Vec<crate::models::TlvEntry>>::sse_encode(value, | |
serializer); | |
} | |
} | |
} | |
impl SseEncode for crate::models::PayOnchainRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.recipient_address, serializer); | |
<crate::models::PrepareOnchainPaymentResponse>::sse_encode(self.prepare_res, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::models::PayOnchainResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<crate::models::ReverseSwapInfo>::sse_encode(self.reverse_swap_info, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::models::Payment { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.id, serializer); | |
<crate::models::PaymentType>::sse_encode(self.payment_type, | |
serializer); | |
<i64>::sse_encode(self.payment_time, serializer); | |
<u64>::sse_encode(self.amount_msat, serializer); | |
<u64>::sse_encode(self.fee_msat, serializer); | |
<crate::models::PaymentStatus>::sse_encode(self.status, | |
serializer); | |
<Option<String>>::sse_encode(self.error, serializer); | |
<Option<String>>::sse_encode(self.description, serializer); | |
<crate::models::PaymentDetails>::sse_encode(self.details, | |
serializer); | |
<Option<String>>::sse_encode(self.metadata, serializer); | |
} | |
} | |
impl SseEncode for crate::models::PaymentDetails { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
match self { | |
crate::models::PaymentDetails::Ln { data } => { | |
<i32>::sse_encode(0, serializer); | |
<crate::models::LnPaymentDetails>::sse_encode(data, | |
serializer); | |
} | |
crate::models::PaymentDetails::ClosedChannel { data } => { | |
<i32>::sse_encode(1, serializer); | |
<crate::models::ClosedChannelPaymentDetails>::sse_encode(data, | |
serializer); | |
} | |
} | |
} | |
} | |
impl SseEncode for crate::breez_services::PaymentFailedData { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.error, serializer); | |
<String>::sse_encode(self.node_id, serializer); | |
<Option<crate::invoice::LNInvoice>>::sse_encode(self.invoice, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::models::PaymentStatus { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(match self { | |
crate::models::PaymentStatus::Pending => 0, | |
crate::models::PaymentStatus::Complete => 1, | |
crate::models::PaymentStatus::Failed => 2, | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
}, serializer); | |
} | |
} | |
impl SseEncode for crate::models::PaymentType { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(match self { | |
crate::models::PaymentType::Sent => 0, | |
crate::models::PaymentType::Received => 1, | |
crate::models::PaymentType::ClosedChannel => 2, | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
}, serializer); | |
} | |
} | |
impl SseEncode for crate::models::PaymentTypeFilter { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(match self { | |
crate::models::PaymentTypeFilter::Sent => 0, | |
crate::models::PaymentTypeFilter::Received => 1, | |
crate::models::PaymentTypeFilter::ClosedChannel => 2, | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
}, serializer); | |
} | |
} | |
impl SseEncode for crate::models::PrepareOnchainPaymentRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<u64>::sse_encode(self.amount_sat, serializer); | |
<crate::models::SwapAmountType>::sse_encode(self.amount_type, | |
serializer); | |
<u32>::sse_encode(self.claim_tx_feerate, serializer); | |
} | |
} | |
impl SseEncode for crate::models::PrepareOnchainPaymentResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.fees_hash, serializer); | |
<f64>::sse_encode(self.fees_percentage, serializer); | |
<u64>::sse_encode(self.fees_lockup, serializer); | |
<u64>::sse_encode(self.fees_claim, serializer); | |
<u64>::sse_encode(self.sender_amount_sat, serializer); | |
<u64>::sse_encode(self.recipient_amount_sat, serializer); | |
<u64>::sse_encode(self.total_fees, serializer); | |
} | |
} | |
impl SseEncode for crate::models::PrepareRedeemOnchainFundsRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.to_address, serializer); | |
<u32>::sse_encode(self.sat_per_vbyte, serializer); | |
} | |
} | |
impl SseEncode for crate::models::PrepareRedeemOnchainFundsResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<u64>::sse_encode(self.tx_weight, serializer); | |
<u64>::sse_encode(self.tx_fee_sat, serializer); | |
} | |
} | |
impl SseEncode for crate::models::PrepareRefundRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.swap_address, serializer); | |
<String>::sse_encode(self.to_address, serializer); | |
<u32>::sse_encode(self.sat_per_vbyte, serializer); | |
} | |
} | |
impl SseEncode for crate::models::PrepareRefundResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<u32>::sse_encode(self.refund_tx_weight, serializer); | |
<u64>::sse_encode(self.refund_tx_fee_sat, serializer); | |
} | |
} | |
impl SseEncode for crate::fiat::Rate { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.coin, serializer); | |
<f64>::sse_encode(self.value, serializer); | |
} | |
} | |
impl SseEncode for crate::models::ReceiveOnchainRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Option<crate::models::OpeningFeeParams>>::sse_encode(self.opening_fee_params, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::models::ReceivePaymentRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<u64>::sse_encode(self.amount_msat, serializer); | |
<String>::sse_encode(self.description, serializer); | |
<Option<Vec<u8>>>::sse_encode(self.preimage, serializer); | |
<Option<crate::models::OpeningFeeParams>>::sse_encode(self.opening_fee_params, | |
serializer); | |
<Option<bool>>::sse_encode(self.use_description_hash, serializer); | |
<Option<u32>>::sse_encode(self.expiry, serializer); | |
<Option<u32>>::sse_encode(self.cltv, serializer); | |
} | |
} | |
impl SseEncode for crate::models::ReceivePaymentResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<crate::invoice::LNInvoice>::sse_encode(self.ln_invoice, | |
serializer); | |
<Option<crate::models::OpeningFeeParams>>::sse_encode(self.opening_fee_params, | |
serializer); | |
<Option<u64>>::sse_encode(self.opening_fee_msat, serializer); | |
} | |
} | |
impl SseEncode for crate::chain::RecommendedFees { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<u64>::sse_encode(self.fastest_fee, serializer); | |
<u64>::sse_encode(self.half_hour_fee, serializer); | |
<u64>::sse_encode(self.hour_fee, serializer); | |
<u64>::sse_encode(self.economy_fee, serializer); | |
<u64>::sse_encode(self.minimum_fee, serializer); | |
} | |
} | |
impl SseEncode for crate::models::RedeemOnchainFundsRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.to_address, serializer); | |
<u32>::sse_encode(self.sat_per_vbyte, serializer); | |
} | |
} | |
impl SseEncode for crate::models::RedeemOnchainFundsResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Vec<u8>>::sse_encode(self.txid, serializer); | |
} | |
} | |
impl SseEncode for crate::models::RefundRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.swap_address, serializer); | |
<String>::sse_encode(self.to_address, serializer); | |
<u32>::sse_encode(self.sat_per_vbyte, serializer); | |
} | |
} | |
impl SseEncode for crate::models::RefundResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.refund_tx_id, serializer); | |
} | |
} | |
impl SseEncode for crate::models::ReportIssueRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
match self { | |
crate::models::ReportIssueRequest::PaymentFailure { data } => | |
{ | |
<i32>::sse_encode(0, serializer); | |
<crate::models::ReportPaymentFailureDetails>::sse_encode(data, | |
serializer); | |
} | |
} | |
} | |
} | |
impl SseEncode for crate::models::ReportPaymentFailureDetails { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.payment_hash, serializer); | |
<Option<String>>::sse_encode(self.comment, serializer); | |
} | |
} | |
impl SseEncode for crate::models::ReverseSwapFeesRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Option<u64>>::sse_encode(self.send_amount_sat, serializer); | |
<Option<u32>>::sse_encode(self.claim_tx_feerate, serializer); | |
} | |
} | |
impl SseEncode for crate::models::ReverseSwapInfo { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.id, serializer); | |
<String>::sse_encode(self.claim_pubkey, serializer); | |
<Option<String>>::sse_encode(self.lockup_txid, serializer); | |
<Option<String>>::sse_encode(self.claim_txid, serializer); | |
<u64>::sse_encode(self.onchain_amount_sat, serializer); | |
<crate::models::ReverseSwapStatus>::sse_encode(self.status, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::models::ReverseSwapPairInfo { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<u64>::sse_encode(self.min, serializer); | |
<u64>::sse_encode(self.max, serializer); | |
<String>::sse_encode(self.fees_hash, serializer); | |
<f64>::sse_encode(self.fees_percentage, serializer); | |
<u64>::sse_encode(self.fees_lockup, serializer); | |
<u64>::sse_encode(self.fees_claim, serializer); | |
<Option<u64>>::sse_encode(self.total_fees, serializer); | |
} | |
} | |
impl SseEncode for crate::models::ReverseSwapStatus { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(match self { | |
crate::models::ReverseSwapStatus::Initial => 0, | |
crate::models::ReverseSwapStatus::InProgress => 1, | |
crate::models::ReverseSwapStatus::Cancelled => 2, | |
crate::models::ReverseSwapStatus::CompletedSeen => 3, | |
crate::models::ReverseSwapStatus::CompletedConfirmed => 4, | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
}, serializer); | |
} | |
} | |
impl SseEncode for crate::invoice::RouteHint { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Vec<crate::invoice::RouteHintHop>>::sse_encode(self.hops, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::invoice::RouteHintHop { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.src_node_id, serializer); | |
<u64>::sse_encode(self.short_channel_id, serializer); | |
<u32>::sse_encode(self.fees_base_msat, serializer); | |
<u32>::sse_encode(self.fees_proportional_millionths, serializer); | |
<u64>::sse_encode(self.cltv_expiry_delta, serializer); | |
<Option<u64>>::sse_encode(self.htlc_minimum_msat, serializer); | |
<Option<u64>>::sse_encode(self.htlc_maximum_msat, serializer); | |
} | |
} | |
impl SseEncode for crate::models::SendOnchainRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<u64>::sse_encode(self.amount_sat, serializer); | |
<String>::sse_encode(self.onchain_recipient_address, serializer); | |
<String>::sse_encode(self.pair_hash, serializer); | |
<u32>::sse_encode(self.sat_per_vbyte, serializer); | |
} | |
} | |
impl SseEncode for crate::models::SendOnchainResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<crate::models::ReverseSwapInfo>::sse_encode(self.reverse_swap_info, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::models::SendPaymentRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.bolt11, serializer); | |
<Option<u64>>::sse_encode(self.amount_msat, serializer); | |
<Option<String>>::sse_encode(self.label, serializer); | |
} | |
} | |
impl SseEncode for crate::models::SendPaymentResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<crate::models::Payment>::sse_encode(self.payment, serializer); | |
} | |
} | |
impl SseEncode for crate::models::SendSpontaneousPaymentRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.node_id, serializer); | |
<u64>::sse_encode(self.amount_msat, serializer); | |
<Option<Vec<crate::models::TlvEntry>>>::sse_encode(self.extra_tlvs, | |
serializer); | |
<Option<String>>::sse_encode(self.label, serializer); | |
} | |
} | |
impl SseEncode for crate::models::ServiceHealthCheckResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<crate::models::HealthCheckStatus>::sse_encode(self.status, | |
serializer); | |
} | |
} | |
impl SseEncode for crate::breez_services::SignMessageRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.message, serializer); | |
} | |
} | |
impl SseEncode for crate::breez_services::SignMessageResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.signature, serializer); | |
} | |
} | |
impl SseEncode for crate::models::StaticBackupRequest { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.working_dir, serializer); | |
} | |
} | |
impl SseEncode for crate::models::StaticBackupResponse { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Option<Vec<String>>>::sse_encode(self.backup, serializer); | |
} | |
} | |
impl SseEncode for crate::lnurl::pay::model::SuccessActionProcessed { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
match self { | |
crate::lnurl::pay::model::SuccessActionProcessed::Aes { result | |
} => { | |
<i32>::sse_encode(0, serializer); | |
<crate::lnurl::pay::model::AesSuccessActionDataResult>::sse_encode(result, | |
serializer); | |
} | |
crate::lnurl::pay::model::SuccessActionProcessed::Message { | |
data } => { | |
<i32>::sse_encode(1, serializer); | |
<crate::lnurl::pay::model::MessageSuccessActionData>::sse_encode(data, | |
serializer); | |
} | |
crate::lnurl::pay::model::SuccessActionProcessed::Url { data } | |
=> { | |
<i32>::sse_encode(2, serializer); | |
<crate::lnurl::pay::model::UrlSuccessActionData>::sse_encode(data, | |
serializer); | |
} | |
} | |
} | |
} | |
impl SseEncode for crate::models::SwapAmountType { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(match self { | |
crate::models::SwapAmountType::Send => 0, | |
crate::models::SwapAmountType::Receive => 1, | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
}, serializer); | |
} | |
} | |
impl SseEncode for crate::models::SwapInfo { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.bitcoin_address, serializer); | |
<i64>::sse_encode(self.created_at, serializer); | |
<i64>::sse_encode(self.lock_height, serializer); | |
<Vec<u8>>::sse_encode(self.payment_hash, serializer); | |
<Vec<u8>>::sse_encode(self.preimage, serializer); | |
<Vec<u8>>::sse_encode(self.private_key, serializer); | |
<Vec<u8>>::sse_encode(self.public_key, serializer); | |
<Vec<u8>>::sse_encode(self.swapper_public_key, serializer); | |
<Vec<u8>>::sse_encode(self.script, serializer); | |
<Option<String>>::sse_encode(self.bolt11, serializer); | |
<u64>::sse_encode(self.paid_msat, serializer); | |
<u64>::sse_encode(self.total_incoming_txs, serializer); | |
<u64>::sse_encode(self.confirmed_sats, serializer); | |
<u64>::sse_encode(self.unconfirmed_sats, serializer); | |
<crate::models::SwapStatus>::sse_encode(self.status, serializer); | |
<Vec<String>>::sse_encode(self.refund_tx_ids, serializer); | |
<Vec<String>>::sse_encode(self.unconfirmed_tx_ids, serializer); | |
<Vec<String>>::sse_encode(self.confirmed_tx_ids, serializer); | |
<i64>::sse_encode(self.min_allowed_deposit, serializer); | |
<i64>::sse_encode(self.max_allowed_deposit, serializer); | |
<i64>::sse_encode(self.max_swapper_payable, serializer); | |
<Option<String>>::sse_encode(self.last_redeem_error, serializer); | |
<Option<crate::models::OpeningFeeParams>>::sse_encode(self.channel_opening_fees, | |
serializer); | |
<Option<u32>>::sse_encode(self.confirmed_at, serializer); | |
} | |
} | |
impl SseEncode for crate::models::SwapStatus { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<i32>::sse_encode(match self { | |
crate::models::SwapStatus::Initial => 0, | |
crate::models::SwapStatus::WaitingConfirmation => 1, | |
crate::models::SwapStatus::Redeemable => 2, | |
crate::models::SwapStatus::Redeemed => 3, | |
crate::models::SwapStatus::Refundable => 4, | |
crate::models::SwapStatus::Completed => 5, | |
_ => { | |
{ | |
::core::panicking::panic_fmt(format_args!("not implemented: {0}", | |
format_args!(""))); | |
}; | |
} | |
}, serializer); | |
} | |
} | |
impl SseEncode for crate::fiat::Symbol { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Option<String>>::sse_encode(self.grapheme, serializer); | |
<Option<String>>::sse_encode(self.template, serializer); | |
<Option<bool>>::sse_encode(self.rtl, serializer); | |
<Option<u32>>::sse_encode(self.position, serializer); | |
} | |
} | |
impl SseEncode for crate::models::TlvEntry { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<u64>::sse_encode(self.field_number, serializer); | |
<Vec<u8>>::sse_encode(self.value, serializer); | |
} | |
} | |
impl SseEncode for u16 { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
serializer.cursor.write_u16::<NativeEndian>(self).unwrap(); | |
} | |
} | |
impl SseEncode for u32 { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
serializer.cursor.write_u32::<NativeEndian>(self).unwrap(); | |
} | |
} | |
impl SseEncode for u64 { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
serializer.cursor.write_u64::<NativeEndian>(self).unwrap(); | |
} | |
} | |
impl SseEncode for u8 { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
serializer.cursor.write_u8(self).unwrap(); | |
} | |
} | |
impl SseEncode for () { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) {} | |
} | |
impl SseEncode for crate::models::UnspentTransactionOutput { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<Vec<u8>>::sse_encode(self.txid, serializer); | |
<u32>::sse_encode(self.outnum, serializer); | |
<u64>::sse_encode(self.amount_millisatoshi, serializer); | |
<String>::sse_encode(self.address, serializer); | |
<bool>::sse_encode(self.reserved, serializer); | |
} | |
} | |
impl SseEncode for crate::lnurl::pay::model::UrlSuccessActionData { | |
fn sse_encode(self, | |
serializer: | |
&mut flutter_rust_bridge::for_generated::SseSerializer) { | |
<String>::sse_encode(self.description, serializer); | |
<String>::sse_encode(self.url, serializer); | |
} | |
} | |
#[cfg(not(target_family = "wasm"))] | |
#[path = "frb_generated.io.rs"] | |
mod io { | |
use super::*; | |
use flutter_rust_bridge::for_generated::byteorder::{ | |
NativeEndian, ReadBytesExt, WriteBytesExt, | |
}; | |
use flutter_rust_bridge::for_generated::transform_result_dco; | |
use flutter_rust_bridge::{Handler, IntoIntoDart}; | |
pub trait NewWithNullPtr { | |
fn new_with_null_ptr() | |
-> Self; | |
} | |
impl<T> NewWithNullPtr for *mut T { | |
fn new_with_null_ptr() -> Self { std::ptr::null_mut() } | |
} | |
#[no_mangle] | |
pub extern "C" fn frb_get_rust_content_hash() -> i32 { | |
FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH | |
} | |
#[no_mangle] | |
pub extern "C" fn frb_pde_ffi_dispatcher_primary(func_id: i32, | |
port_: i64, ptr_: *mut u8, rust_vec_len_: i32, data_len_: i32) { | |
pde_ffi_dispatcher_primary_impl(func_id, port_, ptr_, | |
rust_vec_len_, data_len_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frb_pde_ffi_dispatcher_sync(func_id: i32, | |
ptr_: *mut u8, rust_vec_len_: i32, data_len_: i32) | |
-> ::flutter_rust_bridge::for_generated::WireSyncRust2DartSse { | |
pde_ffi_dispatcher_sync_impl(func_id, ptr_, rust_vec_len_, | |
data_len_) | |
} | |
#[no_mangle] | |
pub extern "C" fn dart_fn_deliver_output(call_id: i32, ptr_: *mut u8, | |
rust_vec_len_: i32, data_len_: i32) { | |
let message = | |
unsafe { | |
::flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(ptr_, | |
rust_vec_len_, data_len_) | |
}; | |
FLUTTER_RUST_BRIDGE_HANDLER.dart_fn_handle_output(call_id, | |
message) | |
} | |
impl CstDecode<flutter_rust_bridge::for_generated::anyhow::Error> for | |
*mut wire_cst_list_prim_u_8_strict { | |
fn cst_decode(self) | |
-> flutter_rust_bridge::for_generated::anyhow::Error { | |
::core::panicking::panic("not implemented") | |
} | |
} | |
impl CstDecode<StreamSink<crate::breez_services::BreezEvent, | |
flutter_rust_bridge::for_generated::DcoCodec>> for | |
*mut wire_cst_list_prim_u_8_strict { | |
fn cst_decode(self) | |
-> | |
StreamSink<crate::breez_services::BreezEvent, | |
flutter_rust_bridge::for_generated::DcoCodec> { | |
let raw: String = self.cst_decode(); | |
StreamSink::deserialize(raw) | |
} | |
} | |
impl CstDecode<StreamSink<crate::models::LogEntry, | |
flutter_rust_bridge::for_generated::DcoCodec>> for | |
*mut wire_cst_list_prim_u_8_strict { | |
fn cst_decode(self) | |
-> | |
StreamSink<crate::models::LogEntry, | |
flutter_rust_bridge::for_generated::DcoCodec> { | |
let raw: String = self.cst_decode(); | |
StreamSink::deserialize(raw) | |
} | |
} | |
impl CstDecode<String> for *mut wire_cst_list_prim_u_8_strict { | |
fn cst_decode(self) -> String { | |
let vec: Vec<u8> = self.cst_decode(); | |
String::from_utf8(vec).unwrap() | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::AesSuccessActionDataDecrypted> | |
for wire_cst_aes_success_action_data_decrypted { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::AesSuccessActionDataDecrypted { | |
crate::lnurl::pay::model::AesSuccessActionDataDecrypted { | |
description: self.description.cst_decode(), | |
plaintext: self.plaintext.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::AesSuccessActionDataResult> | |
for wire_cst_aes_success_action_data_result { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::AesSuccessActionDataResult { | |
match self.tag { | |
0 => { | |
let ans = unsafe { self.kind.Decrypted }; | |
crate::lnurl::pay::model::AesSuccessActionDataResult::Decrypted { | |
data: ans.data.cst_decode(), | |
} | |
} | |
1 => { | |
let ans = unsafe { self.kind.ErrorStatus }; | |
crate::lnurl::pay::model::AesSuccessActionDataResult::ErrorStatus { | |
reason: ans.reason.cst_decode(), | |
} | |
} | |
_ => | |
::core::panicking::panic("internal error: entered unreachable code"), | |
} | |
} | |
} | |
impl CstDecode<crate::breez_services::BackupFailedData> for | |
wire_cst_backup_failed_data { | |
fn cst_decode(self) -> crate::breez_services::BackupFailedData { | |
crate::breez_services::BackupFailedData { | |
error: self.error.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::BackupStatus> for wire_cst_backup_status | |
{ | |
fn cst_decode(self) -> crate::models::BackupStatus { | |
crate::models::BackupStatus { | |
backed_up: self.backed_up.cst_decode(), | |
last_backup_time: self.last_backup_time.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::input_parser::BitcoinAddressData> for | |
wire_cst_bitcoin_address_data { | |
fn cst_decode(self) -> crate::input_parser::BitcoinAddressData { | |
crate::input_parser::BitcoinAddressData { | |
address: self.address.cst_decode(), | |
network: self.network.cst_decode(), | |
amount_sat: self.amount_sat.cst_decode(), | |
label: self.label.cst_decode(), | |
message: self.message.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::AesSuccessActionDataDecrypted> | |
for *mut wire_cst_aes_success_action_data_decrypted { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::AesSuccessActionDataDecrypted { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::lnurl::pay::model::AesSuccessActionDataDecrypted>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::AesSuccessActionDataResult> | |
for *mut wire_cst_aes_success_action_data_result { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::AesSuccessActionDataResult { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::lnurl::pay::model::AesSuccessActionDataResult>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::breez_services::BackupFailedData> for | |
*mut wire_cst_backup_failed_data { | |
fn cst_decode(self) -> crate::breez_services::BackupFailedData { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::breez_services::BackupFailedData>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::input_parser::BitcoinAddressData> for | |
*mut wire_cst_bitcoin_address_data { | |
fn cst_decode(self) -> crate::input_parser::BitcoinAddressData { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::input_parser::BitcoinAddressData>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<bool> for *mut bool { | |
fn cst_decode(self) -> bool { | |
unsafe { | |
*flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
} | |
} | |
} | |
impl CstDecode<crate::models::BuyBitcoinRequest> for | |
*mut wire_cst_buy_bitcoin_request { | |
fn cst_decode(self) -> crate::models::BuyBitcoinRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::BuyBitcoinRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::breez_services::CheckMessageRequest> for | |
*mut wire_cst_check_message_request { | |
fn cst_decode(self) | |
-> crate::breez_services::CheckMessageRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::breez_services::CheckMessageRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::ClosedChannelPaymentDetails> for | |
*mut wire_cst_closed_channel_payment_details { | |
fn cst_decode(self) | |
-> crate::models::ClosedChannelPaymentDetails { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::ClosedChannelPaymentDetails>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::ConfigureNodeRequest> for | |
*mut wire_cst_configure_node_request { | |
fn cst_decode(self) -> crate::models::ConfigureNodeRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::ConfigureNodeRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::ConnectRequest> for | |
*mut wire_cst_connect_request { | |
fn cst_decode(self) -> crate::models::ConnectRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::ConnectRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::GreenlightCredentials> for | |
*mut wire_cst_greenlight_credentials { | |
fn cst_decode(self) -> crate::models::GreenlightCredentials { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::GreenlightCredentials>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::GreenlightNodeConfig> for | |
*mut wire_cst_greenlight_node_config { | |
fn cst_decode(self) -> crate::models::GreenlightNodeConfig { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::GreenlightNodeConfig>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<i64> for *mut i64 { | |
fn cst_decode(self) -> i64 { | |
unsafe { | |
*flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
} | |
} | |
} | |
impl CstDecode<crate::breez_services::InvoicePaidDetails> for | |
*mut wire_cst_invoice_paid_details { | |
fn cst_decode(self) -> crate::breez_services::InvoicePaidDetails { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::breez_services::InvoicePaidDetails>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::ListPaymentsRequest> for | |
*mut wire_cst_list_payments_request { | |
fn cst_decode(self) -> crate::models::ListPaymentsRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::ListPaymentsRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::invoice::LNInvoice> for *mut wire_cst_ln_invoice | |
{ | |
fn cst_decode(self) -> crate::invoice::LNInvoice { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::invoice::LNInvoice>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::LnPaymentDetails> for | |
*mut wire_cst_ln_payment_details { | |
fn cst_decode(self) -> crate::models::LnPaymentDetails { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::LnPaymentDetails>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::input_parser::LnUrlAuthRequestData> for | |
*mut wire_cst_ln_url_auth_request_data { | |
fn cst_decode(self) -> crate::input_parser::LnUrlAuthRequestData { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::input_parser::LnUrlAuthRequestData>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::input_parser::LnUrlErrorData> for | |
*mut wire_cst_ln_url_error_data { | |
fn cst_decode(self) -> crate::input_parser::LnUrlErrorData { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::input_parser::LnUrlErrorData>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::LnUrlPayErrorData> for | |
*mut wire_cst_ln_url_pay_error_data { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::LnUrlPayErrorData { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::lnurl::pay::model::LnUrlPayErrorData>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::LnUrlPayRequest> for | |
*mut wire_cst_ln_url_pay_request { | |
fn cst_decode(self) -> crate::models::LnUrlPayRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::LnUrlPayRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::input_parser::LnUrlPayRequestData> for | |
*mut wire_cst_ln_url_pay_request_data { | |
fn cst_decode(self) -> crate::input_parser::LnUrlPayRequestData { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::input_parser::LnUrlPayRequestData>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::LnUrlPaySuccessData> for | |
*mut wire_cst_ln_url_pay_success_data { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::LnUrlPaySuccessData { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::lnurl::pay::model::LnUrlPaySuccessData>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::LnUrlWithdrawRequest> for | |
*mut wire_cst_ln_url_withdraw_request { | |
fn cst_decode(self) -> crate::models::LnUrlWithdrawRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::LnUrlWithdrawRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::input_parser::LnUrlWithdrawRequestData> for | |
*mut wire_cst_ln_url_withdraw_request_data { | |
fn cst_decode(self) | |
-> crate::input_parser::LnUrlWithdrawRequestData { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::input_parser::LnUrlWithdrawRequestData>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::LnUrlWithdrawSuccessData> for | |
*mut wire_cst_ln_url_withdraw_success_data { | |
fn cst_decode(self) -> crate::models::LnUrlWithdrawSuccessData { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::LnUrlWithdrawSuccessData>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::lsp::LspInformation> for | |
*mut wire_cst_lsp_information { | |
fn cst_decode(self) -> crate::lsp::LspInformation { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::lsp::LspInformation>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::MessageSuccessActionData> for | |
*mut wire_cst_message_success_action_data { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::MessageSuccessActionData { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::lnurl::pay::model::MessageSuccessActionData>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::NodeConfig> for | |
*mut wire_cst_node_config { | |
fn cst_decode(self) -> crate::models::NodeConfig { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::NodeConfig>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::NodeCredentials> for | |
*mut wire_cst_node_credentials { | |
fn cst_decode(self) -> crate::models::NodeCredentials { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::NodeCredentials>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::OpenChannelFeeRequest> for | |
*mut wire_cst_open_channel_fee_request { | |
fn cst_decode(self) -> crate::models::OpenChannelFeeRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::OpenChannelFeeRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::OpeningFeeParams> for | |
*mut wire_cst_opening_fee_params { | |
fn cst_decode(self) -> crate::models::OpeningFeeParams { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::OpeningFeeParams>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::PayOnchainRequest> for | |
*mut wire_cst_pay_onchain_request { | |
fn cst_decode(self) -> crate::models::PayOnchainRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::PayOnchainRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::Payment> for *mut wire_cst_payment { | |
fn cst_decode(self) -> crate::models::Payment { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::Payment>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::breez_services::PaymentFailedData> for | |
*mut wire_cst_payment_failed_data { | |
fn cst_decode(self) -> crate::breez_services::PaymentFailedData { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::breez_services::PaymentFailedData>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::PrepareOnchainPaymentRequest> for | |
*mut wire_cst_prepare_onchain_payment_request { | |
fn cst_decode(self) | |
-> crate::models::PrepareOnchainPaymentRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::PrepareOnchainPaymentRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::PrepareRedeemOnchainFundsRequest> for | |
*mut wire_cst_prepare_redeem_onchain_funds_request { | |
fn cst_decode(self) | |
-> crate::models::PrepareRedeemOnchainFundsRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::PrepareRedeemOnchainFundsRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::PrepareRefundRequest> for | |
*mut wire_cst_prepare_refund_request { | |
fn cst_decode(self) -> crate::models::PrepareRefundRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::PrepareRefundRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::ReceiveOnchainRequest> for | |
*mut wire_cst_receive_onchain_request { | |
fn cst_decode(self) -> crate::models::ReceiveOnchainRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::ReceiveOnchainRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::ReceivePaymentRequest> for | |
*mut wire_cst_receive_payment_request { | |
fn cst_decode(self) -> crate::models::ReceivePaymentRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::ReceivePaymentRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::RedeemOnchainFundsRequest> for | |
*mut wire_cst_redeem_onchain_funds_request { | |
fn cst_decode(self) -> crate::models::RedeemOnchainFundsRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::RedeemOnchainFundsRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::RefundRequest> for | |
*mut wire_cst_refund_request { | |
fn cst_decode(self) -> crate::models::RefundRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::RefundRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::ReportIssueRequest> for | |
*mut wire_cst_report_issue_request { | |
fn cst_decode(self) -> crate::models::ReportIssueRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::ReportIssueRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::ReportPaymentFailureDetails> for | |
*mut wire_cst_report_payment_failure_details { | |
fn cst_decode(self) | |
-> crate::models::ReportPaymentFailureDetails { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::ReportPaymentFailureDetails>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::ReverseSwapFeesRequest> for | |
*mut wire_cst_reverse_swap_fees_request { | |
fn cst_decode(self) -> crate::models::ReverseSwapFeesRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::ReverseSwapFeesRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::ReverseSwapInfo> for | |
*mut wire_cst_reverse_swap_info { | |
fn cst_decode(self) -> crate::models::ReverseSwapInfo { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::ReverseSwapInfo>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::SendOnchainRequest> for | |
*mut wire_cst_send_onchain_request { | |
fn cst_decode(self) -> crate::models::SendOnchainRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::SendOnchainRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::SendPaymentRequest> for | |
*mut wire_cst_send_payment_request { | |
fn cst_decode(self) -> crate::models::SendPaymentRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::SendPaymentRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::SendSpontaneousPaymentRequest> for | |
*mut wire_cst_send_spontaneous_payment_request { | |
fn cst_decode(self) | |
-> crate::models::SendSpontaneousPaymentRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::SendSpontaneousPaymentRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::breez_services::SignMessageRequest> for | |
*mut wire_cst_sign_message_request { | |
fn cst_decode(self) -> crate::breez_services::SignMessageRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::breez_services::SignMessageRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::StaticBackupRequest> for | |
*mut wire_cst_static_backup_request { | |
fn cst_decode(self) -> crate::models::StaticBackupRequest { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::StaticBackupRequest>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::SuccessActionProcessed> for | |
*mut wire_cst_success_action_processed { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::SuccessActionProcessed { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::lnurl::pay::model::SuccessActionProcessed>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::models::SwapInfo> for *mut wire_cst_swap_info { | |
fn cst_decode(self) -> crate::models::SwapInfo { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::models::SwapInfo>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::fiat::Symbol> for *mut wire_cst_symbol { | |
fn cst_decode(self) -> crate::fiat::Symbol { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::fiat::Symbol>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<u32> for *mut u32 { | |
fn cst_decode(self) -> u32 { | |
unsafe { | |
*flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
} | |
} | |
} | |
impl CstDecode<u64> for *mut u64 { | |
fn cst_decode(self) -> u64 { | |
unsafe { | |
*flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
} | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::UrlSuccessActionData> for | |
*mut wire_cst_url_success_action_data { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::UrlSuccessActionData { | |
let wrap = | |
unsafe { | |
flutter_rust_bridge::for_generated::box_from_leak_ptr(self) | |
}; | |
CstDecode::<crate::lnurl::pay::model::UrlSuccessActionData>::cst_decode(*wrap).into() | |
} | |
} | |
impl CstDecode<crate::breez_services::BreezEvent> for | |
wire_cst_breez_event { | |
fn cst_decode(self) -> crate::breez_services::BreezEvent { | |
match self.tag { | |
0 => { | |
let ans = unsafe { self.kind.NewBlock }; | |
crate::breez_services::BreezEvent::NewBlock { | |
block: ans.block.cst_decode(), | |
} | |
} | |
1 => { | |
let ans = unsafe { self.kind.InvoicePaid }; | |
crate::breez_services::BreezEvent::InvoicePaid { | |
details: ans.details.cst_decode(), | |
} | |
} | |
2 => crate::breez_services::BreezEvent::Synced, | |
3 => { | |
let ans = unsafe { self.kind.PaymentSucceed }; | |
crate::breez_services::BreezEvent::PaymentSucceed { | |
details: ans.details.cst_decode(), | |
} | |
} | |
4 => { | |
let ans = unsafe { self.kind.PaymentFailed }; | |
crate::breez_services::BreezEvent::PaymentFailed { | |
details: ans.details.cst_decode(), | |
} | |
} | |
5 => crate::breez_services::BreezEvent::BackupStarted, | |
6 => crate::breez_services::BreezEvent::BackupSucceeded, | |
7 => { | |
let ans = unsafe { self.kind.BackupFailed }; | |
crate::breez_services::BreezEvent::BackupFailed { | |
details: ans.details.cst_decode(), | |
} | |
} | |
8 => { | |
let ans = unsafe { self.kind.SwapUpdated }; | |
crate::breez_services::BreezEvent::SwapUpdated { | |
details: ans.details.cst_decode(), | |
} | |
} | |
_ => | |
::core::panicking::panic("internal error: entered unreachable code"), | |
} | |
} | |
} | |
impl CstDecode<crate::models::BuyBitcoinRequest> for | |
wire_cst_buy_bitcoin_request { | |
fn cst_decode(self) -> crate::models::BuyBitcoinRequest { | |
crate::models::BuyBitcoinRequest { | |
provider: self.provider.cst_decode(), | |
opening_fee_params: self.opening_fee_params.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::BuyBitcoinResponse> for | |
wire_cst_buy_bitcoin_response { | |
fn cst_decode(self) -> crate::models::BuyBitcoinResponse { | |
crate::models::BuyBitcoinResponse { | |
url: self.url.cst_decode(), | |
opening_fee_params: self.opening_fee_params.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::breez_services::CheckMessageRequest> for | |
wire_cst_check_message_request { | |
fn cst_decode(self) | |
-> crate::breez_services::CheckMessageRequest { | |
crate::breez_services::CheckMessageRequest { | |
message: self.message.cst_decode(), | |
pubkey: self.pubkey.cst_decode(), | |
signature: self.signature.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::breez_services::CheckMessageResponse> for | |
wire_cst_check_message_response { | |
fn cst_decode(self) | |
-> crate::breez_services::CheckMessageResponse { | |
crate::breez_services::CheckMessageResponse { | |
is_valid: self.is_valid.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::ClosedChannelPaymentDetails> for | |
wire_cst_closed_channel_payment_details { | |
fn cst_decode(self) | |
-> crate::models::ClosedChannelPaymentDetails { | |
crate::models::ClosedChannelPaymentDetails { | |
state: self.state.cst_decode(), | |
funding_txid: self.funding_txid.cst_decode(), | |
short_channel_id: self.short_channel_id.cst_decode(), | |
closing_txid: self.closing_txid.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::Config> for wire_cst_config { | |
fn cst_decode(self) -> crate::models::Config { | |
crate::models::Config { | |
breezserver: self.breezserver.cst_decode(), | |
chainnotifier_url: self.chainnotifier_url.cst_decode(), | |
mempoolspace_url: self.mempoolspace_url.cst_decode(), | |
working_dir: self.working_dir.cst_decode(), | |
network: self.network.cst_decode(), | |
payment_timeout_sec: self.payment_timeout_sec.cst_decode(), | |
default_lsp_id: self.default_lsp_id.cst_decode(), | |
api_key: self.api_key.cst_decode(), | |
maxfee_percent: self.maxfee_percent.cst_decode(), | |
exemptfee_msat: self.exemptfee_msat.cst_decode(), | |
node_config: self.node_config.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::ConfigureNodeRequest> for | |
wire_cst_configure_node_request { | |
fn cst_decode(self) -> crate::models::ConfigureNodeRequest { | |
crate::models::ConfigureNodeRequest { | |
close_to_address: self.close_to_address.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::ConnectRequest> for | |
wire_cst_connect_request { | |
fn cst_decode(self) -> crate::models::ConnectRequest { | |
crate::models::ConnectRequest { | |
config: self.config.cst_decode(), | |
seed: self.seed.cst_decode(), | |
restore_only: self.restore_only.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::fiat::CurrencyInfo> for wire_cst_currency_info { | |
fn cst_decode(self) -> crate::fiat::CurrencyInfo { | |
crate::fiat::CurrencyInfo { | |
name: self.name.cst_decode(), | |
fraction_size: self.fraction_size.cst_decode(), | |
spacing: self.spacing.cst_decode(), | |
symbol: self.symbol.cst_decode(), | |
uniq_symbol: self.uniq_symbol.cst_decode(), | |
localized_name: self.localized_name.cst_decode(), | |
locale_overrides: self.locale_overrides.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::fiat::FiatCurrency> for wire_cst_fiat_currency { | |
fn cst_decode(self) -> crate::fiat::FiatCurrency { | |
crate::fiat::FiatCurrency { | |
id: self.id.cst_decode(), | |
info: self.info.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::GreenlightCredentials> for | |
wire_cst_greenlight_credentials { | |
fn cst_decode(self) -> crate::models::GreenlightCredentials { | |
crate::models::GreenlightCredentials { | |
device_key: self.device_key.cst_decode(), | |
device_cert: self.device_cert.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::GreenlightNodeConfig> for | |
wire_cst_greenlight_node_config { | |
fn cst_decode(self) -> crate::models::GreenlightNodeConfig { | |
crate::models::GreenlightNodeConfig { | |
partner_credentials: self.partner_credentials.cst_decode(), | |
invite_code: self.invite_code.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::input_parser::InputType> for wire_cst_input_type | |
{ | |
fn cst_decode(self) -> crate::input_parser::InputType { | |
match self.tag { | |
0 => { | |
let ans = unsafe { self.kind.BitcoinAddress }; | |
crate::input_parser::InputType::BitcoinAddress { | |
address: ans.address.cst_decode(), | |
} | |
} | |
1 => { | |
let ans = unsafe { self.kind.Bolt11 }; | |
crate::input_parser::InputType::Bolt11 { | |
invoice: ans.invoice.cst_decode(), | |
} | |
} | |
2 => { | |
let ans = unsafe { self.kind.NodeId }; | |
crate::input_parser::InputType::NodeId { | |
node_id: ans.node_id.cst_decode(), | |
} | |
} | |
3 => { | |
let ans = unsafe { self.kind.Url }; | |
crate::input_parser::InputType::Url { | |
url: ans.url.cst_decode(), | |
} | |
} | |
4 => { | |
let ans = unsafe { self.kind.LnUrlPay }; | |
crate::input_parser::InputType::LnUrlPay { | |
data: ans.data.cst_decode(), | |
} | |
} | |
5 => { | |
let ans = unsafe { self.kind.LnUrlWithdraw }; | |
crate::input_parser::InputType::LnUrlWithdraw { | |
data: ans.data.cst_decode(), | |
} | |
} | |
6 => { | |
let ans = unsafe { self.kind.LnUrlAuth }; | |
crate::input_parser::InputType::LnUrlAuth { | |
data: ans.data.cst_decode(), | |
} | |
} | |
7 => { | |
let ans = unsafe { self.kind.LnUrlError }; | |
crate::input_parser::InputType::LnUrlError { | |
data: ans.data.cst_decode(), | |
} | |
} | |
_ => | |
::core::panicking::panic("internal error: entered unreachable code"), | |
} | |
} | |
} | |
impl CstDecode<crate::breez_services::InvoicePaidDetails> for | |
wire_cst_invoice_paid_details { | |
fn cst_decode(self) -> crate::breez_services::InvoicePaidDetails { | |
crate::breez_services::InvoicePaidDetails { | |
payment_hash: self.payment_hash.cst_decode(), | |
bolt11: self.bolt11.cst_decode(), | |
payment: self.payment.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<Vec<String>> for *mut wire_cst_list_String { | |
fn cst_decode(self) -> Vec<String> { | |
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<Vec<crate::fiat::FiatCurrency>> for | |
*mut wire_cst_list_fiat_currency { | |
fn cst_decode(self) -> Vec<crate::fiat::FiatCurrency> { | |
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<Vec<crate::fiat::LocaleOverrides>> for | |
*mut wire_cst_list_locale_overrides { | |
fn cst_decode(self) -> Vec<crate::fiat::LocaleOverrides> { | |
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<Vec<crate::fiat::LocalizedName>> for | |
*mut wire_cst_list_localized_name { | |
fn cst_decode(self) -> Vec<crate::fiat::LocalizedName> { | |
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<Vec<crate::lsp::LspInformation>> for | |
*mut wire_cst_list_lsp_information { | |
fn cst_decode(self) -> Vec<crate::lsp::LspInformation> { | |
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<Vec<crate::models::MetadataFilter>> for | |
*mut wire_cst_list_metadata_filter { | |
fn cst_decode(self) -> Vec<crate::models::MetadataFilter> { | |
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<Vec<crate::models::OpeningFeeParams>> for | |
*mut wire_cst_list_opening_fee_params { | |
fn cst_decode(self) -> Vec<crate::models::OpeningFeeParams> { | |
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<Vec<crate::models::Payment>> for | |
*mut wire_cst_list_payment { | |
fn cst_decode(self) -> Vec<crate::models::Payment> { | |
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<Vec<crate::models::PaymentTypeFilter>> for | |
*mut wire_cst_list_payment_type_filter { | |
fn cst_decode(self) -> Vec<crate::models::PaymentTypeFilter> { | |
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<crate::models::ListPaymentsRequest> for | |
wire_cst_list_payments_request { | |
fn cst_decode(self) -> crate::models::ListPaymentsRequest { | |
crate::models::ListPaymentsRequest { | |
filters: self.filters.cst_decode(), | |
metadata_filters: self.metadata_filters.cst_decode(), | |
from_timestamp: self.from_timestamp.cst_decode(), | |
to_timestamp: self.to_timestamp.cst_decode(), | |
include_failures: self.include_failures.cst_decode(), | |
offset: self.offset.cst_decode(), | |
limit: self.limit.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<Vec<u8>> for *mut wire_cst_list_prim_u_8_strict { | |
fn cst_decode(self) -> Vec<u8> { | |
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<Vec<crate::fiat::Rate>> for *mut wire_cst_list_rate { | |
fn cst_decode(self) -> Vec<crate::fiat::Rate> { | |
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<Vec<crate::models::ReverseSwapInfo>> for | |
*mut wire_cst_list_reverse_swap_info { | |
fn cst_decode(self) -> Vec<crate::models::ReverseSwapInfo> { | |
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<Vec<crate::invoice::RouteHint>> for | |
*mut wire_cst_list_route_hint { | |
fn cst_decode(self) -> Vec<crate::invoice::RouteHint> { | |
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<Vec<crate::invoice::RouteHintHop>> for | |
*mut wire_cst_list_route_hint_hop { | |
fn cst_decode(self) -> Vec<crate::invoice::RouteHintHop> { | |
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<Vec<crate::models::SwapInfo>> for | |
*mut wire_cst_list_swap_info { | |
fn cst_decode(self) -> Vec<crate::models::SwapInfo> { | |
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<Vec<crate::models::TlvEntry>> for | |
*mut wire_cst_list_tlv_entry { | |
fn cst_decode(self) -> Vec<crate::models::TlvEntry> { | |
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<Vec<crate::models::UnspentTransactionOutput>> for | |
*mut wire_cst_list_unspent_transaction_output { | |
fn cst_decode(self) | |
-> Vec<crate::models::UnspentTransactionOutput> { | |
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<crate::invoice::LNInvoice> for wire_cst_ln_invoice { | |
fn cst_decode(self) -> crate::invoice::LNInvoice { | |
crate::invoice::LNInvoice { | |
bolt11: self.bolt11.cst_decode(), | |
network: self.network.cst_decode(), | |
payee_pubkey: self.payee_pubkey.cst_decode(), | |
payment_hash: self.payment_hash.cst_decode(), | |
description: self.description.cst_decode(), | |
description_hash: self.description_hash.cst_decode(), | |
amount_msat: self.amount_msat.cst_decode(), | |
timestamp: self.timestamp.cst_decode(), | |
expiry: self.expiry.cst_decode(), | |
routing_hints: self.routing_hints.cst_decode(), | |
payment_secret: self.payment_secret.cst_decode(), | |
min_final_cltv_expiry_delta: self.min_final_cltv_expiry_delta.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::LnPaymentDetails> for | |
wire_cst_ln_payment_details { | |
fn cst_decode(self) -> crate::models::LnPaymentDetails { | |
crate::models::LnPaymentDetails { | |
payment_hash: self.payment_hash.cst_decode(), | |
label: self.label.cst_decode(), | |
destination_pubkey: self.destination_pubkey.cst_decode(), | |
payment_preimage: self.payment_preimage.cst_decode(), | |
keysend: self.keysend.cst_decode(), | |
bolt11: self.bolt11.cst_decode(), | |
open_channel_bolt11: self.open_channel_bolt11.cst_decode(), | |
lnurl_success_action: self.lnurl_success_action.cst_decode(), | |
lnurl_pay_domain: self.lnurl_pay_domain.cst_decode(), | |
ln_address: self.ln_address.cst_decode(), | |
lnurl_metadata: self.lnurl_metadata.cst_decode(), | |
lnurl_withdraw_endpoint: self.lnurl_withdraw_endpoint.cst_decode(), | |
swap_info: self.swap_info.cst_decode(), | |
reverse_swap_info: self.reverse_swap_info.cst_decode(), | |
pending_expiration_block: self.pending_expiration_block.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::input_parser::LnUrlAuthRequestData> for | |
wire_cst_ln_url_auth_request_data { | |
fn cst_decode(self) -> crate::input_parser::LnUrlAuthRequestData { | |
crate::input_parser::LnUrlAuthRequestData { | |
k1: self.k1.cst_decode(), | |
action: self.action.cst_decode(), | |
domain: self.domain.cst_decode(), | |
url: self.url.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::LnUrlCallbackStatus> for | |
wire_cst_ln_url_callback_status { | |
fn cst_decode(self) -> crate::models::LnUrlCallbackStatus { | |
match self.tag { | |
0 => crate::models::LnUrlCallbackStatus::Ok, | |
1 => { | |
let ans = unsafe { self.kind.ErrorStatus }; | |
crate::models::LnUrlCallbackStatus::ErrorStatus { | |
data: ans.data.cst_decode(), | |
} | |
} | |
_ => | |
::core::panicking::panic("internal error: entered unreachable code"), | |
} | |
} | |
} | |
impl CstDecode<crate::input_parser::LnUrlErrorData> for | |
wire_cst_ln_url_error_data { | |
fn cst_decode(self) -> crate::input_parser::LnUrlErrorData { | |
crate::input_parser::LnUrlErrorData { | |
reason: self.reason.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::LnUrlPayErrorData> for | |
wire_cst_ln_url_pay_error_data { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::LnUrlPayErrorData { | |
crate::lnurl::pay::model::LnUrlPayErrorData { | |
payment_hash: self.payment_hash.cst_decode(), | |
reason: self.reason.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::LnUrlPayRequest> for | |
wire_cst_ln_url_pay_request { | |
fn cst_decode(self) -> crate::models::LnUrlPayRequest { | |
crate::models::LnUrlPayRequest { | |
data: self.data.cst_decode(), | |
amount_msat: self.amount_msat.cst_decode(), | |
comment: self.comment.cst_decode(), | |
payment_label: self.payment_label.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::input_parser::LnUrlPayRequestData> for | |
wire_cst_ln_url_pay_request_data { | |
fn cst_decode(self) -> crate::input_parser::LnUrlPayRequestData { | |
crate::input_parser::LnUrlPayRequestData { | |
callback: self.callback.cst_decode(), | |
min_sendable: self.min_sendable.cst_decode(), | |
max_sendable: self.max_sendable.cst_decode(), | |
metadata_str: self.metadata_str.cst_decode(), | |
comment_allowed: self.comment_allowed.cst_decode(), | |
domain: self.domain.cst_decode(), | |
allows_nostr: self.allows_nostr.cst_decode(), | |
nostr_pubkey: self.nostr_pubkey.cst_decode(), | |
ln_address: self.ln_address.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::LnUrlPayResult> for | |
wire_cst_ln_url_pay_result { | |
fn cst_decode(self) -> crate::lnurl::pay::model::LnUrlPayResult { | |
match self.tag { | |
0 => { | |
let ans = unsafe { self.kind.EndpointSuccess }; | |
crate::lnurl::pay::model::LnUrlPayResult::EndpointSuccess { | |
data: ans.data.cst_decode(), | |
} | |
} | |
1 => { | |
let ans = unsafe { self.kind.EndpointError }; | |
crate::lnurl::pay::model::LnUrlPayResult::EndpointError { | |
data: ans.data.cst_decode(), | |
} | |
} | |
2 => { | |
let ans = unsafe { self.kind.PayError }; | |
crate::lnurl::pay::model::LnUrlPayResult::PayError { | |
data: ans.data.cst_decode(), | |
} | |
} | |
_ => | |
::core::panicking::panic("internal error: entered unreachable code"), | |
} | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::LnUrlPaySuccessData> for | |
wire_cst_ln_url_pay_success_data { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::LnUrlPaySuccessData { | |
crate::lnurl::pay::model::LnUrlPaySuccessData { | |
payment: self.payment.cst_decode(), | |
success_action: self.success_action.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::LnUrlWithdrawRequest> for | |
wire_cst_ln_url_withdraw_request { | |
fn cst_decode(self) -> crate::models::LnUrlWithdrawRequest { | |
crate::models::LnUrlWithdrawRequest { | |
data: self.data.cst_decode(), | |
amount_msat: self.amount_msat.cst_decode(), | |
description: self.description.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::input_parser::LnUrlWithdrawRequestData> for | |
wire_cst_ln_url_withdraw_request_data { | |
fn cst_decode(self) | |
-> crate::input_parser::LnUrlWithdrawRequestData { | |
crate::input_parser::LnUrlWithdrawRequestData { | |
callback: self.callback.cst_decode(), | |
k1: self.k1.cst_decode(), | |
default_description: self.default_description.cst_decode(), | |
min_withdrawable: self.min_withdrawable.cst_decode(), | |
max_withdrawable: self.max_withdrawable.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::LnUrlWithdrawResult> for | |
wire_cst_ln_url_withdraw_result { | |
fn cst_decode(self) -> crate::models::LnUrlWithdrawResult { | |
match self.tag { | |
0 => { | |
let ans = unsafe { self.kind.Ok }; | |
crate::models::LnUrlWithdrawResult::Ok { | |
data: ans.data.cst_decode(), | |
} | |
} | |
1 => { | |
let ans = unsafe { self.kind.ErrorStatus }; | |
crate::models::LnUrlWithdrawResult::ErrorStatus { | |
data: ans.data.cst_decode(), | |
} | |
} | |
_ => | |
::core::panicking::panic("internal error: entered unreachable code"), | |
} | |
} | |
} | |
impl CstDecode<crate::models::LnUrlWithdrawSuccessData> for | |
wire_cst_ln_url_withdraw_success_data { | |
fn cst_decode(self) -> crate::models::LnUrlWithdrawSuccessData { | |
crate::models::LnUrlWithdrawSuccessData { | |
invoice: self.invoice.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::fiat::LocaleOverrides> for | |
wire_cst_locale_overrides { | |
fn cst_decode(self) -> crate::fiat::LocaleOverrides { | |
crate::fiat::LocaleOverrides { | |
locale: self.locale.cst_decode(), | |
spacing: self.spacing.cst_decode(), | |
symbol: self.symbol.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::fiat::LocalizedName> for wire_cst_localized_name | |
{ | |
fn cst_decode(self) -> crate::fiat::LocalizedName { | |
crate::fiat::LocalizedName { | |
locale: self.locale.cst_decode(), | |
name: self.name.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::LogEntry> for wire_cst_log_entry { | |
fn cst_decode(self) -> crate::models::LogEntry { | |
crate::models::LogEntry { | |
line: self.line.cst_decode(), | |
level: self.level.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::lsp::LspInformation> for | |
wire_cst_lsp_information { | |
fn cst_decode(self) -> crate::lsp::LspInformation { | |
crate::lsp::LspInformation { | |
id: self.id.cst_decode(), | |
name: self.name.cst_decode(), | |
widget_url: self.widget_url.cst_decode(), | |
pubkey: self.pubkey.cst_decode(), | |
host: self.host.cst_decode(), | |
base_fee_msat: self.base_fee_msat.cst_decode(), | |
fee_rate: self.fee_rate.cst_decode(), | |
time_lock_delta: self.time_lock_delta.cst_decode(), | |
min_htlc_msat: self.min_htlc_msat.cst_decode(), | |
lsp_pubkey: self.lsp_pubkey.cst_decode(), | |
opening_fee_params_list: self.opening_fee_params_list.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::MaxReverseSwapAmountResponse> for | |
wire_cst_max_reverse_swap_amount_response { | |
fn cst_decode(self) | |
-> crate::models::MaxReverseSwapAmountResponse { | |
crate::models::MaxReverseSwapAmountResponse { | |
total_sat: self.total_sat.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::MessageSuccessActionData> for | |
wire_cst_message_success_action_data { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::MessageSuccessActionData { | |
crate::lnurl::pay::model::MessageSuccessActionData { | |
message: self.message.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::MetadataFilter> for | |
wire_cst_metadata_filter { | |
fn cst_decode(self) -> crate::models::MetadataFilter { | |
crate::models::MetadataFilter { | |
json_path: self.json_path.cst_decode(), | |
json_value: self.json_value.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::NodeConfig> for wire_cst_node_config { | |
fn cst_decode(self) -> crate::models::NodeConfig { | |
match self.tag { | |
0 => { | |
let ans = unsafe { self.kind.Greenlight }; | |
crate::models::NodeConfig::Greenlight { | |
config: ans.config.cst_decode(), | |
} | |
} | |
_ => | |
::core::panicking::panic("internal error: entered unreachable code"), | |
} | |
} | |
} | |
impl CstDecode<crate::models::NodeCredentials> for | |
wire_cst_node_credentials { | |
fn cst_decode(self) -> crate::models::NodeCredentials { | |
match self.tag { | |
0 => { | |
let ans = unsafe { self.kind.Greenlight }; | |
crate::models::NodeCredentials::Greenlight { | |
credentials: ans.credentials.cst_decode(), | |
} | |
} | |
_ => | |
::core::panicking::panic("internal error: entered unreachable code"), | |
} | |
} | |
} | |
impl CstDecode<crate::models::NodeState> for wire_cst_node_state { | |
fn cst_decode(self) -> crate::models::NodeState { | |
crate::models::NodeState { | |
id: self.id.cst_decode(), | |
block_height: self.block_height.cst_decode(), | |
channels_balance_msat: self.channels_balance_msat.cst_decode(), | |
onchain_balance_msat: self.onchain_balance_msat.cst_decode(), | |
pending_onchain_balance_msat: self.pending_onchain_balance_msat.cst_decode(), | |
utxos: self.utxos.cst_decode(), | |
max_payable_msat: self.max_payable_msat.cst_decode(), | |
max_receivable_msat: self.max_receivable_msat.cst_decode(), | |
max_single_payment_amount_msat: self.max_single_payment_amount_msat.cst_decode(), | |
max_chan_reserve_msats: self.max_chan_reserve_msats.cst_decode(), | |
connected_peers: self.connected_peers.cst_decode(), | |
inbound_liquidity_msats: self.inbound_liquidity_msats.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::OnchainPaymentLimitsResponse> for | |
wire_cst_onchain_payment_limits_response { | |
fn cst_decode(self) | |
-> crate::models::OnchainPaymentLimitsResponse { | |
crate::models::OnchainPaymentLimitsResponse { | |
min_sat: self.min_sat.cst_decode(), | |
max_sat: self.max_sat.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::OpenChannelFeeRequest> for | |
wire_cst_open_channel_fee_request { | |
fn cst_decode(self) -> crate::models::OpenChannelFeeRequest { | |
crate::models::OpenChannelFeeRequest { | |
amount_msat: self.amount_msat.cst_decode(), | |
expiry: self.expiry.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::OpenChannelFeeResponse> for | |
wire_cst_open_channel_fee_response { | |
fn cst_decode(self) -> crate::models::OpenChannelFeeResponse { | |
crate::models::OpenChannelFeeResponse { | |
fee_msat: self.fee_msat.cst_decode(), | |
fee_params: self.fee_params.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::OpeningFeeParams> for | |
wire_cst_opening_fee_params { | |
fn cst_decode(self) -> crate::models::OpeningFeeParams { | |
crate::models::OpeningFeeParams { | |
min_msat: self.min_msat.cst_decode(), | |
proportional: self.proportional.cst_decode(), | |
valid_until: self.valid_until.cst_decode(), | |
max_idle_time: self.max_idle_time.cst_decode(), | |
max_client_to_self_delay: self.max_client_to_self_delay.cst_decode(), | |
promise: self.promise.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::OpeningFeeParamsMenu> for | |
wire_cst_opening_fee_params_menu { | |
fn cst_decode(self) -> crate::models::OpeningFeeParamsMenu { | |
crate::models::OpeningFeeParamsMenu { | |
values: self.values.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::PayOnchainRequest> for | |
wire_cst_pay_onchain_request { | |
fn cst_decode(self) -> crate::models::PayOnchainRequest { | |
crate::models::PayOnchainRequest { | |
recipient_address: self.recipient_address.cst_decode(), | |
prepare_res: self.prepare_res.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::PayOnchainResponse> for | |
wire_cst_pay_onchain_response { | |
fn cst_decode(self) -> crate::models::PayOnchainResponse { | |
crate::models::PayOnchainResponse { | |
reverse_swap_info: self.reverse_swap_info.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::Payment> for wire_cst_payment { | |
fn cst_decode(self) -> crate::models::Payment { | |
crate::models::Payment { | |
id: self.id.cst_decode(), | |
payment_type: self.payment_type.cst_decode(), | |
payment_time: self.payment_time.cst_decode(), | |
amount_msat: self.amount_msat.cst_decode(), | |
fee_msat: self.fee_msat.cst_decode(), | |
status: self.status.cst_decode(), | |
error: self.error.cst_decode(), | |
description: self.description.cst_decode(), | |
details: self.details.cst_decode(), | |
metadata: self.metadata.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::PaymentDetails> for | |
wire_cst_payment_details { | |
fn cst_decode(self) -> crate::models::PaymentDetails { | |
match self.tag { | |
0 => { | |
let ans = unsafe { self.kind.Ln }; | |
crate::models::PaymentDetails::Ln { | |
data: ans.data.cst_decode(), | |
} | |
} | |
1 => { | |
let ans = unsafe { self.kind.ClosedChannel }; | |
crate::models::PaymentDetails::ClosedChannel { | |
data: ans.data.cst_decode(), | |
} | |
} | |
_ => | |
::core::panicking::panic("internal error: entered unreachable code"), | |
} | |
} | |
} | |
impl CstDecode<crate::breez_services::PaymentFailedData> for | |
wire_cst_payment_failed_data { | |
fn cst_decode(self) -> crate::breez_services::PaymentFailedData { | |
crate::breez_services::PaymentFailedData { | |
error: self.error.cst_decode(), | |
node_id: self.node_id.cst_decode(), | |
invoice: self.invoice.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::PrepareOnchainPaymentRequest> for | |
wire_cst_prepare_onchain_payment_request { | |
fn cst_decode(self) | |
-> crate::models::PrepareOnchainPaymentRequest { | |
crate::models::PrepareOnchainPaymentRequest { | |
amount_sat: self.amount_sat.cst_decode(), | |
amount_type: self.amount_type.cst_decode(), | |
claim_tx_feerate: self.claim_tx_feerate.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::PrepareOnchainPaymentResponse> for | |
wire_cst_prepare_onchain_payment_response { | |
fn cst_decode(self) | |
-> crate::models::PrepareOnchainPaymentResponse { | |
crate::models::PrepareOnchainPaymentResponse { | |
fees_hash: self.fees_hash.cst_decode(), | |
fees_percentage: self.fees_percentage.cst_decode(), | |
fees_lockup: self.fees_lockup.cst_decode(), | |
fees_claim: self.fees_claim.cst_decode(), | |
sender_amount_sat: self.sender_amount_sat.cst_decode(), | |
recipient_amount_sat: self.recipient_amount_sat.cst_decode(), | |
total_fees: self.total_fees.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::PrepareRedeemOnchainFundsRequest> for | |
wire_cst_prepare_redeem_onchain_funds_request { | |
fn cst_decode(self) | |
-> crate::models::PrepareRedeemOnchainFundsRequest { | |
crate::models::PrepareRedeemOnchainFundsRequest { | |
to_address: self.to_address.cst_decode(), | |
sat_per_vbyte: self.sat_per_vbyte.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::PrepareRedeemOnchainFundsResponse> for | |
wire_cst_prepare_redeem_onchain_funds_response { | |
fn cst_decode(self) | |
-> crate::models::PrepareRedeemOnchainFundsResponse { | |
crate::models::PrepareRedeemOnchainFundsResponse { | |
tx_weight: self.tx_weight.cst_decode(), | |
tx_fee_sat: self.tx_fee_sat.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::PrepareRefundRequest> for | |
wire_cst_prepare_refund_request { | |
fn cst_decode(self) -> crate::models::PrepareRefundRequest { | |
crate::models::PrepareRefundRequest { | |
swap_address: self.swap_address.cst_decode(), | |
to_address: self.to_address.cst_decode(), | |
sat_per_vbyte: self.sat_per_vbyte.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::PrepareRefundResponse> for | |
wire_cst_prepare_refund_response { | |
fn cst_decode(self) -> crate::models::PrepareRefundResponse { | |
crate::models::PrepareRefundResponse { | |
refund_tx_weight: self.refund_tx_weight.cst_decode(), | |
refund_tx_fee_sat: self.refund_tx_fee_sat.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::fiat::Rate> for wire_cst_rate { | |
fn cst_decode(self) -> crate::fiat::Rate { | |
crate::fiat::Rate { | |
coin: self.coin.cst_decode(), | |
value: self.value.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::ReceiveOnchainRequest> for | |
wire_cst_receive_onchain_request { | |
fn cst_decode(self) -> crate::models::ReceiveOnchainRequest { | |
crate::models::ReceiveOnchainRequest { | |
opening_fee_params: self.opening_fee_params.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::ReceivePaymentRequest> for | |
wire_cst_receive_payment_request { | |
fn cst_decode(self) -> crate::models::ReceivePaymentRequest { | |
crate::models::ReceivePaymentRequest { | |
amount_msat: self.amount_msat.cst_decode(), | |
description: self.description.cst_decode(), | |
preimage: self.preimage.cst_decode(), | |
opening_fee_params: self.opening_fee_params.cst_decode(), | |
use_description_hash: self.use_description_hash.cst_decode(), | |
expiry: self.expiry.cst_decode(), | |
cltv: self.cltv.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::ReceivePaymentResponse> for | |
wire_cst_receive_payment_response { | |
fn cst_decode(self) -> crate::models::ReceivePaymentResponse { | |
crate::models::ReceivePaymentResponse { | |
ln_invoice: self.ln_invoice.cst_decode(), | |
opening_fee_params: self.opening_fee_params.cst_decode(), | |
opening_fee_msat: self.opening_fee_msat.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::chain::RecommendedFees> for | |
wire_cst_recommended_fees { | |
fn cst_decode(self) -> crate::chain::RecommendedFees { | |
crate::chain::RecommendedFees { | |
fastest_fee: self.fastest_fee.cst_decode(), | |
half_hour_fee: self.half_hour_fee.cst_decode(), | |
hour_fee: self.hour_fee.cst_decode(), | |
economy_fee: self.economy_fee.cst_decode(), | |
minimum_fee: self.minimum_fee.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::RedeemOnchainFundsRequest> for | |
wire_cst_redeem_onchain_funds_request { | |
fn cst_decode(self) -> crate::models::RedeemOnchainFundsRequest { | |
crate::models::RedeemOnchainFundsRequest { | |
to_address: self.to_address.cst_decode(), | |
sat_per_vbyte: self.sat_per_vbyte.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::RedeemOnchainFundsResponse> for | |
wire_cst_redeem_onchain_funds_response { | |
fn cst_decode(self) -> crate::models::RedeemOnchainFundsResponse { | |
crate::models::RedeemOnchainFundsResponse { | |
txid: self.txid.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::RefundRequest> for | |
wire_cst_refund_request { | |
fn cst_decode(self) -> crate::models::RefundRequest { | |
crate::models::RefundRequest { | |
swap_address: self.swap_address.cst_decode(), | |
to_address: self.to_address.cst_decode(), | |
sat_per_vbyte: self.sat_per_vbyte.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::RefundResponse> for | |
wire_cst_refund_response { | |
fn cst_decode(self) -> crate::models::RefundResponse { | |
crate::models::RefundResponse { | |
refund_tx_id: self.refund_tx_id.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::ReportIssueRequest> for | |
wire_cst_report_issue_request { | |
fn cst_decode(self) -> crate::models::ReportIssueRequest { | |
match self.tag { | |
0 => { | |
let ans = unsafe { self.kind.PaymentFailure }; | |
crate::models::ReportIssueRequest::PaymentFailure { | |
data: ans.data.cst_decode(), | |
} | |
} | |
_ => | |
::core::panicking::panic("internal error: entered unreachable code"), | |
} | |
} | |
} | |
impl CstDecode<crate::models::ReportPaymentFailureDetails> for | |
wire_cst_report_payment_failure_details { | |
fn cst_decode(self) | |
-> crate::models::ReportPaymentFailureDetails { | |
crate::models::ReportPaymentFailureDetails { | |
payment_hash: self.payment_hash.cst_decode(), | |
comment: self.comment.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::ReverseSwapFeesRequest> for | |
wire_cst_reverse_swap_fees_request { | |
fn cst_decode(self) -> crate::models::ReverseSwapFeesRequest { | |
crate::models::ReverseSwapFeesRequest { | |
send_amount_sat: self.send_amount_sat.cst_decode(), | |
claim_tx_feerate: self.claim_tx_feerate.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::ReverseSwapInfo> for | |
wire_cst_reverse_swap_info { | |
fn cst_decode(self) -> crate::models::ReverseSwapInfo { | |
crate::models::ReverseSwapInfo { | |
id: self.id.cst_decode(), | |
claim_pubkey: self.claim_pubkey.cst_decode(), | |
lockup_txid: self.lockup_txid.cst_decode(), | |
claim_txid: self.claim_txid.cst_decode(), | |
onchain_amount_sat: self.onchain_amount_sat.cst_decode(), | |
status: self.status.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::ReverseSwapPairInfo> for | |
wire_cst_reverse_swap_pair_info { | |
fn cst_decode(self) -> crate::models::ReverseSwapPairInfo { | |
crate::models::ReverseSwapPairInfo { | |
min: self.min.cst_decode(), | |
max: self.max.cst_decode(), | |
fees_hash: self.fees_hash.cst_decode(), | |
fees_percentage: self.fees_percentage.cst_decode(), | |
fees_lockup: self.fees_lockup.cst_decode(), | |
fees_claim: self.fees_claim.cst_decode(), | |
total_fees: self.total_fees.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::invoice::RouteHint> for wire_cst_route_hint { | |
fn cst_decode(self) -> crate::invoice::RouteHint { | |
crate::invoice::RouteHint { hops: self.hops.cst_decode() } | |
} | |
} | |
impl CstDecode<crate::invoice::RouteHintHop> for | |
wire_cst_route_hint_hop { | |
fn cst_decode(self) -> crate::invoice::RouteHintHop { | |
crate::invoice::RouteHintHop { | |
src_node_id: self.src_node_id.cst_decode(), | |
short_channel_id: self.short_channel_id.cst_decode(), | |
fees_base_msat: self.fees_base_msat.cst_decode(), | |
fees_proportional_millionths: self.fees_proportional_millionths.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(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::SendOnchainRequest> for | |
wire_cst_send_onchain_request { | |
fn cst_decode(self) -> crate::models::SendOnchainRequest { | |
crate::models::SendOnchainRequest { | |
amount_sat: self.amount_sat.cst_decode(), | |
onchain_recipient_address: self.onchain_recipient_address.cst_decode(), | |
pair_hash: self.pair_hash.cst_decode(), | |
sat_per_vbyte: self.sat_per_vbyte.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::SendOnchainResponse> for | |
wire_cst_send_onchain_response { | |
fn cst_decode(self) -> crate::models::SendOnchainResponse { | |
crate::models::SendOnchainResponse { | |
reverse_swap_info: self.reverse_swap_info.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::SendPaymentRequest> for | |
wire_cst_send_payment_request { | |
fn cst_decode(self) -> crate::models::SendPaymentRequest { | |
crate::models::SendPaymentRequest { | |
bolt11: self.bolt11.cst_decode(), | |
amount_msat: self.amount_msat.cst_decode(), | |
label: self.label.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::SendPaymentResponse> for | |
wire_cst_send_payment_response { | |
fn cst_decode(self) -> crate::models::SendPaymentResponse { | |
crate::models::SendPaymentResponse { | |
payment: self.payment.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::SendSpontaneousPaymentRequest> for | |
wire_cst_send_spontaneous_payment_request { | |
fn cst_decode(self) | |
-> crate::models::SendSpontaneousPaymentRequest { | |
crate::models::SendSpontaneousPaymentRequest { | |
node_id: self.node_id.cst_decode(), | |
amount_msat: self.amount_msat.cst_decode(), | |
extra_tlvs: self.extra_tlvs.cst_decode(), | |
label: self.label.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::ServiceHealthCheckResponse> for | |
wire_cst_service_health_check_response { | |
fn cst_decode(self) -> crate::models::ServiceHealthCheckResponse { | |
crate::models::ServiceHealthCheckResponse { | |
status: self.status.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::breez_services::SignMessageRequest> for | |
wire_cst_sign_message_request { | |
fn cst_decode(self) -> crate::breez_services::SignMessageRequest { | |
crate::breez_services::SignMessageRequest { | |
message: self.message.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::breez_services::SignMessageResponse> for | |
wire_cst_sign_message_response { | |
fn cst_decode(self) | |
-> crate::breez_services::SignMessageResponse { | |
crate::breez_services::SignMessageResponse { | |
signature: self.signature.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::StaticBackupRequest> for | |
wire_cst_static_backup_request { | |
fn cst_decode(self) -> crate::models::StaticBackupRequest { | |
crate::models::StaticBackupRequest { | |
working_dir: self.working_dir.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::StaticBackupResponse> for | |
wire_cst_static_backup_response { | |
fn cst_decode(self) -> crate::models::StaticBackupResponse { | |
crate::models::StaticBackupResponse { | |
backup: self.backup.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::SuccessActionProcessed> for | |
wire_cst_success_action_processed { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::SuccessActionProcessed { | |
match self.tag { | |
0 => { | |
let ans = unsafe { self.kind.Aes }; | |
crate::lnurl::pay::model::SuccessActionProcessed::Aes { | |
result: ans.result.cst_decode(), | |
} | |
} | |
1 => { | |
let ans = unsafe { self.kind.Message }; | |
crate::lnurl::pay::model::SuccessActionProcessed::Message { | |
data: ans.data.cst_decode(), | |
} | |
} | |
2 => { | |
let ans = unsafe { self.kind.Url }; | |
crate::lnurl::pay::model::SuccessActionProcessed::Url { | |
data: ans.data.cst_decode(), | |
} | |
} | |
_ => | |
::core::panicking::panic("internal error: entered unreachable code"), | |
} | |
} | |
} | |
impl CstDecode<crate::models::SwapInfo> for wire_cst_swap_info { | |
fn cst_decode(self) -> crate::models::SwapInfo { | |
crate::models::SwapInfo { | |
bitcoin_address: self.bitcoin_address.cst_decode(), | |
created_at: self.created_at.cst_decode(), | |
lock_height: self.lock_height.cst_decode(), | |
payment_hash: self.payment_hash.cst_decode(), | |
preimage: self.preimage.cst_decode(), | |
private_key: self.private_key.cst_decode(), | |
public_key: self.public_key.cst_decode(), | |
swapper_public_key: self.swapper_public_key.cst_decode(), | |
script: self.script.cst_decode(), | |
bolt11: self.bolt11.cst_decode(), | |
paid_msat: self.paid_msat.cst_decode(), | |
total_incoming_txs: self.total_incoming_txs.cst_decode(), | |
confirmed_sats: self.confirmed_sats.cst_decode(), | |
unconfirmed_sats: self.unconfirmed_sats.cst_decode(), | |
status: self.status.cst_decode(), | |
refund_tx_ids: self.refund_tx_ids.cst_decode(), | |
unconfirmed_tx_ids: self.unconfirmed_tx_ids.cst_decode(), | |
confirmed_tx_ids: self.confirmed_tx_ids.cst_decode(), | |
min_allowed_deposit: self.min_allowed_deposit.cst_decode(), | |
max_allowed_deposit: self.max_allowed_deposit.cst_decode(), | |
max_swapper_payable: self.max_swapper_payable.cst_decode(), | |
last_redeem_error: self.last_redeem_error.cst_decode(), | |
channel_opening_fees: self.channel_opening_fees.cst_decode(), | |
confirmed_at: self.confirmed_at.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::fiat::Symbol> for wire_cst_symbol { | |
fn cst_decode(self) -> crate::fiat::Symbol { | |
crate::fiat::Symbol { | |
grapheme: self.grapheme.cst_decode(), | |
template: self.template.cst_decode(), | |
rtl: self.rtl.cst_decode(), | |
position: self.position.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::TlvEntry> for wire_cst_tlv_entry { | |
fn cst_decode(self) -> crate::models::TlvEntry { | |
crate::models::TlvEntry { | |
field_number: self.field_number.cst_decode(), | |
value: self.value.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::models::UnspentTransactionOutput> for | |
wire_cst_unspent_transaction_output { | |
fn cst_decode(self) -> crate::models::UnspentTransactionOutput { | |
crate::models::UnspentTransactionOutput { | |
txid: self.txid.cst_decode(), | |
outnum: self.outnum.cst_decode(), | |
amount_millisatoshi: self.amount_millisatoshi.cst_decode(), | |
address: self.address.cst_decode(), | |
reserved: self.reserved.cst_decode(), | |
} | |
} | |
} | |
impl CstDecode<crate::lnurl::pay::model::UrlSuccessActionData> for | |
wire_cst_url_success_action_data { | |
fn cst_decode(self) | |
-> crate::lnurl::pay::model::UrlSuccessActionData { | |
crate::lnurl::pay::model::UrlSuccessActionData { | |
description: self.description.cst_decode(), | |
url: self.url.cst_decode(), | |
} | |
} | |
} | |
impl NewWithNullPtr for wire_cst_aes_success_action_data_decrypted { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
description: core::ptr::null_mut(), | |
plaintext: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_aes_success_action_data_decrypted { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_aes_success_action_data_result { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
tag: -1, | |
kind: AesSuccessActionDataResultKind { nil__: () }, | |
} | |
} | |
} | |
impl Default for wire_cst_aes_success_action_data_result { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_backup_failed_data { | |
fn new_with_null_ptr() -> Self { | |
Self { error: core::ptr::null_mut() } | |
} | |
} | |
impl Default for wire_cst_backup_failed_data { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_backup_status { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
backed_up: Default::default(), | |
last_backup_time: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_backup_status { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_bitcoin_address_data { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
address: core::ptr::null_mut(), | |
network: Default::default(), | |
amount_sat: core::ptr::null_mut(), | |
label: core::ptr::null_mut(), | |
message: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_bitcoin_address_data { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_breez_event { | |
fn new_with_null_ptr() -> Self { | |
Self { tag: -1, kind: BreezEventKind { nil__: () } } | |
} | |
} | |
impl Default for wire_cst_breez_event { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_buy_bitcoin_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
provider: Default::default(), | |
opening_fee_params: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_buy_bitcoin_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_buy_bitcoin_response { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
url: core::ptr::null_mut(), | |
opening_fee_params: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_buy_bitcoin_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_check_message_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
message: core::ptr::null_mut(), | |
pubkey: core::ptr::null_mut(), | |
signature: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_check_message_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_check_message_response { | |
fn new_with_null_ptr() -> Self { | |
Self { is_valid: Default::default() } | |
} | |
} | |
impl Default for wire_cst_check_message_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_closed_channel_payment_details { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
state: Default::default(), | |
funding_txid: core::ptr::null_mut(), | |
short_channel_id: core::ptr::null_mut(), | |
closing_txid: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_closed_channel_payment_details { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_config { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
breezserver: core::ptr::null_mut(), | |
chainnotifier_url: core::ptr::null_mut(), | |
mempoolspace_url: core::ptr::null_mut(), | |
working_dir: core::ptr::null_mut(), | |
network: Default::default(), | |
payment_timeout_sec: Default::default(), | |
default_lsp_id: core::ptr::null_mut(), | |
api_key: core::ptr::null_mut(), | |
maxfee_percent: Default::default(), | |
exemptfee_msat: Default::default(), | |
node_config: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_config { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_configure_node_request { | |
fn new_with_null_ptr() -> Self { | |
Self { close_to_address: core::ptr::null_mut() } | |
} | |
} | |
impl Default for wire_cst_configure_node_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_connect_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
config: Default::default(), | |
seed: core::ptr::null_mut(), | |
restore_only: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_connect_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_currency_info { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
name: core::ptr::null_mut(), | |
fraction_size: Default::default(), | |
spacing: core::ptr::null_mut(), | |
symbol: core::ptr::null_mut(), | |
uniq_symbol: core::ptr::null_mut(), | |
localized_name: core::ptr::null_mut(), | |
locale_overrides: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_currency_info { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_fiat_currency { | |
fn new_with_null_ptr() -> Self { | |
Self { id: core::ptr::null_mut(), info: Default::default() } | |
} | |
} | |
impl Default for wire_cst_fiat_currency { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_greenlight_credentials { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
device_key: core::ptr::null_mut(), | |
device_cert: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_greenlight_credentials { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_greenlight_node_config { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
partner_credentials: core::ptr::null_mut(), | |
invite_code: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_greenlight_node_config { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_input_type { | |
fn new_with_null_ptr() -> Self { | |
Self { tag: -1, kind: InputTypeKind { nil__: () } } | |
} | |
} | |
impl Default for wire_cst_input_type { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_invoice_paid_details { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
payment_hash: core::ptr::null_mut(), | |
bolt11: core::ptr::null_mut(), | |
payment: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_invoice_paid_details { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_list_payments_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
filters: core::ptr::null_mut(), | |
metadata_filters: core::ptr::null_mut(), | |
from_timestamp: core::ptr::null_mut(), | |
to_timestamp: core::ptr::null_mut(), | |
include_failures: core::ptr::null_mut(), | |
offset: core::ptr::null_mut(), | |
limit: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_list_payments_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_invoice { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
bolt11: core::ptr::null_mut(), | |
network: Default::default(), | |
payee_pubkey: core::ptr::null_mut(), | |
payment_hash: core::ptr::null_mut(), | |
description: core::ptr::null_mut(), | |
description_hash: core::ptr::null_mut(), | |
amount_msat: core::ptr::null_mut(), | |
timestamp: Default::default(), | |
expiry: Default::default(), | |
routing_hints: core::ptr::null_mut(), | |
payment_secret: core::ptr::null_mut(), | |
min_final_cltv_expiry_delta: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_ln_invoice { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_payment_details { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
payment_hash: core::ptr::null_mut(), | |
label: core::ptr::null_mut(), | |
destination_pubkey: core::ptr::null_mut(), | |
payment_preimage: core::ptr::null_mut(), | |
keysend: Default::default(), | |
bolt11: core::ptr::null_mut(), | |
open_channel_bolt11: core::ptr::null_mut(), | |
lnurl_success_action: core::ptr::null_mut(), | |
lnurl_pay_domain: core::ptr::null_mut(), | |
ln_address: core::ptr::null_mut(), | |
lnurl_metadata: core::ptr::null_mut(), | |
lnurl_withdraw_endpoint: core::ptr::null_mut(), | |
swap_info: core::ptr::null_mut(), | |
reverse_swap_info: core::ptr::null_mut(), | |
pending_expiration_block: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_ln_payment_details { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_url_auth_request_data { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
k1: core::ptr::null_mut(), | |
action: core::ptr::null_mut(), | |
domain: core::ptr::null_mut(), | |
url: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_ln_url_auth_request_data { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_url_callback_status { | |
fn new_with_null_ptr() -> Self { | |
Self { tag: -1, kind: LnUrlCallbackStatusKind { nil__: () } } | |
} | |
} | |
impl Default for wire_cst_ln_url_callback_status { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_url_error_data { | |
fn new_with_null_ptr() -> Self { | |
Self { reason: core::ptr::null_mut() } | |
} | |
} | |
impl Default for wire_cst_ln_url_error_data { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_url_pay_error_data { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
payment_hash: core::ptr::null_mut(), | |
reason: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_ln_url_pay_error_data { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_url_pay_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
data: Default::default(), | |
amount_msat: Default::default(), | |
comment: core::ptr::null_mut(), | |
payment_label: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_ln_url_pay_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_url_pay_request_data { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
callback: core::ptr::null_mut(), | |
min_sendable: Default::default(), | |
max_sendable: Default::default(), | |
metadata_str: core::ptr::null_mut(), | |
comment_allowed: Default::default(), | |
domain: core::ptr::null_mut(), | |
allows_nostr: Default::default(), | |
nostr_pubkey: core::ptr::null_mut(), | |
ln_address: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_ln_url_pay_request_data { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_url_pay_result { | |
fn new_with_null_ptr() -> Self { | |
Self { tag: -1, kind: LnUrlPayResultKind { nil__: () } } | |
} | |
} | |
impl Default for wire_cst_ln_url_pay_result { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_url_pay_success_data { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
payment: Default::default(), | |
success_action: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_ln_url_pay_success_data { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_url_withdraw_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
data: Default::default(), | |
amount_msat: Default::default(), | |
description: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_ln_url_withdraw_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_url_withdraw_request_data { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
callback: core::ptr::null_mut(), | |
k1: core::ptr::null_mut(), | |
default_description: core::ptr::null_mut(), | |
min_withdrawable: Default::default(), | |
max_withdrawable: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_ln_url_withdraw_request_data { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_url_withdraw_result { | |
fn new_with_null_ptr() -> Self { | |
Self { tag: -1, kind: LnUrlWithdrawResultKind { nil__: () } } | |
} | |
} | |
impl Default for wire_cst_ln_url_withdraw_result { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_ln_url_withdraw_success_data { | |
fn new_with_null_ptr() -> Self { | |
Self { invoice: Default::default() } | |
} | |
} | |
impl Default for wire_cst_ln_url_withdraw_success_data { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_locale_overrides { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
locale: core::ptr::null_mut(), | |
spacing: core::ptr::null_mut(), | |
symbol: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_locale_overrides { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_localized_name { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
locale: core::ptr::null_mut(), | |
name: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_localized_name { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_log_entry { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
line: core::ptr::null_mut(), | |
level: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_log_entry { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_lsp_information { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
id: core::ptr::null_mut(), | |
name: core::ptr::null_mut(), | |
widget_url: core::ptr::null_mut(), | |
pubkey: core::ptr::null_mut(), | |
host: core::ptr::null_mut(), | |
base_fee_msat: Default::default(), | |
fee_rate: Default::default(), | |
time_lock_delta: Default::default(), | |
min_htlc_msat: Default::default(), | |
lsp_pubkey: core::ptr::null_mut(), | |
opening_fee_params_list: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_lsp_information { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_max_reverse_swap_amount_response { | |
fn new_with_null_ptr() -> Self { | |
Self { total_sat: Default::default() } | |
} | |
} | |
impl Default for wire_cst_max_reverse_swap_amount_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_message_success_action_data { | |
fn new_with_null_ptr() -> Self { | |
Self { message: core::ptr::null_mut() } | |
} | |
} | |
impl Default for wire_cst_message_success_action_data { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_metadata_filter { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
json_path: core::ptr::null_mut(), | |
json_value: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_metadata_filter { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_node_config { | |
fn new_with_null_ptr() -> Self { | |
Self { tag: -1, kind: NodeConfigKind { nil__: () } } | |
} | |
} | |
impl Default for wire_cst_node_config { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_node_credentials { | |
fn new_with_null_ptr() -> Self { | |
Self { tag: -1, kind: NodeCredentialsKind { nil__: () } } | |
} | |
} | |
impl Default for wire_cst_node_credentials { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_node_state { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
id: core::ptr::null_mut(), | |
block_height: Default::default(), | |
channels_balance_msat: Default::default(), | |
onchain_balance_msat: Default::default(), | |
pending_onchain_balance_msat: Default::default(), | |
utxos: core::ptr::null_mut(), | |
max_payable_msat: Default::default(), | |
max_receivable_msat: Default::default(), | |
max_single_payment_amount_msat: Default::default(), | |
max_chan_reserve_msats: Default::default(), | |
connected_peers: core::ptr::null_mut(), | |
inbound_liquidity_msats: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_node_state { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_onchain_payment_limits_response { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
min_sat: Default::default(), | |
max_sat: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_onchain_payment_limits_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_open_channel_fee_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
amount_msat: core::ptr::null_mut(), | |
expiry: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_open_channel_fee_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_open_channel_fee_response { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
fee_msat: core::ptr::null_mut(), | |
fee_params: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_open_channel_fee_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_opening_fee_params { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
min_msat: Default::default(), | |
proportional: Default::default(), | |
valid_until: core::ptr::null_mut(), | |
max_idle_time: Default::default(), | |
max_client_to_self_delay: Default::default(), | |
promise: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_opening_fee_params { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_opening_fee_params_menu { | |
fn new_with_null_ptr() -> Self { | |
Self { values: core::ptr::null_mut() } | |
} | |
} | |
impl Default for wire_cst_opening_fee_params_menu { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_pay_onchain_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
recipient_address: core::ptr::null_mut(), | |
prepare_res: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_pay_onchain_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_pay_onchain_response { | |
fn new_with_null_ptr() -> Self { | |
Self { reverse_swap_info: Default::default() } | |
} | |
} | |
impl Default for wire_cst_pay_onchain_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_payment { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
id: core::ptr::null_mut(), | |
payment_type: Default::default(), | |
payment_time: Default::default(), | |
amount_msat: Default::default(), | |
fee_msat: Default::default(), | |
status: Default::default(), | |
error: core::ptr::null_mut(), | |
description: core::ptr::null_mut(), | |
details: Default::default(), | |
metadata: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_payment { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_payment_details { | |
fn new_with_null_ptr() -> Self { | |
Self { tag: -1, kind: PaymentDetailsKind { nil__: () } } | |
} | |
} | |
impl Default for wire_cst_payment_details { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_payment_failed_data { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
error: core::ptr::null_mut(), | |
node_id: core::ptr::null_mut(), | |
invoice: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_payment_failed_data { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_prepare_onchain_payment_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
amount_sat: Default::default(), | |
amount_type: Default::default(), | |
claim_tx_feerate: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_prepare_onchain_payment_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_prepare_onchain_payment_response { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
fees_hash: core::ptr::null_mut(), | |
fees_percentage: Default::default(), | |
fees_lockup: Default::default(), | |
fees_claim: Default::default(), | |
sender_amount_sat: Default::default(), | |
recipient_amount_sat: Default::default(), | |
total_fees: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_prepare_onchain_payment_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_prepare_redeem_onchain_funds_request | |
{ | |
fn new_with_null_ptr() -> Self { | |
Self { | |
to_address: core::ptr::null_mut(), | |
sat_per_vbyte: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_prepare_redeem_onchain_funds_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_prepare_redeem_onchain_funds_response | |
{ | |
fn new_with_null_ptr() -> Self { | |
Self { | |
tx_weight: Default::default(), | |
tx_fee_sat: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_prepare_redeem_onchain_funds_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_prepare_refund_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
swap_address: core::ptr::null_mut(), | |
to_address: core::ptr::null_mut(), | |
sat_per_vbyte: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_prepare_refund_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_prepare_refund_response { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
refund_tx_weight: Default::default(), | |
refund_tx_fee_sat: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_prepare_refund_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_rate { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
coin: core::ptr::null_mut(), | |
value: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_rate { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_receive_onchain_request { | |
fn new_with_null_ptr() -> Self { | |
Self { opening_fee_params: core::ptr::null_mut() } | |
} | |
} | |
impl Default for wire_cst_receive_onchain_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_receive_payment_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
amount_msat: Default::default(), | |
description: core::ptr::null_mut(), | |
preimage: core::ptr::null_mut(), | |
opening_fee_params: core::ptr::null_mut(), | |
use_description_hash: core::ptr::null_mut(), | |
expiry: core::ptr::null_mut(), | |
cltv: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_receive_payment_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_receive_payment_response { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
ln_invoice: Default::default(), | |
opening_fee_params: core::ptr::null_mut(), | |
opening_fee_msat: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_receive_payment_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_recommended_fees { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
fastest_fee: Default::default(), | |
half_hour_fee: Default::default(), | |
hour_fee: Default::default(), | |
economy_fee: Default::default(), | |
minimum_fee: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_recommended_fees { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_redeem_onchain_funds_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
to_address: core::ptr::null_mut(), | |
sat_per_vbyte: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_redeem_onchain_funds_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_redeem_onchain_funds_response { | |
fn new_with_null_ptr() -> Self { | |
Self { txid: core::ptr::null_mut() } | |
} | |
} | |
impl Default for wire_cst_redeem_onchain_funds_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_refund_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
swap_address: core::ptr::null_mut(), | |
to_address: core::ptr::null_mut(), | |
sat_per_vbyte: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_refund_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_refund_response { | |
fn new_with_null_ptr() -> Self { | |
Self { refund_tx_id: core::ptr::null_mut() } | |
} | |
} | |
impl Default for wire_cst_refund_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_report_issue_request { | |
fn new_with_null_ptr() -> Self { | |
Self { tag: -1, kind: ReportIssueRequestKind { nil__: () } } | |
} | |
} | |
impl Default for wire_cst_report_issue_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_report_payment_failure_details { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
payment_hash: core::ptr::null_mut(), | |
comment: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_report_payment_failure_details { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_reverse_swap_fees_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
send_amount_sat: core::ptr::null_mut(), | |
claim_tx_feerate: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_reverse_swap_fees_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_reverse_swap_info { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
id: core::ptr::null_mut(), | |
claim_pubkey: core::ptr::null_mut(), | |
lockup_txid: core::ptr::null_mut(), | |
claim_txid: core::ptr::null_mut(), | |
onchain_amount_sat: Default::default(), | |
status: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_reverse_swap_info { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_reverse_swap_pair_info { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
min: Default::default(), | |
max: Default::default(), | |
fees_hash: core::ptr::null_mut(), | |
fees_percentage: Default::default(), | |
fees_lockup: Default::default(), | |
fees_claim: Default::default(), | |
total_fees: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_reverse_swap_pair_info { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_route_hint { | |
fn new_with_null_ptr() -> Self { | |
Self { hops: core::ptr::null_mut() } | |
} | |
} | |
impl Default for wire_cst_route_hint { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_route_hint_hop { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
src_node_id: core::ptr::null_mut(), | |
short_channel_id: Default::default(), | |
fees_base_msat: Default::default(), | |
fees_proportional_millionths: Default::default(), | |
cltv_expiry_delta: Default::default(), | |
htlc_minimum_msat: core::ptr::null_mut(), | |
htlc_maximum_msat: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_route_hint_hop { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_send_onchain_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
amount_sat: Default::default(), | |
onchain_recipient_address: core::ptr::null_mut(), | |
pair_hash: core::ptr::null_mut(), | |
sat_per_vbyte: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_send_onchain_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_send_onchain_response { | |
fn new_with_null_ptr() -> Self { | |
Self { reverse_swap_info: Default::default() } | |
} | |
} | |
impl Default for wire_cst_send_onchain_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_send_payment_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
bolt11: core::ptr::null_mut(), | |
amount_msat: core::ptr::null_mut(), | |
label: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_send_payment_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_send_payment_response { | |
fn new_with_null_ptr() -> Self { | |
Self { payment: Default::default() } | |
} | |
} | |
impl Default for wire_cst_send_payment_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_send_spontaneous_payment_request { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
node_id: core::ptr::null_mut(), | |
amount_msat: Default::default(), | |
extra_tlvs: core::ptr::null_mut(), | |
label: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_send_spontaneous_payment_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_service_health_check_response { | |
fn new_with_null_ptr() -> Self { | |
Self { status: Default::default() } | |
} | |
} | |
impl Default for wire_cst_service_health_check_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_sign_message_request { | |
fn new_with_null_ptr() -> Self { | |
Self { message: core::ptr::null_mut() } | |
} | |
} | |
impl Default for wire_cst_sign_message_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_sign_message_response { | |
fn new_with_null_ptr() -> Self { | |
Self { signature: core::ptr::null_mut() } | |
} | |
} | |
impl Default for wire_cst_sign_message_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_static_backup_request { | |
fn new_with_null_ptr() -> Self { | |
Self { working_dir: core::ptr::null_mut() } | |
} | |
} | |
impl Default for wire_cst_static_backup_request { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_static_backup_response { | |
fn new_with_null_ptr() -> Self { | |
Self { backup: core::ptr::null_mut() } | |
} | |
} | |
impl Default for wire_cst_static_backup_response { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_success_action_processed { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
tag: -1, | |
kind: SuccessActionProcessedKind { nil__: () }, | |
} | |
} | |
} | |
impl Default for wire_cst_success_action_processed { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_swap_info { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
bitcoin_address: core::ptr::null_mut(), | |
created_at: Default::default(), | |
lock_height: Default::default(), | |
payment_hash: core::ptr::null_mut(), | |
preimage: core::ptr::null_mut(), | |
private_key: core::ptr::null_mut(), | |
public_key: core::ptr::null_mut(), | |
swapper_public_key: core::ptr::null_mut(), | |
script: core::ptr::null_mut(), | |
bolt11: core::ptr::null_mut(), | |
paid_msat: Default::default(), | |
total_incoming_txs: Default::default(), | |
confirmed_sats: Default::default(), | |
unconfirmed_sats: Default::default(), | |
status: Default::default(), | |
refund_tx_ids: core::ptr::null_mut(), | |
unconfirmed_tx_ids: core::ptr::null_mut(), | |
confirmed_tx_ids: core::ptr::null_mut(), | |
min_allowed_deposit: Default::default(), | |
max_allowed_deposit: Default::default(), | |
max_swapper_payable: Default::default(), | |
last_redeem_error: core::ptr::null_mut(), | |
channel_opening_fees: core::ptr::null_mut(), | |
confirmed_at: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_swap_info { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_symbol { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
grapheme: core::ptr::null_mut(), | |
template: core::ptr::null_mut(), | |
rtl: core::ptr::null_mut(), | |
position: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_symbol { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_tlv_entry { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
field_number: Default::default(), | |
value: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_tlv_entry { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_unspent_transaction_output { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
txid: core::ptr::null_mut(), | |
outnum: Default::default(), | |
amount_millisatoshi: Default::default(), | |
address: core::ptr::null_mut(), | |
reserved: Default::default(), | |
} | |
} | |
} | |
impl Default for wire_cst_unspent_transaction_output { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
impl NewWithNullPtr for wire_cst_url_success_action_data { | |
fn new_with_null_ptr() -> Self { | |
Self { | |
description: core::ptr::null_mut(), | |
url: core::ptr::null_mut(), | |
} | |
} | |
} | |
impl Default for wire_cst_url_success_action_data { | |
fn default() -> Self { Self::new_with_null_ptr() } | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_backup(port_: i64) { | |
wire_backup_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_backup_status(port_: i64) { | |
wire_backup_status_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_breez_events_stream(port_: | |
i64, s: *mut wire_cst_list_prim_u_8_strict) { | |
wire_breez_events_stream_impl(port_, s) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_breez_log_stream(port_: i64, | |
s: *mut wire_cst_list_prim_u_8_strict) { | |
wire_breez_log_stream_impl(port_, s) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_buy_bitcoin(port_: i64, | |
req: *mut wire_cst_buy_bitcoin_request) { | |
wire_buy_bitcoin_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_check_message(port_: i64, | |
req: *mut wire_cst_check_message_request) { | |
wire_check_message_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_close_lsp_channels(port_: | |
i64) { | |
wire_close_lsp_channels_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_configure_node(port_: i64, | |
req: *mut wire_cst_configure_node_request) { | |
wire_configure_node_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_connect(port_: i64, | |
req: *mut wire_cst_connect_request) { | |
wire_connect_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_connect_lsp(port_: i64, | |
lsp_id: *mut wire_cst_list_prim_u_8_strict) { | |
wire_connect_lsp_impl(port_, lsp_id) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_default_config(port_: i64, | |
env_type: i32, api_key: *mut wire_cst_list_prim_u_8_strict, | |
node_config: *mut wire_cst_node_config) { | |
wire_default_config_impl(port_, env_type, api_key, node_config) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_disconnect(port_: i64) { | |
wire_disconnect_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_execute_command(port_: i64, | |
command: *mut wire_cst_list_prim_u_8_strict) { | |
wire_execute_command_impl(port_, command) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_fetch_fiat_rates(port_: i64) { | |
wire_fetch_fiat_rates_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_fetch_lsp_info(port_: i64, | |
id: *mut wire_cst_list_prim_u_8_strict) { | |
wire_fetch_lsp_info_impl(port_, id) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_fetch_reverse_swap_fees(port_: | |
i64, req: *mut wire_cst_reverse_swap_fees_request) { | |
wire_fetch_reverse_swap_fees_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_generate_diagnostic_data(port_: | |
i64) { | |
wire_generate_diagnostic_data_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_in_progress_onchain_payments(port_: | |
i64) { | |
wire_in_progress_onchain_payments_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_in_progress_reverse_swaps(port_: | |
i64) { | |
wire_in_progress_reverse_swaps_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_in_progress_swap(port_: i64) { | |
wire_in_progress_swap_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_is_initialized(port_: i64) { | |
wire_is_initialized_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_list_fiat_currencies(port_: | |
i64) { | |
wire_list_fiat_currencies_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_list_lsps(port_: i64) { | |
wire_list_lsps_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_list_payments(port_: i64, | |
req: *mut wire_cst_list_payments_request) { | |
wire_list_payments_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_list_refundables(port_: i64) { | |
wire_list_refundables_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_lnurl_auth(port_: i64, | |
req_data: *mut wire_cst_ln_url_auth_request_data) { | |
wire_lnurl_auth_impl(port_, req_data) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_lnurl_pay(port_: i64, | |
req: *mut wire_cst_ln_url_pay_request) { | |
wire_lnurl_pay_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_lnurl_withdraw(port_: i64, | |
req: *mut wire_cst_ln_url_withdraw_request) { | |
wire_lnurl_withdraw_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_lsp_id(port_: i64) { | |
wire_lsp_id_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_lsp_info(port_: i64) { | |
wire_lsp_info_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_max_reverse_swap_amount(port_: | |
i64) { | |
wire_max_reverse_swap_amount_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_mnemonic_to_seed(port_: i64, | |
phrase: *mut wire_cst_list_prim_u_8_strict) { | |
wire_mnemonic_to_seed_impl(port_, phrase) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_node_credentials(port_: i64) { | |
wire_node_credentials_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_node_info(port_: i64) { | |
wire_node_info_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_onchain_payment_limits(port_: | |
i64) { | |
wire_onchain_payment_limits_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_open_channel_fee(port_: i64, | |
req: *mut wire_cst_open_channel_fee_request) { | |
wire_open_channel_fee_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_parse_input(port_: i64, | |
input: *mut wire_cst_list_prim_u_8_strict) { | |
wire_parse_input_impl(port_, input) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_parse_invoice(port_: i64, | |
invoice: *mut wire_cst_list_prim_u_8_strict) { | |
wire_parse_invoice_impl(port_, invoice) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_pay_onchain(port_: i64, | |
req: *mut wire_cst_pay_onchain_request) { | |
wire_pay_onchain_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_payment_by_hash(port_: i64, | |
hash: *mut wire_cst_list_prim_u_8_strict) { | |
wire_payment_by_hash_impl(port_, hash) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_prepare_onchain_payment(port_: | |
i64, req: *mut wire_cst_prepare_onchain_payment_request) { | |
wire_prepare_onchain_payment_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_prepare_redeem_onchain_funds(port_: | |
i64, | |
req: *mut wire_cst_prepare_redeem_onchain_funds_request) { | |
wire_prepare_redeem_onchain_funds_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_prepare_refund(port_: i64, | |
req: *mut wire_cst_prepare_refund_request) { | |
wire_prepare_refund_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_receive_onchain(port_: i64, | |
req: *mut wire_cst_receive_onchain_request) { | |
wire_receive_onchain_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_receive_payment(port_: i64, | |
req: *mut wire_cst_receive_payment_request) { | |
wire_receive_payment_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_recommended_fees(port_: i64) { | |
wire_recommended_fees_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_redeem_onchain_funds(port_: | |
i64, req: *mut wire_cst_redeem_onchain_funds_request) { | |
wire_redeem_onchain_funds_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_redeem_swap(port_: i64, | |
swap_address: *mut wire_cst_list_prim_u_8_strict) { | |
wire_redeem_swap_impl(port_, swap_address) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_refund(port_: i64, | |
req: *mut wire_cst_refund_request) { | |
wire_refund_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_register_webhook(port_: i64, | |
webhook_url: *mut wire_cst_list_prim_u_8_strict) { | |
wire_register_webhook_impl(port_, webhook_url) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_report_issue(port_: i64, | |
req: *mut wire_cst_report_issue_request) { | |
wire_report_issue_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_rescan_swaps(port_: i64) { | |
wire_rescan_swaps_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_send_onchain(port_: i64, | |
req: *mut wire_cst_send_onchain_request) { | |
wire_send_onchain_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_send_payment(port_: i64, | |
req: *mut wire_cst_send_payment_request) { | |
wire_send_payment_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_send_spontaneous_payment(port_: | |
i64, req: *mut wire_cst_send_spontaneous_payment_request) { | |
wire_send_spontaneous_payment_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_service_health_check(port_: | |
i64, api_key: *mut wire_cst_list_prim_u_8_strict) { | |
wire_service_health_check_impl(port_, api_key) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_set_payment_metadata(port_: | |
i64, hash: *mut wire_cst_list_prim_u_8_strict, | |
metadata: *mut wire_cst_list_prim_u_8_strict) { | |
wire_set_payment_metadata_impl(port_, hash, metadata) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_sign_message(port_: i64, | |
req: *mut wire_cst_sign_message_request) { | |
wire_sign_message_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_static_backup(port_: i64, | |
req: *mut wire_cst_static_backup_request) { | |
wire_static_backup_impl(port_, req) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_wire_sync(port_: i64) { | |
wire_sync_impl(port_) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_aes_success_action_data_decrypted() | |
-> *mut wire_cst_aes_success_action_data_decrypted { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_aes_success_action_data_decrypted::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_aes_success_action_data_result() | |
-> *mut wire_cst_aes_success_action_data_result { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_aes_success_action_data_result::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_backup_failed_data() | |
-> *mut wire_cst_backup_failed_data { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_backup_failed_data::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_bitcoin_address_data() | |
-> *mut wire_cst_bitcoin_address_data { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_bitcoin_address_data::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_bool(value: | |
bool) -> *mut bool { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(value) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_buy_bitcoin_request() | |
-> *mut wire_cst_buy_bitcoin_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_buy_bitcoin_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_check_message_request() | |
-> *mut wire_cst_check_message_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_check_message_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_closed_channel_payment_details() | |
-> *mut wire_cst_closed_channel_payment_details { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_closed_channel_payment_details::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_configure_node_request() | |
-> *mut wire_cst_configure_node_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_configure_node_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_connect_request() | |
-> *mut wire_cst_connect_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_connect_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_greenlight_credentials() | |
-> *mut wire_cst_greenlight_credentials { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_greenlight_credentials::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_greenlight_node_config() | |
-> *mut wire_cst_greenlight_node_config { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_greenlight_node_config::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_i_64(value: | |
i64) -> *mut i64 { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(value) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_invoice_paid_details() | |
-> *mut wire_cst_invoice_paid_details { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_invoice_paid_details::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_list_payments_request() | |
-> *mut wire_cst_list_payments_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_list_payments_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_ln_invoice() | |
-> *mut wire_cst_ln_invoice { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ln_invoice::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_ln_payment_details() | |
-> *mut wire_cst_ln_payment_details { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ln_payment_details::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_ln_url_auth_request_data() | |
-> *mut wire_cst_ln_url_auth_request_data { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ln_url_auth_request_data::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_ln_url_error_data() | |
-> *mut wire_cst_ln_url_error_data { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ln_url_error_data::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_ln_url_pay_error_data() | |
-> *mut wire_cst_ln_url_pay_error_data { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ln_url_pay_error_data::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_ln_url_pay_request() | |
-> *mut wire_cst_ln_url_pay_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ln_url_pay_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_ln_url_pay_request_data() | |
-> *mut wire_cst_ln_url_pay_request_data { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ln_url_pay_request_data::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_ln_url_pay_success_data() | |
-> *mut wire_cst_ln_url_pay_success_data { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ln_url_pay_success_data::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_ln_url_withdraw_request() | |
-> *mut wire_cst_ln_url_withdraw_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ln_url_withdraw_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_ln_url_withdraw_request_data() | |
-> *mut wire_cst_ln_url_withdraw_request_data { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ln_url_withdraw_request_data::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_ln_url_withdraw_success_data() | |
-> *mut wire_cst_ln_url_withdraw_success_data { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_ln_url_withdraw_success_data::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_lsp_information() | |
-> *mut wire_cst_lsp_information { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_lsp_information::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_message_success_action_data() | |
-> *mut wire_cst_message_success_action_data { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_message_success_action_data::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_node_config() | |
-> *mut wire_cst_node_config { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_node_config::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_node_credentials() | |
-> *mut wire_cst_node_credentials { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_node_credentials::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_open_channel_fee_request() | |
-> *mut wire_cst_open_channel_fee_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_open_channel_fee_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_opening_fee_params() | |
-> *mut wire_cst_opening_fee_params { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_opening_fee_params::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_pay_onchain_request() | |
-> *mut wire_cst_pay_onchain_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_pay_onchain_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_payment() | |
-> *mut wire_cst_payment { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_payment::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_payment_failed_data() | |
-> *mut wire_cst_payment_failed_data { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_payment_failed_data::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_prepare_onchain_payment_request() | |
-> *mut wire_cst_prepare_onchain_payment_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_prepare_onchain_payment_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_prepare_redeem_onchain_funds_request() | |
-> *mut wire_cst_prepare_redeem_onchain_funds_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_prepare_redeem_onchain_funds_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_prepare_refund_request() | |
-> *mut wire_cst_prepare_refund_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_prepare_refund_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_receive_onchain_request() | |
-> *mut wire_cst_receive_onchain_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_receive_onchain_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_receive_payment_request() | |
-> *mut wire_cst_receive_payment_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_receive_payment_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_redeem_onchain_funds_request() | |
-> *mut wire_cst_redeem_onchain_funds_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_redeem_onchain_funds_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_refund_request() | |
-> *mut wire_cst_refund_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_refund_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_report_issue_request() | |
-> *mut wire_cst_report_issue_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_report_issue_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_report_payment_failure_details() | |
-> *mut wire_cst_report_payment_failure_details { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_report_payment_failure_details::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_reverse_swap_fees_request() | |
-> *mut wire_cst_reverse_swap_fees_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_reverse_swap_fees_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_reverse_swap_info() | |
-> *mut wire_cst_reverse_swap_info { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_reverse_swap_info::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_send_onchain_request() | |
-> *mut wire_cst_send_onchain_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_send_onchain_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_send_payment_request() | |
-> *mut wire_cst_send_payment_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_send_payment_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_send_spontaneous_payment_request() | |
-> *mut wire_cst_send_spontaneous_payment_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_send_spontaneous_payment_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_sign_message_request() | |
-> *mut wire_cst_sign_message_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_sign_message_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_static_backup_request() | |
-> *mut wire_cst_static_backup_request { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_static_backup_request::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_success_action_processed() | |
-> *mut wire_cst_success_action_processed { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_success_action_processed::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_swap_info() | |
-> *mut wire_cst_swap_info { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_swap_info::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_symbol() | |
-> *mut wire_cst_symbol { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_symbol::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_u_32(value: | |
u32) -> *mut u32 { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(value) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_u_64(value: | |
u64) -> *mut u64 { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(value) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_box_autoadd_url_success_action_data() | |
-> *mut wire_cst_url_success_action_data { | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_url_success_action_data::new_with_null_ptr()) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_String(len: i32) | |
-> *mut wire_cst_list_String { | |
let wrap = | |
wire_cst_list_String { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<*mut wire_cst_list_prim_u_8_strict>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_fiat_currency(len: | |
i32) -> *mut wire_cst_list_fiat_currency { | |
let wrap = | |
wire_cst_list_fiat_currency { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_fiat_currency>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_locale_overrides(len: | |
i32) -> *mut wire_cst_list_locale_overrides { | |
let wrap = | |
wire_cst_list_locale_overrides { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_locale_overrides>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_localized_name(len: | |
i32) -> *mut wire_cst_list_localized_name { | |
let wrap = | |
wire_cst_list_localized_name { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_localized_name>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_lsp_information(len: | |
i32) -> *mut wire_cst_list_lsp_information { | |
let wrap = | |
wire_cst_list_lsp_information { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_lsp_information>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_metadata_filter(len: | |
i32) -> *mut wire_cst_list_metadata_filter { | |
let wrap = | |
wire_cst_list_metadata_filter { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_metadata_filter>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_opening_fee_params(len: | |
i32) -> *mut wire_cst_list_opening_fee_params { | |
let wrap = | |
wire_cst_list_opening_fee_params { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_opening_fee_params>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_payment(len: i32) | |
-> *mut wire_cst_list_payment { | |
let wrap = | |
wire_cst_list_payment { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_payment>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_payment_type_filter(len: | |
i32) -> *mut wire_cst_list_payment_type_filter { | |
let wrap = | |
wire_cst_list_payment_type_filter { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_prim_u_8_strict(len: | |
i32) -> *mut wire_cst_list_prim_u_8_strict { | |
let ans = | |
wire_cst_list_prim_u_8_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_breez_sdk_cst_new_list_rate(len: i32) | |
-> *mut wire_cst_list_rate { | |
let wrap = | |
wire_cst_list_rate { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_rate>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_reverse_swap_info(len: | |
i32) -> *mut wire_cst_list_reverse_swap_info { | |
let wrap = | |
wire_cst_list_reverse_swap_info { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_reverse_swap_info>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_route_hint(len: i32) | |
-> *mut wire_cst_list_route_hint { | |
let wrap = | |
wire_cst_list_route_hint { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_route_hint>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_route_hint_hop(len: | |
i32) -> *mut wire_cst_list_route_hint_hop { | |
let wrap = | |
wire_cst_list_route_hint_hop { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_route_hint_hop>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_swap_info(len: i32) | |
-> *mut wire_cst_list_swap_info { | |
let wrap = | |
wire_cst_list_swap_info { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_swap_info>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_tlv_entry(len: i32) | |
-> *mut wire_cst_list_tlv_entry { | |
let wrap = | |
wire_cst_list_tlv_entry { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_tlv_entry>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[no_mangle] | |
pub extern "C" fn frbgen_breez_sdk_cst_new_list_unspent_transaction_output(len: | |
i32) -> *mut wire_cst_list_unspent_transaction_output { | |
let wrap = | |
wire_cst_list_unspent_transaction_output { | |
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(<wire_cst_unspent_transaction_output>::new_with_null_ptr(), | |
len), | |
len, | |
}; | |
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) | |
} | |
#[repr(C)] | |
pub struct wire_cst_aes_success_action_data_decrypted { | |
description: *mut wire_cst_list_prim_u_8_strict, | |
plaintext: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for | |
wire_cst_aes_success_action_data_decrypted { | |
#[inline] | |
fn clone(&self) -> wire_cst_aes_success_action_data_decrypted { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for | |
wire_cst_aes_success_action_data_decrypted { | |
} | |
#[repr(C)] | |
pub struct wire_cst_aes_success_action_data_result { | |
tag: i32, | |
kind: AesSuccessActionDataResultKind, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_aes_success_action_data_result | |
{ | |
#[inline] | |
fn clone(&self) -> wire_cst_aes_success_action_data_result { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: | |
::core::clone::AssertParamIsClone<AesSuccessActionDataResultKind>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_aes_success_action_data_result | |
{ | |
} | |
#[repr(C)] | |
pub union AesSuccessActionDataResultKind { | |
Decrypted: wire_cst_AesSuccessActionDataResult_Decrypted, | |
ErrorStatus: wire_cst_AesSuccessActionDataResult_ErrorStatus, | |
nil__: (), | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for AesSuccessActionDataResultKind { | |
#[inline] | |
fn clone(&self) -> AesSuccessActionDataResultKind { | |
let _: ::core::clone::AssertParamIsCopy<Self>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for AesSuccessActionDataResultKind { } | |
#[repr(C)] | |
pub struct wire_cst_AesSuccessActionDataResult_Decrypted { | |
data: *mut wire_cst_aes_success_action_data_decrypted, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for | |
wire_cst_AesSuccessActionDataResult_Decrypted { | |
#[inline] | |
fn clone(&self) -> wire_cst_AesSuccessActionDataResult_Decrypted { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_aes_success_action_data_decrypted>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for | |
wire_cst_AesSuccessActionDataResult_Decrypted { | |
} | |
#[repr(C)] | |
pub struct wire_cst_AesSuccessActionDataResult_ErrorStatus { | |
reason: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for | |
wire_cst_AesSuccessActionDataResult_ErrorStatus { | |
#[inline] | |
fn clone(&self) | |
-> wire_cst_AesSuccessActionDataResult_ErrorStatus { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for | |
wire_cst_AesSuccessActionDataResult_ErrorStatus { | |
} | |
#[repr(C)] | |
pub struct wire_cst_backup_failed_data { | |
error: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_backup_failed_data { | |
#[inline] | |
fn clone(&self) -> wire_cst_backup_failed_data { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_backup_failed_data { } | |
#[repr(C)] | |
pub struct wire_cst_backup_status { | |
backed_up: bool, | |
last_backup_time: *mut u64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_backup_status { | |
#[inline] | |
fn clone(&self) -> wire_cst_backup_status { | |
let _: ::core::clone::AssertParamIsClone<bool>; | |
let _: ::core::clone::AssertParamIsClone<*mut u64>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_backup_status { } | |
#[repr(C)] | |
pub struct wire_cst_bitcoin_address_data { | |
address: *mut wire_cst_list_prim_u_8_strict, | |
network: i32, | |
amount_sat: *mut u64, | |
label: *mut wire_cst_list_prim_u_8_strict, | |
message: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_bitcoin_address_data { | |
#[inline] | |
fn clone(&self) -> wire_cst_bitcoin_address_data { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: ::core::clone::AssertParamIsClone<*mut u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_bitcoin_address_data { } | |
#[repr(C)] | |
pub struct wire_cst_breez_event { | |
tag: i32, | |
kind: BreezEventKind, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_breez_event { | |
#[inline] | |
fn clone(&self) -> wire_cst_breez_event { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: ::core::clone::AssertParamIsClone<BreezEventKind>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_breez_event { } | |
#[repr(C)] | |
pub union BreezEventKind { | |
NewBlock: wire_cst_BreezEvent_NewBlock, | |
InvoicePaid: wire_cst_BreezEvent_InvoicePaid, | |
PaymentSucceed: wire_cst_BreezEvent_PaymentSucceed, | |
PaymentFailed: wire_cst_BreezEvent_PaymentFailed, | |
BackupFailed: wire_cst_BreezEvent_BackupFailed, | |
SwapUpdated: wire_cst_BreezEvent_SwapUpdated, | |
nil__: (), | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for BreezEventKind { | |
#[inline] | |
fn clone(&self) -> BreezEventKind { | |
let _: ::core::clone::AssertParamIsCopy<Self>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for BreezEventKind { } | |
#[repr(C)] | |
pub struct wire_cst_BreezEvent_NewBlock { | |
block: u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_BreezEvent_NewBlock { | |
#[inline] | |
fn clone(&self) -> wire_cst_BreezEvent_NewBlock { | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_BreezEvent_NewBlock { } | |
#[repr(C)] | |
pub struct wire_cst_BreezEvent_InvoicePaid { | |
details: *mut wire_cst_invoice_paid_details, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_BreezEvent_InvoicePaid { | |
#[inline] | |
fn clone(&self) -> wire_cst_BreezEvent_InvoicePaid { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_invoice_paid_details>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_BreezEvent_InvoicePaid { } | |
#[repr(C)] | |
pub struct wire_cst_BreezEvent_PaymentSucceed { | |
details: *mut wire_cst_payment, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_BreezEvent_PaymentSucceed { | |
#[inline] | |
fn clone(&self) -> wire_cst_BreezEvent_PaymentSucceed { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_payment>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_BreezEvent_PaymentSucceed { } | |
#[repr(C)] | |
pub struct wire_cst_BreezEvent_PaymentFailed { | |
details: *mut wire_cst_payment_failed_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_BreezEvent_PaymentFailed { | |
#[inline] | |
fn clone(&self) -> wire_cst_BreezEvent_PaymentFailed { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_payment_failed_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_BreezEvent_PaymentFailed { } | |
#[repr(C)] | |
pub struct wire_cst_BreezEvent_BackupFailed { | |
details: *mut wire_cst_backup_failed_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_BreezEvent_BackupFailed { | |
#[inline] | |
fn clone(&self) -> wire_cst_BreezEvent_BackupFailed { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_backup_failed_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_BreezEvent_BackupFailed { } | |
#[repr(C)] | |
pub struct wire_cst_BreezEvent_SwapUpdated { | |
details: *mut wire_cst_swap_info, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_BreezEvent_SwapUpdated { | |
#[inline] | |
fn clone(&self) -> wire_cst_BreezEvent_SwapUpdated { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_swap_info>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_BreezEvent_SwapUpdated { } | |
#[repr(C)] | |
pub struct wire_cst_buy_bitcoin_request { | |
provider: i32, | |
opening_fee_params: *mut wire_cst_opening_fee_params, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_buy_bitcoin_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_buy_bitcoin_request { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_opening_fee_params>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_buy_bitcoin_request { } | |
#[repr(C)] | |
pub struct wire_cst_buy_bitcoin_response { | |
url: *mut wire_cst_list_prim_u_8_strict, | |
opening_fee_params: *mut wire_cst_opening_fee_params, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_buy_bitcoin_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_buy_bitcoin_response { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_opening_fee_params>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_buy_bitcoin_response { } | |
#[repr(C)] | |
pub struct wire_cst_check_message_request { | |
message: *mut wire_cst_list_prim_u_8_strict, | |
pubkey: *mut wire_cst_list_prim_u_8_strict, | |
signature: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_check_message_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_check_message_request { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_check_message_request { } | |
#[repr(C)] | |
pub struct wire_cst_check_message_response { | |
is_valid: bool, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_check_message_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_check_message_response { | |
let _: ::core::clone::AssertParamIsClone<bool>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_check_message_response { } | |
#[repr(C)] | |
pub struct wire_cst_closed_channel_payment_details { | |
state: i32, | |
funding_txid: *mut wire_cst_list_prim_u_8_strict, | |
short_channel_id: *mut wire_cst_list_prim_u_8_strict, | |
closing_txid: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_closed_channel_payment_details | |
{ | |
#[inline] | |
fn clone(&self) -> wire_cst_closed_channel_payment_details { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_closed_channel_payment_details | |
{ | |
} | |
#[repr(C)] | |
pub struct wire_cst_config { | |
breezserver: *mut wire_cst_list_prim_u_8_strict, | |
chainnotifier_url: *mut wire_cst_list_prim_u_8_strict, | |
mempoolspace_url: *mut wire_cst_list_prim_u_8_strict, | |
working_dir: *mut wire_cst_list_prim_u_8_strict, | |
network: i32, | |
payment_timeout_sec: u32, | |
default_lsp_id: *mut wire_cst_list_prim_u_8_strict, | |
api_key: *mut wire_cst_list_prim_u_8_strict, | |
maxfee_percent: f64, | |
exemptfee_msat: u64, | |
node_config: wire_cst_node_config, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_config { | |
#[inline] | |
fn clone(&self) -> wire_cst_config { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<f64>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: | |
::core::clone::AssertParamIsClone<wire_cst_node_config>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_config { } | |
#[repr(C)] | |
pub struct wire_cst_configure_node_request { | |
close_to_address: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_configure_node_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_configure_node_request { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_configure_node_request { } | |
#[repr(C)] | |
pub struct wire_cst_connect_request { | |
config: wire_cst_config, | |
seed: *mut wire_cst_list_prim_u_8_strict, | |
restore_only: *mut bool, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_connect_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_connect_request { | |
let _: ::core::clone::AssertParamIsClone<wire_cst_config>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<*mut bool>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_connect_request { } | |
#[repr(C)] | |
pub struct wire_cst_currency_info { | |
name: *mut wire_cst_list_prim_u_8_strict, | |
fraction_size: u32, | |
spacing: *mut u32, | |
symbol: *mut wire_cst_symbol, | |
uniq_symbol: *mut wire_cst_symbol, | |
localized_name: *mut wire_cst_list_localized_name, | |
locale_overrides: *mut wire_cst_list_locale_overrides, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_currency_info { | |
#[inline] | |
fn clone(&self) -> wire_cst_currency_info { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
let _: ::core::clone::AssertParamIsClone<*mut u32>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_symbol>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_symbol>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_localized_name>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_locale_overrides>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_currency_info { } | |
#[repr(C)] | |
pub struct wire_cst_fiat_currency { | |
id: *mut wire_cst_list_prim_u_8_strict, | |
info: wire_cst_currency_info, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_fiat_currency { | |
#[inline] | |
fn clone(&self) -> wire_cst_fiat_currency { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<wire_cst_currency_info>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_fiat_currency { } | |
#[repr(C)] | |
pub struct wire_cst_greenlight_credentials { | |
device_key: *mut wire_cst_list_prim_u_8_strict, | |
device_cert: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_greenlight_credentials { | |
#[inline] | |
fn clone(&self) -> wire_cst_greenlight_credentials { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_greenlight_credentials { } | |
#[repr(C)] | |
pub struct wire_cst_greenlight_node_config { | |
partner_credentials: *mut wire_cst_greenlight_credentials, | |
invite_code: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_greenlight_node_config { | |
#[inline] | |
fn clone(&self) -> wire_cst_greenlight_node_config { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_greenlight_credentials>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_greenlight_node_config { } | |
#[repr(C)] | |
pub struct wire_cst_input_type { | |
tag: i32, | |
kind: InputTypeKind, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_input_type { | |
#[inline] | |
fn clone(&self) -> wire_cst_input_type { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: ::core::clone::AssertParamIsClone<InputTypeKind>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_input_type { } | |
#[repr(C)] | |
pub union InputTypeKind { | |
BitcoinAddress: wire_cst_InputType_BitcoinAddress, | |
Bolt11: wire_cst_InputType_Bolt11, | |
NodeId: wire_cst_InputType_NodeId, | |
Url: wire_cst_InputType_Url, | |
LnUrlPay: wire_cst_InputType_LnUrlPay, | |
LnUrlWithdraw: wire_cst_InputType_LnUrlWithdraw, | |
LnUrlAuth: wire_cst_InputType_LnUrlAuth, | |
LnUrlError: wire_cst_InputType_LnUrlError, | |
nil__: (), | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for InputTypeKind { | |
#[inline] | |
fn clone(&self) -> InputTypeKind { | |
let _: ::core::clone::AssertParamIsCopy<Self>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for InputTypeKind { } | |
#[repr(C)] | |
pub struct wire_cst_InputType_BitcoinAddress { | |
address: *mut wire_cst_bitcoin_address_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_InputType_BitcoinAddress { | |
#[inline] | |
fn clone(&self) -> wire_cst_InputType_BitcoinAddress { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_bitcoin_address_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_InputType_BitcoinAddress { } | |
#[repr(C)] | |
pub struct wire_cst_InputType_Bolt11 { | |
invoice: *mut wire_cst_ln_invoice, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_InputType_Bolt11 { | |
#[inline] | |
fn clone(&self) -> wire_cst_InputType_Bolt11 { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_ln_invoice>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_InputType_Bolt11 { } | |
#[repr(C)] | |
pub struct wire_cst_InputType_NodeId { | |
node_id: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_InputType_NodeId { | |
#[inline] | |
fn clone(&self) -> wire_cst_InputType_NodeId { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_InputType_NodeId { } | |
#[repr(C)] | |
pub struct wire_cst_InputType_Url { | |
url: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_InputType_Url { | |
#[inline] | |
fn clone(&self) -> wire_cst_InputType_Url { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_InputType_Url { } | |
#[repr(C)] | |
pub struct wire_cst_InputType_LnUrlPay { | |
data: *mut wire_cst_ln_url_pay_request_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_InputType_LnUrlPay { | |
#[inline] | |
fn clone(&self) -> wire_cst_InputType_LnUrlPay { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_ln_url_pay_request_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_InputType_LnUrlPay { } | |
#[repr(C)] | |
pub struct wire_cst_InputType_LnUrlWithdraw { | |
data: *mut wire_cst_ln_url_withdraw_request_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_InputType_LnUrlWithdraw { | |
#[inline] | |
fn clone(&self) -> wire_cst_InputType_LnUrlWithdraw { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_ln_url_withdraw_request_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_InputType_LnUrlWithdraw { } | |
#[repr(C)] | |
pub struct wire_cst_InputType_LnUrlAuth { | |
data: *mut wire_cst_ln_url_auth_request_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_InputType_LnUrlAuth { | |
#[inline] | |
fn clone(&self) -> wire_cst_InputType_LnUrlAuth { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_ln_url_auth_request_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_InputType_LnUrlAuth { } | |
#[repr(C)] | |
pub struct wire_cst_InputType_LnUrlError { | |
data: *mut wire_cst_ln_url_error_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_InputType_LnUrlError { | |
#[inline] | |
fn clone(&self) -> wire_cst_InputType_LnUrlError { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_ln_url_error_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_InputType_LnUrlError { } | |
#[repr(C)] | |
pub struct wire_cst_invoice_paid_details { | |
payment_hash: *mut wire_cst_list_prim_u_8_strict, | |
bolt11: *mut wire_cst_list_prim_u_8_strict, | |
payment: *mut wire_cst_payment, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_invoice_paid_details { | |
#[inline] | |
fn clone(&self) -> wire_cst_invoice_paid_details { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_payment>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_invoice_paid_details { } | |
#[repr(C)] | |
pub struct wire_cst_list_String { | |
ptr: *mut *mut wire_cst_list_prim_u_8_strict, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_String { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_String { | |
let _: | |
::core::clone::AssertParamIsClone<*mut *mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_String { } | |
#[repr(C)] | |
pub struct wire_cst_list_fiat_currency { | |
ptr: *mut wire_cst_fiat_currency, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_fiat_currency { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_fiat_currency { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_fiat_currency>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_fiat_currency { } | |
#[repr(C)] | |
pub struct wire_cst_list_locale_overrides { | |
ptr: *mut wire_cst_locale_overrides, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_locale_overrides { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_locale_overrides { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_locale_overrides>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_locale_overrides { } | |
#[repr(C)] | |
pub struct wire_cst_list_localized_name { | |
ptr: *mut wire_cst_localized_name, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_localized_name { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_localized_name { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_localized_name>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_localized_name { } | |
#[repr(C)] | |
pub struct wire_cst_list_lsp_information { | |
ptr: *mut wire_cst_lsp_information, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_lsp_information { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_lsp_information { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_lsp_information>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_lsp_information { } | |
#[repr(C)] | |
pub struct wire_cst_list_metadata_filter { | |
ptr: *mut wire_cst_metadata_filter, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_metadata_filter { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_metadata_filter { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_metadata_filter>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_metadata_filter { } | |
#[repr(C)] | |
pub struct wire_cst_list_opening_fee_params { | |
ptr: *mut wire_cst_opening_fee_params, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_opening_fee_params { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_opening_fee_params { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_opening_fee_params>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_opening_fee_params { } | |
#[repr(C)] | |
pub struct wire_cst_list_payment { | |
ptr: *mut wire_cst_payment, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_payment { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_payment { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_payment>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_payment { } | |
#[repr(C)] | |
pub struct wire_cst_list_payment_type_filter { | |
ptr: *mut i32, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_payment_type_filter { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_payment_type_filter { | |
let _: ::core::clone::AssertParamIsClone<*mut i32>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_payment_type_filter { } | |
#[repr(C)] | |
pub struct wire_cst_list_payments_request { | |
filters: *mut wire_cst_list_payment_type_filter, | |
metadata_filters: *mut wire_cst_list_metadata_filter, | |
from_timestamp: *mut i64, | |
to_timestamp: *mut i64, | |
include_failures: *mut bool, | |
offset: *mut u32, | |
limit: *mut u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_payments_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_payments_request { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_payment_type_filter>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_metadata_filter>; | |
let _: ::core::clone::AssertParamIsClone<*mut i64>; | |
let _: ::core::clone::AssertParamIsClone<*mut i64>; | |
let _: ::core::clone::AssertParamIsClone<*mut bool>; | |
let _: ::core::clone::AssertParamIsClone<*mut u32>; | |
let _: ::core::clone::AssertParamIsClone<*mut u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_payments_request { } | |
#[repr(C)] | |
pub struct wire_cst_list_prim_u_8_strict { | |
ptr: *mut u8, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_prim_u_8_strict { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_prim_u_8_strict { | |
let _: ::core::clone::AssertParamIsClone<*mut u8>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_prim_u_8_strict { } | |
#[repr(C)] | |
pub struct wire_cst_list_rate { | |
ptr: *mut wire_cst_rate, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_rate { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_rate { | |
let _: ::core::clone::AssertParamIsClone<*mut wire_cst_rate>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_rate { } | |
#[repr(C)] | |
pub struct wire_cst_list_reverse_swap_info { | |
ptr: *mut wire_cst_reverse_swap_info, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_reverse_swap_info { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_reverse_swap_info { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_reverse_swap_info>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_reverse_swap_info { } | |
#[repr(C)] | |
pub struct wire_cst_list_route_hint { | |
ptr: *mut wire_cst_route_hint, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_route_hint { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_route_hint { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_route_hint>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_route_hint { } | |
#[repr(C)] | |
pub struct wire_cst_list_route_hint_hop { | |
ptr: *mut wire_cst_route_hint_hop, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_route_hint_hop { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_route_hint_hop { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_route_hint_hop>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_route_hint_hop { } | |
#[repr(C)] | |
pub struct wire_cst_list_swap_info { | |
ptr: *mut wire_cst_swap_info, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_swap_info { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_swap_info { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_swap_info>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_swap_info { } | |
#[repr(C)] | |
pub struct wire_cst_list_tlv_entry { | |
ptr: *mut wire_cst_tlv_entry, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_tlv_entry { | |
#[inline] | |
fn clone(&self) -> wire_cst_list_tlv_entry { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_tlv_entry>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_tlv_entry { } | |
#[repr(C)] | |
pub struct wire_cst_list_unspent_transaction_output { | |
ptr: *mut wire_cst_unspent_transaction_output, | |
len: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_list_unspent_transaction_output | |
{ | |
#[inline] | |
fn clone(&self) -> wire_cst_list_unspent_transaction_output { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_unspent_transaction_output>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_list_unspent_transaction_output | |
{ | |
} | |
#[repr(C)] | |
pub struct wire_cst_ln_invoice { | |
bolt11: *mut wire_cst_list_prim_u_8_strict, | |
network: i32, | |
payee_pubkey: *mut wire_cst_list_prim_u_8_strict, | |
payment_hash: *mut wire_cst_list_prim_u_8_strict, | |
description: *mut wire_cst_list_prim_u_8_strict, | |
description_hash: *mut wire_cst_list_prim_u_8_strict, | |
amount_msat: *mut u64, | |
timestamp: u64, | |
expiry: u64, | |
routing_hints: *mut wire_cst_list_route_hint, | |
payment_secret: *mut wire_cst_list_prim_u_8_strict, | |
min_final_cltv_expiry_delta: u64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_invoice { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_invoice { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<*mut u64>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_route_hint>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_invoice { } | |
#[repr(C)] | |
pub struct wire_cst_ln_payment_details { | |
payment_hash: *mut wire_cst_list_prim_u_8_strict, | |
label: *mut wire_cst_list_prim_u_8_strict, | |
destination_pubkey: *mut wire_cst_list_prim_u_8_strict, | |
payment_preimage: *mut wire_cst_list_prim_u_8_strict, | |
keysend: bool, | |
bolt11: *mut wire_cst_list_prim_u_8_strict, | |
open_channel_bolt11: *mut wire_cst_list_prim_u_8_strict, | |
lnurl_success_action: *mut wire_cst_success_action_processed, | |
lnurl_pay_domain: *mut wire_cst_list_prim_u_8_strict, | |
ln_address: *mut wire_cst_list_prim_u_8_strict, | |
lnurl_metadata: *mut wire_cst_list_prim_u_8_strict, | |
lnurl_withdraw_endpoint: *mut wire_cst_list_prim_u_8_strict, | |
swap_info: *mut wire_cst_swap_info, | |
reverse_swap_info: *mut wire_cst_reverse_swap_info, | |
pending_expiration_block: *mut u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_payment_details { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_payment_details { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<bool>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_success_action_processed>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_swap_info>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_reverse_swap_info>; | |
let _: ::core::clone::AssertParamIsClone<*mut u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_payment_details { } | |
#[repr(C)] | |
pub struct wire_cst_ln_url_auth_request_data { | |
k1: *mut wire_cst_list_prim_u_8_strict, | |
action: *mut wire_cst_list_prim_u_8_strict, | |
domain: *mut wire_cst_list_prim_u_8_strict, | |
url: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_url_auth_request_data { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_url_auth_request_data { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_url_auth_request_data { } | |
#[repr(C)] | |
pub struct wire_cst_ln_url_callback_status { | |
tag: i32, | |
kind: LnUrlCallbackStatusKind, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_url_callback_status { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_url_callback_status { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: | |
::core::clone::AssertParamIsClone<LnUrlCallbackStatusKind>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_url_callback_status { } | |
#[repr(C)] | |
pub union LnUrlCallbackStatusKind { | |
ErrorStatus: wire_cst_LnUrlCallbackStatus_ErrorStatus, | |
nil__: (), | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for LnUrlCallbackStatusKind { | |
#[inline] | |
fn clone(&self) -> LnUrlCallbackStatusKind { | |
let _: ::core::clone::AssertParamIsCopy<Self>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for LnUrlCallbackStatusKind { } | |
#[repr(C)] | |
pub struct wire_cst_LnUrlCallbackStatus_ErrorStatus { | |
data: *mut wire_cst_ln_url_error_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_LnUrlCallbackStatus_ErrorStatus | |
{ | |
#[inline] | |
fn clone(&self) -> wire_cst_LnUrlCallbackStatus_ErrorStatus { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_ln_url_error_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_LnUrlCallbackStatus_ErrorStatus | |
{ | |
} | |
#[repr(C)] | |
pub struct wire_cst_ln_url_error_data { | |
reason: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_url_error_data { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_url_error_data { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_url_error_data { } | |
#[repr(C)] | |
pub struct wire_cst_ln_url_pay_error_data { | |
payment_hash: *mut wire_cst_list_prim_u_8_strict, | |
reason: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_url_pay_error_data { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_url_pay_error_data { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_url_pay_error_data { } | |
#[repr(C)] | |
pub struct wire_cst_ln_url_pay_request { | |
data: wire_cst_ln_url_pay_request_data, | |
amount_msat: u64, | |
comment: *mut wire_cst_list_prim_u_8_strict, | |
payment_label: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_url_pay_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_url_pay_request { | |
let _: | |
::core::clone::AssertParamIsClone<wire_cst_ln_url_pay_request_data>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_url_pay_request { } | |
#[repr(C)] | |
pub struct wire_cst_ln_url_pay_request_data { | |
callback: *mut wire_cst_list_prim_u_8_strict, | |
min_sendable: u64, | |
max_sendable: u64, | |
metadata_str: *mut wire_cst_list_prim_u_8_strict, | |
comment_allowed: u16, | |
domain: *mut wire_cst_list_prim_u_8_strict, | |
allows_nostr: bool, | |
nostr_pubkey: *mut wire_cst_list_prim_u_8_strict, | |
ln_address: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_url_pay_request_data { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_url_pay_request_data { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u16>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<bool>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_url_pay_request_data { } | |
#[repr(C)] | |
pub struct wire_cst_ln_url_pay_result { | |
tag: i32, | |
kind: LnUrlPayResultKind, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_url_pay_result { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_url_pay_result { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: ::core::clone::AssertParamIsClone<LnUrlPayResultKind>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_url_pay_result { } | |
#[repr(C)] | |
pub union LnUrlPayResultKind { | |
EndpointSuccess: wire_cst_LnUrlPayResult_EndpointSuccess, | |
EndpointError: wire_cst_LnUrlPayResult_EndpointError, | |
PayError: wire_cst_LnUrlPayResult_PayError, | |
nil__: (), | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for LnUrlPayResultKind { | |
#[inline] | |
fn clone(&self) -> LnUrlPayResultKind { | |
let _: ::core::clone::AssertParamIsCopy<Self>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for LnUrlPayResultKind { } | |
#[repr(C)] | |
pub struct wire_cst_LnUrlPayResult_EndpointSuccess { | |
data: *mut wire_cst_ln_url_pay_success_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_LnUrlPayResult_EndpointSuccess | |
{ | |
#[inline] | |
fn clone(&self) -> wire_cst_LnUrlPayResult_EndpointSuccess { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_ln_url_pay_success_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_LnUrlPayResult_EndpointSuccess | |
{ | |
} | |
#[repr(C)] | |
pub struct wire_cst_LnUrlPayResult_EndpointError { | |
data: *mut wire_cst_ln_url_error_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_LnUrlPayResult_EndpointError { | |
#[inline] | |
fn clone(&self) -> wire_cst_LnUrlPayResult_EndpointError { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_ln_url_error_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_LnUrlPayResult_EndpointError { | |
} | |
#[repr(C)] | |
pub struct wire_cst_LnUrlPayResult_PayError { | |
data: *mut wire_cst_ln_url_pay_error_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_LnUrlPayResult_PayError { | |
#[inline] | |
fn clone(&self) -> wire_cst_LnUrlPayResult_PayError { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_ln_url_pay_error_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_LnUrlPayResult_PayError { } | |
#[repr(C)] | |
pub struct wire_cst_ln_url_pay_success_data { | |
payment: wire_cst_payment, | |
success_action: *mut wire_cst_success_action_processed, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_url_pay_success_data { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_url_pay_success_data { | |
let _: ::core::clone::AssertParamIsClone<wire_cst_payment>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_success_action_processed>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_url_pay_success_data { } | |
#[repr(C)] | |
pub struct wire_cst_ln_url_withdraw_request { | |
data: wire_cst_ln_url_withdraw_request_data, | |
amount_msat: u64, | |
description: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_url_withdraw_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_url_withdraw_request { | |
let _: | |
::core::clone::AssertParamIsClone<wire_cst_ln_url_withdraw_request_data>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_url_withdraw_request { } | |
#[repr(C)] | |
pub struct wire_cst_ln_url_withdraw_request_data { | |
callback: *mut wire_cst_list_prim_u_8_strict, | |
k1: *mut wire_cst_list_prim_u_8_strict, | |
default_description: *mut wire_cst_list_prim_u_8_strict, | |
min_withdrawable: u64, | |
max_withdrawable: u64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_url_withdraw_request_data { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_url_withdraw_request_data { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_url_withdraw_request_data { | |
} | |
#[repr(C)] | |
pub struct wire_cst_ln_url_withdraw_result { | |
tag: i32, | |
kind: LnUrlWithdrawResultKind, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_url_withdraw_result { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_url_withdraw_result { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: | |
::core::clone::AssertParamIsClone<LnUrlWithdrawResultKind>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_url_withdraw_result { } | |
#[repr(C)] | |
pub union LnUrlWithdrawResultKind { | |
Ok: wire_cst_LnUrlWithdrawResult_Ok, | |
ErrorStatus: wire_cst_LnUrlWithdrawResult_ErrorStatus, | |
nil__: (), | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for LnUrlWithdrawResultKind { | |
#[inline] | |
fn clone(&self) -> LnUrlWithdrawResultKind { | |
let _: ::core::clone::AssertParamIsCopy<Self>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for LnUrlWithdrawResultKind { } | |
#[repr(C)] | |
pub struct wire_cst_LnUrlWithdrawResult_Ok { | |
data: *mut wire_cst_ln_url_withdraw_success_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_LnUrlWithdrawResult_Ok { | |
#[inline] | |
fn clone(&self) -> wire_cst_LnUrlWithdrawResult_Ok { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_ln_url_withdraw_success_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_LnUrlWithdrawResult_Ok { } | |
#[repr(C)] | |
pub struct wire_cst_LnUrlWithdrawResult_ErrorStatus { | |
data: *mut wire_cst_ln_url_error_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_LnUrlWithdrawResult_ErrorStatus | |
{ | |
#[inline] | |
fn clone(&self) -> wire_cst_LnUrlWithdrawResult_ErrorStatus { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_ln_url_error_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_LnUrlWithdrawResult_ErrorStatus | |
{ | |
} | |
#[repr(C)] | |
pub struct wire_cst_ln_url_withdraw_success_data { | |
invoice: wire_cst_ln_invoice, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_ln_url_withdraw_success_data { | |
#[inline] | |
fn clone(&self) -> wire_cst_ln_url_withdraw_success_data { | |
let _: ::core::clone::AssertParamIsClone<wire_cst_ln_invoice>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_ln_url_withdraw_success_data { | |
} | |
#[repr(C)] | |
pub struct wire_cst_locale_overrides { | |
locale: *mut wire_cst_list_prim_u_8_strict, | |
spacing: *mut u32, | |
symbol: wire_cst_symbol, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_locale_overrides { | |
#[inline] | |
fn clone(&self) -> wire_cst_locale_overrides { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<*mut u32>; | |
let _: ::core::clone::AssertParamIsClone<wire_cst_symbol>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_locale_overrides { } | |
#[repr(C)] | |
pub struct wire_cst_localized_name { | |
locale: *mut wire_cst_list_prim_u_8_strict, | |
name: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_localized_name { | |
#[inline] | |
fn clone(&self) -> wire_cst_localized_name { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_localized_name { } | |
#[repr(C)] | |
pub struct wire_cst_log_entry { | |
line: *mut wire_cst_list_prim_u_8_strict, | |
level: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_log_entry { | |
#[inline] | |
fn clone(&self) -> wire_cst_log_entry { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_log_entry { } | |
#[repr(C)] | |
pub struct wire_cst_lsp_information { | |
id: *mut wire_cst_list_prim_u_8_strict, | |
name: *mut wire_cst_list_prim_u_8_strict, | |
widget_url: *mut wire_cst_list_prim_u_8_strict, | |
pubkey: *mut wire_cst_list_prim_u_8_strict, | |
host: *mut wire_cst_list_prim_u_8_strict, | |
base_fee_msat: i64, | |
fee_rate: f64, | |
time_lock_delta: u32, | |
min_htlc_msat: i64, | |
lsp_pubkey: *mut wire_cst_list_prim_u_8_strict, | |
opening_fee_params_list: wire_cst_opening_fee_params_menu, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_lsp_information { | |
#[inline] | |
fn clone(&self) -> wire_cst_lsp_information { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<i64>; | |
let _: ::core::clone::AssertParamIsClone<f64>; | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<wire_cst_opening_fee_params_menu>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_lsp_information { } | |
#[repr(C)] | |
pub struct wire_cst_max_reverse_swap_amount_response { | |
total_sat: u64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for | |
wire_cst_max_reverse_swap_amount_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_max_reverse_swap_amount_response { | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for | |
wire_cst_max_reverse_swap_amount_response { | |
} | |
#[repr(C)] | |
pub struct wire_cst_message_success_action_data { | |
message: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_message_success_action_data { | |
#[inline] | |
fn clone(&self) -> wire_cst_message_success_action_data { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_message_success_action_data { } | |
#[repr(C)] | |
pub struct wire_cst_metadata_filter { | |
json_path: *mut wire_cst_list_prim_u_8_strict, | |
json_value: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_metadata_filter { | |
#[inline] | |
fn clone(&self) -> wire_cst_metadata_filter { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_metadata_filter { } | |
#[repr(C)] | |
pub struct wire_cst_node_config { | |
tag: i32, | |
kind: NodeConfigKind, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_node_config { | |
#[inline] | |
fn clone(&self) -> wire_cst_node_config { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: ::core::clone::AssertParamIsClone<NodeConfigKind>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_node_config { } | |
#[repr(C)] | |
pub union NodeConfigKind { | |
Greenlight: wire_cst_NodeConfig_Greenlight, | |
nil__: (), | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for NodeConfigKind { | |
#[inline] | |
fn clone(&self) -> NodeConfigKind { | |
let _: ::core::clone::AssertParamIsCopy<Self>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for NodeConfigKind { } | |
#[repr(C)] | |
pub struct wire_cst_NodeConfig_Greenlight { | |
config: *mut wire_cst_greenlight_node_config, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_NodeConfig_Greenlight { | |
#[inline] | |
fn clone(&self) -> wire_cst_NodeConfig_Greenlight { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_greenlight_node_config>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_NodeConfig_Greenlight { } | |
#[repr(C)] | |
pub struct wire_cst_node_credentials { | |
tag: i32, | |
kind: NodeCredentialsKind, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_node_credentials { | |
#[inline] | |
fn clone(&self) -> wire_cst_node_credentials { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: ::core::clone::AssertParamIsClone<NodeCredentialsKind>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_node_credentials { } | |
#[repr(C)] | |
pub union NodeCredentialsKind { | |
Greenlight: wire_cst_NodeCredentials_Greenlight, | |
nil__: (), | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for NodeCredentialsKind { | |
#[inline] | |
fn clone(&self) -> NodeCredentialsKind { | |
let _: ::core::clone::AssertParamIsCopy<Self>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for NodeCredentialsKind { } | |
#[repr(C)] | |
pub struct wire_cst_NodeCredentials_Greenlight { | |
credentials: *mut wire_cst_greenlight_credentials, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_NodeCredentials_Greenlight { | |
#[inline] | |
fn clone(&self) -> wire_cst_NodeCredentials_Greenlight { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_greenlight_credentials>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_NodeCredentials_Greenlight { } | |
#[repr(C)] | |
pub struct wire_cst_node_state { | |
id: *mut wire_cst_list_prim_u_8_strict, | |
block_height: u32, | |
channels_balance_msat: u64, | |
onchain_balance_msat: u64, | |
pending_onchain_balance_msat: u64, | |
utxos: *mut wire_cst_list_unspent_transaction_output, | |
max_payable_msat: u64, | |
max_receivable_msat: u64, | |
max_single_payment_amount_msat: u64, | |
max_chan_reserve_msats: u64, | |
connected_peers: *mut wire_cst_list_String, | |
inbound_liquidity_msats: u64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_node_state { | |
#[inline] | |
fn clone(&self) -> wire_cst_node_state { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_unspent_transaction_output>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_String>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_node_state { } | |
#[repr(C)] | |
pub struct wire_cst_onchain_payment_limits_response { | |
min_sat: u64, | |
max_sat: u64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_onchain_payment_limits_response | |
{ | |
#[inline] | |
fn clone(&self) -> wire_cst_onchain_payment_limits_response { | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_onchain_payment_limits_response | |
{ | |
} | |
#[repr(C)] | |
pub struct wire_cst_open_channel_fee_request { | |
amount_msat: *mut u64, | |
expiry: *mut u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_open_channel_fee_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_open_channel_fee_request { | |
let _: ::core::clone::AssertParamIsClone<*mut u64>; | |
let _: ::core::clone::AssertParamIsClone<*mut u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_open_channel_fee_request { } | |
#[repr(C)] | |
pub struct wire_cst_open_channel_fee_response { | |
fee_msat: *mut u64, | |
fee_params: wire_cst_opening_fee_params, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_open_channel_fee_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_open_channel_fee_response { | |
let _: ::core::clone::AssertParamIsClone<*mut u64>; | |
let _: | |
::core::clone::AssertParamIsClone<wire_cst_opening_fee_params>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_open_channel_fee_response { } | |
#[repr(C)] | |
pub struct wire_cst_opening_fee_params { | |
min_msat: u64, | |
proportional: u32, | |
valid_until: *mut wire_cst_list_prim_u_8_strict, | |
max_idle_time: u32, | |
max_client_to_self_delay: u32, | |
promise: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_opening_fee_params { | |
#[inline] | |
fn clone(&self) -> wire_cst_opening_fee_params { | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_opening_fee_params { } | |
#[repr(C)] | |
pub struct wire_cst_opening_fee_params_menu { | |
values: *mut wire_cst_list_opening_fee_params, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_opening_fee_params_menu { | |
#[inline] | |
fn clone(&self) -> wire_cst_opening_fee_params_menu { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_opening_fee_params>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_opening_fee_params_menu { } | |
#[repr(C)] | |
pub struct wire_cst_pay_onchain_request { | |
recipient_address: *mut wire_cst_list_prim_u_8_strict, | |
prepare_res: wire_cst_prepare_onchain_payment_response, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_pay_onchain_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_pay_onchain_request { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<wire_cst_prepare_onchain_payment_response>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_pay_onchain_request { } | |
#[repr(C)] | |
pub struct wire_cst_pay_onchain_response { | |
reverse_swap_info: wire_cst_reverse_swap_info, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_pay_onchain_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_pay_onchain_response { | |
let _: | |
::core::clone::AssertParamIsClone<wire_cst_reverse_swap_info>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_pay_onchain_response { } | |
#[repr(C)] | |
pub struct wire_cst_payment { | |
id: *mut wire_cst_list_prim_u_8_strict, | |
payment_type: i32, | |
payment_time: i64, | |
amount_msat: u64, | |
fee_msat: u64, | |
status: i32, | |
error: *mut wire_cst_list_prim_u_8_strict, | |
description: *mut wire_cst_list_prim_u_8_strict, | |
details: wire_cst_payment_details, | |
metadata: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_payment { | |
#[inline] | |
fn clone(&self) -> wire_cst_payment { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: ::core::clone::AssertParamIsClone<i64>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<wire_cst_payment_details>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_payment { } | |
#[repr(C)] | |
pub struct wire_cst_payment_details { | |
tag: i32, | |
kind: PaymentDetailsKind, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_payment_details { | |
#[inline] | |
fn clone(&self) -> wire_cst_payment_details { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: ::core::clone::AssertParamIsClone<PaymentDetailsKind>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_payment_details { } | |
#[repr(C)] | |
pub union PaymentDetailsKind { | |
Ln: wire_cst_PaymentDetails_Ln, | |
ClosedChannel: wire_cst_PaymentDetails_ClosedChannel, | |
nil__: (), | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for PaymentDetailsKind { | |
#[inline] | |
fn clone(&self) -> PaymentDetailsKind { | |
let _: ::core::clone::AssertParamIsCopy<Self>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for PaymentDetailsKind { } | |
#[repr(C)] | |
pub struct wire_cst_PaymentDetails_Ln { | |
data: *mut wire_cst_ln_payment_details, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_PaymentDetails_Ln { | |
#[inline] | |
fn clone(&self) -> wire_cst_PaymentDetails_Ln { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_ln_payment_details>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_PaymentDetails_Ln { } | |
#[repr(C)] | |
pub struct wire_cst_PaymentDetails_ClosedChannel { | |
data: *mut wire_cst_closed_channel_payment_details, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_PaymentDetails_ClosedChannel { | |
#[inline] | |
fn clone(&self) -> wire_cst_PaymentDetails_ClosedChannel { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_closed_channel_payment_details>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_PaymentDetails_ClosedChannel { | |
} | |
#[repr(C)] | |
pub struct wire_cst_payment_failed_data { | |
error: *mut wire_cst_list_prim_u_8_strict, | |
node_id: *mut wire_cst_list_prim_u_8_strict, | |
invoice: *mut wire_cst_ln_invoice, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_payment_failed_data { | |
#[inline] | |
fn clone(&self) -> wire_cst_payment_failed_data { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_ln_invoice>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_payment_failed_data { } | |
#[repr(C)] | |
pub struct wire_cst_prepare_onchain_payment_request { | |
amount_sat: u64, | |
amount_type: i32, | |
claim_tx_feerate: u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_prepare_onchain_payment_request | |
{ | |
#[inline] | |
fn clone(&self) -> wire_cst_prepare_onchain_payment_request { | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_prepare_onchain_payment_request | |
{ | |
} | |
#[repr(C)] | |
pub struct wire_cst_prepare_onchain_payment_response { | |
fees_hash: *mut wire_cst_list_prim_u_8_strict, | |
fees_percentage: f64, | |
fees_lockup: u64, | |
fees_claim: u64, | |
sender_amount_sat: u64, | |
recipient_amount_sat: u64, | |
total_fees: u64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for | |
wire_cst_prepare_onchain_payment_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_prepare_onchain_payment_response { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<f64>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for | |
wire_cst_prepare_onchain_payment_response { | |
} | |
#[repr(C)] | |
pub struct wire_cst_prepare_redeem_onchain_funds_request { | |
to_address: *mut wire_cst_list_prim_u_8_strict, | |
sat_per_vbyte: u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for | |
wire_cst_prepare_redeem_onchain_funds_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_prepare_redeem_onchain_funds_request { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for | |
wire_cst_prepare_redeem_onchain_funds_request { | |
} | |
#[repr(C)] | |
pub struct wire_cst_prepare_redeem_onchain_funds_response { | |
tx_weight: u64, | |
tx_fee_sat: u64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for | |
wire_cst_prepare_redeem_onchain_funds_response { | |
#[inline] | |
fn clone(&self) | |
-> wire_cst_prepare_redeem_onchain_funds_response { | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for | |
wire_cst_prepare_redeem_onchain_funds_response { | |
} | |
#[repr(C)] | |
pub struct wire_cst_prepare_refund_request { | |
swap_address: *mut wire_cst_list_prim_u_8_strict, | |
to_address: *mut wire_cst_list_prim_u_8_strict, | |
sat_per_vbyte: u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_prepare_refund_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_prepare_refund_request { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_prepare_refund_request { } | |
#[repr(C)] | |
pub struct wire_cst_prepare_refund_response { | |
refund_tx_weight: u32, | |
refund_tx_fee_sat: u64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_prepare_refund_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_prepare_refund_response { | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_prepare_refund_response { } | |
#[repr(C)] | |
pub struct wire_cst_rate { | |
coin: *mut wire_cst_list_prim_u_8_strict, | |
value: f64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_rate { | |
#[inline] | |
fn clone(&self) -> wire_cst_rate { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<f64>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_rate { } | |
#[repr(C)] | |
pub struct wire_cst_receive_onchain_request { | |
opening_fee_params: *mut wire_cst_opening_fee_params, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_receive_onchain_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_receive_onchain_request { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_opening_fee_params>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_receive_onchain_request { } | |
#[repr(C)] | |
pub struct wire_cst_receive_payment_request { | |
amount_msat: u64, | |
description: *mut wire_cst_list_prim_u_8_strict, | |
preimage: *mut wire_cst_list_prim_u_8_strict, | |
opening_fee_params: *mut wire_cst_opening_fee_params, | |
use_description_hash: *mut bool, | |
expiry: *mut u32, | |
cltv: *mut u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_receive_payment_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_receive_payment_request { | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_opening_fee_params>; | |
let _: ::core::clone::AssertParamIsClone<*mut bool>; | |
let _: ::core::clone::AssertParamIsClone<*mut u32>; | |
let _: ::core::clone::AssertParamIsClone<*mut u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_receive_payment_request { } | |
#[repr(C)] | |
pub struct wire_cst_receive_payment_response { | |
ln_invoice: wire_cst_ln_invoice, | |
opening_fee_params: *mut wire_cst_opening_fee_params, | |
opening_fee_msat: *mut u64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_receive_payment_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_receive_payment_response { | |
let _: ::core::clone::AssertParamIsClone<wire_cst_ln_invoice>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_opening_fee_params>; | |
let _: ::core::clone::AssertParamIsClone<*mut u64>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_receive_payment_response { } | |
#[repr(C)] | |
pub struct wire_cst_recommended_fees { | |
fastest_fee: u64, | |
half_hour_fee: u64, | |
hour_fee: u64, | |
economy_fee: u64, | |
minimum_fee: u64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_recommended_fees { | |
#[inline] | |
fn clone(&self) -> wire_cst_recommended_fees { | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_recommended_fees { } | |
#[repr(C)] | |
pub struct wire_cst_redeem_onchain_funds_request { | |
to_address: *mut wire_cst_list_prim_u_8_strict, | |
sat_per_vbyte: u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_redeem_onchain_funds_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_redeem_onchain_funds_request { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_redeem_onchain_funds_request { | |
} | |
#[repr(C)] | |
pub struct wire_cst_redeem_onchain_funds_response { | |
txid: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_redeem_onchain_funds_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_redeem_onchain_funds_response { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_redeem_onchain_funds_response { | |
} | |
#[repr(C)] | |
pub struct wire_cst_refund_request { | |
swap_address: *mut wire_cst_list_prim_u_8_strict, | |
to_address: *mut wire_cst_list_prim_u_8_strict, | |
sat_per_vbyte: u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_refund_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_refund_request { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_refund_request { } | |
#[repr(C)] | |
pub struct wire_cst_refund_response { | |
refund_tx_id: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_refund_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_refund_response { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_refund_response { } | |
#[repr(C)] | |
pub struct wire_cst_report_issue_request { | |
tag: i32, | |
kind: ReportIssueRequestKind, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_report_issue_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_report_issue_request { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: | |
::core::clone::AssertParamIsClone<ReportIssueRequestKind>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_report_issue_request { } | |
#[repr(C)] | |
pub union ReportIssueRequestKind { | |
PaymentFailure: wire_cst_ReportIssueRequest_PaymentFailure, | |
nil__: (), | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for ReportIssueRequestKind { | |
#[inline] | |
fn clone(&self) -> ReportIssueRequestKind { | |
let _: ::core::clone::AssertParamIsCopy<Self>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for ReportIssueRequestKind { } | |
#[repr(C)] | |
pub struct wire_cst_ReportIssueRequest_PaymentFailure { | |
data: *mut wire_cst_report_payment_failure_details, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for | |
wire_cst_ReportIssueRequest_PaymentFailure { | |
#[inline] | |
fn clone(&self) -> wire_cst_ReportIssueRequest_PaymentFailure { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_report_payment_failure_details>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for | |
wire_cst_ReportIssueRequest_PaymentFailure { | |
} | |
#[repr(C)] | |
pub struct wire_cst_report_payment_failure_details { | |
payment_hash: *mut wire_cst_list_prim_u_8_strict, | |
comment: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_report_payment_failure_details | |
{ | |
#[inline] | |
fn clone(&self) -> wire_cst_report_payment_failure_details { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_report_payment_failure_details | |
{ | |
} | |
#[repr(C)] | |
pub struct wire_cst_reverse_swap_fees_request { | |
send_amount_sat: *mut u64, | |
claim_tx_feerate: *mut u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_reverse_swap_fees_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_reverse_swap_fees_request { | |
let _: ::core::clone::AssertParamIsClone<*mut u64>; | |
let _: ::core::clone::AssertParamIsClone<*mut u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_reverse_swap_fees_request { } | |
#[repr(C)] | |
pub struct wire_cst_reverse_swap_info { | |
id: *mut wire_cst_list_prim_u_8_strict, | |
claim_pubkey: *mut wire_cst_list_prim_u_8_strict, | |
lockup_txid: *mut wire_cst_list_prim_u_8_strict, | |
claim_txid: *mut wire_cst_list_prim_u_8_strict, | |
onchain_amount_sat: u64, | |
status: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_reverse_swap_info { | |
#[inline] | |
fn clone(&self) -> wire_cst_reverse_swap_info { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_reverse_swap_info { } | |
#[repr(C)] | |
pub struct wire_cst_reverse_swap_pair_info { | |
min: u64, | |
max: u64, | |
fees_hash: *mut wire_cst_list_prim_u_8_strict, | |
fees_percentage: f64, | |
fees_lockup: u64, | |
fees_claim: u64, | |
total_fees: *mut u64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_reverse_swap_pair_info { | |
#[inline] | |
fn clone(&self) -> wire_cst_reverse_swap_pair_info { | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<f64>; | |
let _: ::core::clone::AssertParamIsClone<*mut u64>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_reverse_swap_pair_info { } | |
#[repr(C)] | |
pub struct wire_cst_route_hint { | |
hops: *mut wire_cst_list_route_hint_hop, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_route_hint { | |
#[inline] | |
fn clone(&self) -> wire_cst_route_hint { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_route_hint_hop>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_route_hint { } | |
#[repr(C)] | |
pub struct wire_cst_route_hint_hop { | |
src_node_id: *mut wire_cst_list_prim_u_8_strict, | |
short_channel_id: u64, | |
fees_base_msat: u32, | |
fees_proportional_millionths: u32, | |
cltv_expiry_delta: u64, | |
htlc_minimum_msat: *mut u64, | |
htlc_maximum_msat: *mut u64, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_route_hint_hop { | |
#[inline] | |
fn clone(&self) -> wire_cst_route_hint_hop { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
let _: ::core::clone::AssertParamIsClone<*mut u64>; | |
let _: ::core::clone::AssertParamIsClone<*mut u64>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_route_hint_hop { } | |
#[repr(C)] | |
pub struct wire_cst_send_onchain_request { | |
amount_sat: u64, | |
onchain_recipient_address: *mut wire_cst_list_prim_u_8_strict, | |
pair_hash: *mut wire_cst_list_prim_u_8_strict, | |
sat_per_vbyte: u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_send_onchain_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_send_onchain_request { | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_send_onchain_request { } | |
#[repr(C)] | |
pub struct wire_cst_send_onchain_response { | |
reverse_swap_info: wire_cst_reverse_swap_info, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_send_onchain_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_send_onchain_response { | |
let _: | |
::core::clone::AssertParamIsClone<wire_cst_reverse_swap_info>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_send_onchain_response { } | |
#[repr(C)] | |
pub struct wire_cst_send_payment_request { | |
bolt11: *mut wire_cst_list_prim_u_8_strict, | |
amount_msat: *mut u64, | |
label: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_send_payment_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_send_payment_request { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<*mut u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_send_payment_request { } | |
#[repr(C)] | |
pub struct wire_cst_send_payment_response { | |
payment: wire_cst_payment, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_send_payment_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_send_payment_response { | |
let _: ::core::clone::AssertParamIsClone<wire_cst_payment>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_send_payment_response { } | |
#[repr(C)] | |
pub struct wire_cst_send_spontaneous_payment_request { | |
node_id: *mut wire_cst_list_prim_u_8_strict, | |
amount_msat: u64, | |
extra_tlvs: *mut wire_cst_list_tlv_entry, | |
label: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for | |
wire_cst_send_spontaneous_payment_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_send_spontaneous_payment_request { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_tlv_entry>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for | |
wire_cst_send_spontaneous_payment_request { | |
} | |
#[repr(C)] | |
pub struct wire_cst_service_health_check_response { | |
status: i32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_service_health_check_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_service_health_check_response { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_service_health_check_response { | |
} | |
#[repr(C)] | |
pub struct wire_cst_sign_message_request { | |
message: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_sign_message_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_sign_message_request { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_sign_message_request { } | |
#[repr(C)] | |
pub struct wire_cst_sign_message_response { | |
signature: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_sign_message_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_sign_message_response { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_sign_message_response { } | |
#[repr(C)] | |
pub struct wire_cst_static_backup_request { | |
working_dir: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_static_backup_request { | |
#[inline] | |
fn clone(&self) -> wire_cst_static_backup_request { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_static_backup_request { } | |
#[repr(C)] | |
pub struct wire_cst_static_backup_response { | |
backup: *mut wire_cst_list_String, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_static_backup_response { | |
#[inline] | |
fn clone(&self) -> wire_cst_static_backup_response { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_String>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_static_backup_response { } | |
#[repr(C)] | |
pub struct wire_cst_success_action_processed { | |
tag: i32, | |
kind: SuccessActionProcessedKind, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_success_action_processed { | |
#[inline] | |
fn clone(&self) -> wire_cst_success_action_processed { | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: | |
::core::clone::AssertParamIsClone<SuccessActionProcessedKind>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_success_action_processed { } | |
#[repr(C)] | |
pub union SuccessActionProcessedKind { | |
Aes: wire_cst_SuccessActionProcessed_Aes, | |
Message: wire_cst_SuccessActionProcessed_Message, | |
Url: wire_cst_SuccessActionProcessed_Url, | |
nil__: (), | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for SuccessActionProcessedKind { | |
#[inline] | |
fn clone(&self) -> SuccessActionProcessedKind { | |
let _: ::core::clone::AssertParamIsCopy<Self>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for SuccessActionProcessedKind { } | |
#[repr(C)] | |
pub struct wire_cst_SuccessActionProcessed_Aes { | |
result: *mut wire_cst_aes_success_action_data_result, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_SuccessActionProcessed_Aes { | |
#[inline] | |
fn clone(&self) -> wire_cst_SuccessActionProcessed_Aes { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_aes_success_action_data_result>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_SuccessActionProcessed_Aes { } | |
#[repr(C)] | |
pub struct wire_cst_SuccessActionProcessed_Message { | |
data: *mut wire_cst_message_success_action_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_SuccessActionProcessed_Message | |
{ | |
#[inline] | |
fn clone(&self) -> wire_cst_SuccessActionProcessed_Message { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_message_success_action_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_SuccessActionProcessed_Message | |
{ | |
} | |
#[repr(C)] | |
pub struct wire_cst_SuccessActionProcessed_Url { | |
data: *mut wire_cst_url_success_action_data, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_SuccessActionProcessed_Url { | |
#[inline] | |
fn clone(&self) -> wire_cst_SuccessActionProcessed_Url { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_url_success_action_data>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_SuccessActionProcessed_Url { } | |
#[repr(C)] | |
pub struct wire_cst_swap_info { | |
bitcoin_address: *mut wire_cst_list_prim_u_8_strict, | |
created_at: i64, | |
lock_height: i64, | |
payment_hash: *mut wire_cst_list_prim_u_8_strict, | |
preimage: *mut wire_cst_list_prim_u_8_strict, | |
private_key: *mut wire_cst_list_prim_u_8_strict, | |
public_key: *mut wire_cst_list_prim_u_8_strict, | |
swapper_public_key: *mut wire_cst_list_prim_u_8_strict, | |
script: *mut wire_cst_list_prim_u_8_strict, | |
bolt11: *mut wire_cst_list_prim_u_8_strict, | |
paid_msat: u64, | |
total_incoming_txs: u64, | |
confirmed_sats: u64, | |
unconfirmed_sats: u64, | |
status: i32, | |
refund_tx_ids: *mut wire_cst_list_String, | |
unconfirmed_tx_ids: *mut wire_cst_list_String, | |
confirmed_tx_ids: *mut wire_cst_list_String, | |
min_allowed_deposit: i64, | |
max_allowed_deposit: i64, | |
max_swapper_payable: i64, | |
last_redeem_error: *mut wire_cst_list_prim_u_8_strict, | |
channel_opening_fees: *mut wire_cst_opening_fee_params, | |
confirmed_at: *mut u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_swap_info { | |
#[inline] | |
fn clone(&self) -> wire_cst_swap_info { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<i64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: ::core::clone::AssertParamIsClone<i32>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_String>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_String>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_String>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_opening_fee_params>; | |
let _: ::core::clone::AssertParamIsClone<*mut u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_swap_info { } | |
#[repr(C)] | |
pub struct wire_cst_symbol { | |
grapheme: *mut wire_cst_list_prim_u_8_strict, | |
template: *mut wire_cst_list_prim_u_8_strict, | |
rtl: *mut bool, | |
position: *mut u32, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_symbol { | |
#[inline] | |
fn clone(&self) -> wire_cst_symbol { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<*mut bool>; | |
let _: ::core::clone::AssertParamIsClone<*mut u32>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_symbol { } | |
#[repr(C)] | |
pub struct wire_cst_tlv_entry { | |
field_number: u64, | |
value: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_tlv_entry { | |
#[inline] | |
fn clone(&self) -> wire_cst_tlv_entry { | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_tlv_entry { } | |
#[repr(C)] | |
pub struct wire_cst_unspent_transaction_output { | |
txid: *mut wire_cst_list_prim_u_8_strict, | |
outnum: u32, | |
amount_millisatoshi: u64, | |
address: *mut wire_cst_list_prim_u_8_strict, | |
reserved: bool, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_unspent_transaction_output { | |
#[inline] | |
fn clone(&self) -> wire_cst_unspent_transaction_output { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<u32>; | |
let _: ::core::clone::AssertParamIsClone<u64>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: ::core::clone::AssertParamIsClone<bool>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_unspent_transaction_output { } | |
#[repr(C)] | |
pub struct wire_cst_url_success_action_data { | |
description: *mut wire_cst_list_prim_u_8_strict, | |
url: *mut wire_cst_list_prim_u_8_strict, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for wire_cst_url_success_action_data { | |
#[inline] | |
fn clone(&self) -> wire_cst_url_success_action_data { | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
let _: | |
::core::clone::AssertParamIsClone<*mut wire_cst_list_prim_u_8_strict>; | |
*self | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::Copy for wire_cst_url_success_action_data { } | |
} | |
#[cfg(not(target_family = "wasm"))] | |
pub use io::*; | |
} | |
#[macro_use] | |
extern crate log; | |
mod backup { | |
use crate::{ | |
breez_services::BackupFailedData, error::SdkResult, | |
persist::db::{HookEvent, SqliteStorage}, | |
BreezEvent, Config, | |
}; | |
use anyhow::{anyhow, Result}; | |
use ecies::symmetric::{sym_decrypt, sym_encrypt}; | |
use miniz_oxide::{ | |
deflate::compress_to_vec, inflate::decompress_to_vec_with_limit, | |
}; | |
use std::{ | |
fs::{self, File}, | |
io::{Read, Write}, | |
path::Path, sync::Arc, time::{SystemTime, UNIX_EPOCH}, | |
}; | |
use tempfile::tempdir_in; | |
use tokio::{ | |
runtime::Builder, | |
sync::{ | |
broadcast::{self, error::RecvError}, | |
mpsc::{self, Sender}, | |
watch, Mutex, | |
}, | |
}; | |
pub(crate) struct BackupRequest { | |
force: bool, | |
on_complete: Option<mpsc::Sender<Result<()>>>, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for BackupRequest { | |
#[inline] | |
fn clone(&self) -> BackupRequest { | |
BackupRequest { | |
force: ::core::clone::Clone::clone(&self.force), | |
on_complete: ::core::clone::Clone::clone(&self.on_complete), | |
} | |
} | |
} | |
unsafe impl Send for BackupRequest {} | |
unsafe impl Sync for BackupRequest {} | |
impl BackupRequest { | |
pub(crate) fn new(force: bool) -> Self { | |
Self { force, on_complete: None } | |
} | |
pub(crate) fn with(on_complete: Sender<Result<()>>, force: bool) | |
-> Self { | |
Self { force, on_complete: Some(on_complete) } | |
} | |
} | |
/// It is just a blob of data marked with a specific version (generation). | |
/// The generation signals for the local state if the remote state is newer, | |
/// where in that case the local state should be updated with the remote state prior to pushing | |
/// any local changes. | |
pub struct BackupState { | |
pub generation: u64, | |
pub data: Vec<u8>, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for BackupState { | |
#[inline] | |
fn clone(&self) -> BackupState { | |
BackupState { | |
generation: ::core::clone::Clone::clone(&self.generation), | |
data: ::core::clone::Clone::clone(&self.data), | |
} | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::StructuralPartialEq for BackupState { } | |
#[automatically_derived] | |
impl ::core::cmp::PartialEq for BackupState { | |
#[inline] | |
fn eq(&self, other: &BackupState) -> bool { | |
self.generation == other.generation && self.data == other.data | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::StructuralEq for BackupState { } | |
#[automatically_derived] | |
impl ::core::cmp::Eq for BackupState { | |
#[inline] | |
#[doc(hidden)] | |
#[coverage(off)] | |
fn assert_receiver_is_total_eq(&self) -> () { | |
let _: ::core::cmp::AssertParamIsEq<u64>; | |
let _: ::core::cmp::AssertParamIsEq<Vec<u8>>; | |
} | |
} | |
#[automatically_derived] | |
impl ::core::fmt::Debug for BackupState { | |
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { | |
::core::fmt::Formatter::debug_struct_field2_finish(f, | |
"BackupState", "generation", &self.generation, "data", | |
&&self.data) | |
} | |
} | |
#[doc = | |
" BackupTransport is the interface for syncing the sdk state between multiple apps."] | |
pub trait BackupTransport: Send + Sync { | |
#[must_use] | |
#[allow(clippy :: type_complexity, clippy :: | |
type_repetition_in_bounds)] | |
fn pull<'life0, 'async_trait>(&'life0 self) | |
-> | |
::core::pin::Pin<Box<dyn ::core::future::Future<Output = | |
SdkResult<Option<BackupState>>> + ::core::marker::Send + | |
'async_trait>> | |
where | |
'life0: 'async_trait, | |
Self: 'async_trait; | |
#[must_use] | |
#[allow(clippy :: type_complexity, clippy :: | |
type_repetition_in_bounds)] | |
fn push<'life0, | |
'async_trait>(&'life0 self, version: Option<u64>, data: Vec<u8>) | |
-> | |
::core::pin::Pin<Box<dyn ::core::future::Future<Output = | |
SdkResult<u64>> + ::core::marker::Send + 'async_trait>> | |
where | |
'life0: 'async_trait, | |
Self: 'async_trait; | |
} | |
pub(crate) struct BackupWatcher { | |
pub(crate) config: Config, | |
backup_request_sender: Mutex<Option<mpsc::Sender<BackupRequest>>>, | |
inner: Arc<dyn BackupTransport>, | |
persister: Arc<SqliteStorage>, | |
encryption_key: Vec<u8>, | |
legacy_encryption_key: Vec<u8>, | |
events_notifier: broadcast::Sender<BreezEvent>, | |
} | |
/// watches for sync requests and syncs the sdk state when a request is detected. | |
impl BackupWatcher { | |
pub(crate) fn new(config: Config, inner: Arc<dyn BackupTransport>, | |
persister: Arc<SqliteStorage>, encryption_key: Vec<u8>, | |
legacy_encryption_key: Vec<u8>) -> Self { | |
let (events_notifier, _) = broadcast::channel::<BreezEvent>(100); | |
Self { | |
config, | |
backup_request_sender: Mutex::new(None), | |
inner, | |
persister, | |
encryption_key, | |
legacy_encryption_key, | |
events_notifier, | |
} | |
} | |
async fn set_request_sender(&self, | |
sender: mpsc::Sender<BackupRequest>) { | |
let mut backup_request_sender = | |
self.backup_request_sender.lock().await; | |
*backup_request_sender = Some(sender); | |
} | |
pub(crate) async fn start(&self, | |
mut quit_receiver: watch::Receiver<()>) -> Result<()> { | |
let worker = | |
BackupWorker::new(self.config.working_dir.clone(), | |
self.inner.clone(), self.persister.clone(), | |
self.encryption_key.clone(), | |
self.legacy_encryption_key.clone(), | |
self.events_notifier.clone()); | |
let mut hooks_subscription = self.persister.subscribe_hooks(); | |
let (backup_request_sender, mut backup_request_receiver) = | |
mpsc::channel::<BackupRequest>(100); | |
self.set_request_sender(backup_request_sender.clone()).await; | |
let rt = Builder::new_current_thread().enable_all().build()?; | |
std::thread::spawn(move || | |
{ | |
rt.block_on(async move | |
{ | |
loop { | |
{ | |
#[doc(hidden)] | |
mod __tokio_select_util { | |
pub(super) enum Out<_0, _1, _2> { | |
_0(_0), | |
_1(_1), | |
_2(_2), | |
Disabled, | |
} | |
pub(super) type Mask = u8; | |
} | |
use ::tokio::macros::support::Future; | |
use ::tokio::macros::support::Pin; | |
use ::tokio::macros::support::Poll::{Ready, Pending}; | |
const BRANCHES: u32 = 3; | |
let mut disabled: __tokio_select_util::Mask = | |
Default::default(); | |
if !true { | |
let mask: __tokio_select_util::Mask = 1 << 0; | |
disabled |= mask; | |
} | |
if !true { | |
let mask: __tokio_select_util::Mask = 1 << 1; | |
disabled |= mask; | |
} | |
if !true { | |
let mask: __tokio_select_util::Mask = 1 << 2; | |
disabled |= mask; | |
} | |
let mut output = | |
{ | |
let mut futures = | |
(backup_request_receiver.recv(), hooks_subscription.recv(), | |
quit_receiver.changed()); | |
let mut futures = &mut futures; | |
::tokio::macros::support::poll_fn(|cx| | |
{ | |
let mut is_pending = false; | |
let start = | |
{ ::tokio::macros::support::thread_rng_n(BRANCHES) }; | |
for i in 0..BRANCHES { | |
let branch; | |
#[allow(clippy :: modulo_one)] | |
{ branch = (start + i) % BRANCHES; } | |
match branch | |
{ | |
#[allow(unreachable_code)] | |
0 => { | |
let mask = 1 << branch; | |
if disabled & mask == mask { continue; } | |
let (fut, ..) = &mut *futures; | |
let mut fut = unsafe { Pin::new_unchecked(fut) }; | |
let out = | |
match Future::poll(fut, cx) { | |
Ready(out) => out, | |
Pending => { is_pending = true; continue; } | |
}; | |
disabled |= mask; | |
#[allow(unused_variables)] | |
#[allow(unused_mut)] | |
match &out { req => {} _ => continue, } | |
return Ready(__tokio_select_util::Out::_0(out)); | |
} | |
#[allow(unreachable_code)] | |
1 => { | |
let mask = 1 << branch; | |
if disabled & mask == mask { continue; } | |
let (_, fut, ..) = &mut *futures; | |
let mut fut = unsafe { Pin::new_unchecked(fut) }; | |
let out = | |
match Future::poll(fut, cx) { | |
Ready(out) => out, | |
Pending => { is_pending = true; continue; } | |
}; | |
disabled |= mask; | |
#[allow(unused_variables)] | |
#[allow(unused_mut)] | |
match &out { event => {} _ => continue, } | |
return Ready(__tokio_select_util::Out::_1(out)); | |
} | |
#[allow(unreachable_code)] | |
2 => { | |
let mask = 1 << branch; | |
if disabled & mask == mask { continue; } | |
let (_, _, fut, ..) = &mut *futures; | |
let mut fut = unsafe { Pin::new_unchecked(fut) }; | |
let out = | |
match Future::poll(fut, cx) { | |
Ready(out) => out, | |
Pending => { is_pending = true; continue; } | |
}; | |
disabled |= mask; | |
#[allow(unused_variables)] | |
#[allow(unused_mut)] | |
match &out { _ => {} _ => continue, } | |
return Ready(__tokio_select_util::Out::_2(out)); | |
} | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("reaching this means there probably is an off by one bug"))); | |
} | |
} | |
} | |
if is_pending { | |
Pending | |
} else { Ready(__tokio_select_util::Out::Disabled) } | |
}).await | |
}; | |
match output { | |
__tokio_select_util::Out::_0(req) => { | |
match req { | |
Some(req) => { | |
match worker.sync(req.force).await { | |
Ok(_) => { | |
if let Some(callback) = req.on_complete { | |
_ = callback.send(Ok(())).await; | |
} | |
} | |
Err(e) => { | |
{ | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Sync worker returned with error {0}", | |
e), lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 140u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
if let Some(callback) = req.on_complete { | |
_ = callback.send(Err(e)).await; | |
} | |
} | |
}; | |
} | |
None => { return } | |
} | |
} | |
__tokio_select_util::Out::_1(event) => { | |
match event { | |
Ok(HookEvent::Insert { table }) => { | |
if table == "sync_requests" { | |
tokio::time::sleep(std::time::Duration::from_millis(100)).await; | |
if let Err(e) = worker.sync(false).await { | |
{ | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Sync worker returned with error {0}", | |
e), lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 161u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
} | |
} | |
} | |
Err(RecvError::Lagged(_)) => { | |
if let Err(e) = worker.sync(false).await { | |
{ | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Sync worker returned with error {0}", | |
e), lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 168u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
} | |
} | |
Err(_) => { return } | |
} | |
} | |
__tokio_select_util::Out::_2(_) => { return } | |
__tokio_select_util::Out::Disabled => { | |
::core::panicking::panic_fmt(format_args!("all branches are disabled and there is no else branch")); | |
} | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("failed to match bind"))); | |
} | |
} | |
} | |
} | |
}); | |
}); | |
Ok(()) | |
} | |
pub(crate) fn subscribe_events(&self) | |
-> broadcast::Receiver<BreezEvent> { | |
self.events_notifier.subscribe() | |
} | |
pub(crate) async fn request_backup(&self, req: BackupRequest) | |
-> Result<()> { | |
let request_handler = self.backup_request_sender.lock().await; | |
let h = request_handler.clone(); | |
h.ok_or_else(|| | |
::anyhow::__private::must_use({ | |
let error = | |
::anyhow::__private::format_err(format_args!("No backup request handler found")); | |
error | |
}))?.send(req).await.map_err(|_| | |
::anyhow::__private::must_use({ | |
let error = | |
::anyhow::__private::format_err(format_args!("Failed to send backup request, the channel is likely closed")); | |
error | |
})) | |
} | |
} | |
/// BackupWorker is a worker that bidirectionally syncs the sdk state. | |
struct BackupWorker { | |
working_dir_path: String, | |
inner: Arc<dyn BackupTransport>, | |
persister: Arc<SqliteStorage>, | |
encryption_key: Vec<u8>, | |
legacy_encryption_key: Vec<u8>, | |
events_notifier: broadcast::Sender<BreezEvent>, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for BackupWorker { | |
#[inline] | |
fn clone(&self) -> BackupWorker { | |
BackupWorker { | |
working_dir_path: ::core::clone::Clone::clone(&self.working_dir_path), | |
inner: ::core::clone::Clone::clone(&self.inner), | |
persister: ::core::clone::Clone::clone(&self.persister), | |
encryption_key: ::core::clone::Clone::clone(&self.encryption_key), | |
legacy_encryption_key: ::core::clone::Clone::clone(&self.legacy_encryption_key), | |
events_notifier: ::core::clone::Clone::clone(&self.events_notifier), | |
} | |
} | |
} | |
impl BackupWorker { | |
pub(crate) fn new(working_dir_path: String, | |
inner: Arc<dyn BackupTransport>, persister: Arc<SqliteStorage>, | |
encryption_key: Vec<u8>, legacy_encryption_key: Vec<u8>, | |
events_notifier: broadcast::Sender<BreezEvent>) -> Self { | |
Self { | |
working_dir_path, | |
inner, | |
persister, | |
encryption_key, | |
legacy_encryption_key, | |
events_notifier, | |
} | |
} | |
async fn notify(&self, e: BreezEvent) -> Result<()> { | |
_ = self.events_notifier.send(e); | |
Ok(()) | |
} | |
async fn sync(&self, force: bool) -> Result<()> { | |
let last_sync_request_id = | |
self.persister.get_last_sync_request()?.unwrap_or_default(); | |
if !force && last_sync_request_id == 0 { return Ok(()); } | |
let sync_dir = self.sync_dir()?; | |
let notify_res = | |
match self.sync_internal(sync_dir.clone(), | |
last_sync_request_id).await { | |
Ok(_) => { | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("backup sync completed successfully"), | |
lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 252u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
self.notify(BreezEvent::BackupSucceeded).await | |
} | |
Err(e) => { | |
{ | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("backup sync failed {0}", | |
e), lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 256u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
self.notify(BreezEvent::BackupFailed { | |
details: BackupFailedData { error: e.to_string() }, | |
}).await | |
} | |
}; | |
fs::remove_dir_all(Path::new(sync_dir.as_str()))?; | |
match notify_res { | |
Ok(r) => Ok(r), | |
Err(e) => { | |
{ | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("failed to notify backup event {0}", | |
e), lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 270u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
Err(e) | |
} | |
} | |
} | |
/// Syncs the sdk state with the remote state. | |
/// The process is done in 3 steps: | |
/// 1. Try to push the local state to the remote state using the current version (optimistic). | |
/// 2. If the push fails, sync the remote changes into the local changes including the remote newer version. | |
/// 3. Try to push the local state again with the new version. | |
async fn sync_internal(&self, sync_dir: String, | |
mut last_sync_request_id: u64) -> Result<()> { | |
let last_version = self.persister.get_last_sync_version()?; | |
self.notify(BreezEvent::BackupStarted).await?; | |
let local_storage_file = | |
tempfile::NamedTempFile::new_in(sync_dir.clone())?; | |
self.persister.backup(local_storage_file.path())?; | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("syncing storge, last_version = {0:?}, file = {1:?}", | |
last_version, local_storage_file.path()), lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 290u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
let mut f = File::open(local_storage_file.path())?; | |
let mut data = ::alloc::vec::Vec::new(); | |
f.read_to_end(&mut data)?; | |
let optimistic_sync = self.push(last_version, data.clone()).await; | |
let sync_result = | |
match optimistic_sync { | |
Ok((new_version, data)) => { | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Optimistic sync succeeded, new version = {0}", | |
new_version), lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 306u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
Ok((new_version, data)) | |
} | |
Err(e) => { | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Optimistic sync failed, trying to sync remote changes {0}", | |
e), lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 310u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
self.sync_remote_and_push(sync_dir, data, | |
&mut last_sync_request_id).await | |
} | |
}; | |
match sync_result { | |
Ok((new_version, new_data)) => { | |
let now = SystemTime::now(); | |
self.persister.set_last_sync_version(new_version, | |
&new_data)?; | |
self.persister.delete_sync_requests_up_to(last_sync_request_id)?; | |
self.persister.set_last_backup_time(now.duration_since(UNIX_EPOCH).unwrap().as_secs())?; | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Sync succeeded"), | |
lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 329u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
Ok(()) | |
} | |
Err(e) => { | |
{ | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Sync failed: {0}", | |
e), lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 333u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
Err(e) | |
} | |
} | |
} | |
/// Syncs the remote changes into the local changes and then tries to push the local changes again. | |
async fn sync_remote_and_push(&self, sync_dir: String, | |
local_data: Vec<u8>, last_sync_request_id: &mut u64) | |
-> Result<(u64, Vec<u8>)> { | |
let remote_state = self.pull().await?; | |
let tmp_dir = tempdir_in(sync_dir)?; | |
let remote_storage_path = tmp_dir.path(); | |
let mut remote_storage_file = | |
File::create(remote_storage_path.join("sync_storage.sql"))?; | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("remote_storage_path = {0:?}", | |
remote_storage_path), lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 350u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
match remote_state { | |
Some(state) => { | |
remote_storage_file.write_all(&state.data[..])?; | |
remote_storage_file.flush()?; | |
let remote_storage = | |
SqliteStorage::new(remote_storage_path.as_os_str().to_str().unwrap().to_string()); | |
self.persister.import_remote_changes(&remote_storage, | |
true)?; | |
remote_storage.import_remote_changes(self.persister.as_ref(), | |
false)?; | |
*last_sync_request_id = | |
self.persister.get_last_sync_request()?.unwrap_or_default(); | |
let mut hex = ::alloc::vec::Vec::new(); | |
remote_storage_file = | |
File::open(Path::new(remote_storage_path).join("sync_storage.sql"))?; | |
remote_storage_file.read_to_end(&mut hex)?; | |
let result = self.push(Some(state.generation), hex).await?; | |
Ok(result) | |
} | |
None => { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("No remote state, pushing local changes"), | |
lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 382u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
self.push(None, local_data).await | |
} | |
} | |
} | |
async fn pull(&self) -> Result<Option<BackupState>> { | |
let state = self.inner.pull().await?; | |
match state { | |
Some(state) => { | |
let mut decrypted = | |
sym_decrypt(self.encryption_key.as_slice(), | |
state.data.as_slice()); | |
if decrypted.is_none() { | |
{ | |
let lvl = ::log::Level::Warn; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Failed to decrypt backup with new key, trying legacy key"), | |
lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 395u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
decrypted = | |
sym_decrypt(self.legacy_encryption_key.as_slice(), | |
state.data.as_slice()); | |
} | |
let decrypted_data = | |
decrypted.ok_or(::anyhow::__private::must_use({ | |
let error = | |
::anyhow::__private::format_err(format_args!("Failed to decrypt backup")); | |
error | |
}))?; | |
match decompress_to_vec_with_limit(&decrypted_data, 4000000) | |
{ | |
Ok(decompressed) => | |
Ok(Some(BackupState { | |
generation: state.generation, | |
data: decompressed, | |
})), | |
Err(e) => { | |
{ | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Failed to decompress backup: {0}", | |
e), lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 406u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
Ok(None) | |
} | |
} | |
} | |
None => Ok(None), | |
} | |
} | |
async fn push(&self, version: Option<u64>, data: Vec<u8>) | |
-> Result<(u64, Vec<u8>)> { | |
let compressed_data = compress_to_vec(&data, 10); | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("Pushing compressed data with size = {0}", | |
compressed_data.len()), lvl, | |
&("breez_sdk_core::backup", "breez_sdk_core::backup", | |
"sdk-core/src/backup.rs"), 417u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
let encrypted_data = | |
sym_encrypt(self.encryption_key.as_slice(), | |
compressed_data.as_slice()).ok_or(::anyhow::__private::must_use({ | |
let error = | |
::anyhow::__private::format_err(format_args!("Failed to encrypt backup")); | |
error | |
}))?; | |
let version = | |
self.inner.push(version, encrypted_data.clone()).await?; | |
Ok((version, encrypted_data)) | |
} | |
fn sync_dir(&self) -> Result<String> { | |
let working_dir = Path::new(self.working_dir_path.as_str()); | |
let buf = working_dir.join("sync"); | |
let sync_path = buf.to_str(); | |
let path_str = | |
match sync_path { | |
Some(sync_path) => { | |
if !Path::new(sync_path).exists() { | |
fs::create_dir_all(sync_path)?; | |
} | |
Ok(sync_path) | |
} | |
None => | |
Err(::anyhow::__private::must_use({ | |
let error = | |
::anyhow::__private::format_err(format_args!("Failed to create sync directory")); | |
error | |
})), | |
}?; | |
Ok(path_str.into()) | |
} | |
} | |
} | |
pub mod binding { | |
//! Bindings for the Dart integration | |
//! | |
//! ### Error handling | |
//! | |
//! Since the integration requires the methods to return `anyhow::Result`, but the SDK service methods | |
//! are being converted to return `SdkResult`, we have two ways to handle errors: | |
//! - by using `Into::into`, which converts the `SdkError` enum to a generic `anyhow::Error` | |
//! - by wrapping the `SdkError` in an `anyhow::Error` | |
//! | |
//! The first option loses the `SdkError` type. The second option keeps the type, which we can retrieve | |
//! with `anyhow::Error::downcast_ref` (or equivalent Dart method). We therefore use the second approach. | |
use std::future::Future; | |
use std::sync::Arc; | |
use anyhow::{anyhow, Result}; | |
use crate::frb_generated::StreamSink; | |
use log::{Level, LevelFilter, Metadata, Record}; | |
use once_cell::sync::{Lazy, OnceCell}; | |
use tokio::sync::Mutex; | |
use crate::breez_services::{ | |
self, BreezEvent, BreezServices, EventListener, | |
}; | |
use crate::chain::RecommendedFees; | |
use crate::error::{ | |
ConnectError, LnUrlAuthError, LnUrlPayError, LnUrlWithdrawError, | |
ReceiveOnchainError, ReceivePaymentError, SdkError, SendOnchainError, | |
SendPaymentError, | |
}; | |
use crate::fiat::{FiatCurrency, Rate}; | |
use crate::input_parser::{self, InputType, LnUrlAuthRequestData}; | |
use crate::invoice::{self, LNInvoice}; | |
use crate::lnurl::pay::model::LnUrlPayResult; | |
use crate::lsp::LspInformation; | |
use crate::models::{Config, LogEntry, NodeState, Payment, SwapInfo}; | |
use crate::{ | |
BackupStatus, BuyBitcoinRequest, BuyBitcoinResponse, | |
CheckMessageRequest, CheckMessageResponse, ConfigureNodeRequest, | |
ConnectRequest, EnvironmentType, ListPaymentsRequest, | |
LnUrlCallbackStatus, LnUrlPayRequest, LnUrlWithdrawRequest, | |
LnUrlWithdrawResult, MaxReverseSwapAmountResponse, NodeConfig, | |
NodeCredentials, OnchainPaymentLimitsResponse, OpenChannelFeeRequest, | |
OpenChannelFeeResponse, PayOnchainRequest, PayOnchainResponse, | |
PrepareOnchainPaymentRequest, PrepareOnchainPaymentResponse, | |
PrepareRedeemOnchainFundsRequest, PrepareRedeemOnchainFundsResponse, | |
PrepareRefundRequest, PrepareRefundResponse, ReceiveOnchainRequest, | |
ReceivePaymentRequest, ReceivePaymentResponse, | |
RedeemOnchainFundsRequest, RedeemOnchainFundsResponse, RefundRequest, | |
RefundResponse, ReportIssueRequest, ReverseSwapFeesRequest, | |
ReverseSwapInfo, ReverseSwapPairInfo, SendOnchainRequest, | |
SendOnchainResponse, SendPaymentRequest, SendPaymentResponse, | |
SendSpontaneousPaymentRequest, ServiceHealthCheckResponse, | |
SignMessageRequest, SignMessageResponse, StaticBackupRequest, | |
StaticBackupResponse, | |
}; | |
static BREEZ_SERVICES_INSTANCE: Lazy<Mutex<Option<Arc<BreezServices>>>> = | |
Lazy::new(|| Mutex::new(None)); | |
static NOTIFICATION_STREAM: OnceCell<StreamSink<BreezEvent>> = | |
OnceCell::new(); | |
static RT: Lazy<tokio::runtime::Runtime> = | |
Lazy::new(|| tokio::runtime::Runtime::new().unwrap()); | |
static LOG_INIT: OnceCell<bool> = OnceCell::new(); | |
/// Wrapper around [BreezServices::connect] which also initializes SDK logging | |
pub fn connect(req: ConnectRequest) -> Result<()> { | |
block_on(async move | |
{ | |
let mut locked = BREEZ_SERVICES_INSTANCE.lock().await; | |
match *locked { | |
None => { | |
let breez_services = | |
BreezServices::connect(req, | |
Box::new(BindingEventListener {})).await?; | |
*locked = Some(breez_services); | |
Ok(()) | |
} | |
Some(_) => | |
Err(ConnectError::Generic { | |
err: "Static node services already set, please call disconnect() first".into(), | |
}), | |
} | |
}).map_err(anyhow::Error::new::<ConnectError>) | |
} | |
/// Check whether node service is initialized or not | |
pub fn is_initialized() -> bool { | |
block_on(async { get_breez_services().await.is_ok() }) | |
} | |
/// See [BreezServices::sync] | |
pub fn sync() -> Result<()> { | |
block_on(async { | |
get_breez_services().await?.sync().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::node_credentials] | |
pub fn node_credentials() -> Result<Option<NodeCredentials>> { | |
block_on(async { | |
get_breez_services().await?.node_credentials().map_err(anyhow::Error::new::<SdkError>) | |
}) | |
} | |
/// See [BreezServices::node_info] | |
pub fn node_info() -> Result<NodeState> { | |
block_on(async { | |
get_breez_services().await?.node_info().map_err(anyhow::Error::new::<SdkError>) | |
}) | |
} | |
/// See [BreezServices::configure_node] | |
pub fn configure_node(req: ConfigureNodeRequest) -> Result<()> { | |
block_on(async { | |
get_breez_services().await?.configure_node(req).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// Cleanup node resources and stop the signer. | |
pub fn disconnect() -> Result<()> { | |
block_on(async { | |
get_breez_services().await?.disconnect().await?; | |
let mut locked_sdk_instance = | |
BREEZ_SERVICES_INSTANCE.lock().await; | |
*locked_sdk_instance = None; | |
Ok(()) | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::sign_message] | |
pub fn sign_message(req: SignMessageRequest) | |
-> Result<SignMessageResponse> { | |
block_on(async { | |
get_breez_services().await?.sign_message(req).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::check_message] | |
pub fn check_message(req: CheckMessageRequest) | |
-> Result<CheckMessageResponse> { | |
block_on(async { | |
get_breez_services().await?.check_message(req).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [breez_services::mnemonic_to_seed] | |
pub fn mnemonic_to_seed(phrase: String) -> Result<Vec<u8>> { | |
breez_services::mnemonic_to_seed(phrase) | |
} | |
/// See [BreezServices::default_config] | |
pub fn default_config(env_type: EnvironmentType, api_key: String, | |
node_config: NodeConfig) -> Config { | |
BreezServices::default_config(env_type, api_key, node_config) | |
} | |
/// See [BreezServices::static_backup] | |
pub fn static_backup(req: StaticBackupRequest) | |
-> Result<StaticBackupResponse> { | |
BreezServices::static_backup(req).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::service_health_check] | |
pub fn service_health_check(api_key: String) | |
-> Result<ServiceHealthCheckResponse> { | |
block_on(async { | |
BreezServices::service_health_check(api_key).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// If used, this must be called before `connect`. It can only be called once. | |
pub fn breez_events_stream(s: StreamSink<BreezEvent>) -> Result<()> { | |
NOTIFICATION_STREAM.set(s).map_err(|_| | |
::anyhow::__private::must_use({ | |
let error = | |
::anyhow::__private::format_err(format_args!("Events stream already created")); | |
error | |
}))?; | |
Ok(()) | |
} | |
/// If used, this must be called before `connect`. It can only be called once. | |
pub fn breez_log_stream(s: StreamSink<LogEntry>) -> Result<()> { | |
LOG_INIT.set(true).map_err(|_| | |
::anyhow::__private::must_use({ | |
let error = | |
::anyhow::__private::format_err(format_args!("Log stream already created")); | |
error | |
}))?; | |
BindingLogger::init(s); | |
Ok(()) | |
} | |
/// See [BreezServices::list_lsps] | |
pub fn list_lsps() -> Result<Vec<LspInformation>> { | |
block_on(async { | |
get_breez_services().await?.list_lsps().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::connect_lsp] | |
pub fn connect_lsp(lsp_id: String) -> Result<()> { | |
block_on(async { | |
get_breez_services().await?.connect_lsp(lsp_id).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::lsp_id] | |
pub fn lsp_id() -> Result<Option<String>> { | |
block_on(async { | |
get_breez_services().await?.lsp_id().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::fetch_lsp_info] | |
pub fn fetch_lsp_info(id: String) -> Result<Option<LspInformation>> { | |
block_on(async { | |
get_breez_services().await?.fetch_lsp_info(id).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::lsp_info] | |
pub fn lsp_info() -> Result<LspInformation> { | |
block_on(async { | |
get_breez_services().await?.lsp_info().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::close_lsp_channels] | |
pub fn close_lsp_channels() -> Result<()> { | |
block_on(async { | |
_ = get_breez_services().await?.close_lsp_channels().await?; | |
Ok(()) | |
}) | |
} | |
pub fn register_webhook(webhook_url: String) -> Result<()> { | |
block_on(async { | |
get_breez_services().await?.register_webhook(webhook_url).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::backup] | |
pub fn backup() -> Result<()> { | |
block_on(async { | |
get_breez_services().await?.backup().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::backup_status] | |
pub fn backup_status() -> Result<BackupStatus> { | |
block_on(async { | |
get_breez_services().await?.backup_status() | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
pub fn parse_invoice(invoice: String) -> Result<LNInvoice> { | |
invoice::parse_invoice(&invoice).map_err(|e| | |
anyhow::Error::new::<SdkError>(e.into())) | |
} | |
pub fn parse_input(input: String) -> Result<InputType> { | |
block_on(async { input_parser::parse(&input).await }) | |
} | |
/// See [BreezServices::list_payments] | |
pub fn list_payments(req: ListPaymentsRequest) -> Result<Vec<Payment>> { | |
block_on(async { | |
get_breez_services().await?.list_payments(req).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::list_payments] | |
pub fn payment_by_hash(hash: String) -> Result<Option<Payment>> { | |
block_on(async { | |
get_breez_services().await?.payment_by_hash(hash).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::set_payment_metadata] | |
pub fn set_payment_metadata(hash: String, metadata: String) | |
-> Result<()> { | |
block_on(async { | |
get_breez_services().await?.set_payment_metadata(hash, | |
metadata).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::send_payment] | |
pub fn send_payment(req: SendPaymentRequest) | |
-> Result<SendPaymentResponse> { | |
block_on(async { | |
get_breez_services().await?.send_payment(req).await | |
}).map_err(anyhow::Error::new::<SendPaymentError>) | |
} | |
/// See [BreezServices::send_spontaneous_payment] | |
pub fn send_spontaneous_payment(req: SendSpontaneousPaymentRequest) | |
-> Result<SendPaymentResponse> { | |
block_on(async { | |
get_breez_services().await?.send_spontaneous_payment(req).await | |
}).map_err(anyhow::Error::new::<SendPaymentError>) | |
} | |
/// See [BreezServices::receive_payment] | |
pub fn receive_payment(req: ReceivePaymentRequest) | |
-> Result<ReceivePaymentResponse> { | |
block_on(async { | |
get_breez_services().await?.receive_payment(req).await | |
}).map_err(anyhow::Error::new::<ReceivePaymentError>) | |
} | |
/// See [BreezServices::lnurl_pay] | |
pub fn lnurl_pay(req: LnUrlPayRequest) -> Result<LnUrlPayResult> { | |
block_on(async { | |
get_breez_services().await?.lnurl_pay(req).await | |
}).map_err(anyhow::Error::new::<LnUrlPayError>) | |
} | |
/// See [BreezServices::lnurl_withdraw] | |
pub fn lnurl_withdraw(req: LnUrlWithdrawRequest) | |
-> Result<LnUrlWithdrawResult> { | |
block_on(async { | |
get_breez_services().await?.lnurl_withdraw(req).await | |
}).map_err(anyhow::Error::new::<LnUrlWithdrawError>) | |
} | |
/// See [BreezServices::lnurl_auth] | |
pub fn lnurl_auth(req_data: LnUrlAuthRequestData) | |
-> Result<LnUrlCallbackStatus> { | |
block_on(async { | |
get_breez_services().await?.lnurl_auth(req_data).await | |
}).map_err(anyhow::Error::new::<LnUrlAuthError>) | |
} | |
/// See [BreezServices::report_issue] | |
pub fn report_issue(req: ReportIssueRequest) -> Result<()> { | |
block_on(async { | |
get_breez_services().await?.report_issue(req).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::fetch_fiat_rates] | |
pub fn fetch_fiat_rates() -> Result<Vec<Rate>> { | |
block_on(async { | |
get_breez_services().await?.fetch_fiat_rates().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::list_fiat_currencies] | |
pub fn list_fiat_currencies() -> Result<Vec<FiatCurrency>> { | |
block_on(async { | |
get_breez_services().await?.list_fiat_currencies().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::max_reverse_swap_amount] | |
pub fn max_reverse_swap_amount() -> Result<MaxReverseSwapAmountResponse> { | |
block_on(async { | |
get_breez_services().await?.max_reverse_swap_amount().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::send_onchain] | |
pub fn send_onchain(req: SendOnchainRequest) | |
-> Result<SendOnchainResponse> { | |
block_on(async { | |
get_breez_services().await?.send_onchain(req).await | |
}).map_err(anyhow::Error::new::<SendOnchainError>) | |
} | |
/// See [BreezServices::pay_onchain] | |
pub fn pay_onchain(req: PayOnchainRequest) -> Result<PayOnchainResponse> { | |
block_on(async { | |
get_breez_services().await?.pay_onchain(req).await | |
}).map_err(anyhow::Error::new::<SendOnchainError>) | |
} | |
/// See [BreezServices::receive_onchain] | |
pub fn receive_onchain(req: ReceiveOnchainRequest) -> Result<SwapInfo> { | |
block_on(async { | |
get_breez_services().await?.receive_onchain(req).await | |
}).map_err(anyhow::Error::new::<ReceiveOnchainError>) | |
} | |
/// See [BreezServices::buy_bitcoin] | |
pub fn buy_bitcoin(req: BuyBitcoinRequest) -> Result<BuyBitcoinResponse> { | |
block_on(async { | |
get_breez_services().await?.buy_bitcoin(req).await | |
}).map_err(anyhow::Error::new::<ReceiveOnchainError>) | |
} | |
/// See [BreezServices::redeem_onchain_funds] | |
pub fn redeem_onchain_funds(req: RedeemOnchainFundsRequest) | |
-> Result<RedeemOnchainFundsResponse> { | |
block_on(async { | |
get_breez_services().await?.redeem_onchain_funds(req).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::prepare_redeem_onchain_funds] | |
pub fn prepare_redeem_onchain_funds(req: PrepareRedeemOnchainFundsRequest) | |
-> Result<PrepareRedeemOnchainFundsResponse> { | |
block_on(async { | |
get_breez_services().await?.prepare_redeem_onchain_funds(req).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::list_refundables] | |
pub fn list_refundables() -> Result<Vec<SwapInfo>> { | |
block_on(async { | |
get_breez_services().await?.list_refundables().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::prepare_refund] | |
pub fn prepare_refund(req: PrepareRefundRequest) | |
-> Result<PrepareRefundResponse> { | |
block_on(async { | |
get_breez_services().await?.prepare_refund(req).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::refund] | |
pub fn refund(req: RefundRequest) -> Result<RefundResponse> { | |
block_on(async { | |
get_breez_services().await?.refund(req).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::rescan_swaps] | |
pub fn rescan_swaps() -> Result<()> { | |
block_on(async { | |
get_breez_services().await?.rescan_swaps().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::redeem_swap] | |
pub fn redeem_swap(swap_address: String) -> Result<()> { | |
block_on(async { | |
get_breez_services().await?.redeem_swap(swap_address).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::in_progress_swap] | |
pub fn in_progress_swap() -> Result<Option<SwapInfo>> { | |
block_on(async { | |
get_breez_services().await?.in_progress_swap().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::in_progress_reverse_swaps] | |
pub fn in_progress_reverse_swaps() -> Result<Vec<ReverseSwapInfo>> { | |
block_on(async { | |
get_breez_services().await?.in_progress_reverse_swaps().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::open_channel_fee] | |
pub fn open_channel_fee(req: OpenChannelFeeRequest) | |
-> Result<OpenChannelFeeResponse> { | |
block_on(async { | |
get_breez_services().await?.open_channel_fee(req).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::fetch_reverse_swap_fees] | |
pub fn fetch_reverse_swap_fees(req: ReverseSwapFeesRequest) | |
-> Result<ReverseSwapPairInfo> { | |
block_on(async { | |
get_breez_services().await?.fetch_reverse_swap_fees(req).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::onchain_payment_limits] | |
pub fn onchain_payment_limits() -> Result<OnchainPaymentLimitsResponse> { | |
block_on(async { | |
get_breez_services().await?.onchain_payment_limits().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::prepare_onchain_payment] | |
pub fn prepare_onchain_payment(req: PrepareOnchainPaymentRequest) | |
-> Result<PrepareOnchainPaymentResponse> { | |
block_on(async { | |
get_breez_services().await?.prepare_onchain_payment(req).await.map_err(anyhow::Error::new::<SendOnchainError>) | |
}) | |
} | |
/// See [BreezServices::in_progress_onchain_payments] | |
pub fn in_progress_onchain_payments() -> Result<Vec<ReverseSwapInfo>> { | |
block_on(async { | |
get_breez_services().await?.in_progress_onchain_payments().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::recommended_fees] | |
pub fn recommended_fees() -> Result<RecommendedFees> { | |
block_on(async { | |
get_breez_services().await?.recommended_fees().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::execute_dev_command] | |
pub fn execute_command(command: String) -> Result<String> { | |
block_on(async { | |
get_breez_services().await?.execute_dev_command(command).await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
/// See [BreezServices::generate_diagnostic_data] | |
pub fn generate_diagnostic_data() -> Result<String> { | |
block_on(async { | |
get_breez_services().await?.generate_diagnostic_data().await | |
}).map_err(anyhow::Error::new::<SdkError>) | |
} | |
struct BindingEventListener; | |
impl EventListener for BindingEventListener { | |
fn on_event(&self, e: BreezEvent) { | |
if let Some(stream) = NOTIFICATION_STREAM.get() { | |
let _ = stream.add(e); | |
} | |
} | |
} | |
struct BindingLogger { | |
log_stream: StreamSink<LogEntry>, | |
} | |
impl BindingLogger { | |
fn init(log_stream: StreamSink<LogEntry>) { | |
let binding_logger = BindingLogger { log_stream }; | |
log::set_boxed_logger(Box::new(binding_logger)).unwrap(); | |
log::set_max_level(LevelFilter::Trace); | |
} | |
} | |
impl log::Log for BindingLogger { | |
fn enabled(&self, m: &Metadata) -> bool { m.level() <= Level::Trace } | |
fn log(&self, record: &Record) { | |
if self.enabled(record.metadata()) { | |
let _ = | |
self.log_stream.add(LogEntry { | |
line: record.args().to_string(), | |
level: record.level().as_str().to_string(), | |
}); | |
} | |
} | |
fn flush(&self) {} | |
} | |
async fn get_breez_services() -> Result<Arc<BreezServices>, SdkError> { | |
match BREEZ_SERVICES_INSTANCE.lock().await.as_ref() { | |
None => | |
Err(SdkError::Generic { | |
err: "Node service was not initialized".into(), | |
}), | |
Some(sdk) => Ok(sdk.clone()), | |
} | |
} | |
fn block_on<F: Future>(future: F) -> F::Output { rt().block_on(future) } | |
pub(crate) fn rt() -> &'static tokio::runtime::Runtime { &RT } | |
} | |
mod breez_services { | |
use std::cmp::min; | |
use std::fs::OpenOptions; | |
use std::io::Write; | |
use std::str::FromStr; | |
use std::sync::Arc; | |
use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; | |
use anyhow::{anyhow, Result}; | |
use bip39::*; | |
use bitcoin::hashes::hex::ToHex; | |
use bitcoin::hashes::{sha256, Hash}; | |
use bitcoin::util::bip32::ChildNumber; | |
use chrono::Local; | |
use futures::TryFutureExt; | |
use log::{LevelFilter, Metadata, Record}; | |
use reqwest::{header::CONTENT_TYPE, Body}; | |
use serde_json::json; | |
use tokio::sync::{mpsc, watch, Mutex}; | |
use tokio::time::{sleep, MissedTickBehavior}; | |
use tonic::codegen::InterceptedService; | |
use tonic::metadata::errors::InvalidMetadataValue; | |
use tonic::metadata::{Ascii, MetadataValue}; | |
use tonic::service::Interceptor; | |
use tonic::transport::{Channel, Endpoint}; | |
use tonic::{Request, Status}; | |
use crate::backup::{BackupRequest, BackupTransport, BackupWatcher}; | |
use crate::chain::{ | |
ChainService, Outspend, RecommendedFees, RedundantChainService, | |
RedundantChainServiceTrait, DEFAULT_MEMPOOL_SPACE_URL, | |
}; | |
use crate::error::{ | |
LnUrlAuthError, LnUrlPayError, LnUrlWithdrawError, | |
ReceiveOnchainError, ReceiveOnchainResult, ReceivePaymentError, | |
SdkError, SdkResult, SendOnchainError, SendPaymentError, | |
}; | |
use crate::fiat::{FiatCurrency, Rate}; | |
use crate::greenlight::{GLBackupTransport, Greenlight}; | |
use crate::grpc::channel_opener_client::ChannelOpenerClient; | |
use crate::grpc::information_client::InformationClient; | |
use crate::grpc::payment_notifier_client::PaymentNotifierClient; | |
use crate::grpc::signer_client::SignerClient; | |
use crate::grpc::support_client::SupportClient; | |
use crate::grpc::swapper_client::SwapperClient; | |
use crate::grpc::{ChainApiServersRequest, PaymentInformation}; | |
use crate::input_parser::get_reqwest_client; | |
use crate::invoice::{ | |
add_routing_hints, parse_invoice, validate_network, LNInvoice, | |
RouteHint, RouteHintHop, | |
}; | |
use crate::lnurl::auth::perform_lnurl_auth; | |
use crate::lnurl::pay::model::SuccessAction::Aes; | |
use crate::lnurl::pay::model::{ | |
LnUrlPayResult, SuccessAction, SuccessActionProcessed, | |
ValidatedCallbackResponse, | |
}; | |
use crate::lnurl::pay::validate_lnurl_pay; | |
use crate::lnurl::withdraw::validate_lnurl_withdraw; | |
use crate::lsp::LspInformation; | |
use crate::models::{ | |
parse_short_channel_id, ChannelState, ClosedChannelPaymentDetails, | |
Config, EnvironmentType, FiatAPI, LnUrlCallbackStatus, LspAPI, | |
NodeState, Payment, PaymentDetails, PaymentType, ReverseSwapPairInfo, | |
ReverseSwapServiceAPI, SwapInfo, SwapperAPI, | |
INVOICE_PAYMENT_FEE_EXPIRY_SECONDS, | |
}; | |
use crate::moonpay::MoonPayApi; | |
use crate::node_api::{CreateInvoiceRequest, NodeAPI}; | |
use crate::persist::db::SqliteStorage; | |
use crate::swap_in::swap::BTCReceiveSwap; | |
use crate::swap_out::boltzswap::BoltzApi; | |
use crate::swap_out::reverseswap::{BTCSendSwap, CreateReverseSwapArg}; | |
use crate::BuyBitcoinProvider::Moonpay; | |
use crate::*; | |
use self::error::ConnectError; | |
use self::grpc::PingRequest; | |
pub type BreezServicesResult<T, E = ConnectError> = Result<T, E>; | |
/// Trait that can be used to react to various [BreezEvent]s emitted by the SDK. | |
pub trait EventListener: Send + Sync { | |
fn on_event(&self, e: BreezEvent); | |
} | |
/// Event emitted by the SDK. To listen for and react to these events, use an [EventListener] when | |
/// initializing the [BreezServices]. | |
#[allow(clippy :: large_enum_variant)] | |
pub enum BreezEvent { | |
/// Indicates that a new block has just been found | |
NewBlock { | |
block: u32, | |
}, | |
/// Indicates that a new invoice has just been paid | |
InvoicePaid { | |
details: InvoicePaidDetails, | |
}, | |
/// Indicates that the local SDK state has just been sync-ed with the remote components | |
Synced, | |
/// Indicates that an outgoing payment has been completed successfully | |
PaymentSucceed { | |
details: Payment, | |
}, | |
/// Indicates that an outgoing payment has been failed to complete | |
PaymentFailed { | |
details: PaymentFailedData, | |
}, | |
/// Indicates that the backup process has just started | |
BackupStarted, | |
/// Indicates that the backup process has just finished successfully | |
BackupSucceeded, | |
/// Indicates that the backup process has just failed | |
BackupFailed { | |
details: BackupFailedData, | |
}, | |
SwapUpdated { | |
details: SwapInfo, | |
}, | |
} | |
#[automatically_derived] | |
#[allow(clippy :: large_enum_variant)] | |
impl ::core::clone::Clone for BreezEvent { | |
#[inline] | |
fn clone(&self) -> BreezEvent { | |
match self { | |
BreezEvent::NewBlock { block: __self_0 } => | |
BreezEvent::NewBlock { | |
block: ::core::clone::Clone::clone(__self_0), | |
}, | |
BreezEvent::InvoicePaid { details: __self_0 } => | |
BreezEvent::InvoicePaid { | |
details: ::core::clone::Clone::clone(__self_0), | |
}, | |
BreezEvent::Synced => BreezEvent::Synced, | |
BreezEvent::PaymentSucceed { details: __self_0 } => | |
BreezEvent::PaymentSucceed { | |
details: ::core::clone::Clone::clone(__self_0), | |
}, | |
BreezEvent::PaymentFailed { details: __self_0 } => | |
BreezEvent::PaymentFailed { | |
details: ::core::clone::Clone::clone(__self_0), | |
}, | |
BreezEvent::BackupStarted => BreezEvent::BackupStarted, | |
BreezEvent::BackupSucceeded => BreezEvent::BackupSucceeded, | |
BreezEvent::BackupFailed { details: __self_0 } => | |
BreezEvent::BackupFailed { | |
details: ::core::clone::Clone::clone(__self_0), | |
}, | |
BreezEvent::SwapUpdated { details: __self_0 } => | |
BreezEvent::SwapUpdated { | |
details: ::core::clone::Clone::clone(__self_0), | |
}, | |
} | |
} | |
} | |
#[automatically_derived] | |
#[allow(clippy :: large_enum_variant)] | |
impl ::core::fmt::Debug for BreezEvent { | |
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { | |
match self { | |
BreezEvent::NewBlock { block: __self_0 } => | |
::core::fmt::Formatter::debug_struct_field1_finish(f, | |
"NewBlock", "block", &__self_0), | |
BreezEvent::InvoicePaid { details: __self_0 } => | |
::core::fmt::Formatter::debug_struct_field1_finish(f, | |
"InvoicePaid", "details", &__self_0), | |
BreezEvent::Synced => | |
::core::fmt::Formatter::write_str(f, "Synced"), | |
BreezEvent::PaymentSucceed { details: __self_0 } => | |
::core::fmt::Formatter::debug_struct_field1_finish(f, | |
"PaymentSucceed", "details", &__self_0), | |
BreezEvent::PaymentFailed { details: __self_0 } => | |
::core::fmt::Formatter::debug_struct_field1_finish(f, | |
"PaymentFailed", "details", &__self_0), | |
BreezEvent::BackupStarted => | |
::core::fmt::Formatter::write_str(f, "BackupStarted"), | |
BreezEvent::BackupSucceeded => | |
::core::fmt::Formatter::write_str(f, "BackupSucceeded"), | |
BreezEvent::BackupFailed { details: __self_0 } => | |
::core::fmt::Formatter::debug_struct_field1_finish(f, | |
"BackupFailed", "details", &__self_0), | |
BreezEvent::SwapUpdated { details: __self_0 } => | |
::core::fmt::Formatter::debug_struct_field1_finish(f, | |
"SwapUpdated", "details", &__self_0), | |
} | |
} | |
} | |
#[automatically_derived] | |
#[allow(clippy :: large_enum_variant)] | |
impl ::core::marker::StructuralPartialEq for BreezEvent { } | |
#[automatically_derived] | |
#[allow(clippy :: large_enum_variant)] | |
impl ::core::cmp::PartialEq for BreezEvent { | |
#[inline] | |
fn eq(&self, other: &BreezEvent) -> bool { | |
let __self_tag = ::core::intrinsics::discriminant_value(self); | |
let __arg1_tag = ::core::intrinsics::discriminant_value(other); | |
__self_tag == __arg1_tag && | |
match (self, other) { | |
(BreezEvent::NewBlock { block: __self_0 }, | |
BreezEvent::NewBlock { block: __arg1_0 }) => | |
*__self_0 == *__arg1_0, | |
(BreezEvent::InvoicePaid { details: __self_0 }, | |
BreezEvent::InvoicePaid { details: __arg1_0 }) => | |
*__self_0 == *__arg1_0, | |
(BreezEvent::PaymentSucceed { details: __self_0 }, | |
BreezEvent::PaymentSucceed { details: __arg1_0 }) => | |
*__self_0 == *__arg1_0, | |
(BreezEvent::PaymentFailed { details: __self_0 }, | |
BreezEvent::PaymentFailed { details: __arg1_0 }) => | |
*__self_0 == *__arg1_0, | |
(BreezEvent::BackupFailed { details: __self_0 }, | |
BreezEvent::BackupFailed { details: __arg1_0 }) => | |
*__self_0 == *__arg1_0, | |
(BreezEvent::SwapUpdated { details: __self_0 }, | |
BreezEvent::SwapUpdated { details: __arg1_0 }) => | |
*__self_0 == *__arg1_0, | |
_ => true, | |
} | |
} | |
} | |
pub struct BackupFailedData { | |
pub error: String, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for BackupFailedData { | |
#[inline] | |
fn clone(&self) -> BackupFailedData { | |
BackupFailedData { | |
error: ::core::clone::Clone::clone(&self.error), | |
} | |
} | |
} | |
#[automatically_derived] | |
impl ::core::fmt::Debug for BackupFailedData { | |
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { | |
::core::fmt::Formatter::debug_struct_field1_finish(f, | |
"BackupFailedData", "error", &&self.error) | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::StructuralPartialEq for BackupFailedData { } | |
#[automatically_derived] | |
impl ::core::cmp::PartialEq for BackupFailedData { | |
#[inline] | |
fn eq(&self, other: &BackupFailedData) -> bool { | |
self.error == other.error | |
} | |
} | |
pub struct PaymentFailedData { | |
pub error: String, | |
pub node_id: String, | |
pub invoice: Option<LNInvoice>, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for PaymentFailedData { | |
#[inline] | |
fn clone(&self) -> PaymentFailedData { | |
PaymentFailedData { | |
error: ::core::clone::Clone::clone(&self.error), | |
node_id: ::core::clone::Clone::clone(&self.node_id), | |
invoice: ::core::clone::Clone::clone(&self.invoice), | |
} | |
} | |
} | |
#[automatically_derived] | |
impl ::core::fmt::Debug for PaymentFailedData { | |
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { | |
::core::fmt::Formatter::debug_struct_field3_finish(f, | |
"PaymentFailedData", "error", &self.error, "node_id", | |
&self.node_id, "invoice", &&self.invoice) | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::StructuralPartialEq for PaymentFailedData { } | |
#[automatically_derived] | |
impl ::core::cmp::PartialEq for PaymentFailedData { | |
#[inline] | |
fn eq(&self, other: &PaymentFailedData) -> bool { | |
self.error == other.error && self.node_id == other.node_id && | |
self.invoice == other.invoice | |
} | |
} | |
/// Details of an invoice that has been paid, included as payload in an emitted [BreezEvent] | |
pub struct InvoicePaidDetails { | |
pub payment_hash: String, | |
pub bolt11: String, | |
pub payment: Option<Payment>, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for InvoicePaidDetails { | |
#[inline] | |
fn clone(&self) -> InvoicePaidDetails { | |
InvoicePaidDetails { | |
payment_hash: ::core::clone::Clone::clone(&self.payment_hash), | |
bolt11: ::core::clone::Clone::clone(&self.bolt11), | |
payment: ::core::clone::Clone::clone(&self.payment), | |
} | |
} | |
} | |
#[automatically_derived] | |
impl ::core::fmt::Debug for InvoicePaidDetails { | |
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { | |
::core::fmt::Formatter::debug_struct_field3_finish(f, | |
"InvoicePaidDetails", "payment_hash", &self.payment_hash, | |
"bolt11", &self.bolt11, "payment", &&self.payment) | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::StructuralPartialEq for InvoicePaidDetails { } | |
#[automatically_derived] | |
impl ::core::cmp::PartialEq for InvoicePaidDetails { | |
#[inline] | |
fn eq(&self, other: &InvoicePaidDetails) -> bool { | |
self.payment_hash == other.payment_hash && | |
self.bolt11 == other.bolt11 && self.payment == other.payment | |
} | |
} | |
pub trait LogStream: Send + Sync { | |
fn log(&self, l: LogEntry); | |
} | |
/// Request to sign a message with the node's private key. | |
pub struct SignMessageRequest { | |
/// The message to be signed by the node's private key. | |
pub message: String, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for SignMessageRequest { | |
#[inline] | |
fn clone(&self) -> SignMessageRequest { | |
SignMessageRequest { | |
message: ::core::clone::Clone::clone(&self.message), | |
} | |
} | |
} | |
#[automatically_derived] | |
impl ::core::fmt::Debug for SignMessageRequest { | |
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { | |
::core::fmt::Formatter::debug_struct_field1_finish(f, | |
"SignMessageRequest", "message", &&self.message) | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::StructuralPartialEq for SignMessageRequest { } | |
#[automatically_derived] | |
impl ::core::cmp::PartialEq for SignMessageRequest { | |
#[inline] | |
fn eq(&self, other: &SignMessageRequest) -> bool { | |
self.message == other.message | |
} | |
} | |
/// Response to a [SignMessageRequest]. | |
pub struct SignMessageResponse { | |
/// The signature that covers the message of SignMessageRequest. Zbase | |
/// encoded. | |
pub signature: String, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for SignMessageResponse { | |
#[inline] | |
fn clone(&self) -> SignMessageResponse { | |
SignMessageResponse { | |
signature: ::core::clone::Clone::clone(&self.signature), | |
} | |
} | |
} | |
#[automatically_derived] | |
impl ::core::fmt::Debug for SignMessageResponse { | |
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { | |
::core::fmt::Formatter::debug_struct_field1_finish(f, | |
"SignMessageResponse", "signature", &&self.signature) | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::StructuralPartialEq for SignMessageResponse { } | |
#[automatically_derived] | |
impl ::core::cmp::PartialEq for SignMessageResponse { | |
#[inline] | |
fn eq(&self, other: &SignMessageResponse) -> bool { | |
self.signature == other.signature | |
} | |
} | |
/// Request to check a message was signed by a specific node id. | |
pub struct CheckMessageRequest { | |
/// The message that was signed. | |
pub message: String, | |
/// The public key of the node that signed the message. | |
pub pubkey: String, | |
/// The zbase encoded signature to verify. | |
pub signature: String, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for CheckMessageRequest { | |
#[inline] | |
fn clone(&self) -> CheckMessageRequest { | |
CheckMessageRequest { | |
message: ::core::clone::Clone::clone(&self.message), | |
pubkey: ::core::clone::Clone::clone(&self.pubkey), | |
signature: ::core::clone::Clone::clone(&self.signature), | |
} | |
} | |
} | |
#[automatically_derived] | |
impl ::core::fmt::Debug for CheckMessageRequest { | |
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { | |
::core::fmt::Formatter::debug_struct_field3_finish(f, | |
"CheckMessageRequest", "message", &self.message, "pubkey", | |
&self.pubkey, "signature", &&self.signature) | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::StructuralPartialEq for CheckMessageRequest { } | |
#[automatically_derived] | |
impl ::core::cmp::PartialEq for CheckMessageRequest { | |
#[inline] | |
fn eq(&self, other: &CheckMessageRequest) -> bool { | |
self.message == other.message && self.pubkey == other.pubkey && | |
self.signature == other.signature | |
} | |
} | |
/// Response to a [CheckMessageRequest] | |
pub struct CheckMessageResponse { | |
/// Boolean value indicating whether the signature covers the message and | |
/// was signed by the given pubkey. | |
pub is_valid: bool, | |
} | |
#[automatically_derived] | |
impl ::core::clone::Clone for CheckMessageResponse { | |
#[inline] | |
fn clone(&self) -> CheckMessageResponse { | |
CheckMessageResponse { | |
is_valid: ::core::clone::Clone::clone(&self.is_valid), | |
} | |
} | |
} | |
#[automatically_derived] | |
impl ::core::fmt::Debug for CheckMessageResponse { | |
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { | |
::core::fmt::Formatter::debug_struct_field1_finish(f, | |
"CheckMessageResponse", "is_valid", &&self.is_valid) | |
} | |
} | |
#[automatically_derived] | |
impl ::core::marker::StructuralPartialEq for CheckMessageResponse { } | |
#[automatically_derived] | |
impl ::core::cmp::PartialEq for CheckMessageResponse { | |
#[inline] | |
fn eq(&self, other: &CheckMessageResponse) -> bool { | |
self.is_valid == other.is_valid | |
} | |
} | |
/// BreezServices is a facade and the single entry point for the SDK. | |
pub struct BreezServices { | |
config: Config, | |
started: Mutex<bool>, | |
node_api: Arc<dyn NodeAPI>, | |
lsp_api: Arc<dyn LspAPI>, | |
fiat_api: Arc<dyn FiatAPI>, | |
moonpay_api: Arc<dyn MoonPayApi>, | |
support_api: Arc<dyn SupportAPI>, | |
chain_service: Arc<dyn ChainService>, | |
persister: Arc<SqliteStorage>, | |
payment_receiver: Arc<PaymentReceiver>, | |
btc_receive_swapper: Arc<BTCReceiveSwap>, | |
btc_send_swapper: Arc<BTCSendSwap>, | |
event_listener: Option<Box<dyn EventListener>>, | |
backup_watcher: Arc<BackupWatcher>, | |
shutdown_sender: watch::Sender<()>, | |
shutdown_receiver: watch::Receiver<()>, | |
} | |
impl BreezServices { | |
/// `connect` initializes the SDK services, schedules the node to run in the cloud and | |
/// runs the signer. This must be called in order to start communicating with the node. | |
/// | |
/// # Arguments | |
/// | |
/// * `req` - The connect request containing the `config` SDK configuration and `seed` node private key, typically derived from the mnemonic. | |
/// When using a new `invite_code`, the seed should be derived from a new random mnemonic. | |
/// When re-using an `invite_code`, the same mnemonic should be used as when the `invite_code` was first used. | |
/// * `event_listener` - Listener to SDK events | |
/// | |
pub async fn connect(req: ConnectRequest, | |
event_listener: Box<dyn EventListener>) | |
-> BreezServicesResult<Arc<BreezServices>> { | |
let sdk_version = | |
::core::option::Option::Some("0.3.2").unwrap_or_default(); | |
let sdk_git_hash = | |
::core::option::Option::Some("53bf37d271").unwrap_or_default(); | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("SDK v{0} ({1})", | |
sdk_version, sdk_git_hash), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 215u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
let start = Instant::now(); | |
let services = | |
BreezServicesBuilder::new(req.config).seed(req.seed).build(req.restore_only, | |
Some(event_listener)).await?; | |
services.start().await?; | |
let connect_duration = start.elapsed(); | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("SDK connected in: {0:?}", | |
connect_duration), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 223u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
Ok(services) | |
} | |
/// Internal utility method that starts the BreezServices background tasks for this instance. | |
/// | |
/// It should be called once right after creating [BreezServices], since it is essential for the | |
/// communicating with the node. | |
/// | |
/// It should be called only once when the app is started, regardless whether the app is sent to | |
/// background and back. | |
async fn start(self: &Arc<BreezServices>) -> BreezServicesResult<()> { | |
let mut started = self.started.lock().await; | |
if !!*started { | |
return Err(ConnectError::Generic { | |
err: "BreezServices already started".into(), | |
}); | |
}; | |
let start = Instant::now(); | |
self.start_background_tasks().await?; | |
let start_duration = start.elapsed(); | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("SDK initialized in: {0:?}", | |
start_duration), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 246u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
*started = true; | |
Ok(()) | |
} | |
/// Trigger the stopping of BreezServices background threads for this instance. | |
pub async fn disconnect(&self) -> SdkResult<()> { | |
let mut started = self.started.lock().await; | |
if !*started { | |
return Err(SdkError::Generic { | |
err: "BreezServices is not running".into(), | |
}); | |
}; | |
self.shutdown_sender.send(()).map_err(|e| | |
SdkError::Generic { | |
err: { | |
let res = | |
::alloc::fmt::format(format_args!("Shutdown failed: {0}", | |
e)); | |
res | |
}, | |
})?; | |
*started = false; | |
Ok(()) | |
} | |
/// Configure the node | |
/// | |
/// This calls [NodeAPI::configure_node] to make changes to the active node's configuration. | |
/// Configuring the [ConfigureNodeRequest::close_to_address] only needs to be done one time | |
/// when registering the node or when the close to address need to be changed. Otherwise it is | |
/// stored by the node and used when neccessary. | |
pub async fn configure_node(&self, req: ConfigureNodeRequest) | |
-> SdkResult<()> { | |
Ok(self.node_api.configure_node(req.close_to_address).await?) | |
} | |
/// Pay a bolt11 invoice | |
/// | |
/// Calling `send_payment` ensures that the payment is not already completed, if so it will result in an error. | |
/// If the invoice doesn't specify an amount, the amount is taken from the `amount_msat` arg. | |
pub async fn send_payment(&self, req: SendPaymentRequest) | |
-> Result<SendPaymentResponse, SendPaymentError> { | |
self.start_node().await?; | |
let parsed_invoice = parse_invoice(req.bolt11.as_str())?; | |
let invoice_amount_msat = | |
parsed_invoice.amount_msat.unwrap_or_default(); | |
let provided_amount_msat = req.amount_msat.unwrap_or_default(); | |
validate_network(parsed_invoice.clone(), self.config.network)?; | |
let amount_msat = | |
match (provided_amount_msat, invoice_amount_msat) { | |
(0, 0) => { | |
return Err(SendPaymentError::InvalidAmount { | |
err: "Amount must be provided when paying a zero invoice".into(), | |
}) | |
} | |
(0, amount_msat) => amount_msat, | |
(amount_msat, 0) => amount_msat, | |
(_amount_1, _amount_2) => { | |
return Err(SendPaymentError::InvalidAmount { | |
err: "Amount should not be provided when paying a non zero invoice".into(), | |
}) | |
} | |
}; | |
match self.persister.get_completed_payment_by_hash(&parsed_invoice.payment_hash)? | |
{ | |
Some(_) => Err(SendPaymentError::AlreadyPaid), | |
None => { | |
self.persist_pending_payment(&parsed_invoice, amount_msat, | |
req.label.clone())?; | |
let payment_res = | |
self.node_api.send_payment(parsed_invoice.bolt11.clone(), | |
req.amount_msat, req.label).map_err(Into::into).await; | |
let payment = | |
self.on_payment_completed(parsed_invoice.payee_pubkey.clone(), | |
Some(parsed_invoice), payment_res).await?; | |
Ok(SendPaymentResponse { payment }) | |
} | |
} | |
} | |
/// Pay directly to a node id using keysend | |
pub async fn send_spontaneous_payment(&self, | |
req: SendSpontaneousPaymentRequest) | |
-> Result<SendPaymentResponse, SendPaymentError> { | |
self.start_node().await?; | |
let payment_res = | |
self.node_api.send_spontaneous_payment(req.node_id.clone(), | |
req.amount_msat, req.extra_tlvs, | |
req.label).map_err(Into::into).await; | |
let payment = | |
self.on_payment_completed(req.node_id, None, | |
payment_res).await?; | |
Ok(SendPaymentResponse { payment }) | |
} | |
/// Second step of LNURL-pay. The first step is `parse()`, which also validates the LNURL destination | |
/// and generates the `LnUrlPayRequest` payload needed here. | |
/// | |
/// This call will validate the `amount_msat` and `comment` parameters of `req` against the parameters | |
/// of the LNURL endpoint (`req_data`). If they match the endpoint requirements, the LNURL payment | |
/// is made. | |
/// | |
/// This method will return an [anyhow::Error] when any validation check fails. | |
pub async fn lnurl_pay(&self, req: LnUrlPayRequest) | |
-> Result<LnUrlPayResult, LnUrlPayError> { | |
match validate_lnurl_pay(req.amount_msat, req.comment, | |
req.data.clone(), self.config.network).await? { | |
ValidatedCallbackResponse::EndpointError { data: e } => { | |
Ok(LnUrlPayResult::EndpointError { data: e }) | |
} | |
ValidatedCallbackResponse::EndpointSuccess { data: cb } => { | |
let pay_req = | |
SendPaymentRequest { | |
bolt11: cb.pr.clone(), | |
amount_msat: None, | |
label: req.payment_label, | |
}; | |
let invoice = parse_invoice(cb.pr.as_str())?; | |
let payment = | |
match self.send_payment(pay_req).await { | |
Ok(p) => Ok(p), | |
e @ | |
Err(SendPaymentError::InvalidInvoice { .. } | | |
SendPaymentError::ServiceConnectivity { .. }) => e, | |
Err(e) => { | |
return Ok(LnUrlPayResult::PayError { | |
data: LnUrlPayErrorData { | |
payment_hash: invoice.payment_hash, | |
reason: e.to_string(), | |
}, | |
}) | |
} | |
}?.payment; | |
let details = | |
match &payment.details { | |
PaymentDetails::ClosedChannel { .. } => { | |
return Err(LnUrlPayError::Generic { | |
err: "Payment lookup found unexpected payment type".into(), | |
}); | |
} | |
PaymentDetails::Ln { data } => data, | |
}; | |
let maybe_sa_processed: Option<SuccessActionProcessed> = | |
match cb.success_action { | |
Some(sa) => { | |
let processed_sa = | |
match sa { | |
Aes(data) => { | |
let preimage = | |
sha256::Hash::from_str(&details.payment_preimage)?; | |
let preimage_arr: [u8; 32] = preimage.into_inner(); | |
let result = | |
match (data, &preimage_arr).try_into() { | |
Ok(data) => AesSuccessActionDataResult::Decrypted { data }, | |
Err(e) => | |
AesSuccessActionDataResult::ErrorStatus { | |
reason: e.to_string(), | |
}, | |
}; | |
SuccessActionProcessed::Aes { result } | |
} | |
SuccessAction::Message(data) => { | |
SuccessActionProcessed::Message { data } | |
} | |
SuccessAction::Url(data) => | |
SuccessActionProcessed::Url { data }, | |
}; | |
Some(processed_sa) | |
} | |
None => None, | |
}; | |
let lnurl_pay_domain = | |
match req.data.ln_address { | |
Some(_) => None, | |
None => Some(req.data.domain), | |
}; | |
self.persister.insert_payment_external_info(&details.payment_hash, | |
PaymentExternalInfo { | |
lnurl_pay_success_action: maybe_sa_processed.clone(), | |
lnurl_pay_domain, | |
lnurl_metadata: Some(req.data.metadata_str), | |
ln_address: req.data.ln_address, | |
lnurl_withdraw_endpoint: None, | |
attempted_amount_msat: invoice.amount_msat, | |
attempted_error: None, | |
})?; | |
Ok(LnUrlPayResult::EndpointSuccess { | |
data: LnUrlPaySuccessData { | |
payment, | |
success_action: maybe_sa_processed, | |
}, | |
}) | |
} | |
} | |
} | |
/// Second step of LNURL-withdraw. The first step is `parse()`, which also validates the LNURL destination | |
/// and generates the `LnUrlWithdrawRequest` payload needed here. | |
/// | |
/// This call will validate the given `amount_msat` against the parameters | |
/// of the LNURL endpoint (`data`). If they match the endpoint requirements, the LNURL withdraw | |
/// request is made. A successful result here means the endpoint started the payment. | |
pub async fn lnurl_withdraw(&self, req: LnUrlWithdrawRequest) | |
-> Result<LnUrlWithdrawResult, LnUrlWithdrawError> { | |
let invoice = | |
self.receive_payment(ReceivePaymentRequest { | |
amount_msat: req.amount_msat, | |
description: req.description.unwrap_or_default(), | |
use_description_hash: Some(false), | |
..Default::default() | |
}).await?.ln_invoice; | |
let lnurl_w_endpoint = req.data.callback.clone(); | |
let res = validate_lnurl_withdraw(req.data, invoice).await?; | |
if let LnUrlWithdrawResult::Ok { ref data } = res { | |
self.persister.insert_payment_external_info(&data.invoice.payment_hash, | |
PaymentExternalInfo { | |
lnurl_pay_success_action: None, | |
lnurl_pay_domain: None, | |
lnurl_metadata: None, | |
ln_address: None, | |
lnurl_withdraw_endpoint: Some(lnurl_w_endpoint), | |
attempted_amount_msat: None, | |
attempted_error: None, | |
})?; | |
} | |
Ok(res) | |
} | |
/// Third and last step of LNURL-auth. The first step is `parse()`, which also validates the LNURL destination | |
/// and generates the `LnUrlAuthRequestData` payload needed here. The second step is user approval of auth action. | |
/// | |
/// This call will sign `k1` of the LNURL endpoint (`req_data`) on `secp256k1` using `linkingPrivKey` and DER-encodes the signature. | |
/// If they match the endpoint requirements, the LNURL auth request is made. A successful result here means the client signature is verified. | |
pub async fn lnurl_auth(&self, req_data: LnUrlAuthRequestData) | |
-> Result<LnUrlCallbackStatus, LnUrlAuthError> { | |
Ok(perform_lnurl_auth(self.node_api.clone(), req_data).await?) | |
} | |
/// Creates an bolt11 payment request. | |
/// This also works when the node doesn't have any channels and need inbound liquidity. | |
/// In such case when the invoice is paid a new zero-conf channel will be open by the LSP, | |
/// providing inbound liquidity and the payment will be routed via this new channel. | |
pub async fn receive_payment(&self, req: ReceivePaymentRequest) | |
-> Result<ReceivePaymentResponse, ReceivePaymentError> { | |
self.payment_receiver.receive_payment(req).await | |
} | |
/// Report an issue. | |
/// | |
/// Calling `report_issue` with a [ReportIssueRequest] enum param sends an issue report using the Support API. | |
/// - [ReportIssueRequest::PaymentFailure] sends a payment failure report to the Support API | |
/// using the provided `payment_hash` to lookup the failed payment and the current [NodeState]. | |
pub async fn report_issue(&self, req: ReportIssueRequest) | |
-> SdkResult<()> { | |
match self.persister.get_node_state()? { | |
Some(node_state) => | |
match req { | |
ReportIssueRequest::PaymentFailure { data } => { | |
let payment = | |
self.persister.get_payment_by_hash(&data.payment_hash)?.ok_or(SdkError::Generic { | |
err: "Payment not found".into(), | |
})?; | |
let lsp_id = self.persister.get_lsp_id()?; | |
self.support_api.report_payment_failure(node_state, payment, | |
lsp_id, data.comment).await | |
} | |
}, | |
None => | |
Err(SdkError::Generic { | |
err: "Node state not found".into(), | |
}), | |
} | |
} | |
/// Retrieve the decrypted credentials from the node. | |
pub fn node_credentials(&self) -> SdkResult<Option<NodeCredentials>> { | |
Ok(self.node_api.node_credentials()?) | |
} | |
/// Retrieve the node state from the persistent storage. | |
/// | |
/// Fail if it could not be retrieved or if `None` was found. | |
pub fn node_info(&self) -> SdkResult<NodeState> { | |
self.persister.get_node_state()?.ok_or(SdkError::Generic { | |
err: "Node info not found".into(), | |
}) | |
} | |
/// Sign given message with the private key of the node id. Returns a zbase | |
/// encoded signature. | |
pub async fn sign_message(&self, req: SignMessageRequest) | |
-> SdkResult<SignMessageResponse> { | |
let signature = self.node_api.sign_message(&req.message).await?; | |
Ok(SignMessageResponse { signature }) | |
} | |
/// Check whether given message was signed by the private key or the given | |
/// pubkey and the signature (zbase encoded) is valid. | |
pub async fn check_message(&self, req: CheckMessageRequest) | |
-> SdkResult<CheckMessageResponse> { | |
let is_valid = | |
self.node_api.check_message(&req.message, &req.pubkey, | |
&req.signature).await?; | |
Ok(CheckMessageResponse { is_valid }) | |
} | |
/// Retrieve the node up to date BackupStatus | |
pub fn backup_status(&self) -> SdkResult<BackupStatus> { | |
let backup_time = self.persister.get_last_backup_time()?; | |
let sync_request = self.persister.get_last_sync_request()?; | |
Ok(BackupStatus { | |
last_backup_time: backup_time, | |
backed_up: sync_request.is_none(), | |
}) | |
} | |
/// Force running backup | |
pub async fn backup(&self) -> SdkResult<()> { | |
let (on_complete, mut on_complete_receiver) = | |
mpsc::channel::<Result<()>>(1); | |
let req = BackupRequest::with(on_complete, true); | |
self.backup_watcher.request_backup(req).await?; | |
match on_complete_receiver.recv().await { | |
Some(res) => | |
res.map_err(|e| | |
SdkError::Generic { | |
err: { | |
let res = | |
::alloc::fmt::format(format_args!("Backup failed: {0}", e)); | |
res | |
}, | |
}), | |
None => | |
Err(SdkError::Generic { | |
err: "Backup process failed to complete".into(), | |
}), | |
} | |
} | |
/// List payments matching the given filters, as retrieved from persistent storage | |
pub async fn list_payments(&self, req: ListPaymentsRequest) | |
-> SdkResult<Vec<Payment>> { | |
Ok(self.persister.list_payments(req)?) | |
} | |
/// Fetch a specific payment by its hash. | |
pub async fn payment_by_hash(&self, hash: String) | |
-> SdkResult<Option<Payment>> { | |
Ok(self.persister.get_payment_by_hash(&hash)?) | |
} | |
/// Set the external metadata of a payment as a valid JSON string | |
pub async fn set_payment_metadata(&self, hash: String, | |
metadata: String) -> SdkResult<()> { | |
Ok(self.persister.set_payment_external_metadata(hash, metadata)?) | |
} | |
/// Redeem on-chain funds from closed channels to the specified on-chain address, with the given feerate | |
pub async fn redeem_onchain_funds(&self, | |
req: RedeemOnchainFundsRequest) | |
-> SdkResult<RedeemOnchainFundsResponse> { | |
self.start_node().await?; | |
let txid = | |
self.node_api.redeem_onchain_funds(req.to_address, | |
req.sat_per_vbyte).await?; | |
self.sync().await?; | |
Ok(RedeemOnchainFundsResponse { txid }) | |
} | |
pub async fn prepare_redeem_onchain_funds(&self, | |
req: PrepareRedeemOnchainFundsRequest) | |
-> SdkResult<PrepareRedeemOnchainFundsResponse> { | |
self.start_node().await?; | |
let response = | |
self.node_api.prepare_redeem_onchain_funds(req).await?; | |
Ok(response) | |
} | |
/// Fetch live rates of fiat currencies, sorted by name | |
pub async fn fetch_fiat_rates(&self) -> SdkResult<Vec<Rate>> { | |
self.fiat_api.fetch_fiat_rates().await | |
} | |
/// List all supported fiat currencies for which there is a known exchange rate. | |
/// List is sorted by the canonical name of the currency | |
pub async fn list_fiat_currencies(&self) | |
-> SdkResult<Vec<FiatCurrency>> { | |
self.fiat_api.list_fiat_currencies().await | |
} | |
/// List available LSPs that can be selected by the user | |
pub async fn list_lsps(&self) -> SdkResult<Vec<LspInformation>> { | |
self.lsp_api.list_lsps(self.node_info()?.id).await | |
} | |
/// Select the LSP to be used and provide inbound liquidity | |
pub async fn connect_lsp(&self, lsp_id: String) -> SdkResult<()> { | |
match self.list_lsps().await?.iter().any(|lsp| lsp.id == lsp_id) { | |
true => { | |
self.persister.set_lsp_id(lsp_id)?; | |
self.sync().await?; | |
if let Some(webhook_url) = self.persister.get_webhook_url()? | |
{ | |
self.register_payment_notifications(webhook_url).await? | |
} | |
Ok(()) | |
} | |
false => | |
Err(SdkError::Generic { | |
err: { | |
let res = | |
::alloc::fmt::format(format_args!("Unknown LSP: {0}", | |
lsp_id)); | |
res | |
}, | |
}), | |
} | |
} | |
/// Get the current LSP's ID | |
pub async fn lsp_id(&self) -> SdkResult<Option<String>> { | |
Ok(self.persister.get_lsp_id()?) | |
} | |
/// Convenience method to look up [LspInformation] for a given LSP ID | |
pub async fn fetch_lsp_info(&self, id: String) | |
-> SdkResult<Option<LspInformation>> { | |
Ok(get_lsp_by_id(self.persister.clone(), self.lsp_api.clone(), | |
id.as_str()).await?) | |
} | |
/// Gets the fees required to open a channel for a given amount. | |
/// If no channel is needed, returns 0. If a channel is needed, returns the required opening fees. | |
pub async fn open_channel_fee(&self, req: OpenChannelFeeRequest) | |
-> SdkResult<OpenChannelFeeResponse> { | |
let lsp_info = self.lsp_info().await?; | |
let fee_params = | |
lsp_info.cheapest_open_channel_fee(req.expiry.unwrap_or(INVOICE_PAYMENT_FEE_EXPIRY_SECONDS))?.clone(); | |
let node_state = self.node_info()?; | |
let fee_msat = | |
req.amount_msat.map(|req_amount_msat| | |
{ | |
match node_state.inbound_liquidity_msats >= req_amount_msat | |
{ | |
true => 0, | |
false => | |
fee_params.get_channel_fees_msat_for(req_amount_msat), | |
} | |
}); | |
Ok(OpenChannelFeeResponse { fee_msat, fee_params }) | |
} | |
/// Close all channels with the current LSP. | |
/// | |
/// Should be called when the user wants to close all the channels. | |
pub async fn close_lsp_channels(&self) -> SdkResult<Vec<String>> { | |
self.start_node().await?; | |
let lsp = self.lsp_info().await?; | |
let tx_ids = self.node_api.close_peer_channels(lsp.pubkey).await?; | |
self.sync().await?; | |
Ok(tx_ids) | |
} | |
/// Onchain receive swap API | |
/// | |
/// Create and start a new swap. A user-selected [OpeningFeeParams] can be optionally set in the argument. | |
/// If set, and the operation requires a new channel, the SDK will try to use the given fee params. | |
/// | |
/// Since we only allow one in-progress swap this method will return error if there is currently | |
/// a swap waiting for confirmation to be redeemed and by that complete the swap. | |
/// In such case the [BreezServices::in_progress_swap] can be used to query the live swap status. | |
/// | |
/// The returned [SwapInfo] contains the created swap details. The channel opening fees are | |
/// available at [SwapInfo::channel_opening_fees]. | |
pub async fn receive_onchain(&self, req: ReceiveOnchainRequest) | |
-> ReceiveOnchainResult<SwapInfo> { | |
if let Some(in_progress) = self.in_progress_swap().await? { | |
return Err(ReceiveOnchainError::SwapInProgress { | |
err: { | |
let res = | |
::alloc::fmt::format(format_args!("A swap was detected for address {0}. Use in_progress_swap method to get the current swap state", | |
in_progress.bitcoin_address)); | |
res | |
}, | |
}); | |
} | |
let channel_opening_fees = | |
req.opening_fee_params.unwrap_or(self.lsp_info().await?.cheapest_open_channel_fee(SWAP_PAYMENT_FEE_EXPIRY_SECONDS)?.clone()); | |
let swap_info = | |
self.btc_receive_swapper.create_swap_address(channel_opening_fees).await?; | |
if let Some(webhook_url) = self.persister.get_webhook_url()? { | |
let address = &swap_info.bitcoin_address; | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Registering for swap tx notification for address {0}", | |
address), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 767u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
self.register_swap_tx_notification(address, | |
&webhook_url).await?; | |
} | |
Ok(swap_info) | |
} | |
/// Returns an optional in-progress [SwapInfo]. | |
/// A [SwapInfo] is in-progress if it is waiting for confirmation to be redeemed and complete the swap. | |
pub async fn in_progress_swap(&self) -> SdkResult<Option<SwapInfo>> { | |
let tip = self.chain_service.current_tip().await?; | |
self.btc_receive_swapper.rescan_monitored_swaps(tip).await?; | |
let in_progress = self.btc_receive_swapper.list_in_progress()?; | |
if !in_progress.is_empty() { | |
return Ok(Some(in_progress[0].clone())); | |
} | |
Ok(None) | |
} | |
/// Iterate all historical swap addresses and fetch their current status from the blockchain. | |
/// The status is then updated in the persistent storage. | |
pub async fn rescan_swaps(&self) -> SdkResult<()> { | |
let tip = self.chain_service.current_tip().await?; | |
self.btc_receive_swapper.rescan_swaps(tip).await?; | |
Ok(()) | |
} | |
/// Redeems an individual swap. | |
/// | |
/// To be used only in the context of mobile notifications, where the notification triggers | |
/// an individual redeem. | |
/// | |
/// This is taken care of automatically in the context of typical SDK usage. | |
pub async fn redeem_swap(&self, swap_address: String) | |
-> SdkResult<()> { | |
let tip = self.chain_service.current_tip().await?; | |
self.btc_receive_swapper.refresh_swap_on_chain_status(swap_address.clone(), | |
tip).await?; | |
self.btc_receive_swapper.redeem_swap(swap_address).await?; | |
Ok(()) | |
} | |
/// Lookup the reverse swap fees (see [ReverseSwapServiceAPI::fetch_reverse_swap_fees]). | |
/// | |
/// If the request has the `send_amount_sat` set, the returned [ReverseSwapPairInfo] will have | |
/// the total estimated fees for the reverse swap in its `total_estimated_fees`. | |
/// | |
/// If, in addition to that, the request has the `claim_tx_feerate` set as well, then | |
/// - `fees_claim` will have the actual claim transaction fees, instead of an estimate, and | |
/// - `total_estimated_fees` will have the actual total fees for the given parameters | |
/// | |
/// ### Errors | |
/// | |
/// If a `send_amount_sat` is specified in the `req`, but is outside the `min` and `max`, | |
/// this will result in an error. If you are not sure what are the `min` and `max`, please call | |
/// this with `send_amount_sat` as `None` first, then repeat the call with the desired amount. | |
pub async fn fetch_reverse_swap_fees(&self, | |
req: ReverseSwapFeesRequest) -> SdkResult<ReverseSwapPairInfo> { | |
let mut res = | |
self.btc_send_swapper.fetch_reverse_swap_fees().await?; | |
if let Some(amt) = req.send_amount_sat { | |
if !(amt <= res.max) { | |
return Err(SdkError::generic("Send amount is too high")); | |
}; | |
if !(amt >= res.min) { | |
return Err(SdkError::generic("Send amount is too low")); | |
}; | |
if let Some(claim_tx_feerate) = req.claim_tx_feerate { | |
res.fees_claim = | |
BTCSendSwap::calculate_claim_tx_fee(claim_tx_feerate)?; | |
} | |
let service_fee_sat = | |
swap_out::get_service_fee_sat(amt, res.fees_percentage); | |
res.total_fees = | |
Some(service_fee_sat + res.fees_lockup + res.fees_claim); | |
} | |
Ok(res) | |
} | |
/// Returns the max amount that can be sent on-chain using the send_onchain method. | |
/// The returned amount is the sum of the max amount that can be sent on each channel | |
/// minus the expected fees. | |
/// This is possible since the route to the swapper node is known in advance and is expected | |
/// to consist of maximum 3 hops. | |
/// | |
/// Deprecated. Please use [BreezServices::onchain_payment_limits] instead. | |
pub async fn max_reverse_swap_amount(&self) | |
-> SdkResult<MaxReverseSwapAmountResponse> { | |
let last_hop = | |
self.btc_send_swapper.last_hop_for_payment().await?; | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("max_reverse_swap_amount last_hop={0:?}", | |
last_hop), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 854u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
let max_to_pay = | |
self.node_api.max_sendable_amount(Some(hex::decode(&last_hop.src_node_id).map_err(|e| | |
SdkError::Generic { | |
err: { | |
let res = | |
::alloc::fmt::format(format_args!("Failed to decode hex node_id: {0}", | |
e)); | |
res | |
}, | |
})?), swap_out::reverseswap::MAX_PAYMENT_PATH_HOPS, | |
Some(&last_hop)).await?; | |
let total_msat: u64 = | |
max_to_pay.into_iter().map(|m| m.amount_msat).sum(); | |
let total_sat = total_msat / 1000; | |
Ok(MaxReverseSwapAmountResponse { total_sat }) | |
} | |
/// Creates a reverse swap and attempts to pay the HODL invoice | |
/// | |
/// Deprecated. Please use [BreezServices::pay_onchain] instead. | |
pub async fn send_onchain(&self, req: SendOnchainRequest) | |
-> Result<SendOnchainResponse, SendOnchainError> { | |
let reverse_swap_info = | |
self.pay_onchain_common(CreateReverseSwapArg::V1(req)).await?; | |
Ok(SendOnchainResponse { reverse_swap_info }) | |
} | |
/// Returns the blocking [ReverseSwapInfo]s that are in progress | |
/// | |
/// Deprecated. Please use [BreezServices::in_progress_onchain_payments] instead. | |
pub async fn in_progress_reverse_swaps(&self) | |
-> SdkResult<Vec<ReverseSwapInfo>> { | |
let full_rsis = self.btc_send_swapper.list_blocking().await?; | |
let mut rsis = ::alloc::vec::Vec::new(); | |
for full_rsi in full_rsis { | |
let rsi = | |
self.btc_send_swapper.convert_reverse_swap_info(full_rsi).await?; | |
rsis.push(rsi); | |
} | |
Ok(rsis) | |
} | |
/// list non-completed expired swaps that should be refunded by calling [BreezServices::refund] | |
pub async fn list_refundables(&self) -> SdkResult<Vec<SwapInfo>> { | |
Ok(self.btc_receive_swapper.list_refundables()?) | |
} | |
/// Prepares a refund transaction for a failed/expired swap. | |
/// | |
/// Can optionally be used before [BreezServices::refund] to know how much fees will be paid | |
/// to perform the refund. | |
pub async fn prepare_refund(&self, req: PrepareRefundRequest) | |
-> SdkResult<PrepareRefundResponse> { | |
Ok(self.btc_receive_swapper.prepare_refund_swap(req).await?) | |
} | |
/// Construct and broadcast a refund transaction for a failed/expired swap | |
/// | |
/// Returns the txid of the refund transaction. | |
pub async fn refund(&self, req: RefundRequest) | |
-> SdkResult<RefundResponse> { | |
Ok(self.btc_receive_swapper.refund_swap(req).await?) | |
} | |
pub async fn onchain_payment_limits(&self) | |
-> SdkResult<OnchainPaymentLimitsResponse> { | |
let fee_info = | |
self.btc_send_swapper.fetch_reverse_swap_fees().await?; | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("Reverse swap pair info: {0:?}", | |
fee_info), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 933u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
let max_amt_current_channels = | |
self.max_reverse_swap_amount().await?; | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("Max send amount possible with current channels: {0:?}", | |
max_amt_current_channels), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 935u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
let composite_max = | |
min(fee_info.max, max_amt_current_channels.total_sat); | |
let (min_sat, max_sat) = | |
match composite_max < fee_info.min { | |
true => { | |
{ | |
let lvl = ::log::Level::Warn; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Reverse swap max < min, setting limits to zero because no reverse swap is possible"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 940u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
(0, 0) | |
} | |
false => (fee_info.min, composite_max), | |
}; | |
Ok(OnchainPaymentLimitsResponse { min_sat, max_sat }) | |
} | |
/// Supersedes [BreezServices::fetch_reverse_swap_fees] | |
/// | |
/// ### Errors | |
/// | |
/// - `OutOfRange`: This indicates the send amount is outside the range of minimum and maximum | |
/// values returned by [BreezServices::onchain_payment_limits]. When you get this error, please first call | |
/// [BreezServices::onchain_payment_limits] to get the new limits, before calling this method again. | |
pub async fn prepare_onchain_payment(&self, | |
req: PrepareOnchainPaymentRequest) | |
-> Result<PrepareOnchainPaymentResponse, SendOnchainError> { | |
let fees_claim = | |
BTCSendSwap::calculate_claim_tx_fee(req.claim_tx_feerate)?; | |
BTCSendSwap::validate_claim_tx_fee(fees_claim)?; | |
let fee_info = | |
self.btc_send_swapper.fetch_reverse_swap_fees().await?; | |
let fees_lockup = fee_info.fees_lockup; | |
let p = fee_info.fees_percentage; | |
let fees_claim = | |
BTCSendSwap::calculate_claim_tx_fee(req.claim_tx_feerate)?; | |
let (send_amt, recv_amt) = | |
match req.amount_type { | |
SwapAmountType::Send => { | |
let temp_send_amt = req.amount_sat; | |
let service_fees = | |
swap_out::get_service_fee_sat(temp_send_amt, p); | |
let total_fees = service_fees + fees_lockup + fees_claim; | |
if !(temp_send_amt > total_fees) { | |
return Err(SendOnchainError::generic("Send amount is not high enough to account for all fees")); | |
}; | |
(temp_send_amt, temp_send_amt - total_fees) | |
} | |
SwapAmountType::Receive => { | |
let temp_recv_amt = req.amount_sat; | |
let send_amt_minus_service_fee = | |
temp_recv_amt + fees_lockup + fees_claim; | |
let temp_send_amt = | |
swap_out::get_invoice_amount_sat(send_amt_minus_service_fee, | |
p); | |
(temp_send_amt, temp_recv_amt) | |
} | |
}; | |
let is_send_in_range = | |
send_amt >= fee_info.min && send_amt <= fee_info.max; | |
if !is_send_in_range { | |
return Err(SendOnchainError::OutOfRange); | |
}; | |
Ok(PrepareOnchainPaymentResponse { | |
fees_hash: fee_info.fees_hash.clone(), | |
fees_percentage: p, | |
fees_lockup, | |
fees_claim, | |
sender_amount_sat: send_amt, | |
recipient_amount_sat: recv_amt, | |
total_fees: send_amt - recv_amt, | |
}) | |
} | |
/// Creates a reverse swap and attempts to pay the HODL invoice | |
/// | |
/// Supersedes [BreezServices::send_onchain] | |
pub async fn pay_onchain(&self, req: PayOnchainRequest) | |
-> Result<PayOnchainResponse, SendOnchainError> { | |
if !(req.prepare_res.sender_amount_sat > | |
req.prepare_res.recipient_amount_sat) { | |
return Err(SendOnchainError::generic("Send amount must be bigger than receive amount")); | |
}; | |
let reverse_swap_info = | |
self.pay_onchain_common(CreateReverseSwapArg::V2(req)).await?; | |
Ok(PayOnchainResponse { reverse_swap_info }) | |
} | |
async fn pay_onchain_common(&self, req: CreateReverseSwapArg) | |
-> SdkResult<ReverseSwapInfo> { | |
if !self.in_progress_reverse_swaps().await?.is_empty() { | |
return Err(SdkError::Generic { | |
err: "You can only start a new one after after the ongoing ones finish. \ | |
Use the in_progress_reverse_swaps method to get an overview of currently ongoing reverse swaps".into(), | |
}); | |
}; | |
let full_rsi = | |
self.btc_send_swapper.create_reverse_swap(req).await?; | |
let reverse_swap_info = | |
self.btc_send_swapper.convert_reverse_swap_info(full_rsi).await?; | |
self.do_sync(true).await?; | |
Ok(reverse_swap_info) | |
} | |
/// Returns the blocking [ReverseSwapInfo]s that are in progress. | |
/// | |
/// Supersedes [BreezServices::in_progress_reverse_swaps] | |
pub async fn in_progress_onchain_payments(&self) | |
-> SdkResult<Vec<ReverseSwapInfo>> { | |
self.in_progress_reverse_swaps().await | |
} | |
/// Execute a command directly on the NodeAPI interface. | |
/// Mainly used to debugging. | |
pub async fn execute_dev_command(&self, command: String) | |
-> SdkResult<String> { | |
Ok(self.node_api.execute_command(command).await?) | |
} | |
pub async fn generate_diagnostic_data(&self) -> SdkResult<String> { | |
let node_data = self.node_api.generate_diagnostic_data().await?; | |
let sdk_data = self.generate_sdk_diagnostic_data().await?; | |
Ok({ | |
let res = | |
::alloc::fmt::format(format_args!("Node Data\n{0}\n\nSDK Data\n{1}", | |
node_data, sdk_data)); | |
res | |
}) | |
} | |
/// This method sync the local state with the remote node state. | |
/// The synced items are as follows: | |
/// * node state - General information about the node and its liquidity status | |
/// * channels - The list of channels and their status | |
/// * payments - The incoming/outgoing payments | |
pub async fn sync(&self) -> SdkResult<()> { | |
Ok(self.do_sync(false).await?) | |
} | |
async fn do_sync(&self, balance_changed: bool) -> Result<()> { | |
let start = Instant::now(); | |
let node_pubkey = self.node_api.start().await?; | |
self.connect_lsp_peer(node_pubkey).await?; | |
let since_timestamp = | |
self.persister.get_last_sync_time()?.unwrap_or(0); | |
let new_data = | |
&self.node_api.pull_changed(since_timestamp, | |
balance_changed).await?; | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("pull changed time={0:?} {1:?}", | |
since_timestamp, new_data.payments), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1083u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
self.persister.set_node_state(&new_data.node_state)?; | |
let channels_before_update = self.persister.list_channels()?; | |
self.persister.update_channels(&new_data.channels)?; | |
let channels_after_update = self.persister.list_channels()?; | |
if channels_before_update.len() != channels_after_update.len() { | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("fetching static backup file from node"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1097u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
let backup = self.node_api.static_backup().await?; | |
self.persister.set_static_backup(backup)?; | |
} | |
let mut closed_channel_payments: Vec<Payment> = | |
::alloc::vec::Vec::new(); | |
for closed_channel in | |
self.persister.list_channels()?.into_iter().filter(|c| | |
{ | |
c.state == ChannelState::Closed || | |
c.state == ChannelState::PendingClose | |
}) { | |
let closed_channel_tx = | |
self.closed_channel_to_transaction(closed_channel).await?; | |
closed_channel_payments.push(closed_channel_tx); | |
} | |
let mut payments = closed_channel_payments; | |
payments.extend(new_data.payments.clone()); | |
self.persister.insert_or_update_payments(&payments, true)?; | |
let duration = start.elapsed(); | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("Sync duration: {0:?}", | |
duration), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1118u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
if let Ok(last_payment_timestamp) = | |
self.persister.last_payment_timestamp() { | |
self.persister.set_last_sync_time(last_payment_timestamp)?; | |
} | |
self.notify_event_listeners(BreezEvent::Synced).await?; | |
Ok(()) | |
} | |
/// Connects to the selected LSP peer. | |
/// This validates if the selected LSP is still in [`list_lsps`]. | |
/// If not or no LSP is selected, it selects the first LSP in [`list_lsps`]. | |
async fn connect_lsp_peer(&self, node_pubkey: String) | |
-> SdkResult<()> { | |
let lsps = self.lsp_api.list_lsps(node_pubkey).await?; | |
if let Some(lsp) = | |
self.persister.get_lsp_id()?.and_then(|lsp_id| | |
lsps.clone().into_iter().find(|lsp| | |
lsp.id == lsp_id)).or_else(|| lsps.first().cloned()) { | |
self.persister.set_lsp_id(lsp.id)?; | |
if let Ok(node_state) = self.node_info() { | |
let node_id = lsp.pubkey; | |
let address = lsp.host; | |
let lsp_connected = | |
node_state.connected_peers.iter().any(|e| | |
e == node_id.as_str()); | |
if !lsp_connected { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("connecting to lsp {0}@{1}", | |
node_id.clone(), address.clone()), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1149u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
self.node_api.connect_peer(node_id.clone(), | |
address.clone()).await.map_err(|e| | |
SdkError::ServiceConnectivity { | |
err: { | |
let res = | |
::alloc::fmt::format(format_args!("(LSP: {0}) Failed to connect: {1}", | |
node_id, e)); | |
res | |
}, | |
})?; | |
} | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("connected to lsp {0}@{1}", | |
node_id, address), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1157u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
} | |
} | |
Ok(()) | |
} | |
fn persist_pending_payment(&self, invoice: &LNInvoice, | |
amount_msat: u64, label: Option<String>) | |
-> Result<(), SendPaymentError> { | |
self.persister.insert_or_update_payments(&[Payment { | |
id: invoice.payment_hash.clone(), | |
payment_type: PaymentType::Sent, | |
payment_time: SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() | |
as i64, | |
amount_msat, | |
fee_msat: 0, | |
status: PaymentStatus::Pending, | |
error: None, | |
description: invoice.description.clone(), | |
details: PaymentDetails::Ln { | |
data: LnPaymentDetails { | |
payment_hash: invoice.payment_hash.clone(), | |
label: label.unwrap_or_default(), | |
destination_pubkey: invoice.payee_pubkey.clone(), | |
payment_preimage: String::new(), | |
keysend: false, | |
bolt11: invoice.bolt11.clone(), | |
lnurl_success_action: None, | |
lnurl_pay_domain: None, | |
ln_address: None, | |
lnurl_metadata: None, | |
lnurl_withdraw_endpoint: None, | |
swap_info: None, | |
reverse_swap_info: None, | |
pending_expiration_block: None, | |
open_channel_bolt11: None, | |
}, | |
}, | |
metadata: None, | |
}], false)?; | |
self.persister.insert_payment_external_info(&invoice.payment_hash, | |
PaymentExternalInfo { | |
lnurl_pay_success_action: None, | |
lnurl_pay_domain: None, | |
lnurl_metadata: None, | |
ln_address: None, | |
lnurl_withdraw_endpoint: None, | |
attempted_amount_msat: invoice.amount_msat.map_or(Some(amount_msat), | |
|_| None), | |
attempted_error: None, | |
})?; | |
Ok(()) | |
} | |
async fn on_payment_completed(&self, node_id: String, | |
invoice: Option<LNInvoice>, | |
payment_res: Result<Payment, SendPaymentError>) | |
-> Result<Payment, SendPaymentError> { | |
self.do_sync(payment_res.is_ok()).await?; | |
match payment_res { | |
Ok(payment) => { | |
self.notify_event_listeners(BreezEvent::PaymentSucceed { | |
details: payment.clone(), | |
}).await?; | |
Ok(payment) | |
} | |
Err(e) => { | |
if let Some(invoice) = invoice.clone() { | |
self.persister.update_payment_attempted_error(&invoice.payment_hash, | |
Some(e.to_string()))?; | |
} | |
self.notify_event_listeners(BreezEvent::PaymentFailed { | |
details: PaymentFailedData { | |
error: e.to_string(), | |
node_id, | |
invoice, | |
}, | |
}).await?; | |
Err(e) | |
} | |
} | |
} | |
async fn on_event(&self, e: BreezEvent) -> Result<()> { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("breez services got event {0:?}", | |
e), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1254u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
self.notify_event_listeners(e.clone()).await | |
} | |
async fn notify_event_listeners(&self, e: BreezEvent) -> Result<()> { | |
if let Err(err) = | |
self.btc_receive_swapper.on_event(e.clone()).await { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("btc_receive_swapper failed to process event {0:?}: {1:?}", | |
e, err), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1260u32, | |
::log::__private_api::Option::None); | |
} | |
} | |
}; | |
if let Err(err) = self.btc_send_swapper.on_event(e.clone()).await | |
{ | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("btc_send_swapper failed to process event {0:?}: {1:?}", | |
e, err), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1266u32, | |
::log::__private_api::Option::None); | |
} | |
} | |
}; | |
if self.event_listener.is_some() { | |
self.event_listener.as_ref().unwrap().on_event(e.clone()) | |
} | |
Ok(()) | |
} | |
/// Convenience method to look up LSP info based on current LSP ID | |
pub async fn lsp_info(&self) -> SdkResult<LspInformation> { | |
Ok(get_lsp(self.persister.clone(), self.lsp_api.clone()).await?) | |
} | |
pub(crate) async fn start_node(&self) -> Result<()> { | |
self.node_api.start().await?; | |
Ok(()) | |
} | |
/// Get the recommended fees for onchain transactions | |
pub async fn recommended_fees(&self) -> SdkResult<RecommendedFees> { | |
Ok(self.chain_service.recommended_fees().await?) | |
} | |
/// Get the full default config for a specific environment type | |
pub fn default_config(env_type: EnvironmentType, api_key: String, | |
node_config: NodeConfig) -> Config { | |
match env_type { | |
EnvironmentType::Production => | |
Config::production(api_key, node_config), | |
EnvironmentType::Staging => | |
Config::staging(api_key, node_config), | |
} | |
} | |
/// Get the static backup data from the persistent storage. | |
/// This data enables the user to recover the node in an external core ligntning node. | |
/// See here for instructions on how to recover using this data: <https://docs.corelightning.org/docs/backup-and-recovery#backing-up-using-static-channel-backup> | |
pub fn static_backup(req: StaticBackupRequest) | |
-> SdkResult<StaticBackupResponse> { | |
let storage = SqliteStorage::new(req.working_dir); | |
Ok(StaticBackupResponse { backup: storage.get_static_backup()? }) | |
} | |
/// Fetches the service health check from the support API. | |
pub async fn service_health_check(api_key: String) | |
-> SdkResult<ServiceHealthCheckResponse> { | |
let support_api: Arc<dyn SupportAPI> = | |
Arc::new(BreezServer::new(PRODUCTION_BREEZSERVER_URL.to_string(), | |
Some(api_key))?); | |
support_api.service_health_check().await | |
} | |
/// Generates an url that can be used by a third part provider to buy Bitcoin with fiat currency. | |
/// | |
/// A user-selected [OpeningFeeParams] can be optionally set in the argument. If set, and the | |
/// operation requires a new channel, the SDK will try to use the given fee params. | |
pub async fn buy_bitcoin(&self, req: BuyBitcoinRequest) | |
-> Result<BuyBitcoinResponse, ReceiveOnchainError> { | |
let swap_info = | |
self.receive_onchain(ReceiveOnchainRequest { | |
opening_fee_params: req.opening_fee_params, | |
}).await?; | |
let url = | |
match req.provider { | |
Moonpay => | |
self.moonpay_api.buy_bitcoin_url(&swap_info).await?, | |
}; | |
Ok(BuyBitcoinResponse { | |
url, | |
opening_fee_params: swap_info.channel_opening_fees, | |
}) | |
} | |
/// Starts the BreezServices background threads. | |
/// | |
/// Internal method. Should only be used as part of [BreezServices::start] | |
async fn start_background_tasks(self: &Arc<BreezServices>) | |
-> SdkResult<()> { | |
let (shutdown_signer_sender, signer_signer_receiver) = | |
mpsc::channel(1); | |
self.start_signer(signer_signer_receiver).await; | |
let sync_breez_services = self.clone(); | |
match sync_breez_services.persister.get_node_state()? { | |
Some(node) => { | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Starting existing node {0}", | |
node.id), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1360u32, | |
::log::__private_api::Option::None); | |
} | |
} | |
} | |
None => { | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("First run, syncing in foreground"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1364u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
sync_breez_services.sync().await?; | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("First run, finished running syncing in foreground"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1366u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
} | |
} | |
self.start_backup_watcher().await?; | |
self.track_backup_events().await; | |
self.track_swap_events().await; | |
self.track_invoices().await; | |
self.track_new_blocks().await; | |
self.track_logs().await; | |
let mut shutdown_receiver = self.shutdown_receiver.clone(); | |
tokio::spawn(async move | |
{ | |
_ = shutdown_receiver.changed().await; | |
_ = shutdown_signer_sender.send(()).await; | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Received the signal to exit event polling loop"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1394u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
}); | |
self.init_chainservice_urls().await?; | |
Ok(()) | |
} | |
async fn start_signer(self: &Arc<BreezServices>, | |
shutdown_receiver: mpsc::Receiver<()>) { | |
let signer_api = self.clone(); | |
tokio::spawn(async move | |
{ | |
tokio::time::sleep(std::time::Duration::from_secs(2)).await; | |
signer_api.node_api.start_signer(shutdown_receiver).await; | |
}); | |
} | |
async fn start_backup_watcher(self: &Arc<BreezServices>) | |
-> Result<()> { | |
self.backup_watcher.start(self.shutdown_receiver.clone()).await.map_err(|e| | |
::anyhow::__private::must_use({ | |
let error = | |
::anyhow::__private::format_err(format_args!("Failed to start backup watcher: {0}", | |
e)); | |
error | |
}))?; | |
let force_backup = | |
self.persister.get_last_sync_version().map_err(|e| | |
::anyhow::__private::must_use({ | |
let error = | |
::anyhow::__private::format_err(format_args!("Failed to read last sync version: {0}", | |
e)); | |
error | |
}))?.is_none(); | |
self.backup_watcher.request_backup(BackupRequest::new(force_backup)).await.map_err(|e| | |
::anyhow::__private::must_use({ | |
let error = | |
::anyhow::__private::format_err(format_args!("Failed to request backup: {0}", | |
e)); | |
error | |
})) | |
} | |
async fn track_backup_events(self: &Arc<BreezServices>) { | |
let cloned = self.clone(); | |
tokio::spawn(async move | |
{ | |
let mut events_stream = | |
cloned.backup_watcher.subscribe_events(); | |
let mut shutdown_receiver = | |
cloned.shutdown_receiver.clone(); | |
loop { | |
{ | |
#[doc(hidden)] | |
mod __tokio_select_util { | |
pub(super) enum Out<_0, _1> { _0(_0), _1(_1), Disabled, } | |
pub(super) type Mask = u8; | |
} | |
use ::tokio::macros::support::Future; | |
use ::tokio::macros::support::Pin; | |
use ::tokio::macros::support::Poll::{Ready, Pending}; | |
const BRANCHES: u32 = 2; | |
let mut disabled: __tokio_select_util::Mask = | |
Default::default(); | |
if !true { | |
let mask: __tokio_select_util::Mask = 1 << 0; | |
disabled |= mask; | |
} | |
if !true { | |
let mask: __tokio_select_util::Mask = 1 << 1; | |
disabled |= mask; | |
} | |
let mut output = | |
{ | |
let mut futures = | |
(events_stream.recv(), shutdown_receiver.changed()); | |
let mut futures = &mut futures; | |
::tokio::macros::support::poll_fn(|cx| | |
{ | |
let mut is_pending = false; | |
let start = | |
{ ::tokio::macros::support::thread_rng_n(BRANCHES) }; | |
for i in 0..BRANCHES { | |
let branch; | |
#[allow(clippy :: modulo_one)] | |
{ branch = (start + i) % BRANCHES; } | |
match branch | |
{ | |
#[allow(unreachable_code)] | |
0 => { | |
let mask = 1 << branch; | |
if disabled & mask == mask { continue; } | |
let (fut, ..) = &mut *futures; | |
let mut fut = unsafe { Pin::new_unchecked(fut) }; | |
let out = | |
match Future::poll(fut, cx) { | |
Ready(out) => out, | |
Pending => { is_pending = true; continue; } | |
}; | |
disabled |= mask; | |
#[allow(unused_variables)] | |
#[allow(unused_mut)] | |
match &out { backup_event => {} _ => continue, } | |
return Ready(__tokio_select_util::Out::_0(out)); | |
} | |
#[allow(unreachable_code)] | |
1 => { | |
let mask = 1 << branch; | |
if disabled & mask == mask { continue; } | |
let (_, fut, ..) = &mut *futures; | |
let mut fut = unsafe { Pin::new_unchecked(fut) }; | |
let out = | |
match Future::poll(fut, cx) { | |
Ready(out) => out, | |
Pending => { is_pending = true; continue; } | |
}; | |
disabled |= mask; | |
#[allow(unused_variables)] | |
#[allow(unused_mut)] | |
match &out { _ => {} _ => continue, } | |
return Ready(__tokio_select_util::Out::_1(out)); | |
} | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("reaching this means there probably is an off by one bug"))); | |
} | |
} | |
} | |
if is_pending { | |
Pending | |
} else { Ready(__tokio_select_util::Out::Disabled) } | |
}).await | |
}; | |
match output { | |
__tokio_select_util::Out::_0(backup_event) => { | |
if let Ok(e) = backup_event { | |
if let Err(err) = cloned.notify_event_listeners(e).await { | |
{ | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("error handling backup event: {0:?}", | |
err), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1438u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
} | |
} | |
let backup_status = cloned.backup_status(); | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("backup status: {0:?}", | |
backup_status), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1442u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
} | |
__tokio_select_util::Out::_1(_) => { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Backup watcher task completed"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1445u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
break; | |
} | |
__tokio_select_util::Out::Disabled => { | |
::core::panicking::panic_fmt(format_args!("all branches are disabled and there is no else branch")); | |
} | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("failed to match bind"))); | |
} | |
} | |
} | |
} | |
}); | |
} | |
async fn track_swap_events(self: &Arc<BreezServices>) { | |
let cloned = self.clone(); | |
tokio::spawn(async move | |
{ | |
let mut events_stream = | |
cloned.btc_receive_swapper.subscribe_status_changes(); | |
let mut shutdown_receiver = | |
cloned.shutdown_receiver.clone(); | |
loop { | |
{ | |
#[doc(hidden)] | |
mod __tokio_select_util { | |
pub(super) enum Out<_0, _1> { _0(_0), _1(_1), Disabled, } | |
pub(super) type Mask = u8; | |
} | |
use ::tokio::macros::support::Future; | |
use ::tokio::macros::support::Pin; | |
use ::tokio::macros::support::Poll::{Ready, Pending}; | |
const BRANCHES: u32 = 2; | |
let mut disabled: __tokio_select_util::Mask = | |
Default::default(); | |
if !true { | |
let mask: __tokio_select_util::Mask = 1 << 0; | |
disabled |= mask; | |
} | |
if !true { | |
let mask: __tokio_select_util::Mask = 1 << 1; | |
disabled |= mask; | |
} | |
let mut output = | |
{ | |
let mut futures = | |
(events_stream.recv(), shutdown_receiver.changed()); | |
let mut futures = &mut futures; | |
::tokio::macros::support::poll_fn(|cx| | |
{ | |
let mut is_pending = false; | |
let start = | |
{ ::tokio::macros::support::thread_rng_n(BRANCHES) }; | |
for i in 0..BRANCHES { | |
let branch; | |
#[allow(clippy :: modulo_one)] | |
{ branch = (start + i) % BRANCHES; } | |
match branch | |
{ | |
#[allow(unreachable_code)] | |
0 => { | |
let mask = 1 << branch; | |
if disabled & mask == mask { continue; } | |
let (fut, ..) = &mut *futures; | |
let mut fut = unsafe { Pin::new_unchecked(fut) }; | |
let out = | |
match Future::poll(fut, cx) { | |
Ready(out) => out, | |
Pending => { is_pending = true; continue; } | |
}; | |
disabled |= mask; | |
#[allow(unused_variables)] | |
#[allow(unused_mut)] | |
match &out { swap_event => {} _ => continue, } | |
return Ready(__tokio_select_util::Out::_0(out)); | |
} | |
#[allow(unreachable_code)] | |
1 => { | |
let mask = 1 << branch; | |
if disabled & mask == mask { continue; } | |
let (_, fut, ..) = &mut *futures; | |
let mut fut = unsafe { Pin::new_unchecked(fut) }; | |
let out = | |
match Future::poll(fut, cx) { | |
Ready(out) => out, | |
Pending => { is_pending = true; continue; } | |
}; | |
disabled |= mask; | |
#[allow(unused_variables)] | |
#[allow(unused_mut)] | |
match &out { _ => {} _ => continue, } | |
return Ready(__tokio_select_util::Out::_1(out)); | |
} | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("reaching this means there probably is an off by one bug"))); | |
} | |
} | |
} | |
if is_pending { | |
Pending | |
} else { Ready(__tokio_select_util::Out::Disabled) } | |
}).await | |
}; | |
match output { | |
__tokio_select_util::Out::_0(swap_event) => { | |
if let Ok(e) = swap_event { | |
if let Err(err) = cloned.notify_event_listeners(e).await { | |
{ | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("error handling swap event: {0:?}", | |
err), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1463u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
} | |
} | |
} | |
__tokio_select_util::Out::_1(_) => { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Swap events handling task completed"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1468u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
break; | |
} | |
__tokio_select_util::Out::Disabled => { | |
::core::panicking::panic_fmt(format_args!("all branches are disabled and there is no else branch")); | |
} | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("failed to match bind"))); | |
} | |
} | |
} | |
} | |
}); | |
} | |
async fn track_invoices(self: &Arc<BreezServices>) { | |
let cloned = self.clone(); | |
tokio::spawn(async move | |
{ | |
let mut shutdown_receiver = | |
cloned.shutdown_receiver.clone(); | |
loop { | |
if shutdown_receiver.has_changed().unwrap_or(true) { | |
return; | |
} | |
let invoice_stream_res = | |
cloned.node_api.stream_incoming_payments().await; | |
if let Ok(mut invoice_stream) = invoice_stream_res { | |
loop { | |
{ | |
#[doc(hidden)] | |
mod __tokio_select_util { | |
pub(super) enum Out<_0, _1> { _0(_0), _1(_1), Disabled, } | |
pub(super) type Mask = u8; | |
} | |
use ::tokio::macros::support::Future; | |
use ::tokio::macros::support::Pin; | |
use ::tokio::macros::support::Poll::{Ready, Pending}; | |
const BRANCHES: u32 = 2; | |
let mut disabled: __tokio_select_util::Mask = | |
Default::default(); | |
if !true { | |
let mask: __tokio_select_util::Mask = 1 << 0; | |
disabled |= mask; | |
} | |
if !true { | |
let mask: __tokio_select_util::Mask = 1 << 1; | |
disabled |= mask; | |
} | |
let mut output = | |
{ | |
let mut futures = | |
(invoice_stream.message(), shutdown_receiver.changed()); | |
let mut futures = &mut futures; | |
::tokio::macros::support::poll_fn(|cx| | |
{ | |
let mut is_pending = false; | |
let start = | |
{ ::tokio::macros::support::thread_rng_n(BRANCHES) }; | |
for i in 0..BRANCHES { | |
let branch; | |
#[allow(clippy :: modulo_one)] | |
{ branch = (start + i) % BRANCHES; } | |
match branch | |
{ | |
#[allow(unreachable_code)] | |
0 => { | |
let mask = 1 << branch; | |
if disabled & mask == mask { continue; } | |
let (fut, ..) = &mut *futures; | |
let mut fut = unsafe { Pin::new_unchecked(fut) }; | |
let out = | |
match Future::poll(fut, cx) { | |
Ready(out) => out, | |
Pending => { is_pending = true; continue; } | |
}; | |
disabled |= mask; | |
#[allow(unused_variables)] | |
#[allow(unused_mut)] | |
match &out { paid_invoice_res => {} _ => continue, } | |
return Ready(__tokio_select_util::Out::_0(out)); | |
} | |
#[allow(unreachable_code)] | |
1 => { | |
let mask = 1 << branch; | |
if disabled & mask == mask { continue; } | |
let (_, fut, ..) = &mut *futures; | |
let mut fut = unsafe { Pin::new_unchecked(fut) }; | |
let out = | |
match Future::poll(fut, cx) { | |
Ready(out) => out, | |
Pending => { is_pending = true; continue; } | |
}; | |
disabled |= mask; | |
#[allow(unused_variables)] | |
#[allow(unused_mut)] | |
match &out { _ => {} _ => continue, } | |
return Ready(__tokio_select_util::Out::_1(out)); | |
} | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("reaching this means there probably is an off by one bug"))); | |
} | |
} | |
} | |
if is_pending { | |
Pending | |
} else { Ready(__tokio_select_util::Out::Disabled) } | |
}).await | |
}; | |
match output { | |
__tokio_select_util::Out::_0(paid_invoice_res) => { | |
match paid_invoice_res { | |
Ok(Some(i)) => { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("invoice stream got new invoice"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1491u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
if let Some(gl_client::signer::model::greenlight::incoming_payment::Details::Offchain(p)) | |
= i.details { | |
let payment: Option<crate::models::Payment> = | |
p.clone().try_into().ok(); | |
if let Some(ref payment) = payment { | |
let res = | |
cloned.persister.insert_or_update_payments(&<[_]>::into_vec(#[rustc_box] ::alloc::boxed::Box::new([payment.clone()])), | |
false); | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("paid invoice was added to payments list {0:?}", | |
res), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1498u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
if let Ok(Some(mut node_info)) = | |
cloned.persister.get_node_state() { | |
node_info.channels_balance_msat += payment.amount_msat; | |
let res = cloned.persister.set_node_state(&node_info); | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("channel balance was updated {0:?}", | |
res), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1502u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
} | |
} | |
_ = | |
cloned.on_event(BreezEvent::InvoicePaid { | |
details: InvoicePaidDetails { | |
payment_hash: hex::encode(p.payment_hash), | |
bolt11: p.bolt11, | |
payment, | |
}, | |
}).await; | |
if let Err(e) = cloned.do_sync(true).await { | |
{ | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("failed to sync after paid invoice: {0:?}", | |
e), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1513u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
} | |
} | |
} | |
Ok(None) => { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("invoice stream got None"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1518u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
break; | |
} | |
Err(err) => { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("invoice stream got error: {0:?}", | |
err), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1522u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
break; | |
} | |
} | |
} | |
__tokio_select_util::Out::_1(_) => { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Invoice tracking task has completed"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1529u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
return; | |
} | |
__tokio_select_util::Out::Disabled => { | |
::core::panicking::panic_fmt(format_args!("all branches are disabled and there is no else branch")); | |
} | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("failed to match bind"))); | |
} | |
} | |
} | |
} | |
} | |
sleep(Duration::from_secs(1)).await; | |
} | |
}); | |
} | |
async fn track_logs(self: &Arc<BreezServices>) { | |
let cloned = self.clone(); | |
tokio::spawn(async move | |
{ | |
let mut shutdown_receiver = | |
cloned.shutdown_receiver.clone(); | |
loop { | |
if shutdown_receiver.has_changed().unwrap_or(true) { | |
return; | |
} | |
let log_stream_res = | |
cloned.node_api.stream_log_messages().await; | |
if let Ok(mut log_stream) = log_stream_res { | |
loop { | |
{ | |
#[doc(hidden)] | |
mod __tokio_select_util { | |
pub(super) enum Out<_0, _1> { _0(_0), _1(_1), Disabled, } | |
pub(super) type Mask = u8; | |
} | |
use ::tokio::macros::support::Future; | |
use ::tokio::macros::support::Pin; | |
use ::tokio::macros::support::Poll::{Ready, Pending}; | |
const BRANCHES: u32 = 2; | |
let mut disabled: __tokio_select_util::Mask = | |
Default::default(); | |
if !true { | |
let mask: __tokio_select_util::Mask = 1 << 0; | |
disabled |= mask; | |
} | |
if !true { | |
let mask: __tokio_select_util::Mask = 1 << 1; | |
disabled |= mask; | |
} | |
let mut output = | |
{ | |
let mut futures = | |
(log_stream.message(), shutdown_receiver.changed()); | |
let mut futures = &mut futures; | |
::tokio::macros::support::poll_fn(|cx| | |
{ | |
let mut is_pending = false; | |
let start = | |
{ ::tokio::macros::support::thread_rng_n(BRANCHES) }; | |
for i in 0..BRANCHES { | |
let branch; | |
#[allow(clippy :: modulo_one)] | |
{ branch = (start + i) % BRANCHES; } | |
match branch | |
{ | |
#[allow(unreachable_code)] | |
0 => { | |
let mask = 1 << branch; | |
if disabled & mask == mask { continue; } | |
let (fut, ..) = &mut *futures; | |
let mut fut = unsafe { Pin::new_unchecked(fut) }; | |
let out = | |
match Future::poll(fut, cx) { | |
Ready(out) => out, | |
Pending => { is_pending = true; continue; } | |
}; | |
disabled |= mask; | |
#[allow(unused_variables)] | |
#[allow(unused_mut)] | |
match &out { log_message_res => {} _ => continue, } | |
return Ready(__tokio_select_util::Out::_0(out)); | |
} | |
#[allow(unreachable_code)] | |
1 => { | |
let mask = 1 << branch; | |
if disabled & mask == mask { continue; } | |
let (_, fut, ..) = &mut *futures; | |
let mut fut = unsafe { Pin::new_unchecked(fut) }; | |
let out = | |
match Future::poll(fut, cx) { | |
Ready(out) => out, | |
Pending => { is_pending = true; continue; } | |
}; | |
disabled |= mask; | |
#[allow(unused_variables)] | |
#[allow(unused_mut)] | |
match &out { _ => {} _ => continue, } | |
return Ready(__tokio_select_util::Out::_1(out)); | |
} | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("reaching this means there probably is an off by one bug"))); | |
} | |
} | |
} | |
if is_pending { | |
Pending | |
} else { Ready(__tokio_select_util::Out::Disabled) } | |
}).await | |
}; | |
match output { | |
__tokio_select_util::Out::_0(log_message_res) => { | |
match log_message_res { | |
Ok(Some(l)) => { | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("node-logs: {0}", | |
l.line), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1555u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
} | |
Ok(None) => { break; } | |
Err(err) => { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("failed to process log entry {0:?}", | |
err), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1562u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
break; | |
} | |
}; | |
} | |
__tokio_select_util::Out::_1(_) => { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Track logs task has completed"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1569u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
return; | |
} | |
__tokio_select_util::Out::Disabled => { | |
::core::panicking::panic_fmt(format_args!("all branches are disabled and there is no else branch")); | |
} | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("failed to match bind"))); | |
} | |
} | |
} | |
} | |
} | |
sleep(Duration::from_secs(1)).await; | |
} | |
}); | |
} | |
async fn track_new_blocks(self: &Arc<BreezServices>) { | |
let cloned = self.clone(); | |
tokio::spawn(async move | |
{ | |
let mut current_block: u32 = 0; | |
let mut shutdown_receiver = | |
cloned.shutdown_receiver.clone(); | |
let mut interval = | |
tokio::time::interval(Duration::from_secs(30)); | |
interval.set_missed_tick_behavior(MissedTickBehavior::Skip); | |
loop { | |
{ | |
#[doc(hidden)] | |
mod __tokio_select_util { | |
pub(super) enum Out<_0, _1> { _0(_0), _1(_1), Disabled, } | |
pub(super) type Mask = u8; | |
} | |
use ::tokio::macros::support::Future; | |
use ::tokio::macros::support::Pin; | |
use ::tokio::macros::support::Poll::{Ready, Pending}; | |
const BRANCHES: u32 = 2; | |
let mut disabled: __tokio_select_util::Mask = | |
Default::default(); | |
if !true { | |
let mask: __tokio_select_util::Mask = 1 << 0; | |
disabled |= mask; | |
} | |
if !true { | |
let mask: __tokio_select_util::Mask = 1 << 1; | |
disabled |= mask; | |
} | |
let mut output = | |
{ | |
let mut futures = | |
(interval.tick(), shutdown_receiver.changed()); | |
let mut futures = &mut futures; | |
::tokio::macros::support::poll_fn(|cx| | |
{ | |
let mut is_pending = false; | |
let start = | |
{ ::tokio::macros::support::thread_rng_n(BRANCHES) }; | |
for i in 0..BRANCHES { | |
let branch; | |
#[allow(clippy :: modulo_one)] | |
{ branch = (start + i) % BRANCHES; } | |
match branch | |
{ | |
#[allow(unreachable_code)] | |
0 => { | |
let mask = 1 << branch; | |
if disabled & mask == mask { continue; } | |
let (fut, ..) = &mut *futures; | |
let mut fut = unsafe { Pin::new_unchecked(fut) }; | |
let out = | |
match Future::poll(fut, cx) { | |
Ready(out) => out, | |
Pending => { is_pending = true; continue; } | |
}; | |
disabled |= mask; | |
#[allow(unused_variables)] | |
#[allow(unused_mut)] | |
match &out { _ => {} _ => continue, } | |
return Ready(__tokio_select_util::Out::_0(out)); | |
} | |
#[allow(unreachable_code)] | |
1 => { | |
let mask = 1 << branch; | |
if disabled & mask == mask { continue; } | |
let (_, fut, ..) = &mut *futures; | |
let mut fut = unsafe { Pin::new_unchecked(fut) }; | |
let out = | |
match Future::poll(fut, cx) { | |
Ready(out) => out, | |
Pending => { is_pending = true; continue; } | |
}; | |
disabled |= mask; | |
#[allow(unused_variables)] | |
#[allow(unused_mut)] | |
match &out { _ => {} _ => continue, } | |
return Ready(__tokio_select_util::Out::_1(out)); | |
} | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("reaching this means there probably is an off by one bug"))); | |
} | |
} | |
} | |
if is_pending { | |
Pending | |
} else { Ready(__tokio_select_util::Out::Disabled) } | |
}).await | |
}; | |
match output { | |
__tokio_select_util::Out::_0(_) => { | |
let tip_res = cloned.chain_service.current_tip().await; | |
match tip_res { | |
Ok(next_block) => { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("got tip {0:?}", | |
next_block), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1593u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
if next_block > current_block { | |
_ = cloned.sync().await; | |
_ = | |
cloned.on_event(BreezEvent::NewBlock { | |
block: next_block, | |
}).await; | |
} | |
current_block = next_block | |
} | |
Err(e) => { | |
{ | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("failed to fetch next block {0}", | |
e), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1601u32, | |
::log::__private_api::Option::None); | |
} | |
} | |
} | |
}; | |
} | |
__tokio_select_util::Out::_1(_) => { | |
{ | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("New blocks task has completed"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1607u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
return; | |
} | |
__tokio_select_util::Out::Disabled => { | |
::core::panicking::panic_fmt(format_args!("all branches are disabled and there is no else branch")); | |
} | |
_ => { | |
::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}", | |
format_args!("failed to match bind"))); | |
} | |
} | |
} | |
} | |
}); | |
} | |
async fn init_chainservice_urls(&self) -> Result<()> { | |
let breez_server = | |
Arc::new(BreezServer::new(PRODUCTION_BREEZSERVER_URL.to_string(), | |
None)?); | |
let persister = &self.persister; | |
let cloned_breez_server = breez_server.clone(); | |
let cloned_persister = persister.clone(); | |
tokio::spawn(async move | |
{ | |
match cloned_breez_server.fetch_mempoolspace_urls().await { | |
Ok(fresh_urls) => { | |
if let Err(e) = | |
cloned_persister.set_mempoolspace_base_urls(fresh_urls) { | |
{ | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Failed to cache mempool.space URLs: {0}", | |
e), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1628u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
} | |
} | |
Err(e) => { | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Failed to fetch mempool.space URLs: {0}", | |
e), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1631u32, | |
::log::__private_api::Option::None); | |
} | |
} | |
} | |
}); | |
Ok(()) | |
} | |
/// Configures a global SDK logger that will log to file and will forward log events to | |
/// an optional application-specific logger. | |
/// | |
/// If called, it should be called before any SDK methods (for example, before `connect`). | |
/// | |
/// It must be called only once in the application lifecycle. Alternatively, If the application | |
/// already uses a globally-registered logger, this method shouldn't be called at all. | |
/// | |
/// ### Arguments | |
/// | |
/// - `log_dir`: Location where the the SDK log file will be created. The directory must already exist. | |
/// | |
/// - `app_logger`: Optional application logger. | |
/// | |
/// If the application is to use it's own logger, but would also like the SDK to log SDK-specific | |
/// log output to a file in the configured `log_dir`, then do not register the | |
/// app-specific logger as a global logger and instead call this method with the app logger as an arg. | |
/// | |
/// ### Logging Configuration | |
/// | |
/// Setting `breez_sdk_core::input_parser=debug` will include in the logs the raw payloads received | |
/// when interacting with JSON endpoints, for example those used during all LNURL workflows. | |
/// | |
/// ### Errors | |
/// | |
/// An error is thrown if the log file cannot be created in the working directory. | |
/// | |
/// An error is thrown if a global logger is already configured. | |
pub fn init_logging(log_dir: &str, | |
app_logger: Option<Box<dyn log::Log>>) -> Result<()> { | |
let target_log_file = | |
Box::new(OpenOptions::new().create(true).append(true).open({ | |
let res = | |
::alloc::fmt::format(format_args!("{0}/sdk.log", log_dir)); | |
res | |
}).map_err(|e| | |
::anyhow::__private::must_use({ | |
let error = | |
::anyhow::__private::format_err(format_args!("Can\'t create log file: {0}", | |
e)); | |
error | |
}))?); | |
let logger = | |
env_logger::Builder::new().target(env_logger::Target::Pipe(target_log_file)).parse_filters(r#" | |
debug, | |
breez_sdk_core::input_parser=warn, | |
breez_sdk_core::backup=info, | |
breez_sdk_core::persist::reverseswap=info, | |
breez_sdk_core::reverseswap=info, | |
gl_client=debug, | |
h2=warn, | |
hyper=warn, | |
lightning_signer=warn, | |
reqwest=warn, | |
rustls=warn, | |
rustyline=warn, | |
vls_protocol_signer=warn | |
"#).format(|buf, | |
record| | |
{ | |
buf.write_fmt(format_args!("[{0} {1} {2}:{3}] {4}\n", | |
Local::now().format("%Y-%m-%d %H:%M:%S%.3f"), | |
record.level(), record.module_path().unwrap_or("unknown"), | |
record.line().unwrap_or(0), record.args())) | |
}).build(); | |
let global_logger = | |
GlobalSdkLogger { logger, log_listener: app_logger }; | |
log::set_boxed_logger(Box::new(global_logger)).map_err(|e| | |
::anyhow::__private::must_use({ | |
let error = | |
::anyhow::__private::format_err(format_args!("Failed to set global logger: {0}", | |
e)); | |
error | |
}))?; | |
log::set_max_level(LevelFilter::Trace); | |
Ok(()) | |
} | |
async fn lookup_chain_service_closing_outspend(&self, | |
channel: crate::models::Channel) -> Result<Option<Outspend>> { | |
match channel.funding_outnum { | |
None => Ok(None), | |
Some(outnum) => { | |
let outspends = | |
self.chain_service.transaction_outspends(channel.funding_txid.clone()).await?; | |
Ok(outspends.get(outnum as usize).cloned()) | |
} | |
} | |
} | |
/// Chain service lookup of relevant channel closing fields (closed_at, closing_txid). | |
/// | |
/// Should be used sparingly because it involves a network lookup. | |
async fn lookup_channel_closing_data(&self, | |
channel: &crate::models::Channel) | |
-> Result<(Option<u64>, Option<String>)> { | |
let maybe_outspend = | |
self.lookup_chain_service_closing_outspend(channel.clone()).await?; | |
let maybe_closed_at = | |
maybe_outspend.clone().and_then(|outspend| | |
outspend.status).and_then(|s| s.block_time); | |
let maybe_closing_txid = | |
maybe_outspend.and_then(|outspend| outspend.txid); | |
Ok((maybe_closed_at, maybe_closing_txid)) | |
} | |
async fn closed_channel_to_transaction(&self, | |
channel: crate::models::Channel) -> Result<Payment> { | |
let (payment_time, closing_txid) = | |
match (channel.closed_at, channel.closing_txid.clone()) { | |
(Some(closed_at), Some(closing_txid)) => | |
(closed_at as i64, Some(closing_txid)), | |
(_, _) => { | |
let (maybe_closed_at, maybe_closing_txid) = | |
self.lookup_channel_closing_data(&channel).await?; | |
let processed_closed_at = | |
match maybe_closed_at { | |
None => { | |
{ | |
let lvl = ::log::Level::Warn; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Blocktime could not be determined for from closing outspend, defaulting closed_at to epoch time"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1769u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() | |
} | |
Some(block_time) => block_time, | |
}; | |
let mut updated_channel = channel.clone(); | |
updated_channel.closed_at = Some(processed_closed_at); | |
updated_channel.closing_txid = maybe_closing_txid.clone(); | |
self.persister.insert_or_update_channel(updated_channel)?; | |
(processed_closed_at as i64, maybe_closing_txid) | |
} | |
}; | |
Ok(Payment { | |
id: channel.funding_txid.clone(), | |
payment_type: PaymentType::ClosedChannel, | |
payment_time, | |
amount_msat: channel.spendable_msat, | |
fee_msat: 0, | |
status: match channel.state { | |
ChannelState::PendingClose => PaymentStatus::Pending, | |
_ => PaymentStatus::Complete, | |
}, | |
description: Some("Closed Channel".to_string()), | |
details: PaymentDetails::ClosedChannel { | |
data: ClosedChannelPaymentDetails { | |
short_channel_id: channel.short_channel_id, | |
state: channel.state, | |
funding_txid: channel.funding_txid, | |
closing_txid, | |
}, | |
}, | |
error: None, | |
metadata: None, | |
}) | |
} | |
/// Register for webhook callbacks at the given `webhook_url`. | |
/// | |
/// More specifically, it registers for the following types of callbacks: | |
/// - a payment is received | |
/// - a swap tx is confirmed | |
/// | |
/// This method should be called once on startup and any time the `webhook_url` changes. For | |
/// example, if the `webhook_url` contains a push notification token and the token changes after | |
/// the application was started, then this method should be called to register for callbacks at | |
/// the new correct `webhook_url`. | |
pub async fn register_webhook(&self, webhook_url: String) | |
-> SdkResult<()> { | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("Registering for webhook notifications"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1820u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
let is_new_webhook_url = | |
match self.persister.get_webhook_url()? { | |
None => true, | |
Some(cached_webhook_url) => | |
cached_webhook_url != webhook_url, | |
}; | |
match is_new_webhook_url { | |
false => { | |
let lvl = ::log::Level::Debug; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Webhook URL not changed, no need to (re-)register for monitored swap tx notifications"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1826u32, | |
::log::__private_api::Option::None); | |
} | |
} | |
true => { | |
for swap in | |
self.btc_receive_swapper.list_monitored()?.iter().filter(|swap| | |
!swap.refundable()) { | |
let swap_address = &swap.bitcoin_address; | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Found non-refundable monitored swap with address {0}, registering for swap tx notifications", | |
swap_address), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 1835u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
self.register_swap_tx_notification(swap_address, | |
&webhook_url).await?; | |
} | |
} | |
} | |
self.register_payment_notifications(webhook_url.clone()).await?; | |
self.persister.set_webhook_url(webhook_url)?; | |
Ok(()) | |
} | |
/// Registers for lightning payment notifications. When a payment is intercepted by the LSP | |
/// to this node, a callback will be triggered to the `webhook_url`. | |
async fn register_payment_notifications(&self, webhook_url: String) | |
-> SdkResult<()> { | |
let message = webhook_url.clone(); | |
let sign_request = SignMessageRequest { message }; | |
let sign_response = self.sign_message(sign_request).await?; | |
let lsp_info = self.lsp_info().await?; | |
self.lsp_api.register_payment_notifications(lsp_info.id, | |
lsp_info.lsp_pubkey, webhook_url.clone(), | |
sign_response.signature).await?; | |
Ok(()) | |
} | |
/// Registers for a swap tx notification. When a new transaction to the specified `swap_address` | |
/// is confirmed, a callback will be triggered to the `webhook_url`. | |
async fn register_swap_tx_notification(&self, swap_address: &str, | |
webhook_url: &str) -> SdkResult<()> { | |
get_reqwest_client()?.post({ | |
let res = | |
::alloc::fmt::format(format_args!("{0}/api/v1/register", | |
self.config.chainnotifier_url)); | |
res | |
}).header(CONTENT_TYPE, | |
"application/json").body(Body::from(::serde_json::Value::Object({ | |
let mut object = ::serde_json::Map::new(); | |
let _ = | |
object.insert(("address").into(), | |
::serde_json::to_value(&swap_address).unwrap()); | |
let _ = | |
object.insert(("webhook").into(), | |
::serde_json::to_value(&webhook_url).unwrap()); | |
object | |
}).to_string())).send().await.map(|_| | |
()).map_err(|err| | |
SdkError::ServiceConnectivity { | |
err: { | |
let res = | |
::alloc::fmt::format(format_args!("Failed to register for tx confirmation notifications: {0}", | |
err)); | |
res | |
}, | |
}) | |
} | |
async fn generate_sdk_diagnostic_data(&self) -> SdkResult<String> { | |
let state: String = | |
serde_json::to_string_pretty(&self.persister.get_node_state()?)?; | |
let payments = | |
serde_json::to_string_pretty(&self.persister.list_payments(ListPaymentsRequest::default())?)?; | |
let channels = | |
serde_json::to_string_pretty(&self.persister.list_channels()?)?; | |
let settings = | |
serde_json::to_string_pretty(&self.persister.list_settings()?)?; | |
let reverse_swaps = | |
serde_json::to_string_pretty(&self.persister.list_reverse_swaps()?)?; | |
let swaps = | |
serde_json::to_string_pretty(&self.persister.list_swaps()?)?; | |
let lsp_id = | |
serde_json::to_string_pretty(&self.persister.get_lsp_id()?)?; | |
let res = | |
{ | |
let res = | |
::alloc::fmt::format(format_args!("***Node State***\n{0}\n\n ***Payments***\n{1}\n\n ***Channels***\n{2}\n\n ***Settings***\n{3}\n\n ***Reverse Swaps***\n{4}\n\n ***LSP ID***\n{5}\n\n ***Swaps***\n{6}\n\n", | |
state, payments, channels, settings, reverse_swaps, lsp_id, | |
swaps)); | |
res | |
}; | |
Ok(res) | |
} | |
} | |
struct GlobalSdkLogger { | |
/// SDK internal logger, which logs to file | |
logger: env_logger::Logger, | |
/// Optional external log listener, that can receive a stream of log statements | |
log_listener: Option<Box<dyn log::Log>>, | |
} | |
impl log::Log for GlobalSdkLogger { | |
fn enabled(&self, metadata: &Metadata) -> bool { | |
metadata.level() <= log::Level::Trace | |
} | |
fn log(&self, record: &Record) { | |
if self.enabled(record.metadata()) { | |
self.logger.log(record); | |
if let Some(s) = &self.log_listener.as_ref() { | |
if s.enabled(record.metadata()) { s.log(record); } | |
} | |
} | |
} | |
fn flush(&self) {} | |
} | |
/// A helper struct to configure and build BreezServices | |
struct BreezServicesBuilder { | |
config: Config, | |
node_api: Option<Arc<dyn NodeAPI>>, | |
backup_transport: Option<Arc<dyn BackupTransport>>, | |
seed: Option<Vec<u8>>, | |
lsp_api: Option<Arc<dyn LspAPI>>, | |
fiat_api: Option<Arc<dyn FiatAPI>>, | |
persister: Option<Arc<SqliteStorage>>, | |
support_api: Option<Arc<dyn SupportAPI>>, | |
swapper_api: Option<Arc<dyn SwapperAPI>>, | |
/// Reverse swap functionality on the Breez Server | |
reverse_swapper_api: Option<Arc<dyn ReverseSwapperRoutingAPI>>, | |
/// Reverse swap functionality on the 3rd party reverse swap service | |
reverse_swap_service_api: Option<Arc<dyn ReverseSwapServiceAPI>>, | |
moonpay_api: Option<Arc<dyn MoonPayApi>>, | |
} | |
#[allow(dead_code)] | |
impl BreezServicesBuilder { | |
pub fn new(config: Config) -> BreezServicesBuilder { | |
BreezServicesBuilder { | |
config, | |
node_api: None, | |
seed: None, | |
lsp_api: None, | |
fiat_api: None, | |
persister: None, | |
support_api: None, | |
swapper_api: None, | |
reverse_swapper_api: None, | |
reverse_swap_service_api: None, | |
moonpay_api: None, | |
backup_transport: None, | |
} | |
} | |
pub fn node_api(&mut self, node_api: Arc<dyn NodeAPI>) -> &mut Self { | |
self.node_api = Some(node_api); | |
self | |
} | |
pub fn lsp_api(&mut self, lsp_api: Arc<dyn LspAPI>) -> &mut Self { | |
self.lsp_api = Some(lsp_api.clone()); | |
self | |
} | |
pub fn fiat_api(&mut self, fiat_api: Arc<dyn FiatAPI>) -> &mut Self { | |
self.fiat_api = Some(fiat_api.clone()); | |
self | |
} | |
pub fn moonpay_api(&mut self, moonpay_api: Arc<dyn MoonPayApi>) | |
-> &mut Self { | |
self.moonpay_api = Some(moonpay_api.clone()); | |
self | |
} | |
pub fn persister(&mut self, persister: Arc<SqliteStorage>) | |
-> &mut Self { | |
self.persister = Some(persister); | |
self | |
} | |
pub fn support_api(&mut self, support_api: Arc<dyn SupportAPI>) | |
-> &mut Self { | |
self.support_api = Some(support_api.clone()); | |
self | |
} | |
pub fn swapper_api(&mut self, swapper_api: Arc<dyn SwapperAPI>) | |
-> &mut Self { | |
self.swapper_api = Some(swapper_api.clone()); | |
self | |
} | |
pub fn reverse_swapper_api(&mut self, | |
reverse_swapper_api: Arc<dyn ReverseSwapperRoutingAPI>) | |
-> &mut Self { | |
self.reverse_swapper_api = Some(reverse_swapper_api.clone()); | |
self | |
} | |
pub fn reverse_swap_service_api(&mut self, | |
reverse_swap_service_api: Arc<dyn ReverseSwapServiceAPI>) | |
-> &mut Self { | |
self.reverse_swap_service_api = | |
Some(reverse_swap_service_api.clone()); | |
self | |
} | |
pub fn backup_transport(&mut self, | |
backup_transport: Arc<dyn BackupTransport>) -> &mut Self { | |
self.backup_transport = Some(backup_transport.clone()); | |
self | |
} | |
pub fn seed(&mut self, seed: Vec<u8>) -> &mut Self { | |
self.seed = Some(seed); | |
self | |
} | |
pub async fn build(&self, restore_only: Option<bool>, | |
event_listener: Option<Box<dyn EventListener>>) | |
-> BreezServicesResult<Arc<BreezServices>> { | |
if self.node_api.is_none() && self.seed.is_none() { | |
return Err(ConnectError::Generic { | |
err: "Either node_api or both credentials and seed should be provided".into(), | |
}); | |
} | |
let persister = | |
self.persister.clone().unwrap_or_else(|| | |
Arc::new(SqliteStorage::new(self.config.working_dir.clone()))); | |
persister.init()?; | |
let mut node_api = self.node_api.clone(); | |
let mut backup_transport = self.backup_transport.clone(); | |
if node_api.is_none() { | |
let greenlight = | |
Greenlight::connect(self.config.clone(), | |
self.seed.clone().unwrap(), restore_only, | |
persister.clone()).await?; | |
let gl_arc = Arc::new(greenlight); | |
node_api = Some(gl_arc.clone()); | |
if backup_transport.is_none() { | |
backup_transport = | |
Some(Arc::new(GLBackupTransport { inner: gl_arc })); | |
} | |
} | |
if backup_transport.is_none() { | |
return Err(ConnectError::Generic { | |
err: "State synchronizer should be provided".into(), | |
}); | |
} | |
let unwrapped_node_api = node_api.unwrap(); | |
let unwrapped_backup_transport = backup_transport.unwrap(); | |
let backup_encryption_key = | |
unwrapped_node_api.derive_bip32_key(<[_]>::into_vec(#[rustc_box] ::alloc::boxed::Box::new([ChildNumber::from_hardened_idx(139)?, | |
ChildNumber::from(0)])))?; | |
let legacy_backup_encryption_key = | |
unwrapped_node_api.legacy_derive_bip32_key(<[_]>::into_vec(#[rustc_box] ::alloc::boxed::Box::new([ChildNumber::from_hardened_idx(139)?, | |
ChildNumber::from(0)])))?; | |
let backup_watcher = | |
BackupWatcher::new(self.config.clone(), | |
unwrapped_backup_transport.clone(), persister.clone(), | |
backup_encryption_key.to_priv().to_bytes(), | |
legacy_backup_encryption_key.to_priv().to_bytes()); | |
let breez_server = | |
Arc::new(BreezServer::new(self.config.breezserver.clone(), | |
self.config.api_key.clone()).map_err(|e| | |
ConnectError::ServiceConnectivity { | |
err: { | |
let res = | |
::alloc::fmt::format(format_args!("Failed to create BreezServer: {0}", | |
e)); | |
res | |
}, | |
})?); | |
let cloned_breez_server = breez_server.clone(); | |
tokio::spawn(async move | |
{ | |
if let Err(e) = cloned_breez_server.ping().await { | |
{ | |
let lvl = ::log::Level::Error; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("Failed to ping breez server: {0}", | |
e), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 2124u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
} | |
}); | |
let current_lsp_id = persister.get_lsp_id()?; | |
if current_lsp_id.is_none() && | |
self.config.default_lsp_id.is_some() { | |
persister.set_lsp_id(self.config.default_lsp_id.clone().unwrap())?; | |
} | |
let payment_receiver = | |
Arc::new(PaymentReceiver { | |
config: self.config.clone(), | |
node_api: unwrapped_node_api.clone(), | |
lsp: breez_server.clone(), | |
persister: persister.clone(), | |
}); | |
let mempoolspace_urls = | |
match self.config.mempoolspace_url.clone() { | |
None => { | |
let cached = persister.get_mempoolspace_base_urls()?; | |
match cached.len() { | |
0 => { | |
let fresh_urls = | |
breez_server.fetch_mempoolspace_urls().await.unwrap_or(<[_]>::into_vec(#[rustc_box] ::alloc::boxed::Box::new([DEFAULT_MEMPOOL_SPACE_URL.into()]))); | |
persister.set_mempoolspace_base_urls(fresh_urls.clone())?; | |
fresh_urls | |
} | |
_ => cached, | |
} | |
} | |
Some(mempoolspace_url_from_config) => | |
<[_]>::into_vec(#[rustc_box] ::alloc::boxed::Box::new([mempoolspace_url_from_config])), | |
}; | |
let chain_service = | |
Arc::new(RedundantChainService::from_base_urls(mempoolspace_urls)); | |
let btc_receive_swapper = | |
Arc::new(BTCReceiveSwap::new(self.config.network.into(), | |
unwrapped_node_api.clone(), | |
self.swapper_api.clone().unwrap_or_else(|| | |
breez_server.clone()), persister.clone(), | |
chain_service.clone(), payment_receiver.clone())); | |
let btc_send_swapper = | |
Arc::new(BTCSendSwap::new(self.config.clone(), | |
self.reverse_swapper_api.clone().unwrap_or_else(|| | |
breez_server.clone()), | |
self.reverse_swap_service_api.clone().unwrap_or_else(|| | |
Arc::new(BoltzApi {})), persister.clone(), | |
chain_service.clone(), unwrapped_node_api.clone())); | |
let (shutdown_sender, shutdown_receiver) = | |
watch::channel::<()>(()); | |
let breez_services = | |
Arc::new(BreezServices { | |
config: self.config.clone(), | |
started: Mutex::new(false), | |
node_api: unwrapped_node_api.clone(), | |
lsp_api: self.lsp_api.clone().unwrap_or_else(|| | |
breez_server.clone()), | |
fiat_api: self.fiat_api.clone().unwrap_or_else(|| | |
breez_server.clone()), | |
support_api: self.support_api.clone().unwrap_or_else(|| | |
breez_server.clone()), | |
moonpay_api: self.moonpay_api.clone().unwrap_or_else(|| | |
breez_server.clone()), | |
chain_service, | |
persister: persister.clone(), | |
btc_receive_swapper, | |
btc_send_swapper, | |
payment_receiver, | |
event_listener, | |
backup_watcher: Arc::new(backup_watcher), | |
shutdown_sender, | |
shutdown_receiver, | |
}); | |
Ok(breez_services) | |
} | |
} | |
pub struct BreezServer { | |
grpc_channel: Channel, | |
api_key: Option<String>, | |
} | |
impl BreezServer { | |
pub fn new(server_url: String, api_key: Option<String>) | |
-> Result<Self> { | |
Ok(Self { | |
grpc_channel: Endpoint::from_shared(server_url)?.connect_lazy(), | |
api_key, | |
}) | |
} | |
fn api_key_metadata(&self) | |
-> SdkResult<Option<MetadataValue<Ascii>>> { | |
match &self.api_key { | |
Some(key) => | |
Ok(Some({ | |
let res = | |
::alloc::fmt::format(format_args!("Bearer {0}", key)); | |
res | |
}.parse().map_err(|e: InvalidMetadataValue| | |
SdkError::ServiceConnectivity { | |
err: { | |
let res = | |
::alloc::fmt::format(format_args!("(Breez: {0:?}) Failed parse API key: {1}", | |
self.api_key, e)); | |
res | |
}, | |
})?)), | |
_ => Ok(None), | |
} | |
} | |
pub(crate) async fn get_channel_opener_client(&self) | |
-> | |
SdkResult<ChannelOpenerClient<InterceptedService<Channel, | |
ApiKeyInterceptor>>> { | |
let api_key_metadata = self.api_key_metadata()?; | |
let with_interceptor = | |
ChannelOpenerClient::with_interceptor(self.grpc_channel.clone(), | |
ApiKeyInterceptor { api_key_metadata }); | |
Ok(with_interceptor) | |
} | |
pub(crate) async fn get_subscription_client(&self) | |
-> SdkResult<PaymentNotifierClient<Channel>> { | |
Ok(PaymentNotifierClient::new(self.grpc_channel.clone())) | |
} | |
pub(crate) async fn get_information_client(&self) | |
-> SdkResult<InformationClient<Channel>> { | |
Ok(InformationClient::new(self.grpc_channel.clone())) | |
} | |
pub(crate) async fn get_signer_client(&self) | |
-> SdkResult<SignerClient<Channel>> { | |
Ok(SignerClient::new(self.grpc_channel.clone())) | |
} | |
pub(crate) async fn get_support_client(&self) | |
-> | |
SdkResult<SupportClient<InterceptedService<Channel, | |
ApiKeyInterceptor>>> { | |
let api_key_metadata = self.api_key_metadata()?; | |
Ok(SupportClient::with_interceptor(self.grpc_channel.clone(), | |
ApiKeyInterceptor { api_key_metadata })) | |
} | |
pub(crate) async fn get_swapper_client(&self) | |
-> SdkResult<SwapperClient<Channel>> { | |
Ok(SwapperClient::new(self.grpc_channel.clone())) | |
} | |
pub(crate) async fn ping(&self) -> SdkResult<String> { | |
let request = Request::new(PingRequest {}); | |
let response = | |
self.get_information_client().await?.ping(request).await?.into_inner().version; | |
Ok(response) | |
} | |
pub(crate) async fn fetch_mempoolspace_urls(&self) | |
-> SdkResult<Vec<String>> { | |
let mut client = self.get_information_client().await?; | |
let chain_api_servers = | |
client.chain_api_servers(ChainApiServersRequest {}).await?.into_inner().servers; | |
{ | |
let lvl = ::log::Level::Trace; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("Received chain_api_servers: {0:?}", | |
chain_api_servers), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 2305u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
let mempoolspace_urls = | |
chain_api_servers.iter().filter(|s| | |
s.server_type == | |
"MEMPOOL_SPACE").map(|s| | |
s.server_base_url.clone()).collect(); | |
{ | |
let lvl = ::log::Level::Trace; | |
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() | |
{ | |
::log::__private_api::log(format_args!("Received mempoolspace_urls: {0:?}", | |
mempoolspace_urls), lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 2312u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
Ok(mempoolspace_urls) | |
} | |
} | |
pub(crate) struct ApiKeyInterceptor { | |
api_key_metadata: Option<MetadataValue<Ascii>>, | |
} | |
impl Interceptor for ApiKeyInterceptor { | |
fn call(&mut self, mut req: Request<()>) | |
-> Result<Request<()>, Status> { | |
if self.api_key_metadata.clone().is_some() { | |
req.metadata_mut().insert("authorization", | |
self.api_key_metadata.clone().unwrap()); | |
} | |
Ok(req) | |
} | |
} | |
/// Attempts to convert the phrase to a mnemonic, then to a seed. | |
/// | |
/// If the phrase is not a valid mnemonic, an error is returned. | |
pub fn mnemonic_to_seed(phrase: String) -> Result<Vec<u8>> { | |
let mnemonic = Mnemonic::from_phrase(&phrase, Language::English)?; | |
let seed = Seed::new(&mnemonic, ""); | |
Ok(seed.as_bytes().to_vec()) | |
} | |
pub struct OpenChannelParams { | |
pub payer_amount_msat: u64, | |
pub opening_fee_params: OpeningFeeParams, | |
} | |
pub trait Receiver: Send + Sync { | |
#[must_use] | |
#[allow(clippy :: type_complexity, clippy :: | |
type_repetition_in_bounds)] | |
fn receive_payment<'life0, | |
'async_trait>(&'life0 self, req: ReceivePaymentRequest) | |
-> | |
::core::pin::Pin<Box<dyn ::core::future::Future<Output = | |
Result<ReceivePaymentResponse, ReceivePaymentError>> + | |
::core::marker::Send + 'async_trait>> | |
where | |
'life0: 'async_trait, | |
Self: 'async_trait; | |
#[must_use] | |
#[allow(clippy :: type_complexity, clippy :: | |
type_repetition_in_bounds)] | |
fn wrap_node_invoice<'life0, 'life1, | |
'async_trait>(&'life0 self, invoice: &'life1 str, | |
params: Option<OpenChannelParams>, lsp_info: Option<LspInformation>) | |
-> | |
::core::pin::Pin<Box<dyn ::core::future::Future<Output = | |
Result<String, ReceivePaymentError>> + ::core::marker::Send + | |
'async_trait>> | |
where | |
'life0: 'async_trait, | |
'life1: 'async_trait, | |
Self: 'async_trait; | |
} | |
pub(crate) struct PaymentReceiver { | |
config: Config, | |
node_api: Arc<dyn NodeAPI>, | |
lsp: Arc<dyn LspAPI>, | |
persister: Arc<SqliteStorage>, | |
} | |
impl Receiver for PaymentReceiver { | |
#[allow(clippy :: async_yields_async, clippy :: | |
diverging_sub_expression, clippy :: let_unit_value, clippy :: | |
no_effect_underscore_binding, clippy :: shadow_same, clippy :: | |
type_complexity, clippy :: type_repetition_in_bounds, clippy :: | |
used_underscore_binding)] | |
fn receive_payment<'life0, | |
'async_trait>(&'life0 self, req: ReceivePaymentRequest) | |
-> | |
::core::pin::Pin<Box<dyn ::core::future::Future<Output = | |
Result<ReceivePaymentResponse, ReceivePaymentError>> + | |
::core::marker::Send + 'async_trait>> where | |
'life0: 'async_trait, Self: 'async_trait { | |
Box::pin(async move | |
{ | |
if let ::core::option::Option::Some(__ret) = | |
::core::option::Option::None::<Result<ReceivePaymentResponse, | |
ReceivePaymentError>> { | |
return __ret; | |
} | |
let __self = self; | |
let req = req; | |
let __ret: | |
Result<ReceivePaymentResponse, ReceivePaymentError> = | |
{ | |
__self.node_api.start().await?; | |
let lsp_info = | |
get_lsp(__self.persister.clone(), | |
__self.lsp.clone()).await?; | |
let node_state = | |
__self.persister.get_node_state()?.ok_or(::anyhow::__private::must_use({ | |
let error = | |
::anyhow::__private::format_err(format_args!("Node info not found")); | |
error | |
}))?; | |
let expiry = | |
req.expiry.unwrap_or(INVOICE_PAYMENT_FEE_EXPIRY_SECONDS); | |
if !(req.amount_msat > 0) { | |
return Err(ReceivePaymentError::InvalidAmount { | |
err: "Receive amount must be more than 0".into(), | |
}); | |
}; | |
let mut destination_invoice_amount_msat = req.amount_msat; | |
let mut channel_opening_fee_params = None; | |
let mut channel_fees_msat = None; | |
let open_channel_needed = | |
node_state.inbound_liquidity_msats < req.amount_msat; | |
if open_channel_needed { | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
::log::__private_api::log(format_args!("We need to open a channel"), | |
lvl, | |
&("breez_sdk_core::breez_services", | |
"breez_sdk_core::breez_services", | |
"sdk-core/src/breez_services.rs"), 2395u32, | |
::log::__private_api::Option::None); | |
} | |
}; | |
let ofp = | |
match req.opening_fee_params { | |
Some(fee_params) => fee_params, | |
None => lsp_info.cheapest_open_channel_fee(expiry)?.clone(), | |
}; | |
channel_opening_fee_params = Some(ofp.clone()); | |
channel_fees_msat = | |
Some(ofp.get_channel_fees_msat_for(req.amount_msat)); | |
if let Some(channel_fees_msat) = channel_fees_msat { | |
{ | |
let lvl = ::log::Level::Info; | |
if lvl <= ::log::STATIC_MAX_LEVEL && | |
lvl <= ::log::max_level() { | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment