What's New in v2.0.0
ZapChain v2.0.0 brings 8 major improvements addressing real user pain points and making the library production-ready for lakhs of users.
🔧 Core Bug Fixes
1. Ghost Wallet Fix
Problem: Users received "No wallet connected" errors despite having an active Web3 instance.
Solution: Robust identity resolution now uses a fallback chain:
metadata.createdBy(if provided)web3.eth.defaultAccounteth_accountsRPC call
2. Native ETH Transfers
Problem: Users had to provide dummy ABIs for simple ETH transfers.
Solution: New native_transfer action type:
{
type: 'native_transfer',
to: '0xRecipientAddress',
value: web3.utils.toWei('0.5', 'ether')
}3. Immediate State Sync
Problem: Rules like "trigger if balance > 1 ETH" did nothing if balance was already 2 ETH at startup.
Solution: Rules now check conditions immediately on startup, not just on state changes.
📊 Enhanced Observability
4. Verbose Execution Logging
Problem: Rules showed "Running" but actions never triggered, with no explanation.
Solution: ExecutionLog now includes:
status: SUCCESS | FAILED | SKIPPEDskipReason: KILL_SWITCH_ACTIVE | COOLDOWN_ACTIVE | SIGNATURE_INVALID | etc.
⚡ Smarter Execution
5. EOA Detection
Problem: Simulation failed with false "revert" errors when sending ETH to wallets.
Solution: Simulator now checks if target code size is 0 (EOA) and useseth_estimateGas instead of eth_call.
6. Per-Rule Polling
Problem: All rules used the same global polling interval.
Solution: Add pollInterval to individual rule config:
config: {
pollInterval: 1000, // Gas-price monitoring every 1s
// ...other config
}🚀 Real-Time & Security
7. WebSocket Integration
Problem: 12-second polling delay was too slow for time-critical automation.
Solution: New WebSocketMonitor subscribes to newHeadsfor sub-second block notifications with automatic polling fallback.
8. EIP-712 Typed Signing
Problem: Users signed random hex hashes without knowing what they authorized.
Solution: MetaMask now shows human-readable rule details:
- Rule name and ID
- Target chain
- Maximum ETH value
- Actions and conditions hashes
⚠️ Breaking Changes
ExecutionLog.statusis now required- EIP-712 signatures are not backward-compatible with v1.x
- Rules with
requireSignature: trueneed re-signing
📖 Migration Guide
- Update to v2.0.0:
npm install zapchain@2.0.0 - Update any code reading
ExecutionLogto handle newstatusfield - Re-sign any rules that have
requireSignature: true - Optionally enable WebSocket:
{ useWebSocket: true }