Skip to content

Commit a3b1fe1

Browse files
OKE BRO
1 parent 0243dfb commit a3b1fe1

File tree

79 files changed

+3314
-710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3314
-710
lines changed

agent/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
},
2020
"dependencies": {
2121
"@elizaos/adapter-postgres": "workspace:*",
22+
"@elizaos/plugin-coinmarketcap": "workspace:*",
23+
"@elizaos/plugin-goplus": "workspace:*",
2224
"@elizaos/adapter-redis": "workspace:*",
2325
"@elizaos/adapter-sqlite": "workspace:*",
2426
"@elizaos/client-auto": "workspace:*",
@@ -62,6 +64,7 @@
6264
"@elizaos/plugin-avalanche": "workspace:*",
6365
"@elizaos/plugin-web-search": "workspace:*",
6466
"readline": "1.3.0",
67+
"@ethosdao/plugin-market-analisys": "workspace:*",
6568
"ws": "8.18.0",
6669
"yargs": "17.7.2"
6770
},

agent/src/index.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
ModelProviderName,
2727
settings,
2828
stringToUuid,
29-
validateCharacterConfig
29+
validateCharacterConfig,
3030
} from "@elizaos/core";
3131
import { zgPlugin } from "@elizaos/plugin-0g";
3232
import { bootstrapPlugin } from "@elizaos/plugin-bootstrap";
@@ -45,12 +45,14 @@ import {
4545
tradePlugin,
4646
webhookPlugin,
4747
} from "@elizaos/plugin-coinbase";
48+
import { coinmarketcapPlugin } from "@elizaos/plugin-coinmarketcap";
4849
import { confluxPlugin } from "@elizaos/plugin-conflux";
4950
import { cronosZkEVMPlugin } from "@elizaos/plugin-cronoszkevm";
5051
import { echoChamberPlugin } from "@elizaos/plugin-echochambers";
5152
import { evmPlugin } from "@elizaos/plugin-evm";
5253
import { flowPlugin } from "@elizaos/plugin-flow";
5354
import { fuelPlugin } from "@elizaos/plugin-fuel";
55+
import { goplusPlugin } from "@elizaos/plugin-goplus";
5456
import { imageGenerationPlugin } from "@elizaos/plugin-image-generation";
5557
import { multiversxPlugin } from "@elizaos/plugin-multiversx";
5658
import { nearPlugin } from "@elizaos/plugin-near";
@@ -530,7 +532,10 @@ export async function createAgent(
530532
? confluxPlugin
531533
: null,
532534
nodePlugin,
533-
getSecret(character, "TAVILY_API_KEY") || getSecret(character, "SERPER_API_KEY") ? webSearchPlugin : null,
535+
getSecret(character, "TAVILY_API_KEY") ||
536+
getSecret(character, "SERPER_API_KEY")
537+
? webSearchPlugin
538+
: null,
534539
getSecret(character, "SOLANA_PUBLIC_KEY") ||
535540
(getSecret(character, "WALLET_PUBLIC_KEY") &&
536541
!getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
@@ -557,6 +562,10 @@ export async function createAgent(
557562
? nftGenerationPlugin
558563
: null,
559564
getSecret(character, "ZEROG_PRIVATE_KEY") ? zgPlugin : null,
565+
goplusPlugin,
566+
getSecret(character, "COINMARKETCAP_API_KEY")
567+
? coinmarketcapPlugin
568+
: null,
560569
getSecret(character, "COINBASE_COMMERCE_KEY")
561570
? coinbaseCommercePlugin
562571
: null,

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
"@0glabs/0g-ts-sdk": "0.2.1",
5858
"@coinbase/coinbase-sdk": "0.10.0",
5959
"@deepgram/sdk": "^3.9.0",
60+
"@glacier-network/client": "^0.2.1",
61+
"@glacier-network/elizaos-adapter": "0.0.1-alpha.1",
6062
"@vitest/eslint-plugin": "1.0.1",
6163
"amqplib": "0.10.5",
6264
"axios": "^1.7.9",

packages/core/src/context.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import handlebars from "handlebars";
2-
import { type State } from "./types.ts";
32
import { names, uniqueNamesGenerator } from "unique-names-generator";
3+
import { type State } from "./types.ts";
44

55
/**
66
* Composes a context string by replacing placeholders in a template with corresponding values from the state.
@@ -45,6 +45,7 @@ export const composeContext = ({
4545
const key = match.replace(/{{|}}/g, "");
4646
return state[key] ?? "";
4747
});
48+
//console.log('DEBUG OUT',out)
4849
return out;
4950
};
5051

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# @elizaos/plugin-coinmarketcap
2+
3+
A plugin for Eliza that enables cryptocurrency price checking using the CoinMarketCap API.
4+
5+
## Features
6+
7+
- Real-time cryptocurrency price checking
8+
- Support for multiple cryptocurrencies (BTC, ETH, SOL, etc.)
9+
- Currency conversion (USD, EUR, etc.)
10+
- Detailed price and market data
11+
- Natural language processing for price queries
12+
13+
## Installation
14+
15+
```bash
16+
npm install @elizaos/plugin-coinmarketcap
17+
```
18+
19+
## Configuration
20+
21+
1. Get your API key from [CoinMarketCap](https://pro.coinmarketcap.com)
22+
23+
2. Set up your environment variables:
24+
25+
```bash
26+
COINMARKETCAP_API_KEY=your_api_key
27+
```
28+
29+
3. Register the plugin in your Eliza configuration:
30+
31+
```typescript
32+
import { CoinMarketCapPlugin } from "@elizaos/plugin-coinmarketcap";
33+
34+
// In your Eliza configuration
35+
plugins: [
36+
new CoinMarketCapPlugin(),
37+
// ... other plugins
38+
];
39+
```
40+
41+
## Usage
42+
43+
The plugin responds to natural language queries about cryptocurrency prices. Here are some examples:
44+
45+
```plaintext
46+
"What's the current price of Bitcoin?"
47+
"Show me ETH price in USD"
48+
"Get the price of SOL"
49+
```
50+
51+
### Supported Cryptocurrencies
52+
53+
The plugin supports major cryptocurrencies including:
54+
55+
- Bitcoin (BTC)
56+
- Ethereum (ETH)
57+
- Solana (SOL)
58+
- USD Coin (USDC)
59+
- And many more...
60+
61+
### Available Actions
62+
63+
#### GET_PRICE
64+
65+
Fetches the current price of a cryptocurrency.
66+
67+
```typescript
68+
// Example response format
69+
{
70+
symbol: "BTC",
71+
price: 50000.00,
72+
currency: "USD",
73+
marketCap: 1000000000000,
74+
volume24h: 50000000000,
75+
percentChange24h: 2.5
76+
}
77+
```
78+
79+
## API Reference
80+
81+
### Environment Variables
82+
83+
| Variable | Description | Required |
84+
| --------------------- | -------------------------- | -------- |
85+
| COINMARKETCAP_API_KEY | Your CoinMarketCap API key | Yes |
86+
87+
### Types
88+
89+
```typescript
90+
interface PriceData {
91+
price: number;
92+
marketCap: number;
93+
volume24h: number;
94+
percentChange24h: number;
95+
}
96+
97+
interface GetPriceContent {
98+
symbol: string;
99+
currency: string;
100+
}
101+
```
102+
103+
## Error Handling
104+
105+
The plugin includes comprehensive error handling for:
106+
107+
- Invalid API keys
108+
- Rate limiting
109+
- Network timeouts
110+
- Invalid cryptocurrency symbols
111+
- Unsupported currencies
112+
113+
## Rate Limits
114+
115+
CoinMarketCap API has different rate limits based on your subscription plan. Please refer to [CoinMarketCap's pricing page](https://coinmarketcap.com/api/pricing/) for detailed information.
116+
117+
## Support
118+
119+
For support, please open an issue in the repository or reach out to the maintainers:
120+
121+
- Discord: 0xspit
122+
123+
## Links
124+
125+
- [CoinMarketCap API Documentation](https://coinmarketcap.com/api/documentation/v1/)
126+
127+
- [GitHub Repository](https://github.com/elizaos/eliza/tree/main/packages/plugin-coinmarketcap)

packages/plugin-coinmarketcap/README.md:Zone.Identifier

Whitespace-only changes.
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "@elizaos/plugin-coinmarketcap",
3+
"version": "0.1.7-alpha.2",
4+
"main": "dist/index.js",
5+
"type": "module",
6+
"types": "dist/index.d.ts",
7+
"dependencies": {
8+
"@elizaos/core": "^0.1.7",
9+
"axios": "^1.6.7",
10+
"zod": "^3.22.4"
11+
},
12+
"devDependencies": {
13+
"tsup": "^8.3.5"
14+
},
15+
"scripts": {
16+
"build": "tsup --format esm --dts",
17+
"dev": "tsup --format esm --dts --watch"
18+
}
19+
}

packages/plugin-coinmarketcap/package.json:Zone.Identifier

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { ActionExample } from "@elizaos/core";
2+
3+
export const priceExamples: ActionExample[][] = [
4+
[
5+
{
6+
user: "{{user1}}",
7+
content: {
8+
text: "What's the current price of Bitcoin?",
9+
},
10+
},
11+
{
12+
user: "{{agent}}",
13+
content: {
14+
text: "Let me check the current Bitcoin price for you.",
15+
action: "GET_PRICE",
16+
},
17+
},
18+
{
19+
user: "{{agent}}",
20+
content: {
21+
text: "The current price of BTC is 65,432.21 USD",
22+
},
23+
},
24+
],
25+
[
26+
{
27+
user: "{{user1}}",
28+
content: {
29+
text: "Check ETH price in EUR",
30+
},
31+
},
32+
{
33+
user: "{{agent}}",
34+
content: {
35+
text: "I'll check the current Ethereum price in EUR.",
36+
action: "GET_PRICE",
37+
},
38+
},
39+
{
40+
user: "{{agent}}",
41+
content: {
42+
text: "The current price of ETH is 2,345.67 EUR",
43+
},
44+
},
45+
],
46+
];

packages/plugin-coinmarketcap/src/actions/getPrice/examples.ts:Zone.Identifier

Whitespace-only changes.

0 commit comments

Comments
 (0)