Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,3 @@ After updating the colors, run `pnpm colors` — this script will generate RGB v
### Favicon
The favicon is a 16x16 image that is displayed in the browser tab. It is located in the `public` folder.
By default, osETH logo is used as the favicon.

10 changes: 2 additions & 8 deletions e2e/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,24 @@ export const cookieNames = {
export const walletNames = {
monitorAddress: 'monitorAddress',
walletConnect: 'walletConnect',
trustWallet: 'trustWallet',
dAppBrowser: 'dAppBrowser',
gnosisSafe: 'gnosisSafe',
coinbase: 'coinbase',
metaMask: 'metaMask',
binance: 'binance',
ledger: 'ledger',
zenGo: 'zenGo',
taho: 'taho',
okx: 'okx',
}

export const walletTitles = {
walletConnect: 'WalletConnect',
monitorAddress: 'Check wallet',
dAppBrowser: 'DApp Browser',
trustWallet: 'Trust Wallet',
gnosisSafe: 'Gnosis Safe',
ledgerLive: 'Ledger Live',
metaMask: 'MetaMask',
binance: 'Binance',
coinbase: 'Coinbase',
ledger: 'Ledger',
zenGo: 'ZenGo',
taho: 'Taho',
okx: 'OKX',
} as const

export const addresses = {
Expand Down
40 changes: 29 additions & 11 deletions e2e/fixtures/wallet/checkWalletList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ const walletList = [
title: constants.walletTitles.ledger,
},
{
id: constants.walletNames.coinbase,
title: constants.walletTitles.coinbase,
id: constants.walletNames.binance,
title: constants.walletTitles.binance,
},
{
id: constants.walletNames.zenGo,
title: constants.walletTitles.zenGo,
id: constants.walletNames.coinbase,
title: constants.walletTitles.coinbase,
},
{
id: constants.walletNames.monitorAddress,
Expand All @@ -45,6 +45,8 @@ const mobileList = [
const mobileWallets = walletList.filter(({ id }) => mobileList.includes(id))
const desktopWallets = walletList.filter(({ id }) => id !== constants.walletNames.dAppBrowser)

const connectClickTimeout = 30_000

export const createCheckWalletList: Wrapper = ({ page, element }) => (
async (isMobile?: boolean, withWalletConnect = true) => {
let currentList = isMobile ? mobileWallets : desktopWallets
Expand All @@ -53,15 +55,31 @@ export const createCheckWalletList: Wrapper = ({ page, element }) => (
currentList = currentList.filter(({ id }) => id !== constants.walletNames.walletConnect)
}

if (!isMobile) {
// MM will not be displayed if window.ethereum is undefined
await page.evaluate(() => {
// @ts-ignore
window.ethereum = {}
// Without window.ethereum the wallet provider hangs in auto-connect and connect-button never mounts
// Use addInitScript so eip6963 provider is announced before mipd store is created on page load
await page.addInitScript(() => {
// @ts-ignore
window.ethereum = {}

const info = Object.freeze({
uuid: '350670db-19fa-4704-a166-e52e178b59d2',
name: 'MetaMask',
icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciLz4=',
rdns: 'metaMask',
})
}
const announce = () => {
window.dispatchEvent(new CustomEvent('eip6963:announceProvider', {
// @ts-ignore
detail: Object.freeze({ info, provider: window.ethereum }),
}))
}
window.addEventListener('eip6963:requestProvider', announce)
announce()
})

await page.reload()

await page.getByTestId('connect-button').click()
await page.getByTestId('connect-button').click({ timeout: connectClickTimeout })

for (const wallet of currentList) {
await element.checkVisibility({ testId: `${wallet.id}-connector-button` })
Expand Down
16 changes: 16 additions & 0 deletions e2e/fixtures/wallet/helpers/eip1193-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,20 @@
window.ethereum = provider

window.dispatchEvent(new Event('ethereum#initialized'))

const eip6963Info = Object.freeze({
uuid: '350670db-19fa-4704-a166-e52e178b59d2',
name: 'MetaMask',
icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciLz4=',
rdns: 'metaMask',
})

const announceProvider = () => {
window.dispatchEvent(new CustomEvent('eip6963:announceProvider', {
detail: Object.freeze({ info: eip6963Info, provider }),
}))
}

window.addEventListener('eip6963:requestProvider', announceProvider)
announceProvider()
})()
3 changes: 3 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ console.log('-------------------------------------------------------------------
*/
const nextConfig = {
reactStrictMode: false,
allowedDevOrigins: [
'local.stakewise.io',
],
sassOptions: {
additionalData: `
@use 'src/styles/variables' as *;
Expand Down
22 changes: 14 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,30 @@
},
"dependencies": {
"@binance/w3w-ethereum-provider": "1.1.8-alpha.0",
"@cowprotocol/cow-sdk": "7.2.5",
"@cowprotocol/sdk-ethers-v6-adapter": "0.3.0",
"@cowprotocol/cow-sdk": "8.0.0",
"@cowprotocol/sdk-ethers-v6-adapter": "0.3.11",
"@floating-ui/react": "0.27.16",
"@floating-ui/react-dom": "2.1.6",
"@headlessui/react": "2.2.4",
"@ledgerhq/hw-app-eth": "6.45.5",
"@ledgerhq/device-management-kit": "0.9.0",
"@ledgerhq/device-signer-kit-ethereum": "1.8.0",
"@ledgerhq/device-transport-kit-web-ble": "1.2.0",
"@ledgerhq/device-transport-kit-web-hid": "1.2.0",
"@ledgerhq/hw-app-eth": "6.46.0",
"@ledgerhq/hw-transport-web-ble": "6.29.12",
"@ledgerhq/hw-transport-webhid": "6.30.1",
"@ledgerhq/hw-transport-webusb": "6.29.5",
"@ledgerhq/hw-transport-webhid": "6.30.8",
"@ledgerhq/hw-transport-webusb": "6.29.12",
"@ledgerhq/types-live": "6.90.0",
"@metamask/onboarding": "1.0.1",
"@reduxjs/toolkit": "2.8.2",
"@safe-global/safe-apps-provider": "0.18.6",
"@safe-global/safe-apps-sdk": "9.1.0",
"@stakewise/v3-sdk": "4.2.2",
"@stakewise/v3-sdk": "4.2.5",
"@tailwindcss/postcss": "4.1.7",
"@types/react-redux": "7.1.34",
"@wagmi/connectors": "7.1.1",
"@wagmi/core": "3.2.1",
"@wagmi/connectors": "7.2.1",
"@wagmi/core": "3.4.0",
"@walletconnect/ethereum-provider": "2.21.1",
"async-mutex": "0.5.0",
"autoprefixer": "10.4.21",
"circular-dependency-plugin": "5.2.2",
Expand All @@ -105,6 +110,7 @@
"husky": "9.1.7",
"js-cookie": "3.0.5",
"lightweight-charts": "5.0.7",
"mipd": "0.0.7",
"next": "16.2.6",
"react": "19.2.3",
"react-dom": "19.2.3",
Expand Down
Loading
Loading