In Cargo.toml
:
toml
[dependencies]
nextid_sdk = "1.0.0-rc1"
```rust use nextidsdk::{proofservice::Endpoint, types::Result};
async fn main() -> Result<()> { let ps = Endpoint::Production; // Or use your own ProofService instance: // let ps = Endpoint::Custom("https://my-proof-service.example.com".to_string());
let avatars = ps.find_by("twitter", "yeiwb", 1).await?; } ```
Run cargo run --example proof_procedure
to play an interactive demo.
See examples/proof_procedure.rs for more info.
```rust use nextidsdk::{ types::Result, kvservice::Endpoint, util::crypto::Secp256k1KeyPair };
async fn main() -> Result<()> {
let avatar = Secp256k1KeyPair::frompkhex("0x047e55e1b78e873c6f7d585064b41cd2735000bacc0092fe947c11ab7742ed351fef59c4f5d558d14a031bb09e44877f9e61f89993f895eb8fa6cfaafe74f6f55c");
let result = Endpoint::Staging.findbyavatar(&avatar).await?;
Ok(()) } ```
platform
/ identity
pair```rust use nextidsdk::{ types::Result, kvservice::Endpoint, proof_service::Platform, };
async fn main() -> Result<()> {
let result = Endpoint::Staging.findbyplatform_identity(Platform::Twitter, "yeiwb").await?;
Ok(()) } ```
Run cargo run --example kv_procedure
to play an interactive demo.
You may find many useful functions under nextid_sdk::util
namespaces.