Webview Base URL
Iframe URL Query Parameters
URL Builder Example
postMessage Protocol
The iframe and wrapper communicate viawindow.postMessage. The protocol is typed in TypeScript below — copy this into your project as src/types/postmessage-protocol.ts.
Shared Types
Message Directions
Type Guards
processBytecode Flow via postMessage
The iframe version ofprocessBytecode works over postMessage instead of in-process callbacks. The transaction lifecycle statuses and error handling are the same as the widget processBytecode — the only difference is the transport: messages are wrapped in { kind: 'TX_STATUS_UPDATE', payload } and sent via postMessage instead of calling ctx.updateTxStatus() directly.
Happy Path
Error Paths
See processBytecode — Error Handling for the full list of error statuses (SIGNATURE_DECLINED, SIGNATURE_ERROR, TX_REVERTED).
Listening for postMessage Events
The wrapper must listen formessage events on window and filter using the type guards from the protocol types:
Iframe HTML Element
Wrapper Implementations
We provide two reference wrapper implementations, each targeting a different wallet/auth stack:wagmi + viem
Browser wallet (MetaMask) with ERC-4337 smart accounts via
permissionless. Single-chain (Polygon).Privy
Privy authentication (email OTP) with embedded smart wallets. Multi-chain support (6 chains).