From 864fce7d18674b14bbd17ca31c82e46ec0036418 Mon Sep 17 00:00:00 2001 From: Kujtim Prenku Date: Sun, 3 Nov 2024 12:21:33 +0100 Subject: [PATCH 1/2] Remove @near-js import and use the near-api-js directly. --- packages/core/src/lib/wallet-selector.spec.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/core/src/lib/wallet-selector.spec.ts b/packages/core/src/lib/wallet-selector.spec.ts index 4edca0c64..bfdcc140d 100644 --- a/packages/core/src/lib/wallet-selector.spec.ts +++ b/packages/core/src/lib/wallet-selector.spec.ts @@ -1,7 +1,9 @@ import { setupWalletSelector } from "./wallet-selector"; -import { FailoverRpcProvider } from "@near-js/providers"; import { getNetworkPreset } from "./options"; -import { JsonRpcProvider } from "near-api-js/lib/providers"; +import { + JsonRpcProvider, + FailoverRpcProvider, +} from "near-api-js/lib/providers"; import type { Network } from "./options.types"; import type { Store } from "./store.types"; import type { WalletModuleFactory } from "./wallet"; @@ -52,8 +54,8 @@ jest.mock("./store", () => { }; }); -jest.mock("@near-js/providers", () => { - const originalModule = jest.requireActual("@near-js/providers"); +jest.mock("near-api-js/lib/providers", () => { + const originalModule = jest.requireActual("near-api-js/lib/providers"); return { ...originalModule, FailoverRpcProvider: jest.fn(), From 5fde290d3ba5ec3e8ecc9b7a71c68c0c6a754482 Mon Sep 17 00:00:00 2001 From: Kujtim Prenku Date: Sun, 3 Nov 2024 12:22:09 +0100 Subject: [PATCH 2/2] Remove un-necessary peer dependency @near-js/providers. --- packages/core/package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index d0c679045..c77a7922e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -20,7 +20,6 @@ }, "homepage": "https://github.com/near/wallet-selector/tree/main/packages/core", "peerDependencies": { - "near-api-js": "4.0.3", - "@near-js/providers": "latest" + "near-api-js": "4.0.3" } -} \ No newline at end of file +}