From 3bc5743df4858b82917df8b384162a62a7620f46 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Mon, 29 Jul 2024 16:57:10 +0530 Subject: [PATCH] Update registry-sdk version --- development.md | 32 ++++++++++++++-------------- package.json | 2 +- src/context/WalletConnectContext.tsx | 2 +- src/hooks/useInitialization.ts | 4 +++- yarn.lock | 8 +++---- 5 files changed, 25 insertions(+), 23 deletions(-) diff --git a/development.md b/development.md index 392e2c2..e487aca 100644 --- a/development.md +++ b/development.md @@ -34,26 +34,26 @@ ```js export default function useInitialization(setWeb3wallet) { - const [initialized, setInitialized] = useState(false); + const [initialized, setInitialized] = useState(false); - const onInitialize = useCallback(async () => { - try { - const web3walletInstance = await createWeb3Wallet(); - setWeb3wallet(web3walletInstance); + const onInitialize = useCallback(async () => { + try { + const web3walletInstance = await createWeb3Wallet(); + setWeb3wallet(web3walletInstance); - setInitialized(true); - } catch (err: unknown) { - console.error('Error for initializing', err); - } - }, [setWeb3wallet]); + setInitialized(true); + } catch (err: unknown) { + console.error('Error for initializing', err); + } + }, [setWeb3wallet]); - useEffect(() => { - if (!initialized) { - onInitialize(); - } - }, [initialized, onInitialize]); + useEffect(() => { + if (!initialized) { + onInitialize(); + } + }, [initialized, onInitialize]); - return initialized; + return initialized; } ``` diff --git a/package.json b/package.json index 4be6ae9..7cf8d71 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "prepare": "husky" }, "dependencies": { - "@cerc-io/registry-sdk": "^0.2.3", + "@cerc-io/registry-sdk": "^0.2.4", "@cosmjs/amino": "^0.32.3", "@cosmjs/crypto": "^0.32.3", "@cosmjs/proto-signing": "^0.32.3", diff --git a/src/context/WalletConnectContext.tsx b/src/context/WalletConnectContext.tsx index fe20895..34b6d5f 100644 --- a/src/context/WalletConnectContext.tsx +++ b/src/context/WalletConnectContext.tsx @@ -1,10 +1,10 @@ import React, { createContext, useContext, useEffect, useState } from 'react'; import { SessionTypes } from '@walletconnect/types'; +import { IWeb3Wallet } from '@walletconnect/web3wallet'; import { WalletConnectContextProps } from '../types'; import useInitialization from '../hooks/useInitialization'; -import { IWeb3Wallet } from '@walletconnect/web3wallet'; const WalletConnectContext = createContext({ activeSessions: {}, diff --git a/src/hooks/useInitialization.ts b/src/hooks/useInitialization.ts index 3407f9e..282f320 100644 --- a/src/hooks/useInitialization.ts +++ b/src/hooks/useInitialization.ts @@ -1,7 +1,9 @@ import { useCallback, useEffect, useState } from 'react'; -import { createWeb3Wallet } from '../utils/wallet-connect/WalletConnectUtils'; + import { IWeb3Wallet } from '@walletconnect/web3wallet'; +import { createWeb3Wallet } from '../utils/wallet-connect/WalletConnectUtils'; + export default function useInitialization( setWeb3wallet: React.Dispatch>, ) { diff --git a/yarn.lock b/yarn.lock index 8157702..f1ae519 100644 --- a/yarn.lock +++ b/yarn.lock @@ -752,10 +752,10 @@ deepmerge "^3.2.0" hoist-non-react-statics "^3.3.0" -"@cerc-io/registry-sdk@^0.2.3": - version "0.2.3" - resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.3/registry-sdk-0.2.3.tgz#73e955b4d49d7c97eea40c351bbc21f98bb330f9" - integrity sha512-8fXRdyiTXn8WsJ8r3DCSBYzUBNEZYPPk5JGUrEmkGQhKOJr+ZeakN+2t6HrqEVB9IMYTJK9BtVLPA0KlaXILYA== +"@cerc-io/registry-sdk@^0.2.4": + version "0.2.4" + resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.4/registry-sdk-0.2.4.tgz#60e4e75b1e6a957cf2b97490af4fda4af07b105f" + integrity sha512-hRZJP+s+uBvfrqtmQ38pmf74SyfFDC65AVwvWigJGxc6uKJG4jyuMyhsoD1P4XkjwAQSnFO89TuDC5JGkdXyrA== dependencies: "@cosmjs/amino" "^0.28.1" "@cosmjs/crypto" "^0.28.1"