Skip to content

Commit

Permalink
feat: create a simple Sign API example on top of the WS client
Browse files Browse the repository at this point in the history
This client implements pairing and session flows:
https://specs.walletconnect.com/2.0/specs/clients/core/pairing
https://specs.walletconnect.com/2.0/specs/clients/sign/session-proposal

Supported actions:
- pairing
- session establishment
- session delete
- ping

This example could be expanded to handle multiple sessions.

Caution:
The purpose of this example is demonstration of core Sign API
functionality. However, it shouldn't be used in production, as might
exhibit some race conditions such as with session deletion, etc...
  • Loading branch information
silvestrst-crypto committed Oct 25, 2023
1 parent 9e5402a commit 3a06da3
Show file tree
Hide file tree
Showing 2 changed files with 477 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,18 @@ sign_api = { path = "./sign_api", optional = true }
[dev-dependencies]
anyhow = "1"
structopt = { version = "0.3", default-features = false }
clap = { version = "4.4", features = ["derive"] }
chrono = "0.4"
tokio = { version = "1.22", features = ["full"] }
url = "2.3"
warp = { version = "0.3", default-features = false }
serde_json = "1.0"
hex = "0.4"
dashmap = "5.5"

[[example]]
name = "session"
required-features = ["client","rpc"]

[[example]]
name = "websocket_client"
Expand Down
Loading

0 comments on commit 3a06da3

Please sign in to comment.