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
.env
file:
# Para Configuration
PARA_API_KEY=your-para-api-key
PARA_ENV=production
- Register the plugin in your Eliza character configuration:
import { paraPlugin } from '@elizaos/plugin-para';
export const characterConfig = {
// ... other config
plugins: [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 requests
await runtime.triggerAction("CREATE_PARA_WALLET", {
type: "EVM"
});
// Create a wallet for a user before they sign up
await runtime.triggerAction("CREATE_PREGEN_WALLET", {
pregenIdentifier: "[email protected]",
pregenIdentifierType: "EMAIL"
});
// Sign a message with a user's wallet
await runtime.triggerAction("SIGN_PARA_MESSAGE", {
walletId: "wallet-id",
message: "Hello, World!"
});
// Sign and submit an EVM transaction
await runtime.triggerAction("SIGN_PARA_TRANSACTION", {
walletId: "wallet-id",
transaction: {
to: "0x1234567890123456789012345678901234567890",
value: "0.01"
},
chainId: "1" // Ethereum mainnet
});
// Users can claim their pre-generated wallets
await runtime.triggerAction("CLAIM_PARA_WALLET", {
pregenIdentifier: "[email protected]",
pregenIdentifierType: "EMAIL"
});
// Get current wallet status through the provider
const walletInfo = await runtime.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 Viem
await runtime.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:
const paraService = runtime.getService<ParaWalletService>(ExtendedServiceType.PARA_WALLET);
// Check if session is active
const isActive = await paraService.isSessionActive();
// Keep session alive
if (isActive) {
await paraService.keepSessionAlive();
} else {
await paraService.refreshSession();
}
Secure handling of user shares for pre-generated wallets:
// Get user share after wallet creation
const { wallet, userShare } = await paraService.createPregenWallet({
pregenIdentifier: "[email protected]",
pregenIdentifierType: "EMAIL"
});
// Store user share securely
await secureStorage.set(`user-share-${wallet.id}`, userShare);
// Restore user share when needed
await paraService.setUserShare({
userShare: await secureStorage.get(`user-share-${walletId}`)
});
The plugin implements comprehensive error handling following Eliza's patterns:
try {
await runtime.triggerAction("SIGN_PARA_TRANSACTION", params);
} catch (error) {
if (error instanceof TransactionReviewDenied) {
// Handle user denial
console.log("User denied the transaction");
} else if (error instanceof TransactionReviewTimeout) {
// Handle timeout
console.log("Transaction review timed out", error.transactionReviewUrl);
} else {
// Handle other errors
console.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.