πŸš€ A fast & easy way to interface w/ Farcaster.xyz via Rust πŸ¦€

Overview

farcaster-rs

πŸš€ A simple & easy way to interface with Farcaster via Rust πŸ¦€

Author: Landon Boles




Credits

  • MistApproach
    • Tons of various improvements & suggestions to build on top of the crate & prepare it for the hubs launch.

πŸ“œ Documentation

For extensive documentation, visit our docs.rs page


πŸš€ Getting Started

Installation

To get started, add the farcaster_rs crate to your Cargo.toml file

farcaster_rs = "0.1.0"

Once you have the crate installed, you can start using the crate!

Usage

In your main.rs file, set up a new Farcaster struct using the ::new(client: String) method.

use farcaster_rs::Farcaster;

#[tokio::main]
async fn main() {
    let farcaster = Farcaster::new("https://goerli.infura.io/v3/key");

    let landon = farcaster.get_user_by_username("lndnnft").await.unwrap();

    println!("{:#?}", landon);
}

πŸ™ Contributing

To start, I appreciate any and all contributions to the farcaster-rs repository!

There are 3 prefered things I'd like if you decide to contribute, however.

1. Ensure the issue/contribution is needed

If you spend your time building something, please ensure it's actually wanted/needed, this is best done by using the Issues tab, and either viewing other discussions, or opening a new issue/discussion

2. Create a new branch for your contribution

Once you have validated the contribution, and forked the repo to your own GitHub account, please create a new branch to commit your code onto.

This can be done via the git CLI pretty easily:

$ git switch -c my_cool_feature

3. Create a detailed pull request, with documentation

I'd like to keep everything documented to make it as easy as possible for people looking to use the crate.

When opening a pull request, please ensure your function/contribution has been properly documented, and include good information about it in the PR. (use common sense)

Thanks so much!

Comments
  • PRs without creating branches?

    PRs without creating branches?

    From my experience it slows down work considerably as i switch from one task to another. Besides my local repo is a mess. Could we possibly accept PRs in a more traditional way?

    question 
    opened by MistApproach 5
  • Overall V2 Migration

    Overall V2 Migration

    How do we want to split up/manage migration from V1 -> V2 endpoints & authentication? open to any ideas, just excited to be able to build out fc-rs and add fulll features :D

    cc @MistApproach

    Farcaster V2 
    opened by TheLDB 3
  • Registry: FIR support

    Registry: FIR support

    FIR "Transfer" event not parsed yet. No factor at this point as there's not a single "Transfer" event logged in FIR contract (would be nice to fix this in the near future). Apart from this Registry now fully supports querying by FID, Address and Username:

    get_fid_by_address() get_fid_by_username() get_address_by_fid() get_address_by_username() get_username_by_fid() get_username_by_address()

    opened by MistApproach 1
  • Update deps

    Update deps

    It appears you overwrote my commit and ethers-rs is back to 0.17.0. This throws error on compilation for me. This patch updates ethers-rs to version 1.0.x. It also removes patch version from stable crates (serde, serde_json).

    opened by MistApproach 1
  • [v2-api] Major FIR/FNR Registry refactor

    [v2-api] Major FIR/FNR Registry refactor

    Just pushed a major FIR/FNR Registry refactor - everything from file structure to interface. ABI, JSON, logs etc. were all over the place. Now the only interface is via Registry struct ! This is first commit and not everything is implemented yet, some things have rough edges, barely any optimizations etc. Even though it appears to work it surely needs more work (like implementing FIR sync). Registry struct implements incremental updates of FIR/FNR via sync(). Everything else that is implemented as public interface replaces/merges previous code and simplifies it. Functions like get_address_by_username() make it very easy - both for ourselves and crate users. Check get_user_by_username() in src/users/get_user.rs to see how it simpified things :) Registry is created alongside Farcaster and encapsulated publicly. It's available to our code as self.registry. Crate users can access it easily as well:

    let farcaster = Farcaster::new(...).await?;
    let address = farcaster.registry.get_address_by_username("mistapproach");
    println!("{:#?}", address);
    
    

    Registry can also by instantiated on its own if desired:

    use farcaster_rs::Registry;
    
    let registry = Registry::new(ethereum_provider).await?;
    let address = registry.get_address_by_username("mistapproach");
    println!("{:#?}", address);
    

    If Registry is created as mutable it can be later used to do incremental update of FIR/FNR state by simply calling registry.sync().await (needs more testing though).

    The downsides: For it to make sense i had to declare Farcaster::new() and Registry::new() as async with Result. Other than that there is a little more mutability around that i would like. I'm sure we can achieve more streamlined integration over time.

    Files added:

    • src/types/registry/mod.rs
    • src/registry/mod.rs

    Files moved:

    • src/users/token_to_fname.rs to src/registry/token_to_fname.rs
    • json to src/registry/json (now inlined at compile time!)

    Files removed:

    • src/abi/mod.rs
    • src/abi/get_registry_abi.rs
    • src/logs/get_id_registry_logs.rs
    • src/logs/get_name_registry_logs.rs
    • src/logs/mod.rs
    • src/logs/parse_log.rs
    • src/types/abi/mod.rs
    • src/types/abi/registry.rs
    • src/types/logs/events.rs
    • src/types/logs/mod.rs
    • src/types/registry/events.rs

    After working on this i have some ideas on how to better integrate FarcasterAccount.

    opened by MistApproach 0
Releases(v0.1.0-pre.3)
Owner
Landon
17, writing code since ~2012 (thanks dad) - just wanna be happy and write code that runs
Landon
SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project.

SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project. With just a few primary configurations, such as project name, you can get started quickly.

Gabriel Michaliszen 4 May 9, 2023
The dead easy way to use config files in your rust project

Configr The dead easy way to use config files in your project This will load a config.toml file if it exists, otherwise it will create the needed fold

Carsten Kragelund JΓΈrgensen 4 Jul 1, 2022
PyO3 bindings and Python interface to skani, a method for fast fast genomic identity calculation using sparse chaining.

?? ⛓️ ?? Pyskani PyO3 bindings and Python interface to skani, a method for fast fast genomic identity calculation using sparse chaining. ??️ Overview

Martin Larralde 13 Mar 21, 2023
Voila is a domain-specific language launched through CLI tool for operating with files and directories in massive amounts in a fast & reliable way.

Voila is a domain-specific language designed for doing complex operations to folders & files. It is based on a CLI tool, although you can write your V

Guillem Jara 86 Dec 12, 2022
⚑️ A blazing fast way of maintaining powerful notes with connections between them.

Zettl ⚑️ A blazing fast way of maintaining powerful notes with connections between them. Installing Zettl To install Zettl, you will need the Rust too

Tirth Jain 26 Dec 2, 2022
πŸš€ A blazingly fast easy to use dotfile and global theme manager written in Rust

GTHEME A blazingly fast easy to use dotfile and global theme manager for *NIX systems written in Rust ?? Demo using wip desktop. To check out more des

David Rodriguez 19 Nov 28, 2022
A blazing fast and easy to use TRPC-like server for Rust.

rspc ?? Work in progress ?? A blazing fast and easy to use TRPC-like server for Rust. Website Example You define a trpc router and attach resolvers to

Oscar Beaumont 344 Dec 31, 2022
A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text!

uwuifyy A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text! Logo Credits: Jade Nelson Tab

Hamothy 43 Dec 12, 2022
An easy, fast and lightweight tool to create notes in terminal.

An easy and lightweight tool to create notes in terminal. Features Make notes faster. Manage your notes directly in terminal. Lightweight and fast. Ea

Konstantin Zhigaylo 5 May 24, 2023
A simple, fast, and easy to use Solidity test generator based on the Branching Tree Technique.

bulloak A simple, fast, and easy to use Solidity test generator based on the Branching Tree Technique. Installing cargo install bulloak Usage Basic Us

Alexander GonzΓ‘lez 38 Aug 7, 2023
A simple, fast, and easy to use static file server

Warning This is still in early development, I would not recommend for production use.. yet. See the issues for things that are on the "roadmap" or mis

Ayodeji O. 5 Feb 26, 2024
Cli tool for git productivity written in Rust and packaged for consumption via NPM

crust ?? cli tool for git productivity written in Rust and packaged for consumption via NPM This repo is identical with @skyneticist/golee in terms of

null 2 Jul 30, 2022
Safe Unix shell-like parameter expansion/variable substitution via cross-platform CLI or Rust API

Safe Unix shell-like parameter expansion/variable substitution for those who need a more powerful alternative to envsubst but don't want to resort to

Isak Wertwein 4 Oct 4, 2022
Choose Rust types at compile-time via boolean constants

condtype Choose Rust types at compile-time via boolean constants, brought to you by Nikolai Vazquez. If you find this library useful, consider starrin

Nikolai Vazquez 36 May 8, 2023
Terminal text styling via ANSI escape sequences.

Iridescent Features iridescent is a library for styling terminal text easily. It supports basic ANSI sequences, Xterm-256 colors, and RGB. You can ope

Rob 2 Oct 20, 2022
πŸ”” CLI utility to send notifications to Slack via integration webhooks

Slack notifier Just a simple CLI tool to send notifications to Slack. Please note that this project is just a playground to start learning Rust, it is

Green.Mod 2 May 21, 2022
A tool to control the fan speed by monitoring the temperature of CPU via IPMI.

ipmi-fan-control A tool to control the fan speed by monitoring the temperature of CPU via IPMI. Why Our Dell R730 server's iDRAC is not works as expec

yinheli 9 Dec 29, 2022
Small microservice to render Lottie animation files via an http REST API.

Lottie Renderer Service Small microservice to render Lottie animation files via an http REST API. Run via docker docker run -p 8080:8080 ghcr.io/mikbo

Mikbot 3 Oct 22, 2022
MollySocket allows getting signal notifications via UnifiedPush.

MollySocket This software is still in alpha. MollySocket allows getting signal notifications via UnifiedPush. It works like a linked device, which doe

null 6 Dec 31, 2022