- Go to https://cloud.walletconnect.com/
- Create a new project
- Copy the Project ID
Add this crate via a path dependency (example):
[dependencies]
scapi = { path = "../scapi" }use scapi::wallet_connect::{WalletConnectClient, WalletConnectConfig, ClientMetadata};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = WalletConnectConfig {
project_id: std::env::var(\"WALLETCONNECT_PROJECT_ID\")?,
qubic_chain_id: \"qubic:mainnet\".to_string(),
metadata: ClientMetadata {
name: \"My Qubic dApp\".to_string(),
description: \"WalletConnect demo\".to_string(),
url: \"https://example.com\".to_string(),
icons: vec![],
},
relay_url: None,
};
let mut client = WalletConnectClient::new(config)?;
client.init().await?;
let uri = client.connect().await?;
println!(\"Scan this URI as a QR: {uri}\");
let ok = client.wait_for_connection(120).await?;
if !ok {
println!(\"Connection rejected\");
return Ok(());
}
let accounts = client.request_accounts().await?;
println!(\"Accounts: {accounts:?}\");
Ok(())
}cargo runwasm-pack build --target webUse pkg/scapi.js from your app and render the generated URI as a QR using any JS QR library.
- Any wallet that supports WalletConnect v2 and the Qubic namespace
✅ Recommended:
- use HTTPS in production
- keep the Project ID in environment variables / configuration
- verify transaction signatures (server-side where appropriate)
❌ Avoid:
- storing private keys in app code
- sending transactions without explicit user approval
set RUST_LOG=debug
cargo run- verify that
connect()produces a new URI each run - verify Qubic is in
required_namespaces
- Full API reference:
WALLET_CONNECT_API.md - Examples:
examples/ - Troubleshooting:
TROUBLESHOOTING.md
If something does not work:
- Check
TROUBLESHOOTING.md - Check examples in
examples/ - Open an issue with logs and the generated URI (redact secrets)
Your app can now connect to Qubic wallets via WalletConnect.