Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: working farcaster client with neynar #570

Merged
merged 9 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ STARKNET_RPC_URL=
# Intiface Configuration
INTIFACE_WEBSOCKET_URL=ws://localhost:12345

# Farcaster
FARCASTER_HUB_URL=
FARCASTER_FID=
FARCASTER_PRIVATE_KEY=
# Farcaster Neynar Configuration
FARCASTER_FID= # the FID associated with the account your are sending casts from
FARCASTER_NEYNAR_API_KEY= # Neynar API key: https://neynar.com/
FARCASTER_NEYNAR_SIGNER_UUID= # signer for the account you are sending casts from. create a signer here: https://dev.neynar.com/app

# Coinbase
COINBASE_COMMERCE_KEY= # from coinbase developer portal
Expand Down
1 change: 1 addition & 0 deletions agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@ai16z/client-auto": "workspace:*",
"@ai16z/client-direct": "workspace:*",
"@ai16z/client-discord": "workspace:*",
"@ai16z/client-farcaster": "workspace:*",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sayangel Ensure that you review and update the documentation to reflect this new dependency.

"@ai16z/client-telegram": "workspace:*",
"@ai16z/client-twitter": "workspace:*",
"@ai16z/eliza": "workspace:*",
Expand Down
7 changes: 7 additions & 0 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { DirectClientInterface } from "@ai16z/client-direct";
import { DiscordClientInterface } from "@ai16z/client-discord";
import { TelegramClientInterface } from "@ai16z/client-telegram";
import { TwitterClientInterface } from "@ai16z/client-twitter";
import { FarcasterAgentClient } from "@ai16z/client-farcaster";
import {
AgentRuntime,
CacheManager,
Expand Down Expand Up @@ -322,6 +323,12 @@ export async function initializeClients(
clients.push(twitterClients);
}

if (clientTypes.includes("farcaster")) {
const farcasterClients = new FarcasterAgentClient(runtime);
farcasterClients.start();
clients.push(farcasterClients);
}

if (character.plugins?.length > 0) {
for (const plugin of character.plugins) {
if (plugin.clients) {
Expand Down
5 changes: 2 additions & 3 deletions packages/client-farcaster/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
"types": "dist/index.d.ts",
"dependencies": {
"@ai16z/eliza": "workspace:*",
"@farcaster/hub-nodejs": "0.12.7",
"viem": "2.21.53"
"@neynar/nodejs-sdk": "^2.0.3"
},
"devDependencies": {
"tsup": "8.3.5"
"tsup": "^8.3.5"
},
"scripts": {
"build": "tsup --format esm --dts",
Expand Down
Loading