-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
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.
- Detect iframe mode:
-
Use EIP-1193 provider flow (no MetaMask-only assumptions)
- Use
window.ethereum.request(...)as the source of truth. - Do not require
isMetaMaskfor connect flow.
- Use
-
Add Wallet Apps bridge client adapter
- Include host-compatible adapter before main app bundle.
- Adapter should support handshake + request/response + events:
WALLET_APPS_BRIDGE_HELLOWALLET_APPS_BRIDGE_REQUEST / RESPONSEWALLET_APPS_BRIDGE_READYWALLET_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
#/appsand connect button uses host-connected wallet. eth_requestAccounts,eth_chainId, signing and tx requests work via bridge.accountsChangedandchainChangedare 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).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels