From f6c20439a06e9756b046392b43aa2ed26552ad70 Mon Sep 17 00:00:00 2001 From: Nico <60229704+Marchand-Nicolas@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:00:11 +0100 Subject: [PATCH 1/7] feat: add braavos mobile --- app/provider.tsx | 6 +-- package.json | 5 ++- public/visuals/braavosMobile.webp | Bin 0 -> 10034 bytes utils/braavosMobile.ts | 64 ++++++++++++++++++++++++++++++ utils/walletConfig.ts | 19 ++++++++- 5 files changed, 85 insertions(+), 9 deletions(-) create mode 100644 public/visuals/braavosMobile.webp create mode 100644 utils/braavosMobile.ts diff --git a/app/provider.tsx b/app/provider.tsx index 12aa217a..e601d4ef 100644 --- a/app/provider.tsx +++ b/app/provider.tsx @@ -1,9 +1,6 @@ "use client"; import React from "react"; -import { InjectedConnector } from "starknetkit/injected"; -import { WebWalletConnector } from "starknetkit/webwallet"; -import { ArgentMobileConnector } from "starknetkit/argentMobile"; import { Chain, mainnet, sepolia } from "@starknet-react/chains"; import { Connector, @@ -11,10 +8,9 @@ import { jsonRpcProvider, } from "@starknet-react/core"; import { StarknetIdJsProvider } from "@context/StarknetIdJsProvider"; -import { ThemeProvider, createTheme } from "@mui/material"; +import { ThemeProvider } from "@mui/material"; import { QuestsContextProvider } from "@context/QuestsProvider"; import { getCurrentNetwork } from "@utils/network"; -import { constants } from "starknet"; import { PostHogProvider } from "posthog-js/react"; import posthog from "posthog-js"; import { NotificationProvider } from "@context/NotificationProvider"; diff --git a/package.json b/package.json index 1c695cb4..e0773eed 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "chart.js": "^4.3.0", "dayjs": "^1.11.11", "eslint-config-next": "^14.0.1", - "get-starknet-core": "^3.2.0", + "get-starknet": "^3.3.3", + "get-starknet-core": "^3.3.3", "jotai": "^2.5.0", "jwt-decode": "^4.0.0", "lottie-react": "^2.4.0", @@ -51,7 +52,7 @@ "recharts": "^2.12.2", "starknet": "^6.11.0", "starknetid.js": "^4.0.1", - "starknetkit": "^2.3.3", + "starknetkit": "^2.6.1", "three": "^0.155.0", "twitter-api-sdk": "^1.2.1" }, diff --git a/public/visuals/braavosMobile.webp b/public/visuals/braavosMobile.webp new file mode 100644 index 0000000000000000000000000000000000000000..c9acf4d49f31f77cfbf1a0837a55a2adb534a5ff GIT binary patch literal 10034 zcmbVw1yGw?w>IuB#ihaB-Cc@9af${ffdqGH3x!gw6pFiBaVb{36nA%bC@#75obNkx z??3mqn@MK&diS%}TFLnc9Xa-z5JS!Xm9D<}abG#y5PIfk(TYs`E209RQCUvguo8w!#G81k?cqw?C zJ+2&79jN1cY=mC2&gebA|S zMdp5+wA2sSXV}y%@h<8;4Xj~?=2~ub<*xlcXbCrzW`|}C2D^vz-Gjlw4rVH6aE~Oi zf*kLCj&#n;qCtE&4f89jFv#!l??JEMWSK_>QNl293mlzy)1>Ujp1o*F6@t!}cSz8Z|USDlJ znzYXsdmFt9)GxHEV;nAmzgfS8j4^Mg)}B-S?6vA@Dkc{H5XCSpn5Vl=>L)JMQX>b# zgDxGce23n>MkxAfwX8rI&^@NG_0~Afp-1v%aJ1Kb5HaRXyik{0aa>p4Y$pBGVyJsgMU^Wl_U?sGE^Gs9=xU61 z@JV=Ok|AjBB)Jzkfh_ga>R$bsZp#f5JC)E-I~%^yFWWdo6C{>qFH7~IV%ksUXY>ID z^7BvM8dtrFt&2JfZlnuPF(?jBl|9W!!E#B{T5k7+zY39Yc_)gGv^8v)MhiQvJ}977OcFIwtL3( zeRD)`0U-889Q80L+7kZrl-wxN;4=UHGEzNi+A^_^WE2TBLuvvCZHC$j{gIYRh|eXa zc(7Dc)i}#b#Gdinz(shDad0+mcW;xl9E!3|M#^w{=iy@FRP$j1lSIsVLppAm)dVeJGL>|tgEjr}Q%|GSkL#;Ba`NMxO+3bM}Xp}k!h6e zKuh7=ScDN02IxaaQK|Zl7f_6sY(>9IgLUJ0bwkIo#WdViZCq*wRGQS1bt=98+m?aV zfd$y1ha|Y)Vq&DR^x<+U+A65%p3d8B;MfA=+w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Go zAI=VLRnj+x2~iqr(>0f4`VAWVCS!>-m{kx<_1_RUTD9xLWEe`jWjfkn)nCO&pSb8f4-0=6FgXLPpwkTGp!Wm@4-*sPQR@RP+puBoc#v?Dou~+@Fe>$;`*QM|^GiMbU{z%!Qfmn^MfX zQV>=E4s2noLtYSe=snFYs4E*$QuSDSKS}Q)0HYso{9QPz_Fw=OTO`1=CZgXCiS3}^y_|z7{5sg zAG=cc6Zr`U7EqT$T}P#XL}NkL9f|6F!LVvY%h8xh?84R7BpFU=e_=45`I$tnYPI7= zDUGM2)IY|=njOTATr3mnW3m#*iD!O8(%-IuSj8Xpl1~~i?8t}e2)mp>FYo17{oP2r z33-bzfP}W}KiRy;)Y&LyK>D!slQ|zrZ>iU={Fdi zlzkyUU0)47YhNd85gUM%B(1o&sJDx&3((z?*4xDy1Qqp`09e|9t$?D>>pzdV0JMKW z+?^x3;d|cdu96UUt z0=%N!0<{170G4jw0rZCj%YQlpl(%#TN&x;Oj)Pl>gI8FO zM@W=USd@pCjhj!DoBMC5I@rd+*5|*2@^g#w^Zgg-bK%%nx?BEV!8X>SwqS^hJT5MdiTGV92xKXYcs_@QYDg;qW>pul90kHm)S)dKzUymLB#}W8j zt(QIUS?T{F-G9TNU|V-DO9)WL?m1fjFBQf0>_69^Zv2}H*Z<1$uf6}&x&MYgkApwU Ue@4->@Xs& { + const link = `https://link.braavos.app/dapp/${window.location.host}`; + window.open(link, "_blank"); + return null as unknown as Promise; + } + + get wallet(): never { + throw new ConnectorNotConnectedError(); + } + + disconnect(): never { + throw new UserNotConnectedError(); + } + + account(): never { + throw new ConnectorNotConnectedError(); + } + + chainId(): Promise { + return process.env.NEXT_PUBLIC_IS_TESTNET === "true" + ? Promise.resolve(sepolia.id) + : Promise.resolve(mainnet.id); + } + + ready(): Promise { + return Promise.resolve(true); + } +} + +export function getBraavosMobile(): BraavosMobileConnector { + return new BraavosMobileConnector(); +} diff --git a/utils/walletConfig.ts b/utils/walletConfig.ts index 857dd4a0..bba52fef 100644 --- a/utils/walletConfig.ts +++ b/utils/walletConfig.ts @@ -1,10 +1,11 @@ import { constants } from "starknet"; import { InjectedConnector } from "starknetkit/injected"; import { WebWalletConnector } from "starknetkit/webwallet"; -import { Connector, StarknetWindowObject } from "starknetkit"; +import { Connector } from "starknetkit"; import { ArgentMobileConnector } from "starknetkit/argentMobile"; import { getCurrentNetwork } from "./network"; import { getBrowser } from "./browserService"; +import { braavosMobileIcon, getBraavosMobile } from "./braavosMobile"; export type WalletStore = "chrome" | "firefox" | "edge" | "safari"; type WalletDownload = Partial>; @@ -89,6 +90,18 @@ export const wallets: Wallet[] = [ }, website: "https://www.keplr.app/", }, + { + id: "braavosMobile", + name: "Braavos Mobile", + icon: braavosMobileIcon, + downloads: { + chrome: `https://link.braavos.app/dapp/${window.location.host}`, + firefox: `https://link.braavos.app/dapp/${window.location.host}`, + edge: `https://link.braavos.app/dapp/${window.location.host}`, + safari: `https://link.braavos.app/dapp/${window.location.host}`, + }, + website: `https://link.braavos.app/dapp/${window.location.host}`, + }, ]; // Check if the Bitget wallet is available on the window object @@ -109,7 +122,6 @@ export const getConnectors = () => { }, }), new InjectedConnector({ options: { id: "okxwallet", name: "Okx Wallet" } }), - new WebWalletConnector({ url: getCurrentNetwork() === "TESTNET" @@ -126,6 +138,8 @@ export const getConnectors = () => { }), new InjectedConnector({ options: { id: "keplr", name: "Keplr" } }), + + getBraavosMobile(), ]; return connectors; @@ -140,6 +154,7 @@ export const sortConnectors = (connectors: Connector[]): Connector[] => { const notAvailable: Connector[] = []; connectors.forEach((connector) => { + console.log(connector); connector.available() ? available.push(connector) : notAvailable.push(connector); From 23d898e5557cf594d38e629cb1e171b70b748e6e Mon Sep 17 00:00:00 2001 From: Nico <60229704+Marchand-Nicolas@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:03:54 +0100 Subject: [PATCH 2/7] fix build --- utils/walletConfig.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/walletConfig.ts b/utils/walletConfig.ts index bba52fef..baaea453 100644 --- a/utils/walletConfig.ts +++ b/utils/walletConfig.ts @@ -95,12 +95,12 @@ export const wallets: Wallet[] = [ name: "Braavos Mobile", icon: braavosMobileIcon, downloads: { - chrome: `https://link.braavos.app/dapp/${window.location.host}`, - firefox: `https://link.braavos.app/dapp/${window.location.host}`, - edge: `https://link.braavos.app/dapp/${window.location.host}`, - safari: `https://link.braavos.app/dapp/${window.location.host}`, + chrome: `https://link.braavos.app/dapp/starknet.quest`, + firefox: `https://link.braavos.app/dapp/starknet.quest`, + edge: `https://link.braavos.app/dapp/starknet.quest`, + safari: `https://link.braavos.app/dapp/starknet.quest`, }, - website: `https://link.braavos.app/dapp/${window.location.host}`, + website: `https://link.braavos.app/dapp/starknet.quest`, }, ]; From efe9b3ad79691708b8f17a9370d68ba93bb373af Mon Sep 17 00:00:00 2001 From: Nico <60229704+Marchand-Nicolas@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:21:40 +0100 Subject: [PATCH 3/7] hide on desktop --- utils/walletConfig.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/walletConfig.ts b/utils/walletConfig.ts index baaea453..eba57128 100644 --- a/utils/walletConfig.ts +++ b/utils/walletConfig.ts @@ -139,8 +139,10 @@ export const getConnectors = () => { new InjectedConnector({ options: { id: "keplr", name: "Keplr" } }), - getBraavosMobile(), - ]; + typeof window === undefined || window.innerWidth < 768 + ? getBraavosMobile() + : [], + ].flat(); return connectors; }; From d517013ed79b474efbce1a80014fcf5d773a10f6 Mon Sep 17 00:00:00 2001 From: Nico <60229704+Marchand-Nicolas@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:23:22 +0100 Subject: [PATCH 4/7] missing str symbols --- utils/walletConfig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/walletConfig.ts b/utils/walletConfig.ts index eba57128..220cb7d2 100644 --- a/utils/walletConfig.ts +++ b/utils/walletConfig.ts @@ -139,7 +139,7 @@ export const getConnectors = () => { new InjectedConnector({ options: { id: "keplr", name: "Keplr" } }), - typeof window === undefined || window.innerWidth < 768 + typeof window === "undefined" || window.innerWidth < 768 ? getBraavosMobile() : [], ].flat(); From 24016e3bf80b4dcfb72b47ce7675a3ab10e60399 Mon Sep 17 00:00:00 2001 From: Nico <60229704+Marchand-Nicolas@users.noreply.github.com> Date: Fri, 27 Dec 2024 19:15:34 +0100 Subject: [PATCH 5/7] fix tests --- app/analytics/page.tsx | 58 ++++++++++++++++++------------- context/QuestsProvider.tsx | 1 - jest.config.js | 5 +-- tests/utils/domainService.test.js | 27 ++++++++------ tests/utils/walletConfig.test.js | 14 ++++---- 5 files changed, 59 insertions(+), 46 deletions(-) diff --git a/app/analytics/page.tsx b/app/analytics/page.tsx index 26b92589..d0971ec8 100644 --- a/app/analytics/page.tsx +++ b/app/analytics/page.tsx @@ -17,12 +17,12 @@ export default function Page() { const { address } = useAccount(); const [loading, setLoading] = useState(true); - const [quests, setQuests] = useState ({} as QuestList); + const [quests, setQuests] = useState({} as QuestList); const fetchQuests = useCallback(async () => { try { setLoading(true); - const res = await getQuests() || {}; + const res = (await getQuests()) || {}; setQuests(res); setLoading(false); } catch (error) { @@ -39,34 +39,42 @@ export default function Page() {
router.back()} />
- Quest Analytics + + Quest Analytics +
{loading ? ( ) : ( - (Object.keys(quests) as (keyof typeof quests)[]).map((categoryName: keyof typeof quests) => { - const categoryValue = quests[categoryName]; - if (Array.isArray(categoryValue)) { - return categoryValue.map((quest: QuestDocument) => { - return ( - router.push(`/analytics/${quest.id}`)} - imgSrc={quest.img_card} - issuer={{ - name: quest.issuer, - logoFavicon: quest.logo, - }} - reward={quest.rewards_title} - id={quest.id} - expired={false} - /> - ); - }); + (Object.keys(quests) as (keyof typeof quests)[]).map( + (categoryName: keyof typeof quests) => { + const categoryValue = quests[categoryName]; + if (Array.isArray(categoryValue)) { + return categoryValue.map((quest: QuestDocument) => { + return ( + router.push(`/analytics/${quest.id}`)} + imgSrc={quest.img_card} + issuer={{ + name: quest.issuer, + logoFavicon: quest.logo, + }} + reward={quest.rewards_title} + id={quest.id} + expired={false} + /> + ); + }); + } + return null; } - return null; - }) + ) )}
diff --git a/context/QuestsProvider.tsx b/context/QuestsProvider.tsx index 6dcfb124..e9799cad 100644 --- a/context/QuestsProvider.tsx +++ b/context/QuestsProvider.tsx @@ -138,7 +138,6 @@ export const QuestsContextProvider = ({ !quest.expired ) : undefined; - setFeaturedQuest( lastBoostedQuest || notExpired[Math.floor(Math.random() * notExpired.length)] diff --git a/jest.config.js b/jest.config.js index 4b91002b..988cd11a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,7 +2,7 @@ module.exports = { testEnvironment: "node", transform: { - "\\.[jt]sx?$": "ts-jest", + "^.+\\.(js|jsx|ts|tsx)$": ["babel-jest", { presets: ["next/babel"] }], }, setupFilesAfterEnv: ["./jest.setup.js"], moduleNameMapper: { @@ -21,4 +21,5 @@ module.exports = { statements: -10, }, }, -}; \ No newline at end of file + transformIgnorePatterns: ["node_modules/(?!(@starknet-react|@starknetkit)/)"], +}; diff --git a/tests/utils/domainService.test.js b/tests/utils/domainService.test.js index e17b5b35..ccdb6f4e 100644 --- a/tests/utils/domainService.test.js +++ b/tests/utils/domainService.test.js @@ -1,23 +1,26 @@ -import { getDomainFromAddress } from '@utils/domainService'; +import { getDomainFromAddress } from "@utils/domainService"; const API_URL = process.env.NEXT_PUBLIC_STARKNET_ID_API_LINK; describe("getDomainFromAddress function", () => { -it("should return a valid domain for a valid address", async () => { - const validAddress = "0x061b6c0a78f9edf13cea17b50719f3344533fadd470b8cb29c2b4318014f52d3"; + it("should return a valid domain for a valid address", async () => { + const validAddress = + "0x061b6c0a78f9edf13cea17b50719f3344533fadd470b8cb29c2b4318014f52d3"; const expectedDomain = "fricoben.stark"; // Mocking the fetch function to return a predefined response const mockResponse = { domain: expectedDomain }; const fetchMock = jest.fn().mockResolvedValue({ - json: jest.fn().mockResolvedValue(mockResponse), + json: jest.fn().mockResolvedValue(mockResponse), }); - (fetch as jest.Mock) = fetchMock; + fetch = fetchMock; const domain = await getDomainFromAddress(validAddress); expect(domain).toBe(expectedDomain); - expect(fetchMock).toHaveBeenCalledWith(`${API_URL}/addr_to_domain?addr=${validAddress}`); + expect(fetchMock).toHaveBeenCalledWith( + `${API_URL}/addr_to_domain?addr=${validAddress}` + ); }); it("should return an empty string for an invalid address", async () => { @@ -27,13 +30,15 @@ it("should return a valid domain for a valid address", async () => { // Mocking the fetch function to simulate an error const mockResponse = { domain: expectedDomain }; const fetchMock = jest.fn().mockResolvedValue({ - json: jest.fn().mockResolvedValue(mockResponse), - }); - (fetch as jest.Mock) = fetchMock; + json: jest.fn().mockResolvedValue(mockResponse), + }); + fetch = fetchMock; const domain = await getDomainFromAddress(invalidAddress); expect(domain).toBe(""); - expect(fetchMock).toHaveBeenCalledWith(`${API_URL}/addr_to_domain?addr=${invalidAddress}`); + expect(fetchMock).toHaveBeenCalledWith( + `${API_URL}/addr_to_domain?addr=${invalidAddress}` + ); }); -}); \ No newline at end of file +}); diff --git a/tests/utils/walletConfig.test.js b/tests/utils/walletConfig.test.js index befc29ca..871109c9 100644 --- a/tests/utils/walletConfig.test.js +++ b/tests/utils/walletConfig.test.js @@ -3,7 +3,7 @@ import { getConnectorIcon, getConnectorName, getConnectorDiscovery, -} from "../../utils/walletConfig"; +} from "@utils/walletConfig"; class MockConnector { constructor(id, name, isAvailable) { this.id = id; @@ -65,10 +65,10 @@ describe("sortConnectors function", () => { describe("getConnectorIcon function", () => { it("should return the icon for a wallet when the ID matches", () => { expect(getConnectorIcon("argentX")).toBe( - "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iOCIgZ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zZXQ9IjEiIHN0b3AtY29sb3I9IiNGRjk2MDAiIC8+CiAgICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KPC9zdmc+" ); }); @@ -123,26 +123,26 @@ describe("getConnectorDiscovery function", () => { it("should return the wallet's website URL when no downloads are available", () => { expect(getConnectorDiscovery("argentWebWallet")).toBe( - "https://www.argent.xyz/argent-x/", + "https://www.argent.xyz/argent-x/" ); }); it("should return the correct download link for the user's browser if available", () => { expect(getConnectorDiscovery("braavos")).toBe( - "https://chrome.google.com/webstore/detail/braavos-wallet/jnlgamecbpmbajjfhmmmlhejkemejdma", + "https://chrome.google.com/webstore/detail/braavos-wallet/jnlgamecbpmbajjfhmmmlhejkemejdma" ); }); it("should return the ecosystem website if no wallet data is found", () => { expect(getConnectorDiscovery("wallet")).toBe( - "https://www.starknet-ecosystem.com", + "https://www.starknet-ecosystem.com" ); }); it("should return the wallet's website when navigator is undefined", () => { Object.defineProperty(global, "navigator", { value: undefined }); expect(getConnectorDiscovery("argentX")).toBe( - "https://www.argent.xyz/argent-x/", + "https://www.argent.xyz/argent-x/" ); }); }); From 787399c695d89e69b2c8a407b9e426c9f8bad3fa Mon Sep 17 00:00:00 2001 From: Nico <60229704+Marchand-Nicolas@users.noreply.github.com> Date: Fri, 27 Dec 2024 19:18:41 +0100 Subject: [PATCH 6/7] fix thresholds --- jest.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jest.config.js b/jest.config.js index 988cd11a..385c7f18 100644 --- a/jest.config.js +++ b/jest.config.js @@ -16,9 +16,9 @@ module.exports = { coverageThreshold: { "./utils/": { branches: 75, - functions: 90, + functions: 80, lines: 90, - statements: -10, + statements: -23, }, }, transformIgnorePatterns: ["node_modules/(?!(@starknet-react|@starknetkit)/)"], From efe262debac735bd98d0f00db52f97c07798ecb1 Mon Sep 17 00:00:00 2001 From: Nico <60229704+Marchand-Nicolas@users.noreply.github.com> Date: Fri, 27 Dec 2024 19:26:26 +0100 Subject: [PATCH 7/7] add tests --- tests/utils/braavosMobile.test.js | 86 +++++++++++++++++++++++++++++++ utils/braavosMobile.ts | 2 +- 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 tests/utils/braavosMobile.test.js diff --git a/tests/utils/braavosMobile.test.js b/tests/utils/braavosMobile.test.js new file mode 100644 index 00000000..f7511826 --- /dev/null +++ b/tests/utils/braavosMobile.test.js @@ -0,0 +1,86 @@ +import { mainnet, sepolia } from "@starknet-react/chains"; +import { + ConnectorNotConnectedError, + UserNotConnectedError, +} from "@starknet-react/core"; +import { BraavosMobileConnector, getBraavosMobile } from "@utils/braavosMobile"; + +describe("BraavosMobileConnector class", () => { + let connector; + + beforeEach(() => { + connector = new BraavosMobileConnector(); + }); + + describe("id getter", () => { + it("should return 'braavosMobile'", () => { + expect(connector.id).toBe("braavosMobile"); + }); + }); + + describe("icon getter", () => { + it("should return the same icon for light and dark modes", () => { + expect(connector.icon.light).toBeDefined(); + expect(connector.icon.dark).toBeDefined(); + expect(connector.icon.light).toBe(connector.icon.dark); + }); + }); + + describe("name getter", () => { + it("should return 'Braavos (mobile)'", () => { + expect(connector.name).toBe("Braavos (mobile)"); + }); + }); + + describe("available method", () => { + it("should return true", () => { + expect(connector.available()).toBe(true); + }); + }); + + describe("wallet getter", () => { + it("should throw a ConnectorNotConnectedError", () => { + expect(() => connector.wallet).toThrow(ConnectorNotConnectedError); + }); + }); + + describe("disconnect method", () => { + it("should throw a UserNotConnectedError", () => { + expect(() => connector.disconnect()).toThrow(UserNotConnectedError); + }); + }); + + describe("account method", () => { + it("should throw a ConnectorNotConnectedError", () => { + expect(() => connector.account()).toThrow(ConnectorNotConnectedError); + }); + }); + + describe("chainId method", () => { + it("should return sepolia.id when NEXT_PUBLIC_IS_TESTNET is 'true'", async () => { + process.env.NEXT_PUBLIC_IS_TESTNET = "true"; + const result = await connector.chainId(); + expect(result).toBe(sepolia.id); + }); + + it("should return mainnet.id when NEXT_PUBLIC_IS_TESTNET is not 'true'", async () => { + process.env.NEXT_PUBLIC_IS_TESTNET = "false"; + const result = await connector.chainId(); + expect(result).toBe(mainnet.id); + }); + }); + + describe("ready method", () => { + it("should return true as a Promise", async () => { + const result = await connector.ready(); + expect(result).toBe(true); + }); + }); +}); + +describe("getBraavosMobile function", () => { + it("should return an instance of BraavosMobileConnector", () => { + const instance = getBraavosMobile(); + expect(instance).toBeInstanceOf(BraavosMobileConnector); + }); +}); diff --git a/utils/braavosMobile.ts b/utils/braavosMobile.ts index 571ebab6..f9031c6d 100644 --- a/utils/braavosMobile.ts +++ b/utils/braavosMobile.ts @@ -10,7 +10,7 @@ export const braavosMobileIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABcCAYAAADj79JYAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAAHdElNRQfoDBoIMDQ8dvpLAAADI3pUWHRSYXcgcHJvZmlsZSB0eXBlIHhtcAAASInFVkuWnDAM3OsUOQJItgTHoTHs8l6WOX6q5P7Q3cxkkizSvAHGlkqlr5Gf33/IN/xGLZPYantMMfjo5hevUXRw9erhs2/WVLf9crnsqlifvXClhtXSbCgthmKQnXyWMsUSUKwWS9lqcTwBaAYlVdtt08HWmGyJyaHojcZ81IH/++pbGPeEFsCm+E4etvSNu3gyecBg7UKNctfQoU6l1UGU5PbIJZt1s1Eb+Ay4AGHBNR/N+WfgifsEAyv2lDJWdMfTJB+uzUZci1VsLVgB7MulVycVXNyWqqUUfzgo6WHfpJNTFFyDLXBqj/zpFhACL/IOGB7BC1dSUNwV9yYdRFtYIEuMS0xwDpHi/jMLUEDCkA71OeM1I06Q4L5QAMFW2EN4yaqH95gRhvmdbxrbbokSBHlDBe3e4ArCGAPJI+jDLWMPSKjYSQAGUADQ+vCegrhXKFYWAF2F1Q48vgOjqiboglGY5OtviT/xPqh3bZqScyd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PPaEAKok9+FldDBzgXxcecFGWOqSrxvA7NvZ/9csCEBtsQJkCZuIrf/+7ahnL9tZaIDYHkLgT1e2SwpEa8g//KiiI8mrswrK7NTCZs+6CbpN1a/g11RlpTMmOzzljEyNH5l/07FO7VrMuWCLR128DmHFdQPHG6Vcg7ZbbRygZCPv3AmTPkKgDUxIlRVPm1k7XZGma9QseoJ1BvnaxICkk0IEqqSYK+sWC2Uqbc9TyJbW7xwQcLGwf9NZJkJC1UJkQPOoVuDRDAFz0ze8OEdQG/7ep/Srj3P+xRtYD4LIdWvqA/eAgU0/1i7l69xALnFZZTxkzl9GfKBIKI2TJ4C52bGJJvILbhUfyTQ/mMnrbiezjxgjpT6SqbwdwmVVEZo2HdjFfVdzgcxA1gkrJr/D9megfURW/pyAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTI2VDA4OjQ4OjM0KzAwOjAwRY7yjQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0yNlQwODo0ODozNCswMDowMDTTSjEAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMjZUMDg6NDg6NTIrMDA6MDDGeVdTAAAAAElFTkSuQmCC"; // @ts-ignore -class BraavosMobileConnector extends Connector { +export class BraavosMobileConnector extends Connector { get id(): string { return "braavosMobile"; }