From b9b25ce5770e586618fc5416ee9fe16e9a006ade Mon Sep 17 00:00:00 2001 From: Genaro Molina Date: Thu, 7 Nov 2024 16:35:05 -0300 Subject: [PATCH 1/3] Reorganized wallet pop-up to show uninstalled wallets last --- tsconfig.json | 1 - utils/connectorWrapper.ts | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 8043f344..4d5236e6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,6 @@ "isolatedModules": true, "jsx": "preserve", "incremental": true, - "suppressImplicitAnyIndexErrors": true, "ignoreDeprecations": "5.0", "baseUrl": ".", "paths": { diff --git a/utils/connectorWrapper.ts b/utils/connectorWrapper.ts index 172fe18c..4f433c86 100644 --- a/utils/connectorWrapper.ts +++ b/utils/connectorWrapper.ts @@ -28,6 +28,7 @@ export const getConnectors = () => { return connectors; }; + export const sortConnectors = (connectors: Connector[]) => { const available: Connector[] = []; const notAvailable: Connector[] = []; @@ -103,6 +104,7 @@ export const isInArgentMobileAppBrowser = (): boolean => { return starknetMobile?.isInAppBrowser; }; + const wallets = [ { id: "argentX", @@ -115,18 +117,22 @@ const wallets = [ edge: "https://microsoftedge.microsoft.com/addons/detail/argent-x/ajcicjlkibolbeaaagejfhnofogocgcj", }, website: "https://www.argent.xyz/argent-x/", + available: true, + }, { id: "argentMobile", name: "Argent (mobile)", icon: "data:image/svg+xml;base64,PHN2ZwogICAgd2lkdGg9IjMyIgogICAgaGVpZ2h0PSIzMiIKICAgIHZpZXdCb3g9IjAgMCAzMiAzMiIKICAgIGZpbGw9Im5vbmUiCiAgICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgPgogICAgPHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iOCIgZmlsbD0iI0ZGODc1QiIgLz4KICAgIDxwYXRoCiAgICAgIGQ9Ik0xOC4zMTYgOEgxMy42ODRDMTMuNTI5MiA4IDEzLjQwNTIgOC4xMjcyIDEzLjQwMTggOC4yODUzMUMxMy4zMDgyIDEyLjcyOTYgMTEuMDMyMyAxNi45NDc3IDcuMTE1MTMgMTkuOTM1NUM2Ljk5MDc3IDIwLjAzMDMgNi45NjI0MyAyMC4yMDg1IDcuMDUzMzUgMjAuMzM2OUw5Ljc2MzQ5IDI0LjE2NTRDOS44NTU2OSAyNC4yOTU3IDEwLjAzNTMgMjQuMzI1MSAxMC4xNjE4IDI0LjIyOTRDMTIuNjExMSAyMi4zNzM0IDE0LjU4MTIgMjAuMTM0NSAxNiAxNy42NTI5QzE3LjQxODcgMjAuMTM0NSAxOS4zODkgMjIuMzczNCAyMS44MzgzIDI0LjIyOTRDMjEuOTY0NiAyNC4zMjUxIDIyLjE0NDMgMjQuMjk1NyAyMi4yMzY2IDI0LjE2NTRMMjQuOTQ2NyAyMC4zMzY5QzI1LjAzNzUgMjAuMjA4NSAyNS4wMDkyIDIwLjAzMDMgMjQuODg1IDE5LjkzNTVDMjAuOTY3NiAxNi45NDc3IDE4LjY5MTggMTIuNzI5NiAxOC41OTgzIDguMjg1MzFDMTguNTk0OSA4LjEyNzIgMTguNDcwOCA4IDE4LjMxNiA4WiIKICAgICAgZmlsbD0id2hpdGUiCiAgICAvPgogIDwvc3ZnPg==", website: "https://www.argent.xyz/argent-x/", + available: true, }, { id: "argentWebWallet", name: "Email", icon: "data:image/svg+xml;base64,PHN2Zwp3aWR0aD0iMzIiCmhlaWdodD0iMjgiCnZpZXdCb3g9IjAgMCAxOCAxNCIKZmlsbD0ibm9uZSIKeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgo+CjxwYXRoCiAgZmlsbC1ydWxlPSJldmVub2RkIgogIGNsaXAtcnVsZT0iZXZlbm9kZCIKICBkPSJNMS41IDAuNDM3NUMwLjk4MjIzMyAwLjQzNzUgMC41NjI1IDAuODU3MjMzIDAuNTYyNSAxLjM3NVYxMkMwLjU2MjUgMTIuNDE0NCAwLjcyNzEyIDEyLjgxMTggMS4wMjAxNSAxMy4xMDQ5QzEuMzEzMTcgMTMuMzk3OSAxLjcxMDYgMTMuNTYyNSAyLjEyNSAxMy41NjI1SDE1Ljg3NUMxNi4yODk0IDEzLjU2MjUgMTYuNjg2OCAxMy4zOTc5IDE2Ljk3OTkgMTMuMTA0OUMxNy4yNzI5IDEyLjgxMTggMTcuNDM3NSAxMi40MTQ0IDE3LjQzNzUgMTJWMS4zNzVDMTcuNDM3NSAwLjg1NzIzMyAxNy4wMTc4IDAuNDM3NSAxNi41IDAuNDM3NUgxLjVaTTIuNDM3NSAzLjUwNjE2VjExLjY4NzVIMTUuNTYyNVYzLjUwNjE2TDkuNjMzNDkgOC45NDEwOEM5LjI3NTA3IDkuMjY5NjQgOC43MjQ5MyA5LjI2OTY0IDguMzY2NTEgOC45NDEwOEwyLjQzNzUgMy41MDYxNlpNMTQuMDg5OSAyLjMxMjVIMy45MTAxM0w5IDYuOTc4MjJMMTQuMDg5OSAyLjMxMjVaIgogIGZpbGw9ImN1cnJlbnRDb2xvciIKLz4KPC9zdmc+", website: "https://www.argent.xyz/argent-x/", + available: true, }, { id: "braavos", @@ -139,6 +145,7 @@ const wallets = [ edge: "https://microsoftedge.microsoft.com/addons/detail/braavos-wallet/hkkpjehhcnhgefhbdcgfkeegglpjchdc", }, website: "https://braavos.app/", + available: true, }, { id: "bitkeep", @@ -149,6 +156,7 @@ const wallets = [ "https://chromewebstore.google.com/detail/bitget-wallet-formerly-bi/jiidiaalihmmhddjgbnbgdfflelocpak", }, website: "https://web3.bitget.com/", + available: false, }, { id: "okxwallet", @@ -162,6 +170,7 @@ const wallets = [ safari: "https://apps.apple.com/us/app/okx-wallet/id6463797825", }, website: "https://www.okx.com/", + available: false, }, { id: "keplr", @@ -174,5 +183,6 @@ const wallets = [ edge: "https://microsoftedge.microsoft.com/addons/detail/keplr/ocodgmmffbkkeecmadcijjhkmeohinei", }, website: "https://www.keplr.app/", + available: true, }, ]; From 0e6d099636568be32a39fd68880dabca04c34a99 Mon Sep 17 00:00:00 2001 From: Genaro Molina Date: Thu, 7 Nov 2024 17:02:02 -0300 Subject: [PATCH 2/3] Add WalletConfig interface --- utils/connectorWrapper.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/utils/connectorWrapper.ts b/utils/connectorWrapper.ts index 4f433c86..009e4ed7 100644 --- a/utils/connectorWrapper.ts +++ b/utils/connectorWrapper.ts @@ -5,6 +5,20 @@ import { WebWalletConnector } from "starknetkit/webwallet"; import { getBrowser } from "./browserService"; import { constants } from "starknet"; +interface WalletConfig { + id: string; + name: string; + icon: string; + downloads?: { + chrome?: string; + firefox?: string; + edge?: string; + safari?: string; + }; + website: string; + available: boolean; +} + export const getConnectors = () => { const connectors = [ new InjectedConnector({ options: { id: "argentX" } }), @@ -105,7 +119,7 @@ export const isInArgentMobileAppBrowser = (): boolean => { }; -const wallets = [ +const wallets: WalletConfig[] = [ { id: "argentX", name: "Argent X", From af17e9cba06611ad1cd89f339b23bc9751054f3c Mon Sep 17 00:00:00 2001 From: Genaro Molina Date: Thu, 7 Nov 2024 17:06:47 -0300 Subject: [PATCH 3/3] Reorganized wallet pop-up to show uninstalled wallets last --- utils/connectorWrapper.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/utils/connectorWrapper.ts b/utils/connectorWrapper.ts index 009e4ed7..9e556325 100644 --- a/utils/connectorWrapper.ts +++ b/utils/connectorWrapper.ts @@ -5,19 +5,6 @@ import { WebWalletConnector } from "starknetkit/webwallet"; import { getBrowser } from "./browserService"; import { constants } from "starknet"; -interface WalletConfig { - id: string; - name: string; - icon: string; - downloads?: { - chrome?: string; - firefox?: string; - edge?: string; - safari?: string; - }; - website: string; - available: boolean; -} export const getConnectors = () => { const connectors = [ @@ -119,7 +106,7 @@ export const isInArgentMobileAppBrowser = (): boolean => { }; -const wallets: WalletConfig[] = [ +const wallets = [ { id: "argentX", name: "Argent X",