diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock index 6255a11c5..71378aabb 100644 --- a/Cargo-minimal.lock +++ b/Cargo-minimal.lock @@ -462,8 +462,8 @@ dependencies = [ [[package]] name = "bitcoin-ffi" -version = "0.1.2" -source = "git+https://github.com/benalleng/bitcoin-ffi.git?rev=8e3a23b#8e3a23b0369ac85a27ae33bac60130e9dc439179" +version = "0.1.3" +source = "git+https://github.com/bitcoindevkit/bitcoin-ffi?rev=39cc12b#39cc12bd32d6adf889b48354adcdb0f3c475aad2" dependencies = [ "bitcoin 0.32.7", "thiserror 1.0.63", @@ -1895,6 +1895,7 @@ checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown 0.15.5", + "serde", ] [[package]] @@ -3837,10 +3838,12 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8" dependencies = [ + "indexmap", "serde", "serde_spanned", "toml_datetime", "toml_parser", + "toml_writer", "winnow", ] @@ -3862,6 +3865,12 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_writer" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" + [[package]] name = "tower" version = "0.5.2" @@ -4038,9 +4047,9 @@ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "uniffi" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6d968cb62160c11f2573e6be724ef8b1b18a277aededd17033f8a912d73e2b4" +checksum = "c866f627c3f04c3df068b68bb2d725492caaa539dd313e2a9d26bb85b1a32f4e" dependencies = [ "anyhow", "camino", @@ -4056,7 +4065,7 @@ dependencies = [ [[package]] name = "uniffi-dart" version = "0.1.0" -source = "git+https://github.com/Uniffi-Dart/uniffi-dart.git?rev=364b117#364b11767096ccaaa1e6f681fdfc354cb4cd9d5d" +source = "git+https://github.com/Uniffi-Dart/uniffi-dart.git?rev=5bdcc79#5bdcc790c3fc99845e7b4a61d7a4f6e1460896e9" dependencies = [ "anyhow", "camino", @@ -4067,18 +4076,17 @@ dependencies = [ "proc-macro2", "serde", "stringcase 0.4.0", - "toml 0.5.11", + "toml 0.9.5", "uniffi", "uniffi_bindgen", - "uniffi_build", "uniffi_dart_macro", ] [[package]] name = "uniffi_bindgen" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6b39ef1acbe1467d5d210f274fae344cb6f8766339330cb4c9688752899bf6b" +checksum = "7c8ca600167641ebe7c8ba9254af40492dda3397c528cc3b2f511bd23e8541a5" dependencies = [ "anyhow", "askama", @@ -4093,7 +4101,7 @@ dependencies = [ "serde", "tempfile", "textwrap", - "toml 0.5.11", + "toml 0.9.5", "uniffi_internal_macros", "uniffi_meta", "uniffi_pipeline", @@ -4102,9 +4110,9 @@ dependencies = [ [[package]] name = "uniffi_build" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6683e6b665423cddeacd89a3f97312cf400b2fb245a26f197adaf65c45d505b2" +checksum = "3e55c05228f4858bb258f651d21d743fcc1fe5a2ec20d3c0f9daefddb105ee4d" dependencies = [ "anyhow", "camino", @@ -4113,9 +4121,9 @@ dependencies = [ [[package]] name = "uniffi_core" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d990b553d6b9a7ee9c3ae71134674739913d52350b56152b0e613595bb5a6f" +checksum = "7e7a5a038ebffe8f4cf91416b154ef3c2468b18e828b7009e01b1b99938089f9" dependencies = [ "anyhow", "async-compat", @@ -4127,7 +4135,7 @@ dependencies = [ [[package]] name = "uniffi_dart_macro" version = "0.1.0" -source = "git+https://github.com/Uniffi-Dart/uniffi-dart.git?rev=364b117#364b11767096ccaaa1e6f681fdfc354cb4cd9d5d" +source = "git+https://github.com/Uniffi-Dart/uniffi-dart.git?rev=5bdcc79#5bdcc790c3fc99845e7b4a61d7a4f6e1460896e9" dependencies = [ "futures", "proc-macro2", @@ -4139,9 +4147,9 @@ dependencies = [ [[package]] name = "uniffi_internal_macros" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f4f224becf14885c10e6e400b95cc4d1985738140cb194ccc2044563f8a56b" +checksum = "e3c2a6f93e7b73726e2015696ece25ca0ac5a5f1cf8d6a7ab5214dd0a01d2edf" dependencies = [ "anyhow", "indexmap", @@ -4152,9 +4160,9 @@ dependencies = [ [[package]] name = "uniffi_macros" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b481d385af334871d70904e6a5f129be7cd38c18fcf8dd8fd1f646b426a56d58" +checksum = "64c6309fc36c7992afc03bc0c5b059c656bccbef3f2a4bc362980017f8936141" dependencies = [ "camino", "fs-err", @@ -4163,15 +4171,15 @@ dependencies = [ "quote", "serde", "syn 2.0.106", - "toml 0.5.11", + "toml 0.9.5", "uniffi_meta", ] [[package]] name = "uniffi_meta" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f817868a3b171bb7bf259e882138d104deafde65684689b4694c846d322491" +checksum = "0a138823392dba19b0aa494872689f97d0ee157de5852e2bec157ce6de9cdc22" dependencies = [ "anyhow", "siphasher", @@ -4181,9 +4189,9 @@ dependencies = [ [[package]] name = "uniffi_pipeline" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b147e133ad7824e32426b90bc41fda584363563f2ba747f590eca1fd6fd14e6" +checksum = "8c27c4b515d25f8e53cc918e238c39a79c3144a40eaf2e51c4a7958973422c29" dependencies = [ "anyhow", "heck", @@ -4194,9 +4202,9 @@ dependencies = [ [[package]] name = "uniffi_udl" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caed654fb73da5abbc7a7e9c741532284532ba4762d6fe5071372df22a41730a" +checksum = "d0adacdd848aeed7af4f5af7d2f621d5e82531325d405e29463482becfdeafca" dependencies = [ "anyhow", "textwrap", diff --git a/Cargo-recent.lock b/Cargo-recent.lock index 6255a11c5..71378aabb 100644 --- a/Cargo-recent.lock +++ b/Cargo-recent.lock @@ -462,8 +462,8 @@ dependencies = [ [[package]] name = "bitcoin-ffi" -version = "0.1.2" -source = "git+https://github.com/benalleng/bitcoin-ffi.git?rev=8e3a23b#8e3a23b0369ac85a27ae33bac60130e9dc439179" +version = "0.1.3" +source = "git+https://github.com/bitcoindevkit/bitcoin-ffi?rev=39cc12b#39cc12bd32d6adf889b48354adcdb0f3c475aad2" dependencies = [ "bitcoin 0.32.7", "thiserror 1.0.63", @@ -1895,6 +1895,7 @@ checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown 0.15.5", + "serde", ] [[package]] @@ -3837,10 +3838,12 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8" dependencies = [ + "indexmap", "serde", "serde_spanned", "toml_datetime", "toml_parser", + "toml_writer", "winnow", ] @@ -3862,6 +3865,12 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_writer" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" + [[package]] name = "tower" version = "0.5.2" @@ -4038,9 +4047,9 @@ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "uniffi" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6d968cb62160c11f2573e6be724ef8b1b18a277aededd17033f8a912d73e2b4" +checksum = "c866f627c3f04c3df068b68bb2d725492caaa539dd313e2a9d26bb85b1a32f4e" dependencies = [ "anyhow", "camino", @@ -4056,7 +4065,7 @@ dependencies = [ [[package]] name = "uniffi-dart" version = "0.1.0" -source = "git+https://github.com/Uniffi-Dart/uniffi-dart.git?rev=364b117#364b11767096ccaaa1e6f681fdfc354cb4cd9d5d" +source = "git+https://github.com/Uniffi-Dart/uniffi-dart.git?rev=5bdcc79#5bdcc790c3fc99845e7b4a61d7a4f6e1460896e9" dependencies = [ "anyhow", "camino", @@ -4067,18 +4076,17 @@ dependencies = [ "proc-macro2", "serde", "stringcase 0.4.0", - "toml 0.5.11", + "toml 0.9.5", "uniffi", "uniffi_bindgen", - "uniffi_build", "uniffi_dart_macro", ] [[package]] name = "uniffi_bindgen" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6b39ef1acbe1467d5d210f274fae344cb6f8766339330cb4c9688752899bf6b" +checksum = "7c8ca600167641ebe7c8ba9254af40492dda3397c528cc3b2f511bd23e8541a5" dependencies = [ "anyhow", "askama", @@ -4093,7 +4101,7 @@ dependencies = [ "serde", "tempfile", "textwrap", - "toml 0.5.11", + "toml 0.9.5", "uniffi_internal_macros", "uniffi_meta", "uniffi_pipeline", @@ -4102,9 +4110,9 @@ dependencies = [ [[package]] name = "uniffi_build" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6683e6b665423cddeacd89a3f97312cf400b2fb245a26f197adaf65c45d505b2" +checksum = "3e55c05228f4858bb258f651d21d743fcc1fe5a2ec20d3c0f9daefddb105ee4d" dependencies = [ "anyhow", "camino", @@ -4113,9 +4121,9 @@ dependencies = [ [[package]] name = "uniffi_core" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d990b553d6b9a7ee9c3ae71134674739913d52350b56152b0e613595bb5a6f" +checksum = "7e7a5a038ebffe8f4cf91416b154ef3c2468b18e828b7009e01b1b99938089f9" dependencies = [ "anyhow", "async-compat", @@ -4127,7 +4135,7 @@ dependencies = [ [[package]] name = "uniffi_dart_macro" version = "0.1.0" -source = "git+https://github.com/Uniffi-Dart/uniffi-dart.git?rev=364b117#364b11767096ccaaa1e6f681fdfc354cb4cd9d5d" +source = "git+https://github.com/Uniffi-Dart/uniffi-dart.git?rev=5bdcc79#5bdcc790c3fc99845e7b4a61d7a4f6e1460896e9" dependencies = [ "futures", "proc-macro2", @@ -4139,9 +4147,9 @@ dependencies = [ [[package]] name = "uniffi_internal_macros" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f4f224becf14885c10e6e400b95cc4d1985738140cb194ccc2044563f8a56b" +checksum = "e3c2a6f93e7b73726e2015696ece25ca0ac5a5f1cf8d6a7ab5214dd0a01d2edf" dependencies = [ "anyhow", "indexmap", @@ -4152,9 +4160,9 @@ dependencies = [ [[package]] name = "uniffi_macros" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b481d385af334871d70904e6a5f129be7cd38c18fcf8dd8fd1f646b426a56d58" +checksum = "64c6309fc36c7992afc03bc0c5b059c656bccbef3f2a4bc362980017f8936141" dependencies = [ "camino", "fs-err", @@ -4163,15 +4171,15 @@ dependencies = [ "quote", "serde", "syn 2.0.106", - "toml 0.5.11", + "toml 0.9.5", "uniffi_meta", ] [[package]] name = "uniffi_meta" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f817868a3b171bb7bf259e882138d104deafde65684689b4694c846d322491" +checksum = "0a138823392dba19b0aa494872689f97d0ee157de5852e2bec157ce6de9cdc22" dependencies = [ "anyhow", "siphasher", @@ -4181,9 +4189,9 @@ dependencies = [ [[package]] name = "uniffi_pipeline" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b147e133ad7824e32426b90bc41fda584363563f2ba747f590eca1fd6fd14e6" +checksum = "8c27c4b515d25f8e53cc918e238c39a79c3144a40eaf2e51c4a7958973422c29" dependencies = [ "anyhow", "heck", @@ -4194,9 +4202,9 @@ dependencies = [ [[package]] name = "uniffi_udl" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caed654fb73da5abbc7a7e9c741532284532ba4762d6fe5071372df22a41730a" +checksum = "d0adacdd848aeed7af4f5af7d2f621d5e82531325d405e29463482becfdeafca" dependencies = [ "anyhow", "textwrap", diff --git a/payjoin-ffi/Cargo.toml b/payjoin-ffi/Cargo.toml index aec970723..aa7049418 100644 --- a/payjoin-ffi/Cargo.toml +++ b/payjoin-ffi/Cargo.toml @@ -21,13 +21,9 @@ crate-type = ["lib", "staticlib", "cdylib"] name = "uniffi-bindgen" path = "uniffi-bindgen.rs" -[build-dependencies] -uniffi = { version = "0.29.4", features = ["build", "cli"] } -uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart.git", rev = "364b117", features = ["build"], optional = true } - [dependencies] base64 = "0.22.1" -bitcoin-ffi = { git = "https://github.com/benalleng/bitcoin-ffi.git", rev = "8e3a23b" } +bitcoin-ffi = { git = "https://github.com/bitcoindevkit/bitcoin-ffi", rev = "39cc12b" } getrandom = "0.2" hex = "0.4.3" lazy_static = "1.5.0" @@ -38,8 +34,8 @@ serde = { version = "1.0.219", features = ["derive"] } serde_json = "1.0.142" thiserror = "2.0.14" tokio = { version = "1.47.1", features = ["full"], optional = true } -uniffi = { version = "0.29.4" } -uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart.git", rev = "364b117", optional = true } +uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart.git", rev = "5bdcc79", optional = true } +uniffi = { version = "0.30.0" } url = "2.5.4" [dev-dependencies] diff --git a/payjoin-ffi/build.rs b/payjoin-ffi/build.rs deleted file mode 100644 index 1dc3f82e6..000000000 --- a/payjoin-ffi/build.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn main() { - uniffi::generate_scaffolding("src/payjoin.udl").unwrap(); - #[cfg(feature = "dart")] - uniffi_dart::generate_scaffolding("src/payjoin.udl".into()).unwrap(); -} diff --git a/payjoin-ffi/dart/hook/build.dart b/payjoin-ffi/dart/hook/build.dart new file mode 100644 index 000000000..6713619be --- /dev/null +++ b/payjoin-ffi/dart/hook/build.dart @@ -0,0 +1,11 @@ +import 'package:hooks/hooks.dart'; +import 'package:native_toolchain_rust/native_toolchain_rust.dart'; + +void main(List args) async { + await build(args, (input, output) async { + await RustBuilder( + assetName: 'uniffi:payjoin_ffi', + features: ['_test-utils'], + ).run(input: input, output: output); + }); +} diff --git a/payjoin-ffi/dart/native/Cargo.toml b/payjoin-ffi/dart/native/Cargo.toml new file mode 100644 index 000000000..c229703c2 --- /dev/null +++ b/payjoin-ffi/dart/native/Cargo.toml @@ -0,0 +1,29 @@ +[workspace] + +[package] +name = "payjoin-ffi-wrapper" +description = "This is a simple wrapper crate which re-exports payjoin-ffi for publishing to pub.dev" +version = "0.1.0" +edition = "2021" +license = "MIT OR Apache-2.0" +publish = false + +[features] +_test-utils = ["payjoin-ffi/_test-utils"] + +[lib] +name = "payjoin_ffi_wrapper" +crate-type = ["staticlib", "cdylib"] + +[dependencies] +payjoin-ffi = { git = "https://github.com/payjoin/rust-payjoin.git", branch = "master", features = ["dart"] } +# pinned version for MSRV 1.85 compatibility +home = "=0.5.11" + +[patch."https://github.com/payjoin/rust-payjoin.git"] +payjoin-ffi = { path = "../.." } + +[patch.crates-io] +payjoin = { path = "../../../payjoin" } +payjoin-directory = { path = "../../../payjoin-directory" } +payjoin-test-utils = { path = "../../../payjoin-test-utils" } diff --git a/payjoin-ffi/dart/native/rust-toolchain.toml b/payjoin-ffi/dart/native/rust-toolchain.toml new file mode 100644 index 000000000..b98954795 --- /dev/null +++ b/payjoin-ffi/dart/native/rust-toolchain.toml @@ -0,0 +1,27 @@ +# See https://pub.dev/packages/native_toolchain_rs#rust-toolchaintoml +[toolchain] +channel = "1.85.1" + +targets = [ + # Android + "armv7-linux-androideabi", + "aarch64-linux-android", + "x86_64-linux-android", + + # iOS (device + simulator) + "aarch64-apple-ios", + "aarch64-apple-ios-sim", + "x86_64-apple-ios", + + # Windows + "aarch64-pc-windows-msvc", + "x86_64-pc-windows-msvc", + + # Linux + "aarch64-unknown-linux-gnu", + "x86_64-unknown-linux-gnu", + + # macOS + "aarch64-apple-darwin", + "x86_64-apple-darwin", +] diff --git a/payjoin-ffi/dart/native/src/lib.rs b/payjoin-ffi/dart/native/src/lib.rs new file mode 100644 index 000000000..4ded82f06 --- /dev/null +++ b/payjoin-ffi/dart/native/src/lib.rs @@ -0,0 +1 @@ +pub use payjoin_ffi::*; diff --git a/payjoin-ffi/dart/pubspec.yaml b/payjoin-ffi/dart/pubspec.yaml index 67bc7b8fe..e10eed84c 100644 --- a/payjoin-ffi/dart/pubspec.yaml +++ b/payjoin-ffi/dart/pubspec.yaml @@ -3,10 +3,16 @@ description: Dart bindings for payjoin (EXPERIMENTAL) version: 0.1.0 environment: - sdk: '^3.2.0' + sdk: '^3.10.0' dependencies: ffi: ^2.1.4 + hooks: any + code_assets: any + native_toolchain_rust: ^1.0.0 dev_dependencies: test: ^1.26.2 http: ^1.4.0 + +hooks: + build: hook/build.dart diff --git a/payjoin-ffi/dart/scripts/generate_bindings.sh b/payjoin-ffi/dart/scripts/generate_bindings.sh index 03003f6fb..c218da80f 100755 --- a/payjoin-ffi/dart/scripts/generate_bindings.sh +++ b/payjoin-ffi/dart/scripts/generate_bindings.sh @@ -22,26 +22,4 @@ echo "Generating payjoin dart..." cargo build --features dart,_test-utils --profile dev cargo run --features dart,_test-utils --profile dev --bin uniffi-bindgen -- --library ../target/debug/$LIBNAME --language dart --out-dir dart/lib/ -if [[ "$OS" == "Darwin" ]]; then - echo "Generating native binaries..." - rustup target add aarch64-apple-darwin x86_64-apple-darwin - # This is a test script the actual release should not include the test utils feature - cargo build --profile dev --target aarch64-apple-darwin --features dart,_test-utils & - cargo build --profile dev --target x86_64-apple-darwin --features dart,_test-utils & - wait - - echo "Building macos fat library" - lipo -create -output dart/$LIBNAME \ - ../target/aarch64-apple-darwin/debug/$LIBNAME \ - ../target/x86_64-apple-darwin/debug/$LIBNAME -else - echo "Generating native binaries..." - rustup target add x86_64-unknown-linux-gnu - # This is a test script the actual release should not include the test utils feature - cargo build --profile dev --target x86_64-unknown-linux-gnu --features dart,_test-utils - - echo "Copying payjoin_ffi binary" - cp ../target/x86_64-unknown-linux-gnu/debug/$LIBNAME dart/$LIBNAME -fi - echo "All done!" diff --git a/payjoin-ffi/javascript/package-lock.json b/payjoin-ffi/javascript/package-lock.json index 858a98043..5f8ac4ca8 100644 --- a/payjoin-ffi/javascript/package-lock.json +++ b/payjoin-ffi/javascript/package-lock.json @@ -11,7 +11,7 @@ "prettier": "^3.6.2", "tsx": "^4.20.6", "typescript": "^5.9.3", - "uniffi-bindgen-react-native": "github:spacebear21/uniffi-bindgen-react-native#tsconfig-module-nodenext" + "uniffi-bindgen-react-native": "github:spacebear21/uniffi-bindgen-react-native#update-uniffi-0.30-wasm" } }, "node_modules/@esbuild/aix-ppc64": { @@ -588,7 +588,7 @@ }, "node_modules/uniffi-bindgen-react-native": { "version": "0.29.3-1", - "resolved": "git+ssh://git@github.com/spacebear21/uniffi-bindgen-react-native.git#e7b8b432e8b45d7f40168751b2a84a1c844d6f1a", + "resolved": "git+ssh://git@github.com/spacebear21/uniffi-bindgen-react-native.git#723c0c77c45db1eb74e832a8814e4ac36d07fc28", "dev": true, "license": "MPL-2.0", "bin": { diff --git a/payjoin-ffi/javascript/package.json b/payjoin-ffi/javascript/package.json index 235940261..78560dbc6 100644 --- a/payjoin-ffi/javascript/package.json +++ b/payjoin-ffi/javascript/package.json @@ -29,7 +29,7 @@ "prettier": "^3.6.2", "tsx": "^4.20.6", "typescript": "^5.9.3", - "uniffi-bindgen-react-native": "github:spacebear21/uniffi-bindgen-react-native#tsconfig-module-nodenext" + "uniffi-bindgen-react-native": "github:spacebear21/uniffi-bindgen-react-native#update-uniffi-0.30-wasm" }, "repository": { "type": "git", diff --git a/payjoin-ffi/javascript/wasm-manifest-patch.toml b/payjoin-ffi/javascript/wasm-manifest-patch.toml index 655101c94..86b00af4c 100644 --- a/payjoin-ffi/javascript/wasm-manifest-patch.toml +++ b/payjoin-ffi/javascript/wasm-manifest-patch.toml @@ -7,3 +7,5 @@ payjoin = { path = "../../../../payjoin" } payjoin-directory = { path = "../../../../payjoin-directory" } payjoin-test-utils = { path = "../../../../payjoin-test-utils" } +# This patch is required due to the hardcoded 0.29 dependency in uniffi-bindgen-react-native's Cargo.toml. Once they publish the 0.30 package we shouldn't need this anymore. +uniffi-runtime-javascript = { path = "../../node_modules/uniffi-bindgen-react-native/crates/uniffi-runtime-javascript" } diff --git a/payjoin-ffi/src/payjoin.udl b/payjoin-ffi/src/payjoin.udl deleted file mode 100644 index a5b7a8571..000000000 --- a/payjoin-ffi/src/payjoin.udl +++ /dev/null @@ -1,3 +0,0 @@ -namespace payjoin { - -}; diff --git a/payjoin-ffi/uniffi-bindgen.rs b/payjoin-ffi/uniffi-bindgen.rs index 10bc0ec1d..522340e8f 100644 --- a/payjoin-ffi/uniffi-bindgen.rs +++ b/payjoin-ffi/uniffi-bindgen.rs @@ -21,7 +21,7 @@ fn uniffi_bindgen() { .expect("--out-dir is required when using --library"); uniffi_dart::gen::generate_dart_bindings( "src/payjoin.udl".into(), - None, + Some("uniffi.toml".into()), Some(output_dir.as_str().into()), library_path.as_str().into(), true, diff --git a/payjoin-ffi/uniffi.toml b/payjoin-ffi/uniffi.toml index 3b7ba5189..342d8adf5 100644 --- a/payjoin-ffi/uniffi.toml +++ b/payjoin-ffi/uniffi.toml @@ -6,4 +6,8 @@ cdylib_name = "payjoin_ffi" cdylib_name = "payjoin_ffi" [bindings.swift] -cdylib_name = "payjoin_ffi" \ No newline at end of file +cdylib_name = "payjoin_ffi" + +[bindings.dart] +cdylib_name = "payjoin_ffi" +package_name = "payjoin"