diff --git a/cli/Cargo.lock b/cli/Cargo.lock index db244fd..678c577 100644 --- a/cli/Cargo.lock +++ b/cli/Cargo.lock @@ -713,6 +713,7 @@ dependencies = [ "thiserror 1.0.69", "tokio", "tokio-stream", + "tokio_with_wasm", "tonic 0.12.3", "tonic 0.8.3", "tonic-build 0.8.4", @@ -4647,6 +4648,30 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio_with_wasm" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42d20f41cbfe26740d0c2fb320d44ce7dfa716be135cb663e99a48248a0e897" +dependencies = [ + "js-sys", + "tokio", + "tokio_with_wasm_proc", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "tokio_with_wasm_proc" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee80eb7e23abaa636caa9afe6042c6d8a8c0686165b8165f4fbf2988f0dd347f" +dependencies = [ + "quote", + "syn 2.0.100", +] + [[package]] name = "toml" version = "0.5.11" diff --git a/lib/Cargo.lock b/lib/Cargo.lock index 82de373..a1e83fd 100644 --- a/lib/Cargo.lock +++ b/lib/Cargo.lock @@ -812,6 +812,7 @@ dependencies = [ "thiserror 1.0.69", "tokio", "tokio-stream", + "tokio_with_wasm", "tonic 0.12.3", "tonic 0.8.3", "tonic-build 0.8.4", @@ -5045,6 +5046,30 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio_with_wasm" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42d20f41cbfe26740d0c2fb320d44ce7dfa716be135cb663e99a48248a0e897" +dependencies = [ + "js-sys", + "tokio", + "tokio_with_wasm_proc", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "tokio_with_wasm_proc" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee80eb7e23abaa636caa9afe6042c6d8a8c0686165b8165f4fbf2988f0dd347f" +dependencies = [ + "quote", + "syn 2.0.100", +] + [[package]] name = "toml" version = "0.5.11" diff --git a/lib/core/Cargo.toml b/lib/core/Cargo.toml index cd214e0..b5d7f36 100644 --- a/lib/core/Cargo.toml +++ b/lib/core/Cargo.toml @@ -36,6 +36,7 @@ rusqlite = { git = "https://github.com/Spxg/rusqlite", rev = "e36644127f31fa6e7e "bundled", ] } tokio = { version = "1", default-features = false, features = ["rt", "macros"] } +tokio_with_wasm = { version = "0.8.2", features = ["rt", "macros"] } sdk-common = { workspace = true } sdk-macros = { workspace = true } rusqlite_migration = { git = "https://github.com/hydra-yse/rusqlite_migration", branch = "rusqlite-v0.33.0" } diff --git a/lib/core/src/sdk.rs b/lib/core/src/sdk.rs index 07a80b0..c8dd976 100644 --- a/lib/core/src/sdk.rs +++ b/lib/core/src/sdk.rs @@ -29,6 +29,7 @@ use swapper::boltz::proxy::BoltzProxyFetcher; use tokio::sync::{watch, RwLock}; use tokio::time::MissedTickBehavior; use tokio_stream::wrappers::BroadcastStream; +use tokio_with_wasm::alias as tokio; use web_time::Instant; use x509_parser::parse_x509_certificate; diff --git a/lib/core/src/swapper/boltz/status_stream.rs b/lib/core/src/swapper/boltz/status_stream.rs index 9e36da6..46cd49b 100644 --- a/lib/core/src/swapper/boltz/status_stream.rs +++ b/lib/core/src/swapper/boltz/status_stream.rs @@ -15,6 +15,7 @@ use futures_util::{stream::SplitSink, SinkExt, StreamExt}; use log::{debug, error, info, warn}; use tokio::sync::{broadcast, watch}; use tokio::time::MissedTickBehavior; +use tokio_with_wasm::alias as tokio; impl BoltzSwapper

{ async fn send_subscription( diff --git a/lib/core/src/sync/mod.rs b/lib/core/src/sync/mod.rs index 0de0ba5..0d81561 100644 --- a/lib/core/src/sync/mod.rs +++ b/lib/core/src/sync/mod.rs @@ -7,6 +7,7 @@ use log::{info, trace, warn}; use tokio::sync::{broadcast, watch}; use tokio::time::sleep; use tokio_stream::StreamExt as _; +use tokio_with_wasm::alias as tokio; use tonic::Streaming; use self::client::SyncerClient; diff --git a/lib/core/src/test_utils/status_stream.rs b/lib/core/src/test_utils/status_stream.rs index f33dfd7..cf8d11f 100644 --- a/lib/core/src/test_utils/status_stream.rs +++ b/lib/core/src/test_utils/status_stream.rs @@ -5,6 +5,7 @@ use boltz_client::boltz; use std::sync::Arc; use tokio::sync::{broadcast, watch}; +use tokio_with_wasm::alias as tokio; use crate::swapper::{SubscriptionHandler, SwapperStatusStream};