From 3e21ae0f8d0e9db45f774a6281c5a6d6315b7a5d Mon Sep 17 00:00:00 2001 From: chaitanyapotti Date: Thu, 27 Apr 2023 11:32:34 +0530 Subject: [PATCH] fix import --- demos/wagmi-nextjs/package.json | 10 +++++----- package.json | 2 +- src/lib/connector.ts | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/demos/wagmi-nextjs/package.json b/demos/wagmi-nextjs/package.json index 73c6473..62b3e6a 100644 --- a/demos/wagmi-nextjs/package.json +++ b/demos/wagmi-nextjs/package.json @@ -12,15 +12,15 @@ "@types/node": "18.15.11", "@types/react": "18.0.31", "@types/react-dom": "18.0.11", - "next": "13.2.4", - "react": "18.2.0", - "react-dom": "18.2.0", - "typescript": "4.9.5", "@web3auth/base": "^5.1.0", "@web3auth/modal": "^5.1.1", "@web3auth/openlogin-adapter": "^5.1.1", "@web3auth/torus-wallet-connector-plugin": "^5.1.0", - "@web3auth/web3auth-wagmi-connector": "file:../../", + "@web3auth/web3auth-wagmi-connector": "file:../../web3auth-web3auth-wagmi-connector-3.0.1.tgz", + "next": "13.2.4", + "react": "18.2.0", + "react-dom": "18.2.0", + "typescript": "4.9.5", "wagmi": "^0.12.8" } } diff --git a/package.json b/package.json index 8d51a36..fd744cd 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "build": "torus-scripts build", "release": "torus-scripts release", "lint": "eslint --fix 'src/**/*.ts'", - "prepack": "yarn run build", + "prepack": "npm run build", "pre-commit": "lint-staged --cwd ." }, "dependencies": { diff --git a/src/lib/connector.ts b/src/lib/connector.ts index 93ed37c..6baff58 100644 --- a/src/lib/connector.ts +++ b/src/lib/connector.ts @@ -1,6 +1,7 @@ import { Address, Connector, ConnectorData, normalizeChainId, UserRejectedRequestError } from "@wagmi/core"; import type { Chain } from "@wagmi/core/chains"; -import { ADAPTER_STATUS, CHAIN_NAMESPACES, IWeb3Auth, SafeEventEmitterProvider, WALLET_ADAPTER_TYPE, WALLET_ADAPTERS } from "@web3auth/base"; +import type { IWeb3Auth, SafeEventEmitterProvider, WALLET_ADAPTER_TYPE } from "@web3auth/base"; +import * as pkg from "@web3auth/base"; import type { IWeb3AuthModal, ModalConfig } from "@web3auth/modal"; import type { OpenloginLoginParams } from "@web3auth/openlogin-adapter"; import { providers, Signer } from "ethers"; @@ -9,6 +10,7 @@ import log from "loglevel"; import type { Options } from "./interfaces"; const IS_SERVER = typeof window === "undefined"; +const { ADAPTER_STATUS, CHAIN_NAMESPACES, WALLET_ADAPTERS } = pkg; function isIWeb3AuthModal(obj: IWeb3Auth | IWeb3AuthModal): obj is IWeb3AuthModal { return typeof (obj as IWeb3AuthModal).initModal !== "undefined";