@lunarbase-lab/pmm-v2-source-evm
v0.4.1
Published
Generic EVM RPC and WebSocket data source for LunarBase
Downloads
482
Maintainers
Readme
@lunarbase-lab/pmm-v2-source-evm
EVM HTTP and WebSocket data source for the LunarBase client.
Status: fully supported for standard EVM networks and Base Flashblocks.
Install
npm install @lunarbase-lab/pmm-v2-math @lunarbase-lab/pmm-v2-client @lunarbase-lab/pmm-v2-source-evmUse
import { connect } from "@lunarbase-lab/pmm-v2-client";
import { createBaseFlashblocksSource } from "@lunarbase-lab/pmm-v2-source-evm";
const source = createBaseFlashblocksSource({
httpRpcUrl,
realtimeUrl,
chainId: config.deployment.chainId,
});
const client = await connect(config, source, optionalCheckpoint);
const quote = client.quote(request);
await client.shutdown();For Base, use wss://mainnet-preconf.base.org or
wss://sepolia-preconf.base.org as the application-facing realtime
endpoint. These endpoints provide pendingLogs and progressive newHeads;
see the Base Flashblocks API.
Use EvmRpcSource for standard EVM logs and newHeads streams.
Guarantees
- HTTP RPC provides bootstrap, backfill, and canonical recovery.
- WebSocket updates are normalized into ordered client events.
- The configured chain ID binds cursors and checkpoints to one deployment.
- WebSocket frames, handshake prefetch, reordering, HTTP bodies, and normalized backfills have independent count+byte budgets and fail closed on overflow.
- Socket queues use fixed-capacity ring buffers, and every subscription owns an immutable copy of its contract filter.
- Canonical backfill starts with 1,000-block pages and bisects only an oversized response range.
