From 0c295e1e8d43ef3c560ee9b7446cd36bbe82f81d Mon Sep 17 00:00:00 2001 From: Matias Benary Date: Thu, 29 May 2025 15:46:45 -0300 Subject: [PATCH 1/2] feat: update wallet selector --- frontend/package.json | 38 +++++++++++++++---------------- frontend/src/wallets/web3modal.js | 8 +++++++ 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 61c2073..5394711 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,29 +13,29 @@ }, "dependencies": { "@near-js/providers": "^1.0.1", - "@near-wallet-selector/bitte-wallet": "^8.10.0", - "@near-wallet-selector/core": "^8.10.0", - "@near-wallet-selector/ethereum-wallets": "^8.10.0", - "@near-wallet-selector/here-wallet": "^8.10.0", - "@near-wallet-selector/hot-wallet": "^8.10.0", - "@near-wallet-selector/ledger": "^8.10.0", - "@near-wallet-selector/meteor-wallet": "^8.10.0", - "@near-wallet-selector/meteor-wallet-app": "^8.10.0", - "@near-wallet-selector/modal-ui": "^8.10.0", - "@near-wallet-selector/my-near-wallet": "^8.10.0", - "@near-wallet-selector/near-mobile-wallet": "^8.10.0", - "@near-wallet-selector/nightly": "^8.10.0", - "@near-wallet-selector/react-hook": "^8.9.15", - "@near-wallet-selector/sender": "^8.10.0", - "@near-wallet-selector/welldone-wallet": "^8.10.0", - "@reown/appkit": "^1.6.9", - "@reown/appkit-adapter-wagmi": "^1.6.9", + "@near-wallet-selector/bitte-wallet": "^9.0.2", + "@near-wallet-selector/core": "^9.0.2", + "@near-wallet-selector/ethereum-wallets": "^9.0.2", + "@near-wallet-selector/here-wallet": "^9.0.2", + "@near-wallet-selector/hot-wallet": "^9.0.2", + "@near-wallet-selector/ledger": "^9.0.2", + "@near-wallet-selector/meteor-wallet": "^9.0.2", + "@near-wallet-selector/meteor-wallet-app": "^9.0.2", + "@near-wallet-selector/modal-ui": "^9.0.2", + "@near-wallet-selector/my-near-wallet": "^9.0.2", + "@near-wallet-selector/near-mobile-wallet": "^9.0.2", + "@near-wallet-selector/nightly": "^9.0.2", + "@near-wallet-selector/react-hook": "^9.0.2", + "@near-wallet-selector/sender": "^9.0.2", + "@near-wallet-selector/welldone-wallet": "^9.0.2", + "@reown/appkit": "^1.7.7", + "@reown/appkit-adapter-wagmi": "^1.7.7", "bootstrap": "^5", "bootstrap-icons": "^1.11.3", - "near-api-js": "^5.0.1", "next": "15.2.1", "react": "^18", - "react-dom": "^18" + "react-dom": "^18", + "viem": "^2.30.5" }, "devDependencies": { "encoding": "^0.1.13", diff --git a/frontend/src/wallets/web3modal.js b/frontend/src/wallets/web3modal.js index 55f4ba0..fe14448 100644 --- a/frontend/src/wallets/web3modal.js +++ b/frontend/src/wallets/web3modal.js @@ -43,4 +43,12 @@ export const web3Modal = createAppKit({ socials: false, // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA. }, coinbasePreference: "eoaOnly", // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA. + allWallets: "SHOW", }); + +// force reconnecting if the user has already signed in with an ethereum wallet +// this is a workaround until `ethereum-wallets` supports the `reconnect` method +if (typeof window !== "undefined") { + const recentWallets = localStorage.getItem("near-wallet-selector:recentlySignedInWallets"); + recentWallets && recentWallets.includes("ethereum-wallets") && reconnect(wagmiAdapter.wagmiConfig) +} \ No newline at end of file From 9f8211c427a7c56d7a5e63414c4d322b82cf8a60 Mon Sep 17 00:00:00 2001 From: Matias Benary Date: Thu, 29 May 2025 17:32:50 -0300 Subject: [PATCH 2/2] feat: update wallet selector --- frontend/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/package.json b/frontend/package.json index 5394711..0bea260 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -30,6 +30,7 @@ "@near-wallet-selector/welldone-wallet": "^9.0.2", "@reown/appkit": "^1.7.7", "@reown/appkit-adapter-wagmi": "^1.7.7", + "@wagmi/core": "^2.17.2", "bootstrap": "^5", "bootstrap-icons": "^1.11.3", "next": "15.2.1",