1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! # walletconnect-sdk
//!
//! A Rust implementation of [WalletConnect specs](https://specs.walletconnect.com/2.0/).
//!
//! ## Features
//! - Pairing using session settle
//! - Types
//!
//! ## Example
//! API for interacting with WalletConnect relay
//!
//! ```rust
//! // Get project_id from https://cloud.reown.com
//! let project_id = "xxxx";
//!
//! // Generate random once, store it in client and reuse it for all connections
//! let client_seed = [123u8; 32];
//!
//! let conn = Connection::new(
//! "https://relay.walletconnect.org/rpc",
//! "https://relay.walletconnect.org",
//! project_id,
//! client_seed, Metadata {
//! name: "My Wallet Name".to_string(),
//! description: "My wallet interacts with dapp".to_string(),
//! url: "https://my-wallet-site.com".to_string(),
//! icons: vec![],
//! },
//! );
//!
//! let uri_from_dapp = "wc:e4b9eb7a1372bf88abc46c37acac3687301afdfd0d2a4c2355945d66a1164464@2?relay-protocol=irn&symKey=d7430284e1b70853829a010518a088cde0e163bcad5f24425e3b17578b2b402d&expiryTimestamp=1749783095&methods=wc_sessionAuthenticate";
//!
//! let (mut pairing, _) = conn
//! .init_pairing(uri_from_dapp)
//! .await
//! .expect("pairing failed");
//!
//! pairing
//! .approve_with_session_settle(
//! // Address of the wallet that is connecting to dApp
//! "0x0000000000000000000000000000000000000123"
//! .parse()
//! .unwrap(),
//! )
//! .await
//! .expect("approve failed");
//!
//! loop {
//! let result =
//! pairing.watch_messages(Topic::Derived, None).await.unwrap();
//!
//! println!("result: {result:?}");
//! }
//! ```
//!
//! ## License
//! MIT OR Apache-2.0
/// Exposed for easy access
pub use Connection;
pub use Error;
pub use Result;
pub use Pairing;