1 unstable release

0.1.0 Jun 20, 2022

#10 in #xyz

MIT license

63KB
1.5K SLoC

Rust client crate for https://lens.xyz
Just a draft. See on the bottom to see which APIs it currently supports.

lens-client

0.1.0

Rust client crate for https://lens.xyz

Usage

use lens_client;
use lens_client::{Chain, Net};

fn main(){
    let address = "0x0000000000000000000000000000000000000000";
    let client = lens_client::lens::LensClient::new(Chain::Polygon, Net::Main);

    let default_profile = client.get_default_profile_by_address(String::from(address));

    match default_profile {
        Ok(profile) => {
            println!("{:?}", profile);
            let profile_id = profile.data.default_profile.id;
            let followers = client.get_followers(profile_id,10);

            match followers {
                Ok(followers) => {
                    println!("{:?}", followers);
                }
                Err(e) => {
                    println!("{:?}", e);
                }
            }
        }
        Err(e) => {
            println!("{:?}", e);
        }
    }
}

Functionalities

Profile

  • Profile : get default profile
  • Profile : get profiles
  • Profile : create profile

Follow

  • Follow : does follow
  • Follow : get followers
  • Follow : get following

Auth

  • Auth : get challenge
  • Auth : login

This crate integrates some functions to handle local KeyStores and use them to interact with Lens, mostly useful for development purposes.

Dependencies

~29–43MB
~659K SLoC