When scanning the QR code, the wallet rejected the connection with:
“Connection was established via this URL”
The Rust implementation used optional_namespaces for Qubic, while the JS SDK uses requiredNamespaces. This caused the wallet to reject the proposal.
File: src/wallet_connect/client.rs
- moved Qubic from optional → required
File: src/wallet_connect/client.rs
- added
cleanup_old_state()to clear old listeners/session state before generating a new URI
File: src/wallet_connect/client.rs
- improved errors and logs around waiting for approval / timeout
File: src/main.rs
- clarified that each run generates a fresh URI and stale state is cleaned up
| Aspect | JavaScript (qraw-frontend) | Rust (SCAPI) | Status |
|---|---|---|---|
| Old session cleanup | ✅ automatic | ✅ automatic | aligned |
| URI generation | client.connect() |
client.connect() |
aligned |
| Approval flow | await approval() |
wait_for_connection() |
equivalent |
| Timeout handling | ✅ | ✅ | aligned |
# Run the main program
cargo run
# Or run an example
cargo run --example wallet_connect_basicWALLETCONNECT_FIX_REQUIRED_NAMESPACES.md- root cause explanationWALLETCONNECT_FIX_RU.md- historical note (now English)
- JavaScript analog:
d:\Work\Qubic\qraw-frontend\src\api\wallet-connect-client.ts
Status: ✅ fixed
Next: test with a real Qubic wallet and a full relay implementation