A Rust implementation of a WalletConnect v2 client for connecting a dApp to Qubic wallets via QR code, with WASM bindings for browser usage.
- ✅ WalletConnect v2 protocol support
- ✅ Qubic namespace methods/events
- ✅ WASM support for browser integration
- ✅ strong, type-safe Rust API
- ✅ async/await-based client
- ✅ event system for session updates
[dependencies]
scapi = { path = "../scapi" }# Install wasm-pack
cargo install wasm-pack
# Build
wasm-pack build --target web- Set
WALLETCONNECT_PROJECT_ID - Run an example:
cargo run --example wallet_connect_basic- Build WASM:
wasm-pack build --target web - Import
pkg/scapi.js - Call
connect()and render the returned URI as a QR code
WALLET_CONNECT_INDEX.md- docs entry pointWALLET_CONNECT_QUICKSTART.md- quick start guideWALLET_CONNECT_API.md- full API documentationsrc/wallet_connect/README.md- internal architectureTROUBLESHOOTING.md- common issues and fixes
Generate a WalletConnect URI and render it as a QR code for the wallet to scan.
Request accounts after the session is approved.
Send Qubic or build/sign/send full transactions (depending on wallet support).
Sign transactions and messages via the wallet.
Subscribe to session and wallet events via the event handler.
src/wallet_connect/
├── mod.rs
├── types.rs
├── client.rs
├── session.rs
├── events.rs
├── qubic_namespace.rs
└── wasm_bindings.rs
- Basic connection:
examples/wallet_connect_basic.rs - Transaction flow:
examples/wallet_connect_transaction.rs - Events:
examples/wallet_connect_events.rs
- private keys stay inside the wallet
- do not embed secrets in client-side code
- use HTTPS for production browser deployments
- Rust toolchain (stable)
- WalletConnect Project ID (WalletConnect Cloud)
wasm-pack(only for WASM builds)
set RUST_LOG=debug
cargo run --example wallet_connect_basicSame as the main SCAPI project.
Open an issue or a pull request. Keep changes focused and aligned with the existing module structure.
Start with WALLET_CONNECT_QUICKSTART.md or the examples in examples/.