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: add birdeye plugin #1417

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
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
3 changes: 2 additions & 1 deletion agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@elizaos/plugin-abstract": "workspace:*",
"@elizaos/plugin-aptos": "workspace:*",
"@elizaos/plugin-bootstrap": "workspace:*",
"@elizaos/plugin-birdeye": "workspace:*",
"@elizaos/plugin-intiface": "workspace:*",
"@elizaos/plugin-coinbase": "workspace:*",
"@elizaos/plugin-conflux": "workspace:*",
Expand Down Expand Up @@ -60,4 +61,4 @@
"ts-node": "10.9.2",
"tsup": "8.3.5"
}
}
}
12 changes: 7 additions & 5 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PostgresDatabaseAdapter } from "@elizaos/adapter-postgres";
import { RedisClient } from "@elizaos/adapter-redis";
import { SqliteDatabaseAdapter } from "@elizaos/adapter-sqlite";
import { AutoClientInterface } from "@elizaos/client-auto";
import { DiscordClientInterface } from "@elizaos/client-discord";
Expand All @@ -10,6 +11,7 @@ import { TwitterClientInterface } from "@elizaos/client-twitter";
import {
AgentRuntime,
CacheManager,
CacheStore,
Character,
Clients,
DbCacheAdapter,
Expand All @@ -24,15 +26,15 @@ import {
settings,
stringToUuid,
validateCharacterConfig,
CacheStore,
} from "@elizaos/core";
import { RedisClient } from "@elizaos/adapter-redis";
import { zgPlugin } from "@elizaos/plugin-0g";
import { bootstrapPlugin } from "@elizaos/plugin-bootstrap";
import createGoatPlugin from "@elizaos/plugin-goat";
// import { intifacePlugin } from "@elizaos/plugin-intiface";
import { DirectClient } from "@elizaos/client-direct";
import { abstractPlugin } from "@elizaos/plugin-abstract";
import { aptosPlugin } from "@elizaos/plugin-aptos";
import { birdeyePlugin } from "@elizaos/plugin-birdeye";
import {
advancedTradePlugin,
coinbaseCommercePlugin,
Expand All @@ -43,25 +45,24 @@ import {
} from "@elizaos/plugin-coinbase";
import { confluxPlugin } from "@elizaos/plugin-conflux";
import { evmPlugin } from "@elizaos/plugin-evm";
import { storyPlugin } from "@elizaos/plugin-story";
import { flowPlugin } from "@elizaos/plugin-flow";
import { imageGenerationPlugin } from "@elizaos/plugin-image-generation";
import { multiversxPlugin } from "@elizaos/plugin-multiversx";
import { nearPlugin } from "@elizaos/plugin-near";
import { nftGenerationPlugin } from "@elizaos/plugin-nft-generation";
import { createNodePlugin } from "@elizaos/plugin-node";
import { solanaPlugin } from "@elizaos/plugin-solana";
import { storyPlugin } from "@elizaos/plugin-story";
import { suiPlugin } from "@elizaos/plugin-sui";
import { TEEMode, teePlugin } from "@elizaos/plugin-tee";
import { tonPlugin } from "@elizaos/plugin-ton";
import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era";
import { abstractPlugin } from "@elizaos/plugin-abstract";
import Database from "better-sqlite3";
import fs from "fs";
import net from "net";
import path from "path";
import { fileURLToPath } from "url";
import yargs from "yargs";
import net from "net";

const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
const __dirname = path.dirname(__filename); // get the name of the directory
Expand Down Expand Up @@ -481,6 +482,7 @@ export async function createAgent(
? confluxPlugin
: null,
nodePlugin,
getSecret(character, "BIRDEYE_API_KEY") ? birdeyePlugin : null,
getSecret(character, "SOLANA_PUBLIC_KEY") ||
(getSecret(character, "WALLET_PUBLIC_KEY") &&
!getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
Expand Down
12 changes: 7 additions & 5 deletions client/src/Chat.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { useMutation } from "@tanstack/react-query";
import { useState } from "react";
import { useParams } from "react-router-dom";
import { useMutation } from "@tanstack/react-query";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import "./App.css";

type TextResponse = {
Expand Down Expand Up @@ -58,7 +58,7 @@ export default function Chat() {
messages.map((message, index) => (
<div
key={index}
className={`flex ${
className={`text-left flex ${
message.user === "user"
? "justify-end"
: "justify-start"
Expand All @@ -71,7 +71,9 @@ export default function Chat() {
: "bg-muted"
}`}
>
{message.text}
<pre className="whitespace-pre-wrap break-words font-sans m-0">
{message.text}
</pre>
</div>
</div>
))
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/defaultCharacter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const defaultCharacter: Character = {
username: "eliza",
plugins: [],
clients: [],
modelProvider: ModelProviderName.LLAMALOCAL,
modelProvider: ModelProviderName.ANTHROPIC,
settings: {
secrets: {},
voice: {
Expand Down
6 changes: 6 additions & 0 deletions packages/plugin-birdeye/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
77 changes: 77 additions & 0 deletions packages/plugin-birdeye/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Eliza Birdeye Plugin

A powerful plugin for Eliza that integrates with Birdeye's comprehensive DeFi and token analytics API. This plugin provides real-time access to blockchain data, token metrics, and DeFi analytics across multiple networks.

## Features

- **DeFi Analytics**

- Real-time price and trading data
- Historical price tracking
- OHLCV (Open, High, Low, Close, Volume) data
- Trade analysis for tokens and pairs

- **Token Intelligence**

- Comprehensive token metadata
- Security information
- Token holder analytics
- Mint and burn tracking
- Market trends and new listings

- **Wallet Analysis**

- Multi-chain portfolio tracking
- Token balance monitoring
- Transaction history analysis
- Cross-chain analytics

- **Market Research**
- Gainers and losers tracking
- Trending tokens
- Top trader analysis
- Market pair analytics

## Installation

```bash
npm install @eliza/plugin-birdeye
```

## Configuration

Add the following to your Eliza configuration:

```typescript
import { BirdeyePlugin } from "@eliza/plugin-birdeye";

export default {
plugins: [
new BirdeyePlugin({
apiKey: "YOUR_BIRDEYE_API_KEY",
}),
],
};
```

## Environment Variables

```
BIRDEYE_API_KEY=your_api_key_here
```

## Usage

Once configured, the plugin provides access to Birdeye data through Eliza's interface.

## API Reference

The plugin provides access to all Birdeye API endpoints through structured interfaces. For detailed API documentation, visit [Birdeye's API Documentation](https://public-api.birdeye.so).

## License

MIT

## Contributing

Contributions are welcome! Please read our contributing guidelines before submitting pull requests.
3 changes: 3 additions & 0 deletions packages/plugin-birdeye/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import eslintGlobalConfig from "../../eslint.config.mjs";

export default [...eslintGlobalConfig];
31 changes: 31 additions & 0 deletions packages/plugin-birdeye/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "@elizaos/plugin-birdeye",
"version": "0.1.7-alpha.1",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",
"dependencies": {
"@elizaos/core": "workspace:*",
"@coral-xyz/anchor": "0.30.1",
"@solana/spl-token": "0.4.9",
"@solana/web3.js": "1.95.8",
"bignumber": "1.1.0",
"bignumber.js": "9.1.2",
"bs58": "6.0.0",
"fomo-sdk-solana": "1.3.2",
"node-cache": "5.1.2",
"pumpdotfun-sdk": "1.3.2",
"tsup": "8.3.5",
"vitest": "2.1.4"
},
"scripts": {
"build": "tsup --format esm --dts",
"dev": "tsup --format esm --dts --watch",
"lint": "eslint --fix --cache .",
"test": "vitest run"
},
"peerDependencies": {
"form-data": "4.0.1",
"whatwg-url": "7.1.0"
}
}
Loading
Loading