Crates.io | lens-client |
lib.rs | lens-client |
version | 0.1.0 |
source | src |
created_at | 2022-06-20 20:31:25.796479 |
updated_at | 2022-06-20 20:31:25.796479 |
description | Lens Protocol API client |
homepage | |
repository | https://github.com/gioelecerati/lens-rs |
max_upload_size | |
id | 609779 |
size | 63,570 |
Rust client crate for https://lens.xyz
Just a draft. See on the bottom to see which APIs it currently supports.
Rust client crate for https://lens.xyz
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);
}
}
}
This crate integrates some functions to handle local KeyStores and use them to interact with Lens, mostly useful for development purposes.