Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(new-plugin): A plugin for the Zilliqa blockchain #2455

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ MORALIS_API_KEY=
EVM_PRIVATE_KEY=
EVM_PROVIDER_URL=

# Zilliqa
ZILLIQA_PRIVATE_KEY=
ZILLIQA_PROVIDER_URL=

# Avalanche
AVALANCHE_PRIVATE_KEY=
AVALANCHE_PUBLIC_KEY=
Expand Down
7 changes: 4 additions & 3 deletions agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@
"@elizaos/plugin-dcap": "workspace:*",
"@elizaos/plugin-form": "workspace:*",
"@elizaos/plugin-ankr": "workspace:*",
"@elizaos/client-xmtp": "workspace:*",
"@elizaos/client-xmtp": "workspace:*",
"@elizaos/plugin-btcfun": "workspace:*",
"@elizaos/plugin-trikon": "workspace:*",
"@elizaos/plugin-trikon": "workspace:*",
"@elizaos/plugin-zilliqa": "workspace:*",
"readline": "1.3.0",
"ws": "8.18.0",
"yargs": "17.7.2"
Expand All @@ -158,4 +159,4 @@
"ts-node": "10.9.2",
"tsup": "8.3.5"
}
}
}
12 changes: 11 additions & 1 deletion agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ import { footballPlugin } from "@elizaos/plugin-football"
import { bootstrapPlugin } from "@elizaos/plugin-bootstrap"
import { normalizeCharacter } from "@elizaos/plugin-di"
import createGoatPlugin from "@elizaos/plugin-goat"
import createZilliqaPlugin from "@elizaos/plugin-zilliqa";

// import { intifacePlugin } from "@elizaos/plugin-intiface";
import { ThreeDGenerationPlugin } from "@elizaos/plugin-3d-generation"
import { abstractPlugin } from "@elizaos/plugin-abstract"
Expand Down Expand Up @@ -750,6 +752,13 @@ export async function createAgent(character: Character, db: IDatabaseAdapter, ca
goatPlugin = await createGoatPlugin((secret) => getSecret(character, secret))
}

let zilliqaPlugin: any | undefined;
if (getSecret(character, "ZILLIQA_PRIVATE_KEY")) {
zilliqaPlugin = await createZilliqaPlugin((secret) =>
getSecret(character, secret)
);
}

// Initialize Reclaim adapter if environment variables are present
// let verifiableInferenceAdapter;
// if (
Expand Down Expand Up @@ -846,7 +855,8 @@ export async function createAgent(character: Character, db: IDatabaseAdapter, ca
getSecret(character, "ENABLE_TEE_LOG") && ((teeMode !== TEEMode.OFF && walletSecretSalt) || getSecret(character, "SGX")) ? teeLogPlugin : null,
getSecret(character, "OMNIFLIX_API_URL") && getSecret(character, "OMNIFLIX_MNEMONIC") ? OmniflixPlugin : null,
getSecret(character, "COINBASE_API_KEY") && getSecret(character, "COINBASE_PRIVATE_KEY") && getSecret(character, "COINBASE_NOTIFICATION_URI") ? webhookPlugin : null,
goatPlugin,
goatPlugin,
zilliqaPlugin,
getSecret(character, "COINGECKO_API_KEY") || getSecret(character, "COINGECKO_PRO_API_KEY") ? coingeckoPlugin : null,
getSecret(character, "MORALIS_API_KEY") ? moralisPlugin : null,
getSecret(character, "EVM_PROVIDER_URL") ? goatPlugin : null,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-goat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependencies": {
"@elizaos/core": "workspace:*",
"@goat-sdk/adapter-vercel-ai": "0.2.0",
"@goat-sdk/core": "0.4.0",
"@goat-sdk/core": "0.4.6",
"@goat-sdk/plugin-erc20": "0.2.2",
"@goat-sdk/plugin-kim": "0.1.2",
"@goat-sdk/wallet-evm": "0.2.0",
Expand Down
50 changes: 50 additions & 0 deletions packages/plugin-zilliqa/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# @elizaos/plugin-zilliqa

A plugin for integrating Zilliqa blockchain capabilities through the GOAT (Great Onchain Agent Toolkit) framework within the ElizaOS ecosystem.

## Description

[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.

- [Chains supported](https://ohmygoat.dev/chains-wallets-plugins)
- [Plugins supported](https://ohmygoat.dev/chains-wallets-plugins)

This plugin integrates the GOAT Zilliqa plugin and wallet with Eliza.

## Installation

```bash
pnpm install @elizaos/plugin-zilliqa
```

## Configuration

### Environment Variables

```typescript
EVM_PRIVATE_KEY=<Your EVM wallet private key>
EVM_PROVIDER_URL=<Your RPC provider URL (e.g., Infura, Alchemy)>
ENABLE_ZILLIQA=1
```

## Common Issues & Troubleshooting

1. **Agent not executing an action**:

- 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.
- 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.

2. **Wallet Connection Issues**

- Verify private key is correctly formatted
- Check RPC endpoint availability
- Ensure sufficient network balance

3. **Transaction Issues**
- Verify gas availability
- Check network congestion
- Confirm transaction parameters

## License

This plugin is part of the Eliza project. See the main project repository for license information.
26 changes: 26 additions & 0 deletions packages/plugin-zilliqa/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@elizaos/plugin-zilliqa",
"version": "0.1.7-alpha.2",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",
"dependencies": {
"@elizaos/core": "workspace:*",
"@goat-sdk/adapter-vercel-ai": "0.2.7",
"@goat-sdk/core": "0.4.6",
"@goat-sdk/plugin-zilliqa": "0.1.3",
"@goat-sdk/wallet-evm": "0.2.6",
"@goat-sdk/wallet-viem": "0.2.6",
"@goat-sdk/wallet-zilliqa": "0.2.6",
"@zilliqa-js/account": "^3.5.0",
"@zilliqa-js/zilliqa": "^3.5.0",
"tsup": "8.3.5"
},
"scripts": {
"build": "tsup --format esm --dts",
"dev": "tsup --format esm --dts --watch"
},
"peerDependencies": {
"whatwg-url": "7.1.0"
}
}
Loading
Loading