Packages
@runtimee/evm
Pluggable EVM execution adapter
@runtimee/evm
The EVM package provides an execution adapter for Ethereum-compatible blockchains, initially configured for Base and USDC.
It implements the ExecutionProvider interface from @runtimee/core and handles transaction building, signing, broadcasting, and confirmation.
Features
- Pluggable: Designed to be swapped with other execution adapters (e.g., for different chains or assets).
- Base + USDC: Pre-configured for the Base network and USDC token (6 decimals).
- Transaction Building: Encodes USDC transfers and builds EVM transactions.
- Gas Estimation: Includes a buffer for gas estimation to avoid underpricing.
- Signing and Broadcasting: Integrates with signers (local or KMS) and broadcasts transactions.
Key Exports
Interfaces
import type {
ExecutionProvider,
Signer,
Broadcaster
} from "@runtimee/evm"Constants
import {
USDC_DECIMALS,
USDC_ADDRESS_BASE,
USDC_ABI
} from "@runtimee/evm"Functions
import {
createEVMProvider,
createViemBroadcaster,
encodeUsdcTransfer,
buildEvmTransaction,
estimateGasWithBuffer
} from "@runtimee/evm"Usage
Creating an Execution Provider
import { createEVMProvider } from "@runtimee/evm"
import { createLocalSigner } from "@runtimee/node" // or your own signer
const signer = createLocalSigner("0x...")
const provider = createEVMProvider({
signerAddress: "0xYourAddress"
}, signer)Building a USDC Transfer
import { encodeUsdcTransfer } from "@runtimee/evm"
const data = encodeUsdcTransfer({
to: "0xRecipientAddress",
value: 1000000n // 1 USDC (6 decimals)
})Installation
npm install @runtimee/evm
# or
pnpm add @runtimee/evmLicense
Apache 2.0
How is this guide?