diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..72f192a --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +NEXT_PUBLIC_IS_TESTNET=false +NEXT_PUBLIC_RPC_URL=https://rpc.starknet.id diff --git a/components/UI/modalWallet.tsx b/components/UI/modalWallet.tsx index 8823174..19c8066 100644 --- a/components/UI/modalWallet.tsx +++ b/components/UI/modalWallet.tsx @@ -6,7 +6,6 @@ import { useAccount, useTransactions } from "@starknet-react/core"; import { ContentCopy } from "@mui/icons-material"; import CopiedIcon from "./iconsComponents/icons/copiedIcon"; import ClickableAction from "./iconsComponents/clickableAction"; -import { CommonTransactionReceiptResponse } from "starknet"; import CloseIcon from "./iconsComponents/icons/closeIcon"; import ArgentIcon from "./iconsComponents/icons/argentIcon"; import theme from "../../styles/theme"; @@ -133,9 +132,7 @@ const ModalWallet: FunctionComponent = ({ )}
- {tx.status === "success" && - tx.data && - (tx.data as CommonTransactionReceiptResponse).status} + {tx.isSuccess && tx.status && tx.status}
); diff --git a/components/UI/navbar.tsx b/components/UI/navbar.tsx index 00a4e25..3deb6d2 100644 --- a/components/UI/navbar.tsx +++ b/components/UI/navbar.tsx @@ -52,7 +52,7 @@ const Navbar: FunctionComponent = () => { provider.getChainId().then((chainId) => { const isWrongNetwork = - (chainId === constants.StarknetChainId.SN_GOERLI && + (chainId === constants.StarknetChainId.SN_SEPOLIA && network === "mainnet") || (chainId === constants.StarknetChainId.SN_MAIN && network === "testnet"); diff --git a/context/StarknetIdJsProvider.tsx b/context/StarknetIdJsProvider.tsx index 3fd6aac..be27141 100644 --- a/context/StarknetIdJsProvider.tsx +++ b/context/StarknetIdJsProvider.tsx @@ -1,6 +1,7 @@ -import React, { FunctionComponent } from "react"; -import { createContext, useMemo } from "react"; -import { Provider, constants } from "starknet"; +"use client"; + +import React, { FunctionComponent, createContext, useMemo } from "react"; +import { RpcProvider, constants } from "starknet"; import { StarknetIdNavigator } from "starknetid.js"; type StarknetIdJsConfig = { @@ -14,21 +15,20 @@ export const StarknetIdJsContext = createContext({ export const StarknetIdJsProvider: FunctionComponent = ({ children, }) => { + const provider = useMemo(() => { + return new RpcProvider({ + nodeUrl: process.env.NEXT_PUBLIC_RPC_URL!, + }); + }, []); + const starknetIdNavigator = useMemo(() => { return new StarknetIdNavigator( - new Provider({ - sequencer: { - network: - process.env.NEXT_PUBLIC_IS_TESTNET === "true" - ? constants.NetworkName.SN_GOERLI - : constants.NetworkName.SN_MAIN, - }, - }), + provider, process.env.NEXT_PUBLIC_IS_TESTNET === "true" - ? constants.StarknetChainId.SN_GOERLI + ? constants.StarknetChainId.SN_SEPOLIA : constants.StarknetChainId.SN_MAIN ); - }, []); + }, [provider]); const contextValues = useMemo(() => { return { diff --git a/package.json b/package.json index 8ea2047..6a8acfe 100644 --- a/package.json +++ b/package.json @@ -39,9 +39,9 @@ "react-apexcharts": "^1.4.0", "react-dom": "^18.2.0", "react-icons": "^4.4.0", - "react-loader-spinner": "^5.2.0", - "starknet": "5.14.1", - "starknetid.js": "^1.5.3", + "react-loader-spinner": "^6.1.6", + "starknet": "^6.11.0", + "starknetid.js": "^4.0.1", "twitter-api-sdk": "^1.2.1" }, "devDependencies": { @@ -64,5 +64,6 @@ "tailwindcss": "^3.1.8", "ts-jest": "^29.0.3", "typescript": "^4.7.4" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" }