diff --git a/ios/Classes/frb_generated.h b/ios/Classes/frb_generated.h index 620c796..c24e895 100644 --- a/ios/Classes/frb_generated.h +++ b/ios/Classes/frb_generated.h @@ -482,6 +482,7 @@ typedef struct wire_cst_payment_details { uint64_t *amount_msat; int32_t direction; int32_t status; + uint64_t latest_update_timestamp; } wire_cst_payment_details; typedef struct wire_cst_channel_details { diff --git a/lib/src/generated/api/types.dart b/lib/src/generated/api/types.dart index 1af2513..56c181c 100644 --- a/lib/src/generated/api/types.dart +++ b/lib/src/generated/api/types.dart @@ -1259,12 +1259,16 @@ class PaymentDetails { /// The status of the payment. final PaymentStatus status; + /// The timestamp, in seconds since start of the UNIX epoch, when this entry was last updated. + final BigInt latestUpdateTimestamp; + const PaymentDetails({ required this.id, required this.kind, this.amountMsat, required this.direction, required this.status, + required this.latestUpdateTimestamp, }); @override @@ -1273,7 +1277,8 @@ class PaymentDetails { kind.hashCode ^ amountMsat.hashCode ^ direction.hashCode ^ - status.hashCode; + status.hashCode ^ + latestUpdateTimestamp.hashCode; @override bool operator ==(Object other) => @@ -1284,7 +1289,8 @@ class PaymentDetails { kind == other.kind && amountMsat == other.amountMsat && direction == other.direction && - status == other.status; + status == other.status && + latestUpdateTimestamp == other.latestUpdateTimestamp; } /// Represents the direction of a payment. diff --git a/lib/src/generated/frb_generated.dart b/lib/src/generated/frb_generated.dart index e65c14f..d20793e 100644 --- a/lib/src/generated/frb_generated.dart +++ b/lib/src/generated/frb_generated.dart @@ -3693,14 +3693,15 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { PaymentDetails dco_decode_payment_details(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs final arr = raw as List; - if (arr.length != 5) - throw Exception('unexpected arr length: expect 5 but see ${arr.length}'); + if (arr.length != 6) + throw Exception('unexpected arr length: expect 6 but see ${arr.length}'); return PaymentDetails( id: dco_decode_payment_id(arr[0]), kind: dco_decode_payment_kind(arr[1]), amountMsat: dco_decode_opt_box_autoadd_u_64(arr[2]), direction: dco_decode_payment_direction(arr[3]), status: dco_decode_payment_status(arr[4]), + latestUpdateTimestamp: dco_decode_u_64(arr[5]), ); } @@ -5733,12 +5734,14 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { var var_amountMsat = sse_decode_opt_box_autoadd_u_64(deserializer); var var_direction = sse_decode_payment_direction(deserializer); var var_status = sse_decode_payment_status(deserializer); + var var_latestUpdateTimestamp = sse_decode_u_64(deserializer); return PaymentDetails( id: var_id, kind: var_kind, amountMsat: var_amountMsat, direction: var_direction, - status: var_status); + status: var_status, + latestUpdateTimestamp: var_latestUpdateTimestamp); } @protected @@ -7745,6 +7748,7 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi { sse_encode_opt_box_autoadd_u_64(self.amountMsat, serializer); sse_encode_payment_direction(self.direction, serializer); sse_encode_payment_status(self.status, serializer); + sse_encode_u_64(self.latestUpdateTimestamp, serializer); } @protected diff --git a/lib/src/generated/frb_generated.io.dart b/lib/src/generated/frb_generated.io.dart index a49e574..348ba70 100644 --- a/lib/src/generated/frb_generated.io.dart +++ b/lib/src/generated/frb_generated.io.dart @@ -3139,6 +3139,8 @@ abstract class coreApiImplPlatform extends BaseApiImpl { wireObj.amount_msat = cst_encode_opt_box_autoadd_u_64(apiObj.amountMsat); wireObj.direction = cst_encode_payment_direction(apiObj.direction); wireObj.status = cst_encode_payment_status(apiObj.status); + wireObj.latest_update_timestamp = + cst_encode_u_64(apiObj.latestUpdateTimestamp); } @protected @@ -7268,6 +7270,9 @@ final class wire_cst_payment_details extends ffi.Struct { @ffi.Int32() external int status; + + @ffi.Uint64() + external int latest_update_timestamp; } final class wire_cst_channel_details extends ffi.Struct { diff --git a/rust/src/api/types.rs b/rust/src/api/types.rs index a9fbf8e..8b78caa 100644 --- a/rust/src/api/types.rs +++ b/rust/src/api/types.rs @@ -749,6 +749,8 @@ pub struct PaymentDetails { pub direction: PaymentDirection, /// The status of the payment. pub status: PaymentStatus, + /// The timestamp, in seconds since start of the UNIX epoch, when this entry was last updated. + pub latest_update_timestamp: u64, } impl From for PaymentDetails { @@ -759,6 +761,7 @@ impl From for PaymentDetails { amount_msat: value.amount_msat, direction: value.direction.into(), kind: value.kind.into(), + latest_update_timestamp: value.latest_update_timestamp, } } } diff --git a/rust/src/frb_generated.io.rs b/rust/src/frb_generated.io.rs index bdef0c3..a31e817 100644 --- a/rust/src/frb_generated.io.rs +++ b/rust/src/frb_generated.io.rs @@ -1180,6 +1180,7 @@ impl CstDecode for wire_cst_payment_details { amount_msat: self.amount_msat.cst_decode(), direction: self.direction.cst_decode(), status: self.status.cst_decode(), + latest_update_timestamp: self.latest_update_timestamp.cst_decode(), } } } @@ -1991,6 +1992,7 @@ impl NewWithNullPtr for wire_cst_payment_details { amount_msat: core::ptr::null_mut(), direction: Default::default(), status: Default::default(), + latest_update_timestamp: Default::default(), } } } @@ -4072,6 +4074,7 @@ pub struct wire_cst_payment_details { amount_msat: *mut u64, direction: i32, status: i32, + latest_update_timestamp: u64, } #[repr(C)] #[derive(Clone, Copy)] diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs index 025f9e4..c3c8542 100644 --- a/rust/src/frb_generated.rs +++ b/rust/src/frb_generated.rs @@ -3498,12 +3498,14 @@ impl SseDecode for crate::api::types::PaymentDetails { let mut var_amountMsat = >::sse_decode(deserializer); let mut var_direction = ::sse_decode(deserializer); let mut var_status = ::sse_decode(deserializer); + let mut var_latestUpdateTimestamp = ::sse_decode(deserializer); return crate::api::types::PaymentDetails { id: var_id, kind: var_kind, amount_msat: var_amountMsat, direction: var_direction, status: var_status, + latest_update_timestamp: var_latestUpdateTimestamp, }; } } @@ -5154,6 +5156,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::types::PaymentDetails { self.amount_msat.into_into_dart().into_dart(), self.direction.into_into_dart().into_dart(), self.status.into_into_dart().into_dart(), + self.latest_update_timestamp.into_into_dart().into_dart(), ] .into_dart() } @@ -6971,6 +6974,7 @@ impl SseEncode for crate::api::types::PaymentDetails { >::sse_encode(self.amount_msat, serializer); ::sse_encode(self.direction, serializer); ::sse_encode(self.status, serializer); + ::sse_encode(self.latest_update_timestamp, serializer); } } diff --git a/rust/src/frb_generated.web.rs b/rust/src/frb_generated.web.rs deleted file mode 100644 index e91baec..0000000 --- a/rust/src/frb_generated.web.rs +++ /dev/null @@ -1,2247 +0,0 @@ -// This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0. - -// Section: imports - -use super::*; -use crate::api::builder::*; -use crate::api::node::*; -use crate::*; -use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::wasm_bindgen; -use flutter_rust_bridge::for_generated::wasm_bindgen::prelude::*; -use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; -use flutter_rust_bridge::{Handler, IntoIntoDart}; - -// Section: boilerplate - -flutter_rust_bridge::frb_generated_boilerplate_web!(); - -// Section: dart2rust - -impl CstDecode for String { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> String { - self - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::Address { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::types::Address { - s: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::AnchorChannelsConfig { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 2, - "Expected 2 elements, got {}", - self_.length() - ); - crate::api::types::AnchorChannelsConfig { - trusted_peers_no_reserve: self_.get(0).cst_decode(), - per_channel_reserve_sats: self_.get(1).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::BalanceDetails { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 5, - "Expected 5 elements, got {}", - self_.length() - ); - crate::api::types::BalanceDetails { - total_onchain_balance_sats: self_.get(0).cst_decode(), - spendable_onchain_balance_sats: self_.get(1).cst_decode(), - total_lightning_balance_sats: self_.get(2).cst_decode(), - lightning_balances: self_.get(3).cst_decode(), - pending_balances_from_channel_closures: self_.get(4).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::BestBlock { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 2, - "Expected 2 elements, got {}", - self_.length() - ); - crate::api::types::BestBlock { - block_hash: self_.get(0).cst_decode(), - height: self_.get(1).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::Bolt11Invoice { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::types::Bolt11Invoice { - signed_raw_invoice: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::utils::error::Bolt12ParseError { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::utils::error::Bolt12ParseError::InvalidContinuation, - 1 => crate::utils::error::Bolt12ParseError::InvalidBech32Hrp, - 2 => crate::utils::error::Bolt12ParseError::Bech32(self_.get(1).cst_decode()), - 3 => crate::utils::error::Bolt12ParseError::Decode(self_.get(1).cst_decode()), - 4 => crate::utils::error::Bolt12ParseError::InvalidSemantics(self_.get(1).cst_decode()), - 5 => crate::utils::error::Bolt12ParseError::InvalidSignature(self_.get(1).cst_decode()), - _ => unreachable!(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::ChainDataSourceConfig { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::ChainDataSourceConfig::Esplora(self_.get(1).cst_decode()), - _ => unreachable!(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::ChannelConfig { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 6, - "Expected 6 elements, got {}", - self_.length() - ); - crate::api::types::ChannelConfig { - forwarding_fee_proportional_millionths: self_.get(0).cst_decode(), - forwarding_fee_base_msat: self_.get(1).cst_decode(), - cltv_expiry_delta: self_.get(2).cst_decode(), - max_dust_htlc_exposure: self_.get(3).cst_decode(), - force_close_avoidance_max_fee_satoshis: self_.get(4).cst_decode(), - accept_underpaying_htlcs: self_.get(5).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::ChannelDetails { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 28, - "Expected 28 elements, got {}", - self_.length() - ); - crate::api::types::ChannelDetails { - channel_id: self_.get(0).cst_decode(), - counterparty_node_id: self_.get(1).cst_decode(), - funding_txo: self_.get(2).cst_decode(), - channel_value_sats: self_.get(3).cst_decode(), - unspendable_punishment_reserve: self_.get(4).cst_decode(), - user_channel_id: self_.get(5).cst_decode(), - feerate_sat_per_1000_weight: self_.get(6).cst_decode(), - outbound_capacity_msat: self_.get(7).cst_decode(), - inbound_capacity_msat: self_.get(8).cst_decode(), - confirmations_required: self_.get(9).cst_decode(), - confirmations: self_.get(10).cst_decode(), - is_outbound: self_.get(11).cst_decode(), - is_channel_ready: self_.get(12).cst_decode(), - is_usable: self_.get(13).cst_decode(), - is_public: self_.get(14).cst_decode(), - cltv_expiry_delta: self_.get(15).cst_decode(), - counterparty_unspendable_punishment_reserve: self_.get(16).cst_decode(), - counterparty_outbound_htlc_minimum_msat: self_.get(17).cst_decode(), - counterparty_outbound_htlc_maximum_msat: self_.get(18).cst_decode(), - counterparty_forwarding_info_fee_base_msat: self_.get(19).cst_decode(), - counterparty_forwarding_info_fee_proportional_millionths: self_.get(20).cst_decode(), - counterparty_forwarding_info_cltv_expiry_delta: self_.get(21).cst_decode(), - next_outbound_htlc_limit_msat: self_.get(22).cst_decode(), - next_outbound_htlc_minimum_msat: self_.get(23).cst_decode(), - force_close_spend_delay: self_.get(24).cst_decode(), - inbound_htlc_minimum_msat: self_.get(25).cst_decode(), - inbound_htlc_maximum_msat: self_.get(26).cst_decode(), - config: self_.get(27).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::ChannelId { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::types::ChannelId { - data: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::graph::ChannelInfo { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 5, - "Expected 5 elements, got {}", - self_.length() - ); - crate::api::graph::ChannelInfo { - node_one: self_.get(0).cst_decode(), - one_to_two: self_.get(1).cst_decode(), - node_two: self_.get(2).cst_decode(), - two_to_one: self_.get(3).cst_decode(), - capacity_sats: self_.get(4).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::graph::ChannelUpdateInfo { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 6, - "Expected 6 elements, got {}", - self_.length() - ); - crate::api::graph::ChannelUpdateInfo { - last_update: self_.get(0).cst_decode(), - enabled: self_.get(1).cst_decode(), - cltv_expiry_delta: self_.get(2).cst_decode(), - htlc_minimum_msat: self_.get(3).cst_decode(), - htlc_maximum_msat: self_.get(4).cst_decode(), - fees: self_.get(5).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::ClosureReason { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::ClosureReason::CounterpartyForceClosed { - peer_msg: self_.get(1).cst_decode(), - }, - 1 => crate::api::types::ClosureReason::HolderForceClosed, - 2 => crate::api::types::ClosureReason::LegacyCooperativeClosure, - 3 => crate::api::types::ClosureReason::CounterpartyInitiatedCooperativeClosure, - 4 => crate::api::types::ClosureReason::LocallyInitiatedCooperativeClosure, - 5 => crate::api::types::ClosureReason::CommitmentTxConfirmed, - 6 => crate::api::types::ClosureReason::FundingTimedOut, - 7 => crate::api::types::ClosureReason::ProcessingError { - err: self_.get(1).cst_decode(), - }, - 8 => crate::api::types::ClosureReason::DisconnectedPeer, - 9 => crate::api::types::ClosureReason::OutdatedChannelManager, - 10 => crate::api::types::ClosureReason::CounterpartyCoopClosedUnfundedChannel, - 11 => crate::api::types::ClosureReason::FundingBatchClosure, - 12 => crate::api::types::ClosureReason::HTLCsTimedOut, - _ => unreachable!(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::Config { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 12, - "Expected 12 elements, got {}", - self_.length() - ); - crate::api::types::Config { - storage_dir_path: self_.get(0).cst_decode(), - log_dir_path: self_.get(1).cst_decode(), - network: self_.get(2).cst_decode(), - listening_addresses: self_.get(3).cst_decode(), - default_cltv_expiry_delta: self_.get(4).cst_decode(), - onchain_wallet_sync_interval_secs: self_.get(5).cst_decode(), - wallet_sync_interval_secs: self_.get(6).cst_decode(), - fee_rate_cache_update_interval_secs: self_.get(7).cst_decode(), - trusted_peers_0conf: self_.get(8).cst_decode(), - probing_liquidity_limit_multiplier: self_.get(9).cst_decode(), - log_level: self_.get(10).cst_decode(), - anchor_channels_config: self_.get(11).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::utils::error::DecodeError { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::utils::error::DecodeError::UnknownVersion, - 1 => crate::utils::error::DecodeError::UnknownRequiredFeature, - 2 => crate::utils::error::DecodeError::InvalidValue, - 3 => crate::utils::error::DecodeError::ShortRead, - 4 => crate::utils::error::DecodeError::BadLengthDescriptor, - 5 => crate::utils::error::DecodeError::Io(self_.get(1).cst_decode()), - 6 => crate::utils::error::DecodeError::UnsupportedCompression, - 7 => crate::utils::error::DecodeError::DangerousValue, - _ => unreachable!(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::EntropySourceConfig { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::EntropySourceConfig::SeedFile(self_.get(1).cst_decode()), - 1 => crate::api::types::EntropySourceConfig::SeedBytes(self_.get(1).cst_decode()), - 2 => crate::api::types::EntropySourceConfig::Bip39Mnemonic { - mnemonic: self_.get(1).cst_decode(), - passphrase: self_.get(2).cst_decode(), - }, - _ => unreachable!(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::Event { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::Event::PaymentClaimable { - payment_id: self_.get(1).cst_decode(), - payment_hash: self_.get(2).cst_decode(), - claimable_amount_msat: self_.get(3).cst_decode(), - claim_deadline: self_.get(4).cst_decode(), - }, - 1 => crate::api::types::Event::PaymentSuccessful { - payment_id: self_.get(1).cst_decode(), - payment_hash: self_.get(2).cst_decode(), - fee_paid_msat: self_.get(3).cst_decode(), - }, - 2 => crate::api::types::Event::PaymentFailed { - payment_id: self_.get(1).cst_decode(), - payment_hash: self_.get(2).cst_decode(), - reason: self_.get(3).cst_decode(), - }, - 3 => crate::api::types::Event::PaymentReceived { - payment_id: self_.get(1).cst_decode(), - payment_hash: self_.get(2).cst_decode(), - amount_msat: self_.get(3).cst_decode(), - }, - 4 => crate::api::types::Event::ChannelPending { - channel_id: self_.get(1).cst_decode(), - user_channel_id: self_.get(2).cst_decode(), - former_temporary_channel_id: self_.get(3).cst_decode(), - counterparty_node_id: self_.get(4).cst_decode(), - funding_txo: self_.get(5).cst_decode(), - }, - 5 => crate::api::types::Event::ChannelReady { - channel_id: self_.get(1).cst_decode(), - user_channel_id: self_.get(2).cst_decode(), - counterparty_node_id: self_.get(3).cst_decode(), - }, - 6 => crate::api::types::Event::ChannelClosed { - channel_id: self_.get(1).cst_decode(), - user_channel_id: self_.get(2).cst_decode(), - counterparty_node_id: self_.get(3).cst_decode(), - reason: self_.get(4).cst_decode(), - }, - _ => unreachable!(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::GossipSourceConfig { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::GossipSourceConfig::P2PNetwork, - 1 => crate::api::types::GossipSourceConfig::RapidGossipSync(self_.get(1).cst_decode()), - _ => unreachable!(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::bolt11::LdkBolt11Payment { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::bolt11::LdkBolt11Payment { - ptr: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::bolt12::LdkBolt12Payment { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::bolt12::LdkBolt12Payment { - ptr: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::builder::LdkMnemonic { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::builder::LdkMnemonic { - seed_phrase: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::graph::LdkNetworkGraph { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::graph::LdkNetworkGraph { - inner: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::node::LdkNode { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::node::LdkNode { - ptr: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::utils::error::LdkNodeError { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::utils::error::LdkNodeError::InvalidTxid, - 1 => crate::utils::error::LdkNodeError::AlreadyRunning, - 2 => crate::utils::error::LdkNodeError::NotRunning, - 3 => crate::utils::error::LdkNodeError::OnchainTxCreationFailed, - 4 => crate::utils::error::LdkNodeError::ConnectionFailed, - 5 => crate::utils::error::LdkNodeError::InvoiceCreationFailed, - 6 => crate::utils::error::LdkNodeError::PaymentSendingFailed, - 7 => crate::utils::error::LdkNodeError::ProbeSendingFailed, - 8 => crate::utils::error::LdkNodeError::ChannelCreationFailed, - 9 => crate::utils::error::LdkNodeError::ChannelClosingFailed, - 10 => crate::utils::error::LdkNodeError::ChannelConfigUpdateFailed, - 11 => crate::utils::error::LdkNodeError::PersistenceFailed, - 12 => crate::utils::error::LdkNodeError::WalletOperationFailed, - 13 => crate::utils::error::LdkNodeError::OnchainTxSigningFailed, - 14 => crate::utils::error::LdkNodeError::MessageSigningFailed, - 15 => crate::utils::error::LdkNodeError::TxSyncFailed, - 16 => crate::utils::error::LdkNodeError::GossipUpdateFailed, - 17 => crate::utils::error::LdkNodeError::InvalidAddress, - 18 => crate::utils::error::LdkNodeError::InvalidSocketAddress, - 19 => crate::utils::error::LdkNodeError::InvalidPublicKey, - 20 => crate::utils::error::LdkNodeError::InvalidSecretKey, - 21 => crate::utils::error::LdkNodeError::InvalidPaymentHash, - 22 => crate::utils::error::LdkNodeError::InvalidPaymentPreimage, - 23 => crate::utils::error::LdkNodeError::InvalidPaymentSecret, - 24 => crate::utils::error::LdkNodeError::InvalidAmount, - 25 => crate::utils::error::LdkNodeError::InvalidInvoice, - 26 => crate::utils::error::LdkNodeError::InvalidChannelId, - 27 => crate::utils::error::LdkNodeError::InvalidNetwork, - 28 => crate::utils::error::LdkNodeError::DuplicatePayment, - 29 => crate::utils::error::LdkNodeError::InsufficientFunds, - 30 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateFailed, - 31 => crate::utils::error::LdkNodeError::LiquidityRequestFailed, - 32 => crate::utils::error::LdkNodeError::LiquiditySourceUnavailable, - 33 => crate::utils::error::LdkNodeError::LiquidityFeeTooHigh, - 34 => crate::utils::error::LdkNodeError::InvalidPaymentId, - 35 => crate::utils::error::LdkNodeError::Decode(self_.get(1).cst_decode()), - 36 => crate::utils::error::LdkNodeError::Bolt12Parse(self_.get(1).cst_decode()), - 37 => crate::utils::error::LdkNodeError::InvoiceRequestCreationFailed, - 38 => crate::utils::error::LdkNodeError::OfferCreationFailed, - 39 => crate::utils::error::LdkNodeError::RefundCreationFailed, - 40 => crate::utils::error::LdkNodeError::FeerateEstimationUpdateTimeout, - 41 => crate::utils::error::LdkNodeError::WalletOperationTimeout, - 42 => crate::utils::error::LdkNodeError::TxSyncTimeout, - 43 => crate::utils::error::LdkNodeError::GossipUpdateTimeout, - 44 => crate::utils::error::LdkNodeError::InvalidOfferId, - 45 => crate::utils::error::LdkNodeError::InvalidNodeId, - 46 => crate::utils::error::LdkNodeError::InvalidOffer, - 47 => crate::utils::error::LdkNodeError::InvalidRefund, - 48 => crate::utils::error::LdkNodeError::UnsupportedCurrency, - _ => unreachable!(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::on_chain::LdkOnChainPayment { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::on_chain::LdkOnChainPayment { - ptr: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::spontaneous::LdkSpontaneousPayment { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::spontaneous::LdkSpontaneousPayment { - ptr: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::LightningBalance { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::LightningBalance::ClaimableOnChannelClose { - channel_id: self_.get(1).cst_decode(), - counterparty_node_id: self_.get(2).cst_decode(), - amount_satoshis: self_.get(3).cst_decode(), - }, - 1 => crate::api::types::LightningBalance::ClaimableAwaitingConfirmations { - channel_id: self_.get(1).cst_decode(), - counterparty_node_id: self_.get(2).cst_decode(), - amount_satoshis: self_.get(3).cst_decode(), - confirmation_height: self_.get(4).cst_decode(), - }, - 2 => crate::api::types::LightningBalance::ContentiousClaimable { - channel_id: self_.get(1).cst_decode(), - counterparty_node_id: self_.get(2).cst_decode(), - amount_satoshis: self_.get(3).cst_decode(), - timeout_height: self_.get(4).cst_decode(), - payment_hash: self_.get(5).cst_decode(), - payment_preimage: self_.get(6).cst_decode(), - }, - 3 => crate::api::types::LightningBalance::MaybeTimeoutClaimableHTLC { - channel_id: self_.get(1).cst_decode(), - counterparty_node_id: self_.get(2).cst_decode(), - amount_satoshis: self_.get(3).cst_decode(), - claimable_height: self_.get(4).cst_decode(), - payment_hash: self_.get(5).cst_decode(), - }, - 4 => crate::api::types::LightningBalance::MaybePreimageClaimableHTLC { - channel_id: self_.get(1).cst_decode(), - counterparty_node_id: self_.get(2).cst_decode(), - amount_satoshis: self_.get(3).cst_decode(), - expiry_height: self_.get(4).cst_decode(), - payment_hash: self_.get(5).cst_decode(), - }, - 5 => crate::api::types::LightningBalance::CounterpartyRevokedOutputClaimable { - channel_id: self_.get(1).cst_decode(), - counterparty_node_id: self_.get(2).cst_decode(), - amount_satoshis: self_.get(3).cst_decode(), - }, - _ => unreachable!(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::LiquiditySourceConfig { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::types::LiquiditySourceConfig { - lsps2_service: self_.get(0).cst_decode(), - } - } -} -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - self.dyn_into::() - .unwrap() - .iter() - .map(CstDecode::cst_decode) - .collect() - } -} -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - self.dyn_into::() - .unwrap() - .iter() - .map(CstDecode::cst_decode) - .collect() - } -} -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - self.dyn_into::() - .unwrap() - .iter() - .map(CstDecode::cst_decode) - .collect() - } -} -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - self.dyn_into::() - .unwrap() - .iter() - .map(CstDecode::cst_decode) - .collect() - } -} -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - self.dyn_into::() - .unwrap() - .iter() - .map(CstDecode::cst_decode) - .collect() - } -} -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - self.dyn_into::() - .unwrap() - .iter() - .map(CstDecode::cst_decode) - .collect() - } -} -impl CstDecode> for Box<[u64]> { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - self.into_vec() - } -} -impl CstDecode> for Box<[u8]> { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - self.into_vec() - } -} -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - self.dyn_into::() - .unwrap() - .iter() - .map(CstDecode::cst_decode) - .collect() - } -} -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - self.dyn_into::() - .unwrap() - .iter() - .map(CstDecode::cst_decode) - .collect() - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::LSPFeeLimits { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 2, - "Expected 2 elements, got {}", - self_.length() - ); - crate::api::types::LSPFeeLimits { - max_total_opening_fee_msat: self_.get(0).cst_decode(), - max_proportional_opening_fee_ppm_msat: self_.get(1).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::MaxDustHTLCExposure { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::MaxDustHTLCExposure::FixedLimitMsat(self_.get(1).cst_decode()), - 1 => { - crate::api::types::MaxDustHTLCExposure::FeeRateMultiplier(self_.get(1).cst_decode()) - } - _ => unreachable!(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::graph::NodeId { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::graph::NodeId { - compressed: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::NodeStatus { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 8, - "Expected 8 elements, got {}", - self_.length() - ); - crate::api::types::NodeStatus { - is_running: self_.get(0).cst_decode(), - is_listening: self_.get(1).cst_decode(), - current_best_block: self_.get(2).cst_decode(), - latest_wallet_sync_timestamp: self_.get(3).cst_decode(), - latest_onchain_wallet_sync_timestamp: self_.get(4).cst_decode(), - latest_fee_rate_cache_update_timestamp: self_.get(5).cst_decode(), - latest_rgs_snapshot_timestamp: self_.get(6).cst_decode(), - latest_node_announcement_broadcast_timestamp: self_.get(7).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::OfferId { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::types::OfferId(self_.get(0).cst_decode()) - } -} -impl CstDecode> for Option { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Option { - self.map(CstDecode::cst_decode) - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::OutPoint { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 2, - "Expected 2 elements, got {}", - self_.length() - ); - crate::api::types::OutPoint { - txid: self_.get(0).cst_decode(), - vout: self_.get(1).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentDetails { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 5, - "Expected 5 elements, got {}", - self_.length() - ); - crate::api::types::PaymentDetails { - id: self_.get(0).cst_decode(), - kind: self_.get(1).cst_decode(), - amount_msat: self_.get(2).cst_decode(), - direction: self_.get(3).cst_decode(), - status: self_.get(4).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentHash { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::types::PaymentHash { - data: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentId { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::types::PaymentId(self_.get(0).cst_decode()) - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentKind { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::PaymentKind::Onchain, - 1 => crate::api::types::PaymentKind::Bolt11 { - hash: self_.get(1).cst_decode(), - preimage: self_.get(2).cst_decode(), - secret: self_.get(3).cst_decode(), - }, - 2 => crate::api::types::PaymentKind::Bolt11Jit { - hash: self_.get(1).cst_decode(), - preimage: self_.get(2).cst_decode(), - secret: self_.get(3).cst_decode(), - lsp_fee_limits: self_.get(4).cst_decode(), - }, - 3 => crate::api::types::PaymentKind::Spontaneous { - hash: self_.get(1).cst_decode(), - preimage: self_.get(2).cst_decode(), - }, - 4 => crate::api::types::PaymentKind::Bolt12Offer { - hash: self_.get(1).cst_decode(), - preimage: self_.get(2).cst_decode(), - secret: self_.get(3).cst_decode(), - offer_id: self_.get(4).cst_decode(), - }, - 5 => crate::api::types::PaymentKind::Bolt12Refund { - hash: self_.get(1).cst_decode(), - preimage: self_.get(2).cst_decode(), - secret: self_.get(3).cst_decode(), - }, - _ => unreachable!(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentPreimage { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::types::PaymentPreimage { - data: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentSecret { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::types::PaymentSecret { - data: self_.get(0).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PeerDetails { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 3, - "Expected 3 elements, got {}", - self_.length() - ); - crate::api::types::PeerDetails { - node_id: self_.get(0).cst_decode(), - address: self_.get(1).cst_decode(), - is_connected: self_.get(2).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PendingSweepBalance { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::PendingSweepBalance::PendingBroadcast { - channel_id: self_.get(1).cst_decode(), - amount_satoshis: self_.get(2).cst_decode(), - }, - 1 => crate::api::types::PendingSweepBalance::BroadcastAwaitingConfirmation { - channel_id: self_.get(1).cst_decode(), - latest_broadcast_height: self_.get(2).cst_decode(), - latest_spending_txid: self_.get(3).cst_decode(), - amount_satoshis: self_.get(4).cst_decode(), - }, - 2 => crate::api::types::PendingSweepBalance::AwaitingThresholdConfirmations { - channel_id: self_.get(1).cst_decode(), - latest_spending_txid: self_.get(2).cst_decode(), - confirmation_hash: self_.get(3).cst_decode(), - confirmation_height: self_.get(4).cst_decode(), - amount_satoshis: self_.get(5).cst_decode(), - }, - _ => unreachable!(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PublicKey { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::types::PublicKey { - hex: self_.get(0).cst_decode(), - } - } -} -impl - CstDecode<( - crate::api::types::SocketAddress, - crate::api::types::PublicKey, - Option, - )> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode( - self, - ) -> ( - crate::api::types::SocketAddress, - crate::api::types::PublicKey, - Option, - ) { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 3, - "Expected 3 elements, got {}", - self_.length() - ); - ( - self_.get(0).cst_decode(), - self_.get(1).cst_decode(), - self_.get(2).cst_decode(), - ) - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::graph::RoutingFees { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 2, - "Expected 2 elements, got {}", - self_.length() - ); - crate::api::graph::RoutingFees { - base_msat: self_.get(0).cst_decode(), - proportional_millionths: self_.get(1).cst_decode(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::SocketAddress { - let self_ = self.unchecked_into::(); - match self_.get(0).unchecked_into_f64() as _ { - 0 => crate::api::types::SocketAddress::TcpIpV4 { - addr: self_.get(1).cst_decode(), - port: self_.get(2).cst_decode(), - }, - 1 => crate::api::types::SocketAddress::TcpIpV6 { - addr: self_.get(1).cst_decode(), - port: self_.get(2).cst_decode(), - }, - 2 => crate::api::types::SocketAddress::OnionV2(self_.get(1).cst_decode()), - 3 => crate::api::types::SocketAddress::OnionV3 { - ed25519_pubkey: self_.get(1).cst_decode(), - checksum: self_.get(2).cst_decode(), - version: self_.get(3).cst_decode(), - port: self_.get(4).cst_decode(), - }, - 4 => crate::api::types::SocketAddress::Hostname { - addr: self_.get(1).cst_decode(), - port: self_.get(2).cst_decode(), - }, - _ => unreachable!(), - } - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::Txid { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::types::Txid { - hash: self_.get(0).cst_decode(), - } - } -} -impl CstDecode<[u8; 12]> for Box<[u8]> { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 12] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } -} -impl CstDecode<[u8; 16]> for Box<[u8]> { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 16] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } -} -impl CstDecode<[u8; 32]> for Box<[u8]> { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 32] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } -} -impl CstDecode<[u8; 4]> for Box<[u8]> { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 4] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } -} -impl CstDecode<[u8; 64]> for Box<[u8]> { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 64] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::UserChannelId { - let self_ = self - .dyn_into::() - .unwrap(); - assert_eq!( - self_.length(), - 1, - "Expected 1 elements, got {}", - self_.length() - ); - crate::api::types::UserChannelId { - data: self_.get(0).cst_decode(), - } - } -} -impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> NodeBuilder { - flutter_rust_bridge::for_generated::rust_auto_opaque_decode_owned(CstDecode::< - RustOpaqueNom>, - >::cst_decode( - self - )) - } -} -impl CstDecode>> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> RustOpaqueNom> { - #[cfg(target_pointer_width = "64")] - { - compile_error!("64-bit pointers are not supported."); - } - unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } - } -} -impl CstDecode> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> RustOpaqueNom { - #[cfg(target_pointer_width = "64")] - { - compile_error!("64-bit pointers are not supported."); - } - unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } - } -} -impl CstDecode>> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode( - self, - ) -> RustOpaqueNom> { - #[cfg(target_pointer_width = "64")] - { - compile_error!("64-bit pointers are not supported."); - } - unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } - } -} -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> RustOpaqueNom { - #[cfg(target_pointer_width = "64")] - { - compile_error!("64-bit pointers are not supported."); - } - unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } - } -} -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> RustOpaqueNom { - #[cfg(target_pointer_width = "64")] - { - compile_error!("64-bit pointers are not supported."); - } - unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } - } -} -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> RustOpaqueNom { - #[cfg(target_pointer_width = "64")] - { - compile_error!("64-bit pointers are not supported."); - } - unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } - } -} -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> RustOpaqueNom { - #[cfg(target_pointer_width = "64")] - { - compile_error!("64-bit pointers are not supported."); - } - unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } - } -} -impl CstDecode> - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> RustOpaqueNom { - #[cfg(target_pointer_width = "64")] - { - compile_error!("64-bit pointers are not supported."); - } - unsafe { decode_rust_opaque_nom((self.as_f64().unwrap() as usize) as _) } - } -} -impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> String { - self.as_string().expect("non-UTF-8 string, or not a string") - } -} -impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> bool { - self.is_truthy() - } -} -impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> i32 { - self.unchecked_into_f64() as _ - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::utils::error::LdkBuilderError { - (self.unchecked_into_f64() as i32).cst_decode() - } -} -impl CstDecode> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - let buf = self - .dyn_into::() - .unwrap(); - let buf = flutter_rust_bridge::for_generated::js_sys::Uint8Array::new(&buf.buffer()); - flutter_rust_bridge::for_generated::slice_from_byte_buffer(buf.to_vec()).into() - } -} -impl CstDecode> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - self.unchecked_into::() - .to_vec() - .into() - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::LogLevel { - (self.unchecked_into_f64() as i32).cst_decode() - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::Network { - (self.unchecked_into_f64() as i32).cst_decode() - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentDirection { - (self.unchecked_into_f64() as i32).cst_decode() - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentFailureReason { - (self.unchecked_into_f64() as i32).cst_decode() - } -} -impl CstDecode - for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue -{ - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> crate::api::types::PaymentStatus { - (self.unchecked_into_f64() as i32).cst_decode() - } -} -impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> u16 { - self.unchecked_into_f64() as _ - } -} -impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> u32 { - self.unchecked_into_f64() as _ - } -} -impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> u64 { - ::std::convert::TryInto::::try_into(self).unwrap() as _ - } -} -impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> u8 { - self.unchecked_into_f64() as _ - } -} -impl CstDecode<[u8; 12]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 12] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } -} -impl CstDecode<[u8; 16]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 16] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } -} -impl CstDecode<[u8; 32]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 32] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } -} -impl CstDecode<[u8; 4]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 4] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } -} -impl CstDecode<[u8; 64]> for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> [u8; 64] { - let vec: Vec = self.cst_decode(); - flutter_rust_bridge::for_generated::from_vec_to_array(vec) - } -} -impl CstDecode for flutter_rust_bridge::for_generated::wasm_bindgen::JsValue { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> usize { - ::std::convert::TryInto::::try_into(self).unwrap() as _ - } -} - -#[wasm_bindgen] -pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - description: String, - expiry_secs: u32, -) { - wire__crate__api__bolt11__ldk_bolt_11_payment_receive_impl( - port_, - that, - amount_msat, - description, - expiry_secs, - ) -} - -#[wasm_bindgen] -pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - description: String, - expiry_secs: u32, -) { - wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_impl( - port_, - that, - description, - expiry_secs, - ) -} - -#[wasm_bindgen] -pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - description: String, - expiry_secs: u32, - max_proportional_lsp_fee_limit_ppm_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__bolt11__ldk_bolt_11_payment_receive_variable_amount_via_jit_channel_impl( - port_, - that, - description, - expiry_secs, - max_proportional_lsp_fee_limit_ppm_msat, - ) -} - -#[wasm_bindgen] -pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - description: String, - expiry_secs: u32, - max_total_lsp_fee_limit_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__bolt11__ldk_bolt_11_payment_receive_via_jit_channel_impl( - port_, - that, - amount_msat, - description, - expiry_secs, - max_total_lsp_fee_limit_msat, - ) -} - -#[wasm_bindgen] -pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - invoice: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__bolt11__ldk_bolt_11_payment_send_impl(port_, that, invoice) -} - -#[wasm_bindgen] -pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - invoice: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_impl(port_, that, invoice) -} - -#[wasm_bindgen] -pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - invoice: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__bolt11__ldk_bolt_11_payment_send_probes_using_amount_impl( - port_, - that, - invoice, - amount_msat, - ) -} - -#[wasm_bindgen] -pub fn wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - invoice: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__bolt11__ldk_bolt_11_payment_send_using_amount_impl( - port_, - that, - invoice, - amount_msat, - ) -} - -#[wasm_bindgen] -pub fn wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder( - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { - wire__crate__api__builder__NodeBuilder_auto_accessor_get_builder_impl(that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder( - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - builder: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) -> flutter_rust_bridge::for_generated::WireSyncRust2DartDco { - wire__crate__api__builder__NodeBuilder_auto_accessor_set_builder_impl(that, builder) -} - -#[wasm_bindgen] -pub fn wire__crate__api__builder__NodeBuilder_build( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__builder__NodeBuilder_build_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__builder__NodeBuilder_build_with_fs_store( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__builder__NodeBuilder_build_with_fs_store_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__builder__NodeBuilder_create_builder( - port_: flutter_rust_bridge::for_generated::MessagePort, - config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - chain_data_source_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - entropy_source_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - gossip_source_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - liquidity_source_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__builder__NodeBuilder_create_builder_impl( - port_, - config, - chain_data_source_config, - entropy_source_config, - gossip_source_config, - liquidity_source_config, - ) -} - -#[wasm_bindgen] -pub fn wire__crate__api__builder__ldk_mnemonic_generate( - port_: flutter_rust_bridge::for_generated::MessagePort, -) { - wire__crate__api__builder__ldk_mnemonic_generate_impl(port_) -} - -#[wasm_bindgen] -pub fn wire__crate__api__graph__ldk_network_graph_channel( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - short_channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__graph__ldk_network_graph_channel_impl(port_, that, short_channel_id) -} - -#[wasm_bindgen] -pub fn wire__crate__api__graph__ldk_network_graph_list_channels( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__graph__ldk_network_graph_list_channels_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__graph__ldk_network_graph_list_nodes( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__graph__ldk_network_graph_list_nodes_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_bolt11_payment( - port_: flutter_rust_bridge::for_generated::MessagePort, - ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_bolt11_payment_impl(port_, ptr) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_bolt12_payment( - port_: flutter_rust_bridge::for_generated::MessagePort, - ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_bolt12_payment_impl(port_, ptr) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_close_channel( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - user_channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - counterparty_node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_close_channel_impl( - port_, - that, - user_channel_id, - counterparty_node_id, - ) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_config( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_config_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_connect( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - address: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - persist: bool, -) { - wire__crate__api__node__ldk_node_connect_impl(port_, that, node_id, address, persist) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_connect_open_channel( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - socket_address: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - channel_amount_sats: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - push_to_counterparty_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - announce_channel: bool, - channel_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_connect_open_channel_impl( - port_, - that, - socket_address, - node_id, - channel_amount_sats, - push_to_counterparty_msat, - announce_channel, - channel_config, - ) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_disconnect( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - counterparty_node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_disconnect_impl(port_, that, counterparty_node_id) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_event_handled( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_event_handled_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_force_close_channel( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - user_channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - counterparty_node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_force_close_channel_impl( - port_, - that, - user_channel_id, - counterparty_node_id, - ) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_list_balances( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_list_balances_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_list_channels( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_list_channels_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_list_payments( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_list_payments_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_list_payments_with_filter( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - payment_direction: i32, -) { - wire__crate__api__node__ldk_node_list_payments_with_filter_impl(port_, that, payment_direction) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_list_peers( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_list_peers_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_listening_addresses( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_listening_addresses_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_network_graph( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_network_graph_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_next_event( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_next_event_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_next_event_async( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_next_event_async_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_node_id( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_node_id_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_on_chain_payment( - port_: flutter_rust_bridge::for_generated::MessagePort, - ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_on_chain_payment_impl(port_, ptr) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_payment( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - payment_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_payment_impl(port_, that, payment_id) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_remove_payment( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - payment_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_remove_payment_impl(port_, that, payment_id) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_sign_message( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - msg: Box<[u8]>, -) { - wire__crate__api__node__ldk_node_sign_message_impl(port_, that, msg) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_spontaneous_payment( - port_: flutter_rust_bridge::for_generated::MessagePort, - ptr: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_spontaneous_payment_impl(port_, ptr) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_start( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_start_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_status( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_status_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_stop( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_stop_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_sync_wallets( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_sync_wallets_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_update_channel_config( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - user_channel_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - counterparty_node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - channel_config: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_update_channel_config_impl( - port_, - that, - user_channel_id, - counterparty_node_id, - channel_config, - ) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_verify_signature( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - msg: Box<[u8]>, - sig: String, - public_key: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_verify_signature_impl(port_, that, msg, sig, public_key) -} - -#[wasm_bindgen] -pub fn wire__crate__api__node__ldk_node_wait_next_event( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__node__ldk_node_wait_next_event_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__on_chain__ldk_on_chain_payment_new_address( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__on_chain__ldk_on_chain_payment_new_address_impl(port_, that) -} - -#[wasm_bindgen] -pub fn wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - address: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__on_chain__ldk_on_chain_payment_send_all_to_address_impl(port_, that, address) -} - -#[wasm_bindgen] -pub fn wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - address: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - amount_sats: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__on_chain__ldk_on_chain_payment_send_to_address_impl( - port_, - that, - address, - amount_sats, - ) -} - -#[wasm_bindgen] -pub fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__spontaneous__ldk_spontaneous_payment_send_impl( - port_, - that, - amount_msat, - node_id, - ) -} - -#[wasm_bindgen] -pub fn wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes( - port_: flutter_rust_bridge::for_generated::MessagePort, - that: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - amount_msat: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, - node_id: flutter_rust_bridge::for_generated::wasm_bindgen::JsValue, -) { - wire__crate__api__spontaneous__ldk_spontaneous_payment_send_probes_impl( - port_, - that, - amount_msat, - node_id, - ) -} - -#[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( - ptr: *const std::ffi::c_void, -) { - unsafe { - StdArc::>::increment_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_Arcldk_nodepaymentBolt12Payment( - ptr: *const std::ffi::c_void, -) { - unsafe { - StdArc::>::decrement_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_Node(ptr: *const std::ffi::c_void) { - unsafe { - StdArc::::increment_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_Node(ptr: *const std::ffi::c_void) { - unsafe { - StdArc::::decrement_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( - ptr: *const std::ffi::c_void, -) { - unsafe { - StdArc::>::increment_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerNodeBuilder( - ptr: *const std::ffi::c_void, -) { - unsafe { - StdArc::>::decrement_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodeBuilder(ptr: *const std::ffi::c_void) { - unsafe { - StdArc::::increment_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodeBuilder(ptr: *const std::ffi::c_void) { - unsafe { - StdArc::::decrement_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( - ptr: *const std::ffi::c_void, -) { - unsafe { - StdArc::::increment_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodegraphNetworkGraph( - ptr: *const std::ffi::c_void, -) { - unsafe { - StdArc::::decrement_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( - ptr: *const std::ffi::c_void, -) { - unsafe { - StdArc::::increment_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentBolt11Payment( - ptr: *const std::ffi::c_void, -) { - unsafe { - StdArc::::decrement_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( - ptr: *const std::ffi::c_void, -) { - unsafe { - StdArc::::increment_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentOnchainPayment( - ptr: *const std::ffi::c_void, -) { - unsafe { - StdArc::::decrement_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_increment_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( - ptr: *const std::ffi::c_void, -) { - unsafe { - StdArc::::increment_strong_count(ptr as _); - } -} - -#[wasm_bindgen] -pub fn rust_arc_decrement_strong_count_RustOpaque_ldk_nodepaymentSpontaneousPayment( - ptr: *const std::ffi::c_void, -) { - unsafe { - StdArc::::decrement_strong_count(ptr as _); - } -}