A seamless integration between Para wallet infrastructure and Eliza OS, enabling autonomous agents to manage user wallets and transactions.
- 🔐 Full Para wallet integration with Eliza agents
- 💰 EVM-based transaction support using Viem
- 📝 Message signing capabilities
- 💼 Pre-generated wallet support
- 🔄 Seamless wallet claiming process
- 🛡️ Secure user share management
- 🌐 Multi-chain support (Ethereum, Polygon, Arbitrum, etc.)
- 📋 Built-in wallet status monitoring
- 🤖 Auto-configuration with Eliza agents
- 📱 Session management for persistent authentication
You can install the plugin using your preferred package manager:
# npm
npm install @elizaos/plugin-para
# pnpm
pnpm add @elizaos/plugin-para
# yarn
yarn add @elizaos/plugin-para
# bun
bun add @elizaos/plugin-para- Add required environment variables to your
.envfile:
# Para ConfigurationPARA_API_KEY=your-para-api-keyPARA_ENV=production- Register the plugin in your Eliza character configuration:
import{paraPlugin}from'@elizaos/plugin-para';exportconstcharacterConfig={// ... other configplugins: [paraPlugin],settings: {secrets: {PARA_API_KEY: process.env.PARA_API_KEY,PARA_ENV: process.env.PARA_ENV||'production'}}};The plugin adds several capabilities to your Eliza agent:
// The agent can create wallets in response to user requestsawaitruntime.triggerAction("CREATE_PARA_WALLET",{type: "EVM"});// Create a wallet for a user before they sign upawaitruntime.triggerAction("CREATE_PREGEN_WALLET",{pregenIdentifier: "user@example.com",pregenIdentifierType: "EMAIL"});// Sign a message with a user's walletawaitruntime.triggerAction("SIGN_PARA_MESSAGE",{walletId: "wallet-id",message: "Hello, World!"});// Sign and submit an EVM transactionawaitruntime.triggerAction("SIGN_PARA_TRANSACTION",{walletId: "wallet-id",transaction: {to: "0x1234567890123456789012345678901234567890",value: "0.01"},chainId: "1"// Ethereum mainnet});// Users can claim their pre-generated walletsawaitruntime.triggerAction("CLAIM_PARA_WALLET",{pregenIdentifier: "user@example.com",pregenIdentifierType: "EMAIL"});// Get current wallet status through the providerconstwalletInfo=awaitruntime.getContextFromProvider("paraWalletProvider");The plugin provides the following actions:
| Action | Description |
|---|---|
CREATE_PARA_WALLET | Creates a new Para wallet |
CREATE_PREGEN_WALLET | Creates a pre-generated wallet associated with an identifier |
CLAIM_PARA_WALLET | Claims a pre-generated wallet |
SIGN_PARA_MESSAGE | Signs a message using a Para wallet |
SIGN_PARA_TRANSACTION | Signs and submits a transaction using a Para wallet |
UPDATE_PREGEN_IDENTIFIER | Updates the identifier for a pre-generated wallet |
Available providers for context and status:
| Provider | Description |
|---|---|
paraWalletProvider | Provides current wallet information and status |
The plugin registers the following services in the Eliza runtime:
| Service | Description |
|---|---|
ParaWalletService | Core service handling Para SDK integration |
The plugin uses Viem for Ethereum transactions, offering:
- 🚀 Modern and efficient transaction handling
- 🔧 Type-safe API for Ethereum interactions
- ⚡ Multi-chain support out of the box
- 🔄 Compatible with the Para Viem connector
// Example of transaction handling with Viemawaitruntime.triggerAction("SIGN_PARA_TRANSACTION",{walletId: "wallet-id",transaction: {to: "0x1234567890123456789012345678901234567890",value: "0.05",data: "0x..."// Optional contract interaction data},chainId: "137"// Polygon});The plugin implements Para's session management for maintaining authenticated states:
constparaService=runtime.getService<ParaWalletService>(ExtendedServiceType.PARA_WALLET);// Check if session is activeconstisActive=awaitparaService.isSessionActive();// Keep session aliveif(isActive){awaitparaService.keepSessionAlive();}else{awaitparaService.refreshSession();}Secure handling of user shares for pre-generated wallets:
// Get user share after wallet creationconst{ wallet, userShare }=awaitparaService.createPregenWallet({pregenIdentifier: "user@example.com",pregenIdentifierType: "EMAIL"});// Store user share securelyawaitsecureStorage.set(`user-share-${wallet.id}`,userShare);// Restore user share when neededawaitparaService.setUserShare({userShare: awaitsecureStorage.get(`user-share-${walletId}`)});The plugin implements comprehensive error handling following Eliza's patterns:
try{awaitruntime.triggerAction("SIGN_PARA_TRANSACTION",params);}catch(error){if(errorinstanceofTransactionReviewDenied){// Handle user denialconsole.log("User denied the transaction");}elseif(errorinstanceofTransactionReviewTimeout){// Handle timeoutconsole.log("Transaction review timed out",error.transactionReviewUrl);}else{// Handle other errorsconsole.error("Transaction error:",error);}}The plugin supports a variety of EVM-compatible networks:
| Chain ID | Network |
|---|---|
| 1 | Ethereum Mainnet |
| 11155111 | Sepolia Testnet |
| 137 | Polygon |
| 42161 | Arbitrum |
Additional networks can be added by extending the chain configuration.
Security
- Store API keys securely in environment variables
- Implement proper user authentication before wallet operations
- Use secure storage for user shares
- Follow Para's recommendations for session management
Error Handling
- Implement proper error handling for all wallet operations
- Handle transaction rejections and timeouts gracefully
- Provide clear feedback to users when operations fail
- Log errors appropriately for debugging
Performance
- Keep track of session status to avoid unnecessary refreshes
- Implement proper caching for wallet information
- Use appropriate gas parameters for transactions
- Handle network congestion scenarios with retry logic
User Experience
- Guide users through the wallet creation process
- Provide clear status updates during operations
- Implement proper loading states during transaction signing
- Give feedback on transaction progress and confirmations
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see the LICENSE file for details.