diff --git a/package-lock.json b/package-lock.json index 806fea04f..9858173c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3294,14 +3294,14 @@ "integrity": "sha512-j4PEZSVtKSqxDYMVh/hd5vk088Bg6a6QkrUMTXN9Q6OIFAMfHM235f1AxaakNrEyK0FKMD908KuJEdfFLRn9Hw==" }, "@oceanprotocol/contracts": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.5.1.tgz", - "integrity": "sha512-bt5uwh79D759H6O4bAv+ycGdZQISFAxi65cqIygzA9hwsu29+GuOLwu1mxrzl2lVNLs6Emxo7TaDv0jAoyqnCg==" + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.5.2.tgz", + "integrity": "sha512-PTMeP8Ixe66F2YMUgVLibg9k7r2db85Syb66tWUpI+dGnt5KzW1SmQOsyVRjp3x8avRAyMFYaOodXp570jnsmQ==" }, "@oceanprotocol/lib": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.5.2.tgz", - "integrity": "sha512-LCiQuae9cP+Hcu5rDbASBbmEwhxujm5Z49WtaKo2x+UtDAovjjXtNeSMw7WjyJAe+T/gOkHhzn92w0Cc9SUOQA==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.5.3.tgz", + "integrity": "sha512-LYKqgAuf5PNOiGr6Je6v8yupaFmFojiPtkl/gywlBhF/MsMn/PdKLvHRaNge5y69hoJVXfYYEpr0HzyHq9Mx5w==", "requires": { "@ethereum-navigator/navigator": "^0.5.0", "@oceanprotocol/contracts": "^0.5.1", @@ -3316,11 +3316,11 @@ } }, "@oceanprotocol/react": { - "version": "0.0.50", - "resolved": "https://registry.npmjs.org/@oceanprotocol/react/-/react-0.0.50.tgz", - "integrity": "sha512-HhGqHB3ZSCZJhcO44nRmOBKKmaFSnSX51M3ghP+kuxdZTfs30dQgncbkf8NBXsLhivi8zxzxkkg65L+OaxYtoA==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@oceanprotocol/react/-/react-0.1.0.tgz", + "integrity": "sha512-KndcIA79I0DYRe4iZPUaVFYyrTTj5lpaZGmB/qAjUs2ugX7h+1OFfXEMjOj3kaOFT4FcNyVaNpcaYlHbnQG2IQ==", "requires": { - "@oceanprotocol/lib": "^0.5.2", + "@oceanprotocol/lib": "^0.5.3", "axios": "^0.20.0", "decimal.js": "^10.2.1", "web3": "^1.3.0", diff --git a/package.json b/package.json index b96ee17de..2dfa9904e 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,8 @@ "@coingecko/cryptoformat": "^0.4.2", "@loadable/component": "5.13.1", "@oceanprotocol/art": "^3.0.0", - "@oceanprotocol/lib": "^0.5.2", - "@oceanprotocol/react": "^0.0.50", + "@oceanprotocol/lib": "^0.5.3", + "@oceanprotocol/react": "^0.1.0", "@oceanprotocol/typographies": "^0.1.0", "@sindresorhus/slugify": "^1.0.0", "@tippyjs/react": "^4.2.0", diff --git a/src/components/molecules/FormFields/Price/Dynamic.tsx b/src/components/molecules/FormFields/Price/Dynamic.tsx index 4b261429c..79ac42111 100644 --- a/src/components/molecules/FormFields/Price/Dynamic.tsx +++ b/src/components/molecules/FormFields/Price/Dynamic.tsx @@ -26,11 +26,11 @@ export default function Dynamic({ content: any }): ReactElement { const { appConfig } = useSiteMetadata() - const { account, balance, chainId, refreshBalance } = useOcean() + const { account, balance, networkId, refreshBalance } = useOcean() const { weightOnDataToken } = priceOptions const [error, setError] = useState() - const correctNetwork = isCorrectNetwork(chainId) + const correctNetwork = isCorrectNetwork(networkId) const desiredNetworkName = appConfig.network.replace(/^\w/, (c: string) => c.toUpperCase() ) @@ -46,7 +46,7 @@ export default function Dynamic({ } else { setError(undefined) } - }, [ocean, chainId, account, balance, correctNetwork, desiredNetworkName]) + }, [ocean, networkId, account, balance, correctNetwork, desiredNetworkName]) // refetch balance periodically useEffect(() => { @@ -58,7 +58,7 @@ export default function Dynamic({ return () => { clearInterval(balanceInterval) } - }, [ocean, chainId, account]) + }, [ocean, networkId, account]) return (
diff --git a/src/components/molecules/Wallet/Account.tsx b/src/components/molecules/Wallet/Account.tsx index 51f2c00c5..39928f0cf 100644 --- a/src/components/molecules/Wallet/Account.tsx +++ b/src/components/molecules/Wallet/Account.tsx @@ -23,8 +23,9 @@ const Blockies = ({ account }: { account: string | undefined }) => { // Forward ref for Tippy.js // eslint-disable-next-line const Account = React.forwardRef((props, ref: any) => { - const { accountId, status, connect, chainId } = useOcean() - const hasSuccess = status === 1 && isCorrectNetwork(chainId) + const { accountId, status, connect, networkId } = useOcean() + const hasSuccess = status === 1 && isCorrectNetwork(networkId) + console.log(networkId) async function handleActivation(e: FormEvent) { // prevent accidentially submitting a form the button might be in diff --git a/src/components/molecules/Wallet/Details.tsx b/src/components/molecules/Wallet/Details.tsx index 2a1dc54ca..3c42d01c2 100644 --- a/src/components/molecules/Wallet/Details.tsx +++ b/src/components/molecules/Wallet/Details.tsx @@ -10,7 +10,7 @@ import { formatCurrency } from '@coingecko/cryptoformat' import { useUserPreferences } from '../../../providers/UserPreferences' export default function Details(): ReactElement { - const { balance, connect, logout, chainId } = useOcean() + const { balance, connect, logout, networkId } = useOcean() const { locale } = useUserPreferences() return ( @@ -30,7 +30,7 @@ export default function Details(): ReactElement { {getInjectedProviderName()}
- {getNetworkName(chainId)} + {getNetworkName(networkId)}