diff --git a/Cargo.lock b/Cargo.lock index f46395cc..bdac97e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,12 +40,13 @@ dependencies = [ [[package]] name = "allo-isolate" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71441b1911974f09ca413fc93fb2e3bfc60f4a284fdc7fd51e5a81b6afc61727" +checksum = "c258c1a017ecaccfb34c8fa46ecbb2f5402584e31082c12b5caf0be82ac5ac44" dependencies = [ "anyhow", "atomic", + "backtrace", "chrono", ] @@ -1319,12 +1320,13 @@ dependencies = [ [[package]] name = "flutter_rust_bridge" -version = "1.81.0" +version = "1.82.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5855fcecefa781ff89553b91b376a1aa9505df13aadc78caa7062534b0d5aabc" +checksum = "d5b3f423054f2fbc74e3dcef394ef3fd7a4f8309265a6b9a6ccf9c0fb07bb14b" dependencies = [ "allo-isolate", "anyhow", + "backtrace", "build-target", "bytemuck", "cc", diff --git a/flutter/lib/generated/bridge_definitions.dart b/flutter/lib/generated/bridge_definitions.dart index 924d96e6..284e8081 100644 --- a/flutter/lib/generated/bridge_definitions.dart +++ b/flutter/lib/generated/bridge_definitions.dart @@ -1,5 +1,5 @@ // AUTO GENERATED FILE, DO NOT EDIT. -// Generated by `flutter_rust_bridge`@ 1.80.1. +// Generated by `flutter_rust_bridge`@ 1.82.1. // ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const import 'bridge_generated.io.dart' if (dart.library.html) 'bridge_generated.web.dart'; diff --git a/flutter/lib/generated/bridge_generated.dart b/flutter/lib/generated/bridge_generated.dart index 7f45b03b..31b104ad 100644 --- a/flutter/lib/generated/bridge_generated.dart +++ b/flutter/lib/generated/bridge_generated.dart @@ -1,5 +1,5 @@ // AUTO GENERATED FILE, DO NOT EDIT. -// Generated by `flutter_rust_bridge`@ 1.80.1. +// Generated by `flutter_rust_bridge`@ 1.82.1. // ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const import "bridge_definitions.dart"; @@ -21,6 +21,7 @@ class NativeImpl implements Native { return _platform.executeNormal(FlutterRustBridgeTask( callFfi: (port_) => _platform.inner.wire_init_cashu(port_), parseSuccessData: _wire2api_String, + parseErrorData: _wire2api_FrbAnyhowException, constMeta: kInitCashuConstMeta, argValues: [], hint: hint, @@ -36,6 +37,7 @@ class NativeImpl implements Native { return _platform.executeStream(FlutterRustBridgeTask( callFfi: (port_) => _platform.inner.wire_get_cashu_balance(port_), parseSuccessData: _wire2api_u64, + parseErrorData: null, constMeta: kGetCashuBalanceConstMeta, argValues: [], hint: hint, @@ -53,6 +55,7 @@ class NativeImpl implements Native { return _platform.executeStream(FlutterRustBridgeTask( callFfi: (port_) => _platform.inner.wire_cashu_mint_tokens(port_, arg0, arg1), parseSuccessData: _wire2api_u64, + parseErrorData: null, constMeta: kCashuMintTokensConstMeta, argValues: [amount, hash], hint: hint, @@ -69,6 +72,7 @@ class NativeImpl implements Native { return _platform.executeStream(FlutterRustBridgeTask( callFfi: (port_) => _platform.inner.wire_get_cashu_mint_payment_request(port_, arg0), parseSuccessData: _wire2api_flutter_payment_request, + parseErrorData: null, constMeta: kGetCashuMintPaymentRequestConstMeta, argValues: [amount], hint: hint, @@ -85,6 +89,7 @@ class NativeImpl implements Native { return _platform.executeSync(FlutterRustBridgeSyncTask( callFfi: () => _platform.inner.wire_decode_invoice(arg0), parseSuccessData: _wire2api_flutter_invoice, + parseErrorData: _wire2api_FrbAnyhowException, constMeta: kDecodeInvoiceConstMeta, argValues: [invoice], hint: hint, @@ -101,6 +106,7 @@ class NativeImpl implements Native { return _platform.executeStream(FlutterRustBridgeTask( callFfi: (port_) => _platform.inner.wire_cashu_pay_invoice(port_, arg0), parseSuccessData: _wire2api_bool, + parseErrorData: null, constMeta: kCashuPayInvoiceConstMeta, argValues: [invoice], hint: hint, @@ -117,6 +123,7 @@ class NativeImpl implements Native { return _platform.executeNormal(FlutterRustBridgeTask( callFfi: (port_) => _platform.inner.wire_join_federation(port_, arg0), parseSuccessData: _wire2api_unit, + parseErrorData: _wire2api_FrbAnyhowException, constMeta: kJoinFederationConstMeta, argValues: [federation], hint: hint, @@ -133,6 +140,7 @@ class NativeImpl implements Native { return _platform.executeStream(FlutterRustBridgeTask( callFfi: (port_) => _platform.inner.wire_get_fedimint_payment_request(port_, arg0), parseSuccessData: _wire2api_fedimint_payment_request, + parseErrorData: null, constMeta: kGetFedimintPaymentRequestConstMeta, argValues: [amount], hint: hint, @@ -150,6 +158,7 @@ class NativeImpl implements Native { return _platform.executeStream(FlutterRustBridgeTask( callFfi: (port_) => _platform.inner.wire_fedimint_mint_tokens(port_, arg0, arg1), parseSuccessData: _wire2api_u64, + parseErrorData: null, constMeta: kFedimintMintTokensConstMeta, argValues: [amount, operationId], hint: hint, @@ -165,6 +174,7 @@ class NativeImpl implements Native { return _platform.executeStream(FlutterRustBridgeTask( callFfi: (port_) => _platform.inner.wire_get_fedimint_balance(port_), parseSuccessData: _wire2api_u64, + parseErrorData: null, constMeta: kGetFedimintBalanceConstMeta, argValues: [], hint: hint, @@ -181,6 +191,7 @@ class NativeImpl implements Native { return _platform.executeStream(FlutterRustBridgeTask( callFfi: (port_) => _platform.inner.wire_fedimint_pay_invoice(port_, arg0), parseSuccessData: _wire2api_bool, + parseErrorData: null, constMeta: kFedimintPayInvoiceConstMeta, argValues: [invoice], hint: hint, @@ -197,6 +208,7 @@ class NativeImpl implements Native { return _platform.executeStream(FlutterRustBridgeTask( callFfi: (port_) => _platform.inner.wire_receive_token(port_, arg0), parseSuccessData: _wire2api_u64, + parseErrorData: null, constMeta: kReceiveTokenConstMeta, argValues: [token], hint: hint, @@ -212,6 +224,7 @@ class NativeImpl implements Native { return _platform.executeStream(FlutterRustBridgeTask( callFfi: (port_) => _platform.inner.wire_get_btcprice(port_), parseSuccessData: _wire2api_f64, + parseErrorData: null, constMeta: kGetBtcpriceConstMeta, argValues: [], hint: hint, @@ -228,6 +241,10 @@ class NativeImpl implements Native { } // Section: wire2api + FrbAnyhowException _wire2api_FrbAnyhowException(dynamic raw) { + return FrbAnyhowException(raw as String); + } + String _wire2api_String(dynamic raw) { return raw as String; } diff --git a/flutter/lib/generated/bridge_generated.io.dart b/flutter/lib/generated/bridge_generated.io.dart index b65ec22a..5de876ed 100644 --- a/flutter/lib/generated/bridge_generated.io.dart +++ b/flutter/lib/generated/bridge_generated.io.dart @@ -1,5 +1,5 @@ // AUTO GENERATED FILE, DO NOT EDIT. -// Generated by `flutter_rust_bridge`@ 1.80.1. +// Generated by `flutter_rust_bridge`@ 1.82.1. // ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const import "bridge_definitions.dart"; diff --git a/flutter/lib/generated/bridge_generated.web.dart b/flutter/lib/generated/bridge_generated.web.dart index bf407b34..fd12f469 100644 --- a/flutter/lib/generated/bridge_generated.web.dart +++ b/flutter/lib/generated/bridge_generated.web.dart @@ -1,5 +1,5 @@ // AUTO GENERATED FILE, DO NOT EDIT. -// Generated by `flutter_rust_bridge`@ 1.80.1. +// Generated by `flutter_rust_bridge`@ 1.82.1. // ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const import "bridge_definitions.dart"; diff --git a/flutter/native/Cargo.toml b/flutter/native/Cargo.toml index 471a03c4..63538245 100644 --- a/flutter/native/Cargo.toml +++ b/flutter/native/Cargo.toml @@ -17,7 +17,7 @@ moksha-fedimint = { path = "../../moksha-fedimint" } tracing = "0.1.37" anyhow = { version = "1.0.75", features = ["backtrace"] } thiserror = "1.0.48" -flutter_rust_bridge = "1.81.0" +flutter_rust_bridge = "1.82.1" lightning-invoice = "0.24.0" async-trait = "0.1.72" url = "2.4.1" diff --git a/flutter/native/src/bridge_generated.rs b/flutter/native/src/bridge_generated.rs index e2573a45..a1d0f85b 100644 --- a/flutter/native/src/bridge_generated.rs +++ b/flutter/native/src/bridge_generated.rs @@ -9,7 +9,7 @@ clippy::too_many_arguments )] // AUTO GENERATED FILE, DO NOT EDIT. -// Generated by `flutter_rust_bridge`@ 1.80.1. +// Generated by `flutter_rust_bridge`@ 1.82.1. use crate::api::*; use core::panic::UnwindSafe; @@ -23,7 +23,7 @@ use std::sync::Arc; // Section: wire functions fn wire_init_cashu_impl(port_: MessagePort) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, String>( + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, String, _>( WrapInfo { debug_name: "init_cashu", port: Some(port_), @@ -33,7 +33,7 @@ fn wire_init_cashu_impl(port_: MessagePort) { ) } fn wire_get_cashu_balance_impl(port_: MessagePort) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>( + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, (), _>( WrapInfo { debug_name: "get_cashu_balance", port: Some(port_), @@ -47,7 +47,7 @@ fn wire_cashu_mint_tokens_impl( amount: impl Wire2Api + UnwindSafe, hash: impl Wire2Api + UnwindSafe, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>( + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, (), _>( WrapInfo { debug_name: "cashu_mint_tokens", port: Some(port_), @@ -66,7 +66,7 @@ fn wire_get_cashu_mint_payment_request_impl( port_: MessagePort, amount: impl Wire2Api + UnwindSafe, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>( + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, (), _>( WrapInfo { debug_name: "get_cashu_mint_payment_request", port: Some(port_), @@ -99,7 +99,7 @@ fn wire_decode_invoice_impl( ) } fn wire_cashu_pay_invoice_impl(port_: MessagePort, invoice: impl Wire2Api + UnwindSafe) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>( + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, (), _>( WrapInfo { debug_name: "cashu_pay_invoice", port: Some(port_), @@ -114,7 +114,7 @@ fn wire_cashu_pay_invoice_impl(port_: MessagePort, invoice: impl Wire2Api + UnwindSafe) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>( + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, (), _>( WrapInfo { debug_name: "join_federation", port: Some(port_), @@ -130,7 +130,7 @@ fn wire_get_fedimint_payment_request_impl( port_: MessagePort, amount: impl Wire2Api + UnwindSafe, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>( + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, (), _>( WrapInfo { debug_name: "get_fedimint_payment_request", port: Some(port_), @@ -152,7 +152,7 @@ fn wire_fedimint_mint_tokens_impl( amount: impl Wire2Api + UnwindSafe, operation_id: impl Wire2Api + UnwindSafe, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>( + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, (), _>( WrapInfo { debug_name: "fedimint_mint_tokens", port: Some(port_), @@ -172,7 +172,7 @@ fn wire_fedimint_mint_tokens_impl( ) } fn wire_get_fedimint_balance_impl(port_: MessagePort) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>( + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, (), _>( WrapInfo { debug_name: "get_fedimint_balance", port: Some(port_), @@ -182,7 +182,7 @@ fn wire_get_fedimint_balance_impl(port_: MessagePort) { ) } fn wire_fedimint_pay_invoice_impl(port_: MessagePort, invoice: impl Wire2Api + UnwindSafe) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>( + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, (), _>( WrapInfo { debug_name: "fedimint_pay_invoice", port: Some(port_), @@ -197,7 +197,7 @@ fn wire_fedimint_pay_invoice_impl(port_: MessagePort, invoice: impl Wire2Api + UnwindSafe) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>( + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, (), _>( WrapInfo { debug_name: "receive_token", port: Some(port_), @@ -210,7 +210,7 @@ fn wire_receive_token_impl(port_: MessagePort, token: impl Wire2Api + Un ) } fn wire_get_btcprice_impl(port_: MessagePort) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, ()>( + FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, (), _>( WrapInfo { debug_name: "get_btcprice", port: Some(port_), diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index 99468a65..a982ff32 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -34,7 +34,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 ffi: ^2.0.1 - flutter_rust_bridge: 1.81.0 + flutter_rust_bridge: 1.82.1 meta: ^1.8.0 qr_flutter: ^4.1.0 share_plus: ^7.0.2