Package Exports
- @elizaos/plugin-evm
- @elizaos/plugin-evm/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@elizaos/plugin-evm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@elizaos/plugin-evm
This plugin provides actions and providers for interacting with EVM-compatible chains.
Configuration
Default Setup
By default, Ethereum mainnet is enabled. To use it, simply add your private key to the .env file:
EVM_PRIVATE_KEY=your-private-key-hereAdding Support for Other Chains
To enable support for additional chains, add them to the character config like this:
"settings": {
"chains": {
"evm": [
"base", "arbitrum", "iotex"
]
}
}Note: The chain names must match those in the viem/chains.
Custom RPC URLs
By default, the RPC URL is inferred from the viem/chains config. To use a custom RPC URL for a specific chain, add the following to your .env file:
ETHEREUM_PROVIDER_<CHAIN_NAME>=https://your-custom-rpc-urlExample usage:
ETHEREUM_PROVIDER_IOTEX=https://iotex-network.rpc.thirdweb.comCustom RPC for Ethereum Mainnet
To set a custom RPC URL for Ethereum mainnet, use:
EVM_PROVIDER_URL=https://your-custom-mainnet-rpc-urlProvider
The Wallet Provider initializes with the first chain in the list as the default (or Ethereum mainnet if none are added). It:
- Provides the context of the currently connected address and its balance.
- Creates Public and Wallet clients to interact with the supported chains.
- Allows adding chains dynamically at runtime.
Actions
Transfer
Transfer tokens from one address to another on any EVM-compatible chain. Just specify the:
- Amount
- Chain
- Recipient Address
Example usage:
Transfer 1 ETH to 0xRecipient on arbitrum.Contribution
The plugin contains tests. Whether you're using TDD or not, please make sure to run the tests before submitting a PR.
Running Tests
Navigate to the plugin-evm directory and run:
pnpm test