Skip to content

Commit 194b196

Browse files
committed
(feat) A plugin for the Zilliqa blockchain
1 parent e80c2e6 commit 194b196

File tree

9 files changed

+543
-1
lines changed

9 files changed

+543
-1
lines changed

agent/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
"@elizaos/plugin-devin": "workspace:*",
112112
"@elizaos/plugin-holdstation": "workspace:*",
113113
"@elizaos/plugin-router-nitro": "workspace:*",
114+
"@elizaos/plugin-zilliqa": "workspace:*",
114115
"readline": "1.3.0",
115116
"ws": "8.18.0",
116117
"yargs": "17.7.2"

agent/src/index.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ import { zgPlugin } from "@elizaos/plugin-0g";
4545
import { bootstrapPlugin } from "@elizaos/plugin-bootstrap";
4646
import { normalizeCharacter } from "@elizaos/plugin-di";
4747
import createGoatPlugin from "@elizaos/plugin-goat";
48+
import createZilliqaPlugin from "@elizaos/plugin-zilliqa";
49+
4850
// import { intifacePlugin } from "@elizaos/plugin-intiface";
4951
import { ThreeDGenerationPlugin } from "@elizaos/plugin-3d-generation";
5052
import { abstractPlugin } from "@elizaos/plugin-abstract";
@@ -837,6 +839,12 @@ export async function createAgent(
837839
);
838840
}
839841

842+
let zilliqaPlugin: any | undefined;
843+
if (getSecret(character, "EVM_PRIVATE_KEY")) {
844+
zilliqaPlugin = await createZilliqaPlugin((secret) =>
845+
getSecret(character, secret)
846+
);
847+
}
840848
// Initialize Reclaim adapter if environment variables are present
841849
// let verifiableInferenceAdapter;
842850
// if (
@@ -995,7 +1003,8 @@ export async function createAgent(
9951003
getSecret(character, "COINBASE_NOTIFICATION_URI")
9961004
? webhookPlugin
9971005
: null,
998-
goatPlugin,
1006+
goatPlugin,
1007+
zilliqaPlugin,
9991008
getSecret(character, "COINGECKO_API_KEY") ||
10001009
getSecret(character, "COINGECKO_PRO_API_KEY")
10011010
? coingeckoPlugin

packages/plugin-zilliqa/README.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# @elizaos/plugin-zilliqa
2+
3+
A plugin for integrating Zilliqa blockchain capabilities through the GOAT (Great Onchain Agent Toolkit) framework within the ElizaOS ecosystem.
4+
5+
## Description
6+
7+
[GOAT](https://ohmygoat.dev/) 🐐 (Great Onchain Agent Toolkit) is an open-source framework for adding blockchain tools such as wallets, being able to hold or trade tokens, or interacting with blockchain smart contracts, to your AI agent.
8+
9+
- [Chains supported](https://ohmygoat.dev/chains-wallets-plugins)
10+
- [Plugins supported](https://ohmygoat.dev/chains-wallets-plugins)
11+
12+
This plugin integrates the GOAT Zilliqa plugin and wallet with Eliza.
13+
14+
## Installation
15+
16+
```bash
17+
pnpm install @elizaos/plugin-goat
18+
```
19+
20+
## Configuration
21+
22+
### Environment Variables
23+
24+
```typescript
25+
EVM_PRIVATE_KEY=<Your EVM wallet private key>
26+
EVM_PROVIDER_URL=<Your RPC provider URL (e.g., Infura, Alchemy)>
27+
```
28+
29+
## Common Issues & Troubleshooting
30+
31+
1. **Agent not executing an action**:
32+
33+
- If you are also using the EVM Plugin, sometimes the agent might confuse the action name with an EVM Plugin action name instead of the GOAT Plugin action. Removing the EVM Plugin should fix this issue. There is no need for you to use both plugins at the same time.
34+
- If you are using Trump as a character it might be tricky to get them to perform any action since the character is full of prompts that aim to change the topic of the conversation. To fix this try using a different character or create your own with prompts that are more suitable to what the agent is supposed to do.
35+
36+
2. **Wallet Connection Issues**
37+
38+
- Verify private key is correctly formatted
39+
- Check RPC endpoint availability
40+
- Ensure sufficient network balance
41+
42+
3. **Transaction Issues**
43+
- Verify gas availability
44+
- Check network congestion
45+
- Confirm transaction parameters
46+
47+
## License
48+
49+
This plugin is part of the Eliza project. See the main project repository for license information.

packages/plugin-zilliqa/package.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "@elizaos/plugin-zilliqa",
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": "workspace:*",
9+
"@goat-sdk/adapter-vercel-ai": "0.2.7",
10+
"@goat-sdk/core": "0.4.6",
11+
"@goat-sdk/plugin-zilliqa": "0.1.2",
12+
"@goat-sdk/wallet-evm": "0.2.6",
13+
"@goat-sdk/wallet-viem": "0.2.6",
14+
"@goat-sdk/wallet-zilliqa": "0.2.5",
15+
"@zilliqa-js/account": "^3.5.0",
16+
"@zilliqa-js/zilliqa": "^3.5.0",
17+
"tsup": "8.3.5"
18+
},
19+
"scripts": {
20+
"build": "tsup --format esm --dts",
21+
"dev": "tsup --format esm --dts --watch"
22+
},
23+
"peerDependencies": {
24+
"whatwg-url": "7.1.0"
25+
}
26+
}

0 commit comments

Comments
 (0)