- Added `NativeClient` for non-WASM environments with automatic reconnection and message handling. - Introduced `WasmClient` for WASM environments, supporting WebSocket communication and reconnection logic. - Created protocol definitions for `SignRequest` and `SignResponse` with serialization and deserialization. - Developed integration tests for the client functionality and sign request handling. - Implemented WASM-specific tests to ensure compatibility and functionality in browser environments.
54 lines
1.2 KiB
TOML
54 lines
1.2 KiB
TOML
[package]
|
|
name = "sigsocket_client"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "WebSocket client for sigsocket server with WASM-first support"
|
|
license = "MIT OR Apache-2.0"
|
|
repository = "https://git.ourworld.tf/samehabouelsaad/sal-modular"
|
|
|
|
[lib]
|
|
crate-type = ["cdylib", "rlib"]
|
|
|
|
[dependencies]
|
|
# Core dependencies (both native and WASM)
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
log = "0.4"
|
|
hex = "0.4"
|
|
base64 = "0.21"
|
|
url = "2.5"
|
|
async-trait = "0.1"
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
# Native-only dependencies
|
|
tokio = { version = "1.0", features = ["full"] }
|
|
tokio-tungstenite = "0.21"
|
|
futures-util = "0.3"
|
|
thiserror = "1.0"
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
# WASM-only dependencies
|
|
wasm-bindgen = "0.2"
|
|
wasm-bindgen-futures = "0.4"
|
|
web-sys = { version = "0.3", features = [
|
|
"console",
|
|
"WebSocket",
|
|
"MessageEvent",
|
|
"Event",
|
|
"BinaryType",
|
|
"CloseEvent",
|
|
"ErrorEvent",
|
|
"Window",
|
|
] }
|
|
js-sys = "0.3"
|
|
|
|
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
|
tokio = { version = "1.0", features = ["full"] }
|
|
env_logger = "0.10"
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
|
wasm-bindgen-test = "0.3"
|
|
console_error_panic_hook = "0.1"
|