Skip to content

Commit 1ee0be4

Browse files
committed
(feat) A plugin for the Zilliqa blockchain
1 parent 24729ee commit 1ee0be4

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
@@ -104,6 +104,7 @@
104104
"@elizaos/plugin-b2": "workspace:*",
105105
"@elizaos/plugin-nft-collections": "workspace:*",
106106
"@elizaos/plugin-pyth-data": "workspace:*",
107+
"@elizaos/plugin-zilliqa": "workspace:*",
107108
"readline": "1.3.0",
108109
"ws": "8.18.0",
109110
"yargs": "17.7.2"

agent/src/index.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ import { zgPlugin } from "@elizaos/plugin-0g";
4141

4242
import { bootstrapPlugin } from "@elizaos/plugin-bootstrap";
4343
import createGoatPlugin from "@elizaos/plugin-goat";
44+
import createZilliqaPlugin from "@elizaos/plugin-zilliqa";
45+
4446
// import { intifacePlugin } from "@elizaos/plugin-intiface";
4547
import { ThreeDGenerationPlugin } from "@elizaos/plugin-3d-generation";
4648
import { abstractPlugin } from "@elizaos/plugin-abstract";
@@ -783,6 +785,12 @@ export async function createAgent(
783785
);
784786
}
785787

788+
let zilliqaPlugin: any | undefined;
789+
if (getSecret(character, "EVM_PRIVATE_KEY")) {
790+
zilliqaPlugin = await createZilliqaPlugin((secret) =>
791+
getSecret(character, secret)
792+
);
793+
}
786794
// Initialize Reclaim adapter if environment variables are present
787795
// let verifiableInferenceAdapter;
788796
// if (
@@ -935,7 +943,8 @@ export async function createAgent(
935943
getSecret(character, "COINBASE_NOTIFICATION_URI")
936944
? webhookPlugin
937945
: null,
938-
goatPlugin,
946+
goatPlugin,
947+
zilliqaPlugin,
939948
getSecret(character, "COINGECKO_API_KEY") ||
940949
getSecret(character, "COINGECKO_PRO_API_KEY")
941950
? 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)