Goal
Add compatibility with Swap.Online Wallet Apps host bridge so this dApp can run inside MCW #/apps iframe and use the same connected wallet session.
Related host issue:
Why
The wallet host can be deployed on different domains (white-label) and also used from Android/iOS webviews. dApp integration must not rely on one hardcoded wallet origin.
Required implementation
-
Enable bridge mode in embedded context
- Detect iframe mode:
window.parent !== window.
- Detect host intent by query flag:
walletBridge=swaponline.
-
Use EIP-1193 provider flow (no MetaMask-only assumptions)
- Use
window.ethereum.request(...) as the source of truth.
- Do not require
isMetaMask for connect flow.
-
Add Wallet Apps bridge client adapter
- Include host-compatible adapter before main app bundle.
- Adapter should support handshake + request/response + events:
WALLET_APPS_BRIDGE_HELLO
WALLET_APPS_BRIDGE_REQUEST / RESPONSE
WALLET_APPS_BRIDGE_READY
WALLET_APPS_BRIDGE_EVENT (accountsChanged, chainChanged)
-
Multi-domain support (important)
- Do not hardcode one wallet domain.
- Implement configurable allowed host origins via env/config (array).
- Add runtime override option for support team / white-label deploys.
-
Android / iOS compatibility
- Validate in mobile webviews (Android + iOS Safari/WebView).
- Ensure provider is injected before app wallet init.
- Verify connect/sign/switch network flow without popup dependency.
Acceptance criteria
- dApp opens in MCW
#/apps and connect button uses host-connected wallet.
eth_requestAccounts, eth_chainId, signing and tx requests work via bridge.
accountsChanged and chainChanged are handled correctly.
- No regression when app is opened standalone (outside iframe).
Deliverables in report (required)
Please post a final report comment in this issue with:
- Mainnet deployed URL of this dApp for QA testing.
- Commit/PR links.
- Supported wallet host origins config used.
- Android/iOS test results (device/browser + pass/fail for connect/sign/switch).
Goal
Add compatibility with Swap.Online Wallet Apps host bridge so this dApp can run inside MCW
#/appsiframe and use the same connected wallet session.Related host issue:
Why
The wallet host can be deployed on different domains (white-label) and also used from Android/iOS webviews. dApp integration must not rely on one hardcoded wallet origin.
Required implementation
Enable bridge mode in embedded context
window.parent !== window.walletBridge=swaponline.Use EIP-1193 provider flow (no MetaMask-only assumptions)
window.ethereum.request(...)as the source of truth.isMetaMaskfor connect flow.Add Wallet Apps bridge client adapter
WALLET_APPS_BRIDGE_HELLOWALLET_APPS_BRIDGE_REQUEST / RESPONSEWALLET_APPS_BRIDGE_READYWALLET_APPS_BRIDGE_EVENT(accountsChanged,chainChanged)Multi-domain support (important)
Android / iOS compatibility
Acceptance criteria
#/appsand connect button uses host-connected wallet.eth_requestAccounts,eth_chainId, signing and tx requests work via bridge.accountsChangedandchainChangedare handled correctly.Deliverables in report (required)
Please post a final report comment in this issue with: