MultiversX blockchain integration plugin for Eliza OS that enables on chain actions.
This plugin aims to be the basis of all interactions with the MultiversX ecosystem.
- EGLD and ESDT token transfers
- Token creation and management
- Pool creation on xExchange
- Swap tokens
- Lend EGLD and add collateral on Hatom
- Wallet balance recovery
- Multiple network support (mainnet, devnet, testnet)
- Secure transaction signing
- Automatic nonce management
- Transaction status tracking
- Built-in denomination handling
- Comprehensive error handling
To use the Receive_EGLD action of this plugin, you must set up a QR Code API. The implementation is available here: QrCode_generator.
Reuse providers and utilities from the existing actions where possible. Add more utilities if you think they will be useful for other actions.
- Add the action to the
actions
directory. Try to follow the naming convention of the other actions. - Export the action in the
index.ts
file.
npx elizaos plugins add @elizaos-plugins/plugin-multiversx
The plugin requires environment variables or runtime settings:
MVX_PRIVATE_KEY=your-wallet-private-key
MVX_NETWORK=devnet # mainnet, devnet, or testnet
ACCESS_TOKEN_MANAGEMENT_TO=everyone # you can put an userid to limit token managament to one user only (use same id as in the database)
QR_CODE_API_URL=
import { multiversxPlugin } from "@elizaos/plugin-multiversx";
// Send EGLD to an erd address
const result = await eliza.execute({
action: "SEND_TOKEN",
content: {
tokenAddress: "erd1...",
amount: "1",
tokenIdentifier: "EGLD",
},
});
// Send EGLD to a herotag
const result = await eliza.execute({
action: "SEND_TOKEN",
content: {
tokenAddress: "elpulpo",
amount: "1",
tokenIdentifier: "EGLD",
},
});
// Send ESDT with identifier
const result = await eliza.execute({
action: "SEND_TOKEN",
content: {
tokenAddress: "erd1...",
amount: "100",
tokenIdentifier: "TEST-a1b2c3",
},
});
// Send ESDT with ticker
const result = await eliza.execute({
action: "SEND_TOKEN",
content: {
tokenAddress: "erd1...",
amount: "100",
tokenIdentifier: "TEST",
},
});
const result = await eliza.execute({
action: "CREATE_TOKEN",
content: {
tokenName: "TestToken",
tokenTicker: "TEST",
decimals: "18",
amount: "1000000",
},
});
const result = await eliza.execute({
action: "SWAP",
content: {
tokenIn: "EGLD",
amountIn: "1",
tokenOut: "MEX"
},
});
const result = await eliza.execute({
action: "CREATE_POOL",
content: {
baseTokenID: "KWAK",
quoteTokenID: "EGLD",
baseAmount: "1000000",
quoteAmount: "20"
},
});
const result = await eliza.execute({
action: "CHECK_WALLET"
});
const result = await eliza.execute({
action: "GET_ADDRESS"
});
const result = await eliza.execute({
action: "LEND_EGLD",
content: {
"amount": "10"
},
});
const result = await eliza.execute({
action: "ADD_COLLATERAL",
content: {
"amount": "40",
"tokenIdentifier": "HEGLD"
},
});
-
Transaction Failures
- Verify wallet has sufficient balance
- Check network configuration matches intended network
- Ensure correct token identifiers
- Verify recipient address format
-
Configuration Problems
- Validate private key format
- Check network selection is valid
- Ensure environment variables are properly set
- Verify wallet permissions for token operations
-
Token Creation Issues
- Check token name and ticker format
- Verify EGLD balance for issuance fee
- Ensure unique token identifiers
- Monitor transaction status
-
Network Connectivity
- Verify network endpoint availability
- Check API rate limits
- Monitor network status
- Ensure proper network selection
-
Key Management
- Never expose private keys in code
- Use environment variables for sensitive data
- Implement key rotation policies
- Monitor wallet activity
-
Transaction Safety
- Validate all transaction parameters
- Implement transaction limits
- Use proper denomination handling
- Double-check recipient addresses
-
Network Security
- Use secure network connections
- Implement retry mechanisms
- Monitor for suspicious activity
- Keep dependencies updated
-
Error Handling
- Implement comprehensive error logging
- Handle network timeouts gracefully
- Validate all user inputs
- Provide clear error messages
Run the test suite:
pnpm test
Watch mode for development:
pnpm test:watch
- @multiversx/sdk-core: ^13.15.0
- bignumber.js: ^9.1.2
- tsup: ^8.3.5
- vitest: ^2.1.5
Contributions are welcome! Please see the CONTRIBUTING.md file for more information.
This plugin integrates with the MultiversX blockchain using their official SDK.
Special thanks to:
- The MultiversX team for developing the MultiversX blockchain
- The Eliza community for their contributions and feedback.
For more information about MultiversX blockchain capabilities:
This plugin is part of the Eliza project. See the main project repository for license information.