Skip to content

Commit

Permalink
Merge pull request elizaOS#1417 from swizzmagik/feat/add-birdeye-plugin
Browse files Browse the repository at this point in the history
feat: add birdeye plugin
  • Loading branch information
odilitime authored Jan 14, 2025
2 parents 172d645 + 8ac6b43 commit ecfd42c
Show file tree
Hide file tree
Showing 27 changed files with 5,019 additions and 19 deletions.
5 changes: 3 additions & 2 deletions agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
"@elizaos/plugin-0g": "workspace:*",
"@elizaos/plugin-abstract": "workspace:*",
"@elizaos/plugin-aptos": "workspace:*",
"@elizaos/plugin-coinmarketcap": "workspace:*",
"@elizaos/plugin-birdeye": "workspace:*",
"@elizaos/plugin-coingecko": "workspace:*",
"@elizaos/plugin-coinmarketcap": "workspace:*",
"@elizaos/plugin-binance": "workspace:*",
"@elizaos/plugin-avail": "workspace:*",
"@elizaos/plugin-bootstrap": "workspace:*",
Expand Down Expand Up @@ -107,4 +108,4 @@
"ts-node": "10.9.2",
"tsup": "8.3.5"
}
}
}
36 changes: 19 additions & 17 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ import createGoatPlugin from "@elizaos/plugin-goat";
import { DirectClient } from "@elizaos/client-direct";
import { ThreeDGenerationPlugin } from "@elizaos/plugin-3d-generation";
import { abstractPlugin } from "@elizaos/plugin-abstract";
import { akashPlugin } from "@elizaos/plugin-akash";
import { alloraPlugin } from "@elizaos/plugin-allora";
import { aptosPlugin } from "@elizaos/plugin-aptos";
import { artheraPlugin } from "@elizaos/plugin-arthera";
import { autonomePlugin } from "@elizaos/plugin-autonome";
import { availPlugin } from "@elizaos/plugin-avail";
import { avalanchePlugin } from "@elizaos/plugin-avalanche";
import { b2Plugin } from "@elizaos/plugin-b2";
import { binancePlugin } from "@elizaos/plugin-binance";
import { birdeyePlugin } from "@elizaos/plugin-birdeye";
import {
advancedTradePlugin,
coinbaseCommercePlugin,
Expand All @@ -56,8 +59,8 @@ import {
tradePlugin,
webhookPlugin,
} from "@elizaos/plugin-coinbase";
import { coinmarketcapPlugin } from "@elizaos/plugin-coinmarketcap";
import { coingeckoPlugin } from "@elizaos/plugin-coingecko";
import { coinmarketcapPlugin } from "@elizaos/plugin-coinmarketcap";
import { confluxPlugin } from "@elizaos/plugin-conflux";
import { createCosmosPlugin } from "@elizaos/plugin-cosmos";
import { cronosZkEVMPlugin } from "@elizaos/plugin-cronoszkevm";
Expand All @@ -66,45 +69,41 @@ import { evmPlugin } from "@elizaos/plugin-evm";
import { flowPlugin } from "@elizaos/plugin-flow";
import { fuelPlugin } from "@elizaos/plugin-fuel";
import { genLayerPlugin } from "@elizaos/plugin-genlayer";
import { giphyPlugin } from "@elizaos/plugin-giphy";
import { hyperliquidPlugin } from "@elizaos/plugin-hyperliquid";
import { imageGenerationPlugin } from "@elizaos/plugin-image-generation";
import { lensPlugin } from "@elizaos/plugin-lensNetwork";
import { letzAIPlugin } from "@elizaos/plugin-letzai";
import { multiversxPlugin } from "@elizaos/plugin-multiversx";
import { nearPlugin } from "@elizaos/plugin-near";
import createNFTCollectionsPlugin from "@elizaos/plugin-nft-collections";
import { nftGenerationPlugin } from "@elizaos/plugin-nft-generation";
import { createNodePlugin } from "@elizaos/plugin-node";
import { obsidianPlugin } from "@elizaos/plugin-obsidian";
import { OpacityAdapter } from "@elizaos/plugin-opacity";
import { openWeatherPlugin } from "@elizaos/plugin-open-weather";
import { quaiPlugin } from "@elizaos/plugin-quai";
import { sgxPlugin } from "@elizaos/plugin-sgx";
import { solanaPlugin } from "@elizaos/plugin-solana";
import { solanaAgentkitPlguin } from "@elizaos/plugin-solana-agentkit";
import { autonomePlugin } from "@elizaos/plugin-autonome";
import { stargazePlugin } from "@elizaos/plugin-stargaze";
import { storyPlugin } from "@elizaos/plugin-story";
import { suiPlugin } from "@elizaos/plugin-sui";
import { TEEMode, teePlugin } from "@elizaos/plugin-tee";
import { teeLogPlugin } from "@elizaos/plugin-tee-log";
import { teeMarlinPlugin } from "@elizaos/plugin-tee-marlin";
import { verifiableLogPlugin } from "@elizaos/plugin-tee-verifiable-log";
import { thirdwebPlugin } from "@elizaos/plugin-thirdweb";
import { tonPlugin } from "@elizaos/plugin-ton";
import { squidRouterPlugin } from "@elizaos/plugin-squid-router";
import { webSearchPlugin } from "@elizaos/plugin-web-search";

import { giphyPlugin } from "@elizaos/plugin-giphy";
import { letzAIPlugin } from "@elizaos/plugin-letzai";
import { thirdwebPlugin } from "@elizaos/plugin-thirdweb";
import { hyperliquidPlugin } from "@elizaos/plugin-hyperliquid";
import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era";

import { OpacityAdapter } from "@elizaos/plugin-opacity";
import { openWeatherPlugin } from "@elizaos/plugin-open-weather";
import { stargazePlugin } from "@elizaos/plugin-stargaze";
import { akashPlugin } from "@elizaos/plugin-akash";
import { quaiPlugin } from "@elizaos/plugin-quai";
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 { verifiableLogPlugin } from "@elizaos/plugin-tee-verifiable-log";
import createNFTCollectionsPlugin from "@elizaos/plugin-nft-collections";

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 @@ -801,9 +800,11 @@ export async function createAgent(
]
: []),
...(teeMode !== TEEMode.OFF && walletSecretSalt ? [teePlugin] : []),
(teeMode !== TEEMode.OFF && walletSecretSalt &&getSecret(character,"VLOG")
teeMode !== TEEMode.OFF &&
walletSecretSalt &&
getSecret(character, "VLOG")
? verifiableLogPlugin
: null),
: null,
getSecret(character, "SGX") ? sgxPlugin : null,
getSecret(character, "ENABLE_TEE_LOG") &&
((teeMode !== TEEMode.OFF && walletSecretSalt) ||
Expand Down Expand Up @@ -859,6 +860,7 @@ export async function createAgent(
getSecret(character, "AVALANCHE_PRIVATE_KEY")
? avalanchePlugin
: null,
getSecret(character, "BIRDEYE_API_KEY") ? birdeyePlugin : null,
getSecret(character, "ECHOCHAMBERS_API_URL") &&
getSecret(character, "ECHOCHAMBERS_API_KEY")
? echoChambersPlugin
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
1 change: 1 addition & 0 deletions packages/plugin-birdeye/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v23.3.0
38 changes: 38 additions & 0 deletions packages/plugin-birdeye/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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

### Provider Featurs

- **Agent Portfolio Provider**

- If `BIRDEYE_WALLET_ADDR` is set, this provider will fetch the wallet's portfolio data from Birdeye and be able to respond to questions related to the wallet's holdings.

### Action Features

- **Token Search Address**

- This action will search input message for token addresses and when present will query Birdeye for token information

- **Token Search Symbol**

- This action will search input message for token symbols in the format of `$SYMBOL` and when present will query Birdeye for token information. Note that this action currently only supports SOL, SUI, and ETH addresses.
- _Any addresses that look like EVM addresses will be treated as ETH addresses since there is no easy way to distinguish between the other EVM chains that are supported by Birdeye_.

- **Wallet Search Address**

- This action will search input message for wallet addresses and when present will query Birdeye for wallet information

## API Reference

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

## License

See parent project for license information.

## Contributing

Contributions are welcome! See parent project for contribution guidelines.
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];
37 changes: 37 additions & 0 deletions packages/plugin-birdeye/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "@elizaos/plugin-birdeye",
"version": "0.1.7-alpha.1",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",
"dependencies": {
"@coral-xyz/anchor": "0.30.1",
"@elizaos/core": "workspace:*",
"@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"
},
"devDependencies": {
"@types/node": "^22.10.2",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.7.2"
}
}
Loading

0 comments on commit ecfd42c

Please sign in to comment.