npm @formo/analytics 1.37.0
v1.37.0

2 hours ago

EIP-5792 batched calls now captured in wagmi mode

1.36.0 captured wallet_sendCalls batches only on the EIP-1193 path. Wagmi-mode apps - most React dapps - never install that request wrapper, so a useSendCalls batch produced no events at all: the same silent-loss shape as the missing-connect bug, in the most common integration mode. (#360, completing the scope of #331.)

The wagmi handler now observes batches through the same caches it already watches:

  • The sendCalls mutation (same key in wagmi 2 and 3) emits one transaction event per call: started with batch_size and batch_index, broadcasted with the wallet's batch_id (v2 { id } and draft string ids both accepted), and rejected per call only on a user rejection - a 4001 anywhere in viem's error chain. A wallet without batch support emits nothing further; that is not a user decision.
  • The callsStatus query (shared by useCallsStatus and useWaitForCallsStatus) settles each call: confirmed or reverted, with the receipt hash and the EIP-5792 status-code semantics (400 is a rejection - nothing was mined; 600 leaves receipt-less calls unsettled rather than guessed). Settlement only fires for batch ids this page actually broadcast.

Atomic batches: one receipt, every call (both paths)

An atomic batch lands as ONE on-chain transaction, so the wallet returns one receipt covering all calls. 1.36.0 handed that receipt's hash only to call 0. Every call now shares it, which keeps count(distinct transaction_hash) equal to on-chain transactions and count(distinct batch_id) equal to wallet actions. The wallet's atomic flag is honored in both directions: an explicit atomic: false never shares a receipt onto calls that did not mine.

Settlement robustness

  • A status query that completes before its mutation registers the batch (TanStack runs onSuccess callbacks before publishing the mutation's success state) no longer strands the batch: settlement retries from refetches and from the query cache at registration.
  • Settlement events prefer the chain the wallet_getCallsStatus result names when the mutation named none, so a wallet moving chains mid-prompt cannot mislabel the confirmation. An explicitly named mutation chain still wins.

Counting guidance

The CALL is the unit of attribution. Count on-chain volume by count(distinct transaction_hash), wallet actions by count(distinct batch_id), never by event count.

Outcome rules for both capture paths live in one shared module, so the EIP-1193 and wagmi paths cannot drift. Bundle: 55.36 kB brotlied (budget 55.5 kB).

What's Changed

  • test: end-to-end behaviour scenarios against the built bundle, on every PR by @yosriady in #359
  • ci: run the browser end-to-end suite (#357) on every PR by @yosriady in #361
  • feat: capture EIP-5792 batches in wagmi mode by @yosriady in #362
  • chore(release): 1.37.0 by @yosriady in #363

Full Changelog: v1.36.0...v1.37.0

CDN

<script src="https://cdn.formo.so/analytics@1.37.0" integrity="sha384-ZrrNRLPjsIw4EQ7/aJ7Sc8aRsNa0PbSsQEQjYbeVCGrrDEjMllduWyxcc9RJMFfP" crossorigin="anonymous"></script>

Don't miss a new analytics release

NewReleases is sending notifications on new releases.