Skip to content

Commit 9cedc27

Browse files
committed
feat: enhance token report formatting and update README with action features
1 parent db9e2b5 commit 9cedc27

File tree

4 files changed

+678
-686
lines changed

4 files changed

+678
-686
lines changed

agent/src/index.ts

+52-47
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ import {
2626
ModelProviderName,
2727
settings,
2828
stringToUuid,
29-
validateCharacterConfig
29+
validateCharacterConfig,
3030
} from "@elizaos/core";
31-
import { zgPlugin } from "@elizaos/plugin-0g";
31+
// import { zgPlugin } from "@elizaos/plugin-0g";
3232
import { bootstrapPlugin } from "@elizaos/plugin-bootstrap";
3333
import createGoatPlugin from "@elizaos/plugin-goat";
3434
// import { intifacePlugin } from "@elizaos/plugin-intiface";
3535
import { DirectClient } from "@elizaos/client-direct";
3636
import { ThreeDGenerationPlugin } from "@elizaos/plugin-3d-generation";
37-
import { abstractPlugin } from "@elizaos/plugin-abstract";
38-
import { aptosPlugin } from "@elizaos/plugin-aptos";
39-
import { avalanchePlugin } from "@elizaos/plugin-avalanche";
37+
// import { abstractPlugin } from "@elizaos/plugin-abstract";
38+
// import { aptosPlugin } from "@elizaos/plugin-aptos";
39+
// import { avalanchePlugin } from "@elizaos/plugin-avalanche";
4040
import { birdeyePlugin } from "@elizaos/plugin-birdeye";
4141
import {
4242
advancedTradePlugin,
@@ -46,31 +46,35 @@ import {
4646
tradePlugin,
4747
webhookPlugin,
4848
} from "@elizaos/plugin-coinbase";
49-
import { confluxPlugin } from "@elizaos/plugin-conflux";
50-
import { cronosZkEVMPlugin } from "@elizaos/plugin-cronoszkevm";
49+
// import { confluxPlugin } from "@elizaos/plugin-conflux";
50+
// import { cronosZkEVMPlugin } from "@elizaos/plugin-cronoszkevm";
5151
import { echoChamberPlugin } from "@elizaos/plugin-echochambers";
5252
import { evmPlugin } from "@elizaos/plugin-evm";
53-
import { flowPlugin } from "@elizaos/plugin-flow";
54-
import { fuelPlugin } from "@elizaos/plugin-fuel";
53+
// import { flowPlugin } from "@elizaos/plugin-flow";
54+
// import { fuelPlugin } from "@elizaos/plugin-fuel";
5555
import { imageGenerationPlugin } from "@elizaos/plugin-image-generation";
56-
import { multiversxPlugin } from "@elizaos/plugin-multiversx";
57-
import { nearPlugin } from "@elizaos/plugin-near";
56+
// import { multiversxPlugin } from "@elizaos/plugin-multiversx";
57+
// import { nearPlugin } from "@elizaos/plugin-near";
5858
import { nftGenerationPlugin } from "@elizaos/plugin-nft-generation";
5959
import { createNodePlugin } from "@elizaos/plugin-node";
6060
import { solanaPlugin } from "@elizaos/plugin-solana";
61-
import { storyPlugin } from "@elizaos/plugin-story";
62-
import { suiPlugin } from "@elizaos/plugin-sui";
61+
// import { storyPlugin } from "@elizaos/plugin-story";
62+
// import { suiPlugin } from "@elizaos/plugin-sui";
6363
import { TEEMode, teePlugin } from "@elizaos/plugin-tee";
64-
import { tonPlugin } from "@elizaos/plugin-ton";
64+
// import { tonPlugin } from "@elizaos/plugin-ton";
65+
import { twitterPlugin } from "@elizaos/plugin-twitter";
6566
import { webSearchPlugin } from "@elizaos/plugin-web-search";
66-
import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era";
67+
// import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era";
6768
import Database from "better-sqlite3";
6869
import fs from "fs";
6970
import net from "net";
7071
import path from "path";
7172
import { fileURLToPath } from "url";
7273
import yargs from "yargs";
7374

75+
import { whaleDataEvaluator } from "./whaleDataEvaluator";
76+
import { whaleDataProvider } from "./whaleDataProvider";
77+
7478
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
7579
const __dirname = path.dirname(__filename); // get the name of the directory
7680

@@ -520,26 +524,26 @@ export async function createAgent(
520524
databaseAdapter: db,
521525
token,
522526
modelProvider: character.modelProvider,
523-
evaluators: [],
524527
character,
525528
// character.plugins are handled when clients are added
526529
plugins: [
527530
bootstrapPlugin,
528-
getSecret(character, "CONFLUX_CORE_PRIVATE_KEY")
529-
? confluxPlugin
530-
: null,
531-
nodePlugin,
531+
twitterPlugin,
532+
// getSecret(character, "CONFLUX_CORE_PRIVATE_KEY")
533+
// ? confluxPlugin
534+
// : null,
535+
// nodePlugin,
532536
getSecret(character, "TAVILY_API_KEY") ? webSearchPlugin : null,
533537
getSecret(character, "SOLANA_PUBLIC_KEY") ||
534538
(getSecret(character, "WALLET_PUBLIC_KEY") &&
535539
!getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
536540
? solanaPlugin
537541
: null,
538-
(getSecret(character, "NEAR_ADDRESS") ||
539-
getSecret(character, "NEAR_WALLET_PUBLIC_KEY")) &&
540-
getSecret(character, "NEAR_WALLET_SECRET_KEY")
541-
? nearPlugin
542-
: null,
542+
// (getSecret(character, "NEAR_ADDRESS") ||
543+
// getSecret(character, "NEAR_WALLET_PUBLIC_KEY")) &&
544+
// getSecret(character, "NEAR_WALLET_SECRET_KEY")
545+
// ? nearPlugin
546+
// : null,
543547
getSecret(character, "EVM_PUBLIC_KEY") ||
544548
(getSecret(character, "WALLET_PUBLIC_KEY") &&
545549
getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
@@ -555,7 +559,7 @@ export async function createAgent(
555559
getSecret(character, "SOLANA_ADMIN_PRIVATE_KEY")
556560
? nftGenerationPlugin
557561
: null,
558-
getSecret(character, "ZEROG_PRIVATE_KEY") ? zgPlugin : null,
562+
// getSecret(character, "ZEROG_PRIVATE_KEY") ? zgPlugin : null,
559563
getSecret(character, "COINBASE_COMMERCE_KEY")
560564
? coinbaseCommercePlugin
561565
: null,
@@ -585,33 +589,34 @@ export async function createAgent(
585589
? webhookPlugin
586590
: null,
587591
goatPlugin,
588-
getSecret(character, "ABSTRACT_PRIVATE_KEY")
589-
? abstractPlugin
590-
: null,
591-
getSecret(character, "FLOW_ADDRESS") &&
592-
getSecret(character, "FLOW_PRIVATE_KEY")
593-
? flowPlugin
594-
: null,
595-
getSecret(character, "APTOS_PRIVATE_KEY") ? aptosPlugin : null,
596-
getSecret(character, "MVX_PRIVATE_KEY") ? multiversxPlugin : null,
597-
getSecret(character, "ZKSYNC_PRIVATE_KEY") ? zksyncEraPlugin : null,
598-
getSecret(character, "CRONOSZKEVM_PRIVATE_KEY")
599-
? cronosZkEVMPlugin
600-
: null,
601-
getSecret(character, "TON_PRIVATE_KEY") ? tonPlugin : null,
602-
getSecret(character, "SUI_PRIVATE_KEY") ? suiPlugin : null,
603-
getSecret(character, "STORY_PRIVATE_KEY") ? storyPlugin : null,
604-
getSecret(character, "FUEL_PRIVATE_KEY") ? fuelPlugin : null,
605-
getSecret(character, "AVALANCHE_PRIVATE_KEY")
606-
? avalanchePlugin
607-
: null,
592+
// getSecret(character, "ABSTRACT_PRIVATE_KEY")
593+
// ? abstractPlugin
594+
// : null,
595+
// getSecret(character, "FLOW_ADDRESS") &&
596+
// getSecret(character, "FLOW_PRIVATE_KEY")
597+
// ? flowPlugin
598+
// : null,
599+
// getSecret(character, "APTOS_PRIVATE_KEY") ? aptosPlugin : null,
600+
// getSecret(character, "MVX_PRIVATE_KEY") ? multiversxPlugin : null,
601+
// getSecret(character, "ZKSYNC_PRIVATE_KEY") ? zksyncEraPlugin : null,
602+
// getSecret(character, "CRONOSZKEVM_PRIVATE_KEY")
603+
// ? cronosZkEVMPlugin
604+
// : null,
605+
// getSecret(character, "TON_PRIVATE_KEY") ? tonPlugin : null,
606+
// getSecret(character, "SUI_PRIVATE_KEY") ? suiPlugin : null,
607+
// getSecret(character, "STORY_PRIVATE_KEY") ? storyPlugin : null,
608+
// getSecret(character, "FUEL_PRIVATE_KEY") ? fuelPlugin : null,
609+
// getSecret(character, "AVALANCHE_PRIVATE_KEY")
610+
// ? avalanchePlugin
611+
// : null,
608612
getSecret(character, "BIRDEYE_API_KEY") ? birdeyePlugin : null,
609613
getSecret(character, "ECHOCHAMBERS_API_URL") &&
610614
getSecret(character, "ECHOCHAMBERS_API_KEY")
611615
? echoChamberPlugin
612616
: null,
613617
].filter(Boolean),
614-
providers: [],
618+
evaluators: [whaleDataEvaluator],
619+
providers: [whaleDataProvider],
615620
actions: [],
616621
services: [],
617622
managers: [],

packages/plugin-birdeye/README.md

+10-15
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,24 @@ A powerful plugin for Eliza that integrates with Birdeye's comprehensive DeFi an
66

77
### Provider Featurs
88

9-
- **Wallet Portfolio Provider**
9+
- **Agent Portfolio Provider**
1010

11-
- If `BIRDEYE_WALLET_ADDR` is set, this provider will fetch the wallet's portfolio data from Birdeye and be able to respond to questions
11+
- 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.
1212

13-
- **Wallet Search Provider**
14-
15-
- If the user mentions a wallet address, this provider will search for the address in Birdeye and be able to provide information about the wallet. This includes support for multiple addresses in the same message.
16-
17-
- **Symbol Search Provider**
13+
### Action Features
1814

19-
- If the user mentions a token symbol such as $SOL, $ETH or any random token symbol, this provider will search for the symbol in Birdeye and be able to provide information about the token. This includes support for multiple symbols in the same message.
20-
- i.e. "Tell me about $SOL and $PEPE"
15+
- **Token Search Address**
2116

22-
- **Address Search Provider**
17+
- This action will search input message for token addresses and when present will query Birdeye for token information
2318

24-
- If the user mentions a token address, this provider will search for the address in Birdeye and be able to provide information about the token. This includes support for multiple addresses in the same message.
25-
- i.e. "Tell me about 0x1234567890 and 0x9876543210"
19+
- **Token Search Symbol**
2620

27-
### Action Features
21+
- 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.
22+
- _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_.
2823

29-
- **Report Token**
24+
- **Wallet Search Address**
3025

31-
- This action will report on the current details of the wallet specified in the `BIRDEYE_WALLET_ADDR` setting.
26+
- This action will search input message for wallet addresses and when present will query Birdeye for wallet information
3227

3328
## API Reference
3429

packages/plugin-birdeye/src/actions/token-search-address.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ const formatTokenReport = (
220220
output += `\n`;
221221
output += `Token Overview:\n`;
222222
output += `📝 Name: ${result.overview.data.name}\n`;
223-
output += `🔖 Symbol: ${result.overview.data.symbol.toUpperCase()}\n`;
223+
output += result.overview.data.symbol
224+
? `🔖 Symbol: ${result.overview.data.symbol.toUpperCase()}\n`
225+
: "";
224226
output += `🔗 Address: ${address.address}\n`;
225227
output += `🔢 Decimals: ${result.overview.data.decimals}\n`;
226228
output += ``;

0 commit comments

Comments
 (0)