lens-client

Crates.iolens-client
lib.rslens-client
version0.1.0
sourcesrc
created_at2022-06-20 20:31:25.796479
updated_at2022-06-20 20:31:25.796479
descriptionLens Protocol API client
homepage
repositoryhttps://github.com/gioelecerati/lens-rs
max_upload_size
id609779
size63,570
(gioelecerati)

documentation

README

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.

Commit count: 19

cargo fmt