You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin enables Eliza to interact with the 0x Protocol, providing decentralized exchange capabilities across multiple evm blockchain networks with optimized token swaps and liquidity aggregation.
4
+
5
+
Supported networks include:
6
+
- Ethereum Mainnet
7
+
- Polygon
8
+
- Binance Smart Chain
9
+
- Arbitrum
10
+
- Optimism
11
+
- Base
12
+
- Linea
13
+
- Scroll
14
+
- Avalanche
15
+
- Blast
16
+
17
+
## Configuration
18
+
19
+
Set the following environment variables:
20
+
21
+
```env
22
+
WALLET_PRIVATE_KEY=your_private_key
23
+
ZERO_EX_API_KEY=your_0x_api_key
24
+
{chain}_RPC_URL=your_rpc_endpoint
25
+
```
26
+
27
+
## Installation
28
+
29
+
```bash
30
+
pnpm install @elizaos/plugin-0x
31
+
```
32
+
33
+
## Usage
34
+
35
+
### Basic Integration
36
+
37
+
```typescript
38
+
import { zeroExPlugin } from"@elizaos/plugin-0x";
39
+
```
40
+
41
+
### Example Usage
42
+
43
+
The plugin supports natural language commands for ETH transfers:
44
+
45
+
```typescript
46
+
"I want to convert 1 ETH to USDC on ethereum chain";
47
+
"Give me the quote";
48
+
"Execute it";
49
+
```
50
+
51
+
## Available Actions
52
+
53
+
The plugin provides the following actions:
54
+
55
+
1.**GET_INDICATIVE_PRICE_0X**: Get indicative prices for token swaps
56
+
- Example: "Get quote for swapping 1 ETH to USDC on Ethereum chain"
57
+
- Example: "Price check for trading 100 USDT to MATIC on Polygon chain"
58
+
59
+
2.**GET_QUOTE_0X**: Get the quote for the swap. Quote expires in 5mins. (This action is triggered only after user has requested for an indicative price. No need to repeat the buy/sell tokens because the last indicative price will be stored in the memory)
60
+
- Example: "Get quote"
61
+
62
+
3.**EXECUTE_SWAP_0X**: Execute token swaps. (Action is triggered only after user has gotten a quote)
63
+
- Example: "Execute the swap"
64
+
65
+
## Security Best Practices
66
+
67
+
1.**Environment Variables**
68
+
- Never commit private keys to version control
69
+
- Use secure environment variable management
70
+
- Rotate private keys periodically
71
+
72
+
## Contributing
73
+
74
+
Contributions are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information.
75
+
76
+
## Credits
77
+
78
+
This plugin integrates with:
79
+
-[0x Protocol](https://0x.org/)
80
+
81
+
For more information about 0x capabilities:
82
+
-[0x API Documentation](https://0x.org/docs/api)
83
+
84
+
## License
85
+
86
+
This plugin is part of the Eliza project. See the main project repository for license information.
0 commit comments