Coder Social home page Coder Social logo

go-farcaster's Introduction

Farcaster Go Client

This is the Golang implementation for Farcaster client based on the official v2 API documentation.

Inspired by Rust and Python client implementations. Coauthored by GitHub Copilot and ChatGPT. ๐Ÿ™

Installation

go get github.com/ertan/go-farcaster

Usage

apiUrl := "https://api.warpcast.com"
mnemonic := "Farcaster mnemonic"
providerWs := "Optional: Goerli endpoint"
fc := farcaster.NewFarcasterClient(apiUrl, mnemonic, providerWs)
casts, _, err := fc.Casts.GetRecentCasts(10)

You can find other examples under examples/ directory.

Development

In order to test the examples you need to set the following environment variables in .env file in the repo's root directory.

FARCASTER_API_URL    = "https://api.warpcast.xyz"
FARCASTER_MNEMONIC   = "your mnemonic"
ETHEREUM_PROVIDER_WS = "your Goerli endpoint"

Registry is built based on the event logs to get fid <> fname <> address mappings. If ETHEREUM_PROVIDER_WS variable isn't set, you can still use the API. Mnemonic is required for authorization to access most of the API endpoints. However, it's not required by the client as some endpoints are open to public.

Examples

Some examples to test the client are:

go run examples/casts/casts_example.go
go run examples/reactions/reactions_example.go
go run examples/users/users_example.go

Future Work

  • Tests! There are currently no unit tests for the client, just examples. ๐Ÿ˜…
  • Missing comments on exported functions and structs.

go-farcaster's People

Contributors

ertan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.