update packages to nightly with new magic link and gnosis safe (#599)
* update packages to nightly with new magic link and gnosis safe * update deps
This commit is contained in:
@@ -37,11 +37,11 @@ import {
|
||||
useChainId,
|
||||
useConnect,
|
||||
useDisconnect,
|
||||
useGnosis,
|
||||
useMagic,
|
||||
useMetamask,
|
||||
useNetwork,
|
||||
} from "@thirdweb-dev/react";
|
||||
} from "@thirdweb-dev/react/evm";
|
||||
import { useGnosis } from "@thirdweb-dev/react/evm/connectors/gnosis-safe";
|
||||
import { useMagic } from "@thirdweb-dev/react/evm/connectors/magic";
|
||||
import { ChakraNextImage } from "components/Image";
|
||||
import { MismatchButton } from "components/buttons/MismatchButton";
|
||||
import { ens } from "components/contract-components/hooks";
|
||||
@@ -100,7 +100,7 @@ export const ConnectWallet: React.FC<EcosystemButtonprops> = ({
|
||||
const { getNetworkMetadata } = useWeb3();
|
||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||
const disconnect = useDisconnect();
|
||||
const disconnectFully = useDisconnect({ reconnectAfterGnosis: false });
|
||||
const disconnectFully = useDisconnect({ reconnectPrevious: false });
|
||||
const [network, switchNetwork] = useNetwork();
|
||||
const address = useAddress();
|
||||
const chainId = useChainId();
|
||||
|
||||
@@ -2,27 +2,14 @@ import { SolanaProvider } from "./solana-provider";
|
||||
import { useDashboardEVMChainId } from "@3rdweb-sdk/react";
|
||||
import { useQueryClient } from "@tanstack/react-query";
|
||||
import { ThirdwebProvider, WalletConnector } from "@thirdweb-dev/react";
|
||||
import { GnosisSafeConnector } from "@thirdweb-dev/react/evm/connectors/gnosis-safe";
|
||||
import { MagicConnector } from "@thirdweb-dev/react/evm/connectors/magic";
|
||||
import { EVM_RPC_URL_MAP, getEVMRPC } from "constants/rpc";
|
||||
import { useNativeColorMode } from "hooks/useNativeColorMode";
|
||||
import { StorageSingleton } from "lib/sdk";
|
||||
import { useMemo } from "react";
|
||||
import { ComponentWithChildren } from "types/component-with-children";
|
||||
|
||||
const walletConnectors: WalletConnector[] = [
|
||||
"metamask",
|
||||
"walletConnect",
|
||||
"walletLink",
|
||||
"gnosis",
|
||||
];
|
||||
if (process.env.NEXT_PUBLIC_MAGIC_KEY) {
|
||||
walletConnectors.push({
|
||||
name: "magic",
|
||||
options: {
|
||||
apiKey: process.env.NEXT_PUBLIC_MAGIC_KEY,
|
||||
rpcUrls: EVM_RPC_URL_MAP,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export const DashboardThirdwebProvider: ComponentWithChildren = ({
|
||||
children,
|
||||
}) => {
|
||||
@@ -31,6 +18,31 @@ export const DashboardThirdwebProvider: ComponentWithChildren = ({
|
||||
|
||||
const activeChainId = useDashboardEVMChainId();
|
||||
|
||||
const walletConnectors = useMemo(() => {
|
||||
let wc: WalletConnector[] = [
|
||||
"metamask",
|
||||
"walletConnect",
|
||||
"walletLink",
|
||||
new GnosisSafeConnector({}),
|
||||
];
|
||||
if (process.env.NEXT_PUBLIC_MAGIC_KEY) {
|
||||
wc = wc.concat(
|
||||
new MagicConnector({
|
||||
options: {
|
||||
apiKey: process.env.NEXT_PUBLIC_MAGIC_KEY,
|
||||
rpcUrls: EVM_RPC_URL_MAP,
|
||||
network: activeChainId && {
|
||||
rpcUrl: getEVMRPC(activeChainId),
|
||||
chainId: activeChainId,
|
||||
},
|
||||
doNotAutoConnect: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
return wc;
|
||||
}, [activeChainId]);
|
||||
|
||||
return (
|
||||
<ThirdwebProvider
|
||||
queryClient={queryClient}
|
||||
|
||||
+3
-3
@@ -33,9 +33,9 @@
|
||||
"@tanstack/react-query-persist-client": "^4.0.10",
|
||||
"@tanstack/react-table": "^8.5.13",
|
||||
"@thirdweb-dev/chain-icons": "^1.0.5",
|
||||
"@thirdweb-dev/react": "^3.3.1-nightly-ad851f7",
|
||||
"@thirdweb-dev/sdk": "^3.3.1-nightly-ad851f7",
|
||||
"@thirdweb-dev/storage": "^1.0.5",
|
||||
"@thirdweb-dev/react": "^3.4.0",
|
||||
"@thirdweb-dev/sdk": "^3.4.0",
|
||||
"@thirdweb-dev/storage": "^1.0.6",
|
||||
"bn.js": "^5.2.0",
|
||||
"color": "^4.0.1",
|
||||
"date-fns": "^2.28.0",
|
||||
|
||||
Reference in New Issue
Block a user