One bridge, many skins
> quote 1 ETH USDC
Result
…
Code snippet
…
Pros and cons
Customer effort
- Pro: own UI, with no crypto or session code. One connect() call, and our iframe handles refresh, retries, and API versions.
- Con: the session allowlist is quote, token search, Fusion and Fusion+ quotes, and token details. Address lookups, orderbook, balances, spot price, gas, charts, portfolio, history, and swap build are refused. New calls wait on us, and the API is asynchronous over postMessage.
- Con: one hidden iframe plus our loader script. Debugging crosses the iframe boundary.
- Con: the event log shows proof-of-work difficulty, solve time, and pow_required or pow_wait retries. A 429 from the widget share or the per-session limit shows a Retry-After countdown.
Customer security
- Pro: the key stays on the widget origin, and the token passes through the page but only works with that key.
- Pro: the allowlist limits what a compromised page can do. The iframe origin gate refuses a host whose origin is not on that list.
- Con: a compromised page can still call the allowed operations through the bridge while it is open. That spends quote quota. Address reads, orderbook lookups, spot price, gas, charts, portfolio, history, and swap builds are refused.
- Con: the customer trusts our loader and iframe. Their Content Security Policy must allow our script and frame origins.