@elizaos/plugin-aptos
A plugin for interacting with the Aptos blockchain network within the ElizaOS ecosystem.
Description​
The Aptos plugin enables seamless token transfers and wallet management on the Aptos blockchain. It provides functionality to transfer APT tokens and monitor wallet balances with real-time price tracking.
Installation​
bun install @elizaos/plugin-aptos
Configuration​
The plugin requires the following environment variables to be set:
APTOS_PRIVATE_KEY=<Your Aptos private key>
APTOS_NETWORK=<"mainnet" | "testnet">
Usage​
Basic Integration​
import { aptosPlugin, WalletProvider, TransferAptosToken } from '@elizaos/plugin-aptos';
Transfer Examples​
// The plugin responds to natural language commands like:
'Send 69 APT tokens to 0x4f2e63be8e7fe287836e29cde6f3d5cbc96eefd0c0e3f3747668faa2ae7324b0';
'Transfer APT to [address]';
'Pay [amount] APT to [recipient]';
API Reference​
Actions​
SEND_TOKEN​
Transfers APT tokens from the agent's wallet to another address.
Aliases:
- TRANSFER_TOKEN
- TRANSFER_TOKENS
- SEND_TOKENS
- SEND_APT
- PAY
Configuration:
{
APT_DECIMALS: 8; // Decimal places for APT token
}
Providers​
WalletProvider​
Provides wallet information and portfolio tracking.
Features:
- Real-time APT price tracking
- Portfolio value calculation
- Cached wallet information (5-minute TTL)
- Formatted portfolio reports
Common Issues & Troubleshooting​
-
Transaction Failures
- Verify wallet has sufficient APT balance
- Check recipient address format
- Ensure private key is correctly set
- Verify network connectivity
-
Price Fetching Issues
- Check connection to DexScreener API
- Verify cache functionality
- Monitor retry mechanism (3 attempts with exponential backoff)
Security Best Practices​
- Private Key Management
- Store private key securely using environment variables
- Never commit private keys to version control
- Use separate wallets for development and production
- Monitor wallet activity regularly
Development Guide​
Setting Up Development Environment​
- Clone the repository
- Install dependencies:
bun install
- Build the plugin:
bun run build
- Run tests:
bun run test
- Development mode:
bun run dev
Dependencies​
- @aptos-labs/ts-sdk: ^1.26.0
- bignumber.js: 9.1.2
- node-cache: 5.1.2
Future Enhancements​
The following features and improvements are planned for future releases:
-
Advanced Token Operations
- Batch token transfers
- Token creation templates
- NFT minting and management
- Token metadata management
- Custom tokenomics implementation
- Token upgrade mechanisms
-
DeFi Integration
- Liquidity pool management
- Yield farming automation
- Staking optimization
- AMM integration
- Cross-chain bridges
- Price impact analysis
-
Move Contract Management
- Contract deployment tools
- Contract verification
- Contract upgrade system
- Testing framework
- Gas optimization tools
- Security audit integration
-
Wallet Enhancements
- Multi-wallet support
- Hardware wallet integration
- Transaction batching
- Address book management
- Custom signature schemes
- Account abstraction
-
Price Feed Improvements
- Additional data sources
- Real-time price alerts
- Historical data analysis
- Custom price aggregation
- Price prediction tools
- Market sentiment analysis
-
Developer Tools
- Enhanced debugging capabilities
- Move language IDE integration
- Documentation generator
- Performance profiling
- Testing utilities
- Deployment automation
-
Security Features
- Transaction simulation
- Risk assessment tools
- Rate limiting controls
- Fraud detection
- Emergency shutdown
- Multi-signature support
-
Analytics and Monitoring
- Transaction tracking
- Portfolio analytics
- Network statistics
- Gas usage optimization
- Performance metrics
- Custom reporting tools
We welcome community feedback and contributions to help prioritize these enhancements.
Contributing​
Contributions are welcome! Please see the CONTRIBUTING.md file for more information.
Credits​
This plugin integrates with and builds upon several key technologies:
- Aptos: Layer 1 blockchain platform
- @aptos-labs/ts-sdk: Official TypeScript SDK
- Petra Wallet: Aptos wallet integration
- DexScreener: Price feed integration
- Move Language: Smart contract language
Special thanks to:
- The Aptos Labs team for developing the blockchain
- The Petra Wallet development team
- The DexScreener team for price data
- The Move language developers
- The Aptos Developer community
- The Eliza community for their contributions and feedback
For more information about Aptos capabilities:
License​
This plugin is part of the Eliza project. See the main project repository for license information.