diff --git a/package.json b/package.json index 8d3a09635..4935303b3 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,6 @@ "@rsksmart/rsk-contract-metadata": "^1.0.17", "@rsksmart/rsk-testnet-contract-metadata": "^1.0.15", "@rsksmart/rsk-utils": "^1.1.0", - "@walletconnect/client": "^1.6.6", "@walletconnect/jsonrpc-types": "^1.0.3", "@walletconnect/react-native-compat": "^2.9.0", "@walletconnect/utils": "^2.9.0", diff --git a/src/navigation/rootNavigator/index.tsx b/src/navigation/rootNavigator/index.tsx index 79acc00d6..fe9528a3f 100644 --- a/src/navigation/rootNavigator/index.tsx +++ b/src/navigation/rootNavigator/index.tsx @@ -15,8 +15,8 @@ import { sharedStyles } from 'shared/constants' import { ActivityScreen, ScanQRScreen, - WalletConnectScreen, PinScreen, + WalletConnectScreenWithProvider, } from 'screens/index' import { OfflineScreen } from 'core/components/OfflineScreen' @@ -92,7 +92,7 @@ export const RootNavigationComponent = () => { /> <RootTabs.Screen name={rootTabsRouteNames.WalletConnect} - component={WalletConnectScreen} + component={WalletConnectScreenWithProvider} /> <RootTabs.Screen name={rootTabsRouteNames.Settings} diff --git a/src/screens/index.ts b/src/screens/index.ts index 6f92e803c..4cc5d15aa 100644 --- a/src/screens/index.ts +++ b/src/screens/index.ts @@ -3,7 +3,10 @@ export { ReceiveScreen } from './receive/ReceiveScreen' export { ActivityScreen } from './activity/ActivityScreen' export { ShowMnemonicScreen } from './info/ShowMnemonicScreen' export { RelayDeployScreen } from './settings/RelayDeployScreen' -export { WalletConnectScreenWithProviders as WalletConnectScreen } from './walletConnect' +export { + WalletConnectScreen, + WalletConnectScreenWithProvider, +} from './walletConnect' export { ScanQRScreen } from './walletConnect/ScanQRScreen' export { ChangeLanguageScreen } from './settings/ChangeLanguageScreen' export { SearchDomainScreen } from './rnsManager/SearchDomainScreen' diff --git a/src/screens/walletConnect/WalletConnectContext.tsx b/src/screens/walletConnect/WalletConnectContext.tsx deleted file mode 100644 index 4c563fadd..000000000 --- a/src/screens/walletConnect/WalletConnectContext.tsx +++ /dev/null @@ -1,231 +0,0 @@ -import { useNavigation } from '@react-navigation/core' -import WalletConnect from '@walletconnect/client' -import { - useEffect, - useState, - createContext, - ReactElement, - useCallback, -} from 'react' -import { RIFWallet } from '@rsksmart/rif-wallet-core' -import { WalletConnectAdapter } from '@rsksmart/rif-wallet-adapters' - -import { - deleteWCSession, - getWCSession, - IWCSession, - saveWCSession, -} from 'storage/WalletConnectSessionStore' -import { useAppSelector } from 'store/storeUtils' -import { selectWallet } from 'store/slices/settingsSlice' - -export interface WalletConnectContextInterface { - connections: IWalletConnectConnections - createSession: (wallet: RIFWallet, uri: string, session?: IWCSession) => void - handleApprove: (wc: WalletConnect, wallet: RIFWallet | null) => Promise<void> - handleReject: (wc: WalletConnect) => void -} - -export const WalletConnectContext = - createContext<WalletConnectContextInterface>({ - connections: {}, - createSession: () => {}, - handleApprove: async () => {}, - handleReject: () => {}, - }) - -export interface IWalletConnectConnections { - [key: string]: { - connector: WalletConnect - address: string - } -} - -interface Props { - children: ReactElement -} - -export const WalletConnectProviderElement = ({ children }: Props) => { - const navigation = useNavigation() - - const [connections, setConnections] = useState<IWalletConnectConnections>({}) - - const wallet = useAppSelector(selectWallet) - - const unsubscribeToEvents = async (wc: WalletConnect) => { - const eventsNames = [ - 'session_request', - 'session_update', - 'call_request', - 'connect', - 'disconnect', - ] - - eventsNames.forEach(x => wc.off(x)) - } - - const subscribeToEvents = useCallback( - async (wc: WalletConnect, adapter: WalletConnectAdapter) => { - await unsubscribeToEvents(wc) - wc.on('session_request', async (error, payload) => { - console.log({ - 1: 'EVENT: 69', - 2: 'session_request', - 3: error, - 4: payload, - }) - - if (error) { - throw error - } - - navigation.navigate( - 'WalletConnect' as never, - { wcKey: wc.key } as never, - ) - }) - wc.on('call_request', async (error, payload) => { - console.log({ 1: 'EVENT: 82', 2: 'call_request', 3: error, 4: payload }) - if (error) { - throw error - } - if (!adapter) { - throw new Error('Missing adapter') - } - - const { id, method, params } = payload - - adapter - .handleCall(method, params) - .then(result => wc.approveRequest({ id, result })) - .catch((errorReason: string) => - wc.rejectRequest({ id, error: { message: errorReason } }), - ) - }) - wc.on('disconnect', async error => { - console.log('EVENT: 100', 'disconnect', error) - if (error) { - throw error - } - - await unsubscribeToEvents(wc) - deleteWCSession(wc.uri) - setConnections(prev => { - const result = { ...prev } - delete result[wc.key] - return result - }) - }) - }, - [navigation], - ) - const handleApprove = async ( - wc: WalletConnect, - _wallet: RIFWallet | null, - ) => { - try { - if (wc && wallet) { - wc.approveSession({ - accounts: [wallet.smartWalletAddress], - chainId: await wallet.getChainId(), - }) - saveWCSession({ - key: wc.key, - uri: wc.uri, - session: wc.session, - walletAddress: wallet.address, - }) - const adapter = new WalletConnectAdapter(wallet) - await subscribeToEvents(wc, adapter) - setConnections(prev => ({ - ...prev, - [wc.key]: { - connector: wc, - address: wallet.address, - }, - })) - } - } catch (err) { - console.log(143, err) - } - } - - const handleReject = (wc: WalletConnect) => { - if (wc) { - wc.rejectSession({ message: 'user rejected the session' }) - } - } - - const createSession = useCallback( - (_wallet: RIFWallet, uri: string, session?: IWCSession) => { - try { - const newConnector = new WalletConnect({ - uri, - session, - clientMeta: { - description: 'RIF Wallet', - url: 'https://www.rifos.org/', - icons: [ - 'https://raw.githubusercontent.com/rsksmart/rif-scheduler-ui/develop/src/assets/logoColor.svg', - ], - name: 'RIF Wallet', - }, - }) - const adapter = new WalletConnectAdapter(_wallet) - - // needs to subscribe to events before createSession - // this is because we need the 'session_request' event - subscribeToEvents(newConnector, adapter) - - setConnections(prev => ({ - ...prev, - [newConnector.key]: { - connector: newConnector, - address: _wallet.address, - }, - })) - } catch (error) { - console.error(error) - } - }, - [subscribeToEvents], - ) - useEffect(() => { - const reconnectWCSession = async () => { - const storedSessions = getWCSession() - if (!storedSessions) { - return - } - - const sessions = Object.values(storedSessions) - - for (const { uri, session } of sessions) { - try { - if (wallet) { - createSession(wallet, uri, session) - } - } catch (error) { - console.error('reconnect wc error: ', error) - deleteWCSession(uri) - } - } - } - if (wallet) { - reconnectWCSession() - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [wallet]) - - const initialContext: WalletConnectContextInterface = { - connections, - createSession, - handleApprove, - handleReject, - } - - return ( - <WalletConnectContext.Provider value={initialContext}> - {children} - </WalletConnectContext.Provider> - ) -} diff --git a/src/screens/walletConnect/index.tsx b/src/screens/walletConnect/index.tsx index 357878d39..7328d4368 100644 --- a/src/screens/walletConnect/index.tsx +++ b/src/screens/walletConnect/index.tsx @@ -1,5 +1,4 @@ -import WalletConnect from '@walletconnect/client' -import { ComponentType, useContext, useEffect, useMemo, useState } from 'react' +import { useContext, useEffect, useMemo, useState, ComponentType } from 'react' import { useTranslation } from 'react-i18next' import { Alert, Image, ScrollView, StyleSheet, View } from 'react-native' @@ -11,50 +10,39 @@ import { } from 'navigation/rootNavigator/types' import { sharedColors } from 'shared/constants' import { castStyle } from 'shared/utils' -import { deleteWCSession } from 'storage/WalletConnectSessionStore' import { selectWalletState } from 'store/slices/settingsSlice' import { useAppSelector } from 'store/storeUtils' import { DappItem } from './DappItem' -import { - WalletConnectContext, - WalletConnectProviderElement, -} from './WalletConnectContext' import { SessionStruct, WalletConnect2Context, WalletConnect2Provider, } from './WalletConnect2Context' -type Props = RootTabsScreenProps<rootTabsRouteNames.WalletConnect> - -interface MergedWCSession { - key: string - wc: WalletConnect | SessionStruct - name?: string - url?: string -} - -const withWalletConnectProviders = +const withWalletConnectProvider = <P extends object>(Component: ComponentType<P>) => (props: P) => { const { wallet } = useAppSelector(selectWalletState) return ( - <WalletConnectProviderElement> - <WalletConnect2Provider wallet={wallet}> - <Component {...props} /> - </WalletConnect2Provider> - </WalletConnectProviderElement> + <WalletConnect2Provider wallet={wallet}> + <Component {...props} /> + </WalletConnect2Provider> ) } -const WalletConnectScreen = ({ route }: Props) => { - const { wallet } = useAppSelector(selectWalletState) - const wcKey = route.params?.data +type Props = RootTabsScreenProps<rootTabsRouteNames.WalletConnect> + +interface WC2Session { + key: string + wc: SessionStruct + name?: string + url?: string +} +export const WalletConnectScreen = ({ route }: Props) => { const { t } = useTranslation() - const { connections, handleApprove, handleReject, createSession } = - useContext(WalletConnectContext) + const { pendingSession, error: walletConnect2Error, @@ -65,16 +53,10 @@ const WalletConnectScreen = ({ route }: Props) => { onUserRejectedSession, onCreateNewSession, } = useContext(WalletConnect2Context) - const [disconnectingWC, setDisconnectingWC] = - useState<MergedWCSession | null>(null) - - const openedConnections = useMemo( - () => Object.values(connections).filter(({ connector: c }) => c.connected), - [connections], + const [disconnectingWC, setDisconnectingWC] = useState<WC2Session | null>( + null, ) - const pendingConnector = wcKey ? connections[wcKey]?.connector : null - /** * useEffect that watches when we pass data to the route params and connects user depending on WC version */ @@ -82,9 +64,7 @@ const WalletConnectScreen = ({ route }: Props) => { // When data exists - handle the case if (route.params?.data) { const { data } = route.params - if (data.includes('@1')) { - createSession(wallet, data) - } else if (data.includes('@2')) { + if (data.includes('@2')) { // WalletConnect 2.0 onCreateNewSession(data) } @@ -92,28 +72,13 @@ const WalletConnectScreen = ({ route }: Props) => { // eslint-disable-next-line react-hooks/exhaustive-deps }, [route.params?.data]) - const handleDisconnectSession = (mergedWc: MergedWCSession) => async () => { - if ('topic' in mergedWc.wc) { - try { - await onDisconnectSession(mergedWc.wc) - setDisconnectingWC(null) - } catch (err) { - // @TODO handle error disconnecting - console.log(63, 'WC2.0 error disconnect', err) - } - } else { - const { wc } = mergedWc - try { - const key = wc.key - await wc.killSession() - deleteWCSession(key) - setDisconnectingWC(null) - } catch (err) { - // Error disconnecting session - if (err instanceof Error || typeof err === 'string') { - console.log(53, err.toString()) - } - } + const handleDisconnectSession = (mergedWc: WC2Session) => async () => { + try { + await onDisconnectSession(mergedWc.wc) + setDisconnectingWC(null) + } catch (err) { + // @TODO handle error disconnecting + console.log(63, 'WC2.0 error disconnect', err) } } @@ -127,117 +92,88 @@ const WalletConnectScreen = ({ route }: Props) => { } }, [walletConnect2Error, t, setWalletConnect2Error]) - const onWCDisconnect = (wc: MergedWCSession) => () => setDisconnectingWC(wc) + const onWCDisconnect = (wc: WC2Session) => () => setDisconnectingWC(wc) - const mergedWalletConnectSessions: MergedWCSession[] = useMemo( + const wc2Sessions: WC2Session[] = useMemo( () => - [...openedConnections, ...sessions].map(session => { - if ('connector' in session) { - return { - name: session.connector.peerMeta?.name, - url: session.connector.peerMeta?.url, - key: session.connector.key, - wc: session.connector, - } - } else { - return { - name: session.peer.metadata.name, - url: session.peer.metadata.url, - key: session.topic, - wc: session, - } + [...sessions].map(session => { + return { + name: session.peer.metadata.name, + url: session.peer.metadata.url, + key: session.topic, + wc: session, } }), - [openedConnections, sessions], + [sessions], ) return ( - <WalletConnectProviderElement> - <WalletConnect2Provider wallet={wallet}> - <View style={styles.parent}> - <View style={styles.header}> - <View style={styles.innerHeader1}> - <Typography type="h2">{t('dapps_title')}</Typography> - <Typography type="h5" style={styles.subtitle}> - {t('dapps_instructions')} - </Typography> - </View> - <View style={styles.innerHeader2} /> - </View> - - {mergedWalletConnectSessions.length === 0 ? ( - <> - <Image - source={require('src/images/empty-dapps.png')} - style={styles.noDappsImage} - /> - </> - ) : ( - <ScrollView style={styles.dappsList}> - {mergedWalletConnectSessions.map(session => ( - <DappItem - key={session.key} - name={session.name} - url={session.url} - isDisconnecting={session === disconnectingWC} - onDisconnect={onWCDisconnect(session)} - /> - ))} - </ScrollView> - )} - - {pendingConnector ? ( - <ConfirmationModal - isVisible={!pendingConnector.connected} - title={t('dapps_confirmation_title')} - description={`${t('dapps_confirmation_description')}${ - pendingConnector.peerMeta?.name - ? ` ${pendingConnector.peerMeta?.name}` - : '' - }?`} - okText={t('dapps_confirmation_button_connect')} - cancelText={t('dapps_confirmation_button_cancel')} - onOk={() => handleApprove(pendingConnector, wallet)} - onCancel={() => handleReject(pendingConnector)} - /> - ) : null} - - {pendingSession ? ( - <ConfirmationModal - isVisible - title={t('dapps_confirmation_title')} - description={`${t('dapps_confirmation_description')}${ - pendingSession.proposal.params.proposer.metadata.name - ? ` ${pendingSession.proposal.params.proposer.metadata.name}` - : '' - }?`} - okText={t('dapps_confirmation_button_connect')} - cancelText={t('dapps_confirmation_button_cancel')} - onOk={onUserApprovedSession} - onCancel={onUserRejectedSession} - /> - ) : null} - - {disconnectingWC ? ( - <ConfirmationModal - isVisible={Boolean(disconnectingWC)} - title={t('dapps_confirm_disconnection_title')} - description={`${t('dapps_confirm_disconnection_description')}${ - disconnectingWC.name ? ` ${disconnectingWC.name}` : '' - }?`} - okText={t('dapps_confirm_disconnection_confirm')} - cancelText={t('dapps_confirm_disconnection_cancel')} - onOk={handleDisconnectSession(disconnectingWC)} - onCancel={() => setDisconnectingWC(null)} - /> - ) : null} + <View style={styles.parent}> + <View style={styles.header}> + <View style={styles.innerHeader1}> + <Typography type="h2">{t('dapps_title')}</Typography> + <Typography type="h5" style={styles.subtitle}> + {t('dapps_instructions')} + </Typography> </View> - </WalletConnect2Provider> - </WalletConnectProviderElement> + <View style={styles.innerHeader2} /> + </View> + + {wc2Sessions.length === 0 ? ( + <> + <Image + source={require('src/images/empty-dapps.png')} + style={styles.noDappsImage} + /> + </> + ) : ( + <ScrollView style={styles.dappsList}> + {wc2Sessions.map(session => ( + <DappItem + key={session.key} + name={session.name} + url={session.url} + isDisconnecting={session === disconnectingWC} + onDisconnect={onWCDisconnect(session)} + /> + ))} + </ScrollView> + )} + + {pendingSession ? ( + <ConfirmationModal + isVisible + title={t('dapps_confirmation_title')} + description={`${t('dapps_confirmation_description')}${ + pendingSession.proposal.params.proposer.metadata.name + ? ` ${pendingSession.proposal.params.proposer.metadata.name}` + : '' + }?`} + okText={t('dapps_confirmation_button_connect')} + cancelText={t('dapps_confirmation_button_cancel')} + onOk={onUserApprovedSession} + onCancel={onUserRejectedSession} + /> + ) : null} + + {disconnectingWC ? ( + <ConfirmationModal + isVisible={Boolean(disconnectingWC)} + title={t('dapps_confirm_disconnection_title')} + description={`${t('dapps_confirm_disconnection_description')}${ + disconnectingWC.name ? ` ${disconnectingWC.name}` : '' + }?`} + okText={t('dapps_confirm_disconnection_confirm')} + cancelText={t('dapps_confirm_disconnection_cancel')} + onOk={handleDisconnectSession(disconnectingWC)} + onCancel={() => setDisconnectingWC(null)} + /> + ) : null} + </View> ) } -export const WalletConnectScreenWithProviders = - withWalletConnectProviders(WalletConnectScreen) +export const WalletConnectScreenWithProvider = + withWalletConnectProvider(WalletConnectScreen) const styles = StyleSheet.create({ parent: castStyle.view({ diff --git a/yarn.lock b/yarn.lock index 3d854be4e..a15028df8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2874,27 +2874,6 @@ events "^3.3.0" isomorphic-unfetch "^3.1.0" -"@walletconnect/browser-utils@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@walletconnect/browser-utils/-/browser-utils-1.8.0.tgz#33c10e777aa6be86c713095b5206d63d32df0951" - integrity sha512-Wcqqx+wjxIo9fv6eBUFHPsW1y/bGWWRboni5dfD8PtOmrihrEpOCmvRJe4rfl7xgJW8Ea9UqKEaq0bIRLHlK4A== - dependencies: - "@walletconnect/safe-json" "1.0.0" - "@walletconnect/types" "^1.8.0" - "@walletconnect/window-getters" "1.0.0" - "@walletconnect/window-metadata" "1.0.0" - detect-browser "5.2.0" - -"@walletconnect/client@^1.6.6": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@walletconnect/client/-/client-1.8.0.tgz#6f46b5499c7c861c651ff1ebe5da5b66225ca696" - integrity sha512-svyBQ14NHx6Cs2j4TpkQaBI/2AF4+LXz64FojTjMtV4VMMhl81jSO1vNeg+yYhQzvjcGH/GpSwixjyCW0xFBOQ== - dependencies: - "@walletconnect/core" "^1.8.0" - "@walletconnect/iso-crypto" "^1.8.0" - "@walletconnect/types" "^1.8.0" - "@walletconnect/utils" "^1.8.0" - "@walletconnect/core@2.9.0", "@walletconnect/core@^2.7.2": version "2.9.0" resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.9.0.tgz#7837a5d015a22b48d35b987bcde2aa9ccdf300d8" @@ -2917,39 +2896,6 @@ lodash.isequal "4.5.0" uint8arrays "^3.1.0" -"@walletconnect/core@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-1.8.0.tgz#6b2748b90c999d9d6a70e52e26a8d5e8bfeaa81e" - integrity sha512-aFTHvEEbXcZ8XdWBw6rpQDte41Rxwnuk3SgTD8/iKGSRTni50gI9S3YEzMj05jozSiOBxQci4pJDMVhIUMtarw== - dependencies: - "@walletconnect/socket-transport" "^1.8.0" - "@walletconnect/types" "^1.8.0" - "@walletconnect/utils" "^1.8.0" - -"@walletconnect/crypto@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@walletconnect/crypto/-/crypto-1.0.2.tgz#3fcc2b2cde6f529a19eadd883dc555cd0e861992" - integrity sha512-+OlNtwieUqVcOpFTvLBvH+9J9pntEqH5evpINHfVxff1XIgwV55PpbdvkHu6r9Ib4WQDOFiD8OeeXs1vHw7xKQ== - dependencies: - "@walletconnect/encoding" "^1.0.1" - "@walletconnect/environment" "^1.0.0" - "@walletconnect/randombytes" "^1.0.2" - aes-js "^3.1.2" - hash.js "^1.1.7" - -"@walletconnect/encoding@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@walletconnect/encoding/-/encoding-1.0.1.tgz#93c18ce9478c3d5283dbb88c41eb2864b575269a" - integrity sha512-8opL2rs6N6E3tJfsqwS82aZQDL3gmupWUgmvuZ3CGU7z/InZs3R9jkzH8wmYtpbq0sFK3WkJkQRZFFk4BkrmFA== - dependencies: - is-typedarray "1.0.0" - typedarray-to-buffer "3.1.5" - -"@walletconnect/environment@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@walletconnect/environment/-/environment-1.0.0.tgz#c4545869fa9c389ec88c364e1a5f8178e8ab5034" - integrity sha512-4BwqyWy6KpSvkocSaV7WR3BlZfrxLbJSLkg+j7Gl6pTDE+U55lLhJvQaMuDVazXYxcjBsG09k7UlH7cGiUI5vQ== - "@walletconnect/environment@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@walletconnect/environment/-/environment-1.0.1.tgz#1d7f82f0009ab821a2ba5ad5e5a7b8ae3b214cd7" @@ -2974,15 +2920,6 @@ "@walletconnect/time" "^1.0.2" tslib "1.14.1" -"@walletconnect/iso-crypto@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@walletconnect/iso-crypto/-/iso-crypto-1.8.0.tgz#44ddf337c4f02837c062dbe33fa7ab36789df451" - integrity sha512-pWy19KCyitpfXb70hA73r9FcvklS+FvO9QUIttp3c2mfW8frxgYeRXfxLRCIQTkaYueRKvdqPjbyhPLam508XQ== - dependencies: - "@walletconnect/crypto" "^1.0.2" - "@walletconnect/types" "^1.8.0" - "@walletconnect/utils" "^1.8.0" - "@walletconnect/jsonrpc-provider@1.0.13": version "1.0.13" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-provider/-/jsonrpc-provider-1.0.13.tgz#9a74da648d015e1fffc745f0c7d629457f53648b" @@ -3000,13 +2937,6 @@ keyvaluestorage-interface "^1.0.0" tslib "1.14.1" -"@walletconnect/jsonrpc-types@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.1.tgz#a96b4bb2bcc8838a70e06f15c1b5ab11c47d8e95" - integrity sha512-+6coTtOuChCqM+AoYyi4Q83p9l/laI6NvuM2/AHaZFuf0gT0NjW7IX2+86qGyizn7Ptq4AYZmfxurAxTnhefuw== - dependencies: - keyvaluestorage-interface "^1.0.0" - "@walletconnect/jsonrpc-utils@1.0.8", "@walletconnect/jsonrpc-utils@^1.0.6", "@walletconnect/jsonrpc-utils@^1.0.7", "@walletconnect/jsonrpc-utils@^1.0.8": version "1.0.8" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-utils/-/jsonrpc-utils-1.0.8.tgz#82d0cc6a5d6ff0ecc277cb35f71402c91ad48d72" @@ -3016,14 +2946,6 @@ "@walletconnect/jsonrpc-types" "^1.0.3" tslib "1.14.1" -"@walletconnect/jsonrpc-utils@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-utils/-/jsonrpc-utils-1.0.3.tgz#5bd49865eef0eae48e8b45a06731dc18691cf8c7" - integrity sha512-3yb49bPk16MNLk6uIIHPSHQCpD6UAo1OMOx1rM8cW/MPEAYAzrSW5hkhG7NEUwX9SokRIgnZK3QuQkiyNzBMhQ== - dependencies: - "@walletconnect/environment" "^1.0.0" - "@walletconnect/jsonrpc-types" "^1.0.1" - "@walletconnect/jsonrpc-ws-connection@1.0.12": version "1.0.12" resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-ws-connection/-/jsonrpc-ws-connection-1.0.12.tgz#2192314884fabdda6d0a9d22e157e5b352025ed8" @@ -3051,15 +2973,6 @@ pino "7.11.0" tslib "1.14.1" -"@walletconnect/randombytes@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@walletconnect/randombytes/-/randombytes-1.0.2.tgz#95c644251a15e6675f58fbffc9513a01486da49c" - integrity sha512-ivgOtAyqQnN0rLQmOFPemsgYGysd/ooLfaDA/ACQ3cyqlca56t3rZc7pXfqJOIETx/wSyoF5XbwL+BqYodw27A== - dependencies: - "@walletconnect/encoding" "^1.0.1" - "@walletconnect/environment" "^1.0.0" - randombytes "^2.1.0" - "@walletconnect/react-native-compat@^2.9.0": version "2.9.0" resolved "https://registry.yarnpkg.com/@walletconnect/react-native-compat/-/react-native-compat-2.9.0.tgz#58fe9a1b838218c4cbe45fc80a556282c65c3bf4" @@ -3088,11 +3001,6 @@ tslib "1.14.1" uint8arrays "^3.0.0" -"@walletconnect/safe-json@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@walletconnect/safe-json/-/safe-json-1.0.0.tgz#12eeb11d43795199c045fafde97e3c91646683b2" - integrity sha512-QJzp/S/86sUAgWY6eh5MKYmSfZaRpIlmCJdi5uG4DJlKkZrHEF7ye7gA+VtbVzvTtpM/gRwO2plQuiooIeXjfg== - "@walletconnect/safe-json@^1.0.1", "@walletconnect/safe-json@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@walletconnect/safe-json/-/safe-json-1.0.2.tgz#7237e5ca48046e4476154e503c6d3c914126fa77" @@ -3115,15 +3023,6 @@ "@walletconnect/utils" "2.9.0" events "^3.3.0" -"@walletconnect/socket-transport@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@walletconnect/socket-transport/-/socket-transport-1.8.0.tgz#9a1128a249628a0be11a0979b522fe82b44afa1b" - integrity sha512-5DyIyWrzHXTcVp0Vd93zJ5XMW61iDM6bcWT4p8DTRfFsOtW46JquruMhxOLeCOieM4D73kcr3U7WtyR4JUsGuQ== - dependencies: - "@walletconnect/types" "^1.8.0" - "@walletconnect/utils" "^1.8.0" - ws "7.5.3" - "@walletconnect/time@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@walletconnect/time/-/time-1.0.2.tgz#6c5888b835750ecb4299d28eecc5e72c6d336523" @@ -3143,11 +3042,6 @@ "@walletconnect/logger" "^2.0.1" events "^3.3.0" -"@walletconnect/types@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-1.8.0.tgz#3f5e85b2d6b149337f727ab8a71b8471d8d9a195" - integrity sha512-Cn+3I0V0vT9ghMuzh1KzZvCkiAxTq+1TR2eSqw5E5AVWfmCtECFkVZBP6uUJZ8YjwLqXheI+rnjqPy7sVM4Fyg== - "@walletconnect/utils@2.9.0", "@walletconnect/utils@^2.7.2", "@walletconnect/utils@^2.9.0": version "2.9.0" resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.9.0.tgz#c73925edb9fefe79021bcf028e957028f986b728" @@ -3168,19 +3062,6 @@ query-string "7.1.3" uint8arrays "^3.1.0" -"@walletconnect/utils@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-1.8.0.tgz#2591a197c1fa7429941fe428876088fda6632060" - integrity sha512-zExzp8Mj1YiAIBfKNm5u622oNw44WOESzo6hj+Q3apSMIb0Jph9X3GDIdbZmvVZsNPxWDL7uodKgZcCInZv2vA== - dependencies: - "@walletconnect/browser-utils" "^1.8.0" - "@walletconnect/encoding" "^1.0.1" - "@walletconnect/jsonrpc-utils" "^1.0.3" - "@walletconnect/types" "^1.8.0" - bn.js "4.11.8" - js-sha3 "0.8.0" - query-string "6.13.5" - "@walletconnect/web3wallet@^1.8.6": version "1.8.6" resolved "https://registry.yarnpkg.com/@walletconnect/web3wallet/-/web3wallet-1.8.6.tgz#445f547111dafb1b673d71f6fef849580a14439b" @@ -3195,11 +3076,6 @@ "@walletconnect/types" "2.9.0" "@walletconnect/utils" "2.9.0" -"@walletconnect/window-getters@1.0.0", "@walletconnect/window-getters@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@walletconnect/window-getters/-/window-getters-1.0.0.tgz#1053224f77e725dfd611c83931b5f6c98c32bfc8" - integrity sha512-xB0SQsLaleIYIkSsl43vm8EwETpBzJ2gnzk7e0wMF3ktqiTGS6TFHxcprMl5R44KKh4tCcHCJwolMCaDSwtAaA== - "@walletconnect/window-getters@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@walletconnect/window-getters/-/window-getters-1.0.1.tgz#f36d1c72558a7f6b87ecc4451fc8bd44f63cbbdc" @@ -3207,13 +3083,6 @@ dependencies: tslib "1.14.1" -"@walletconnect/window-metadata@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@walletconnect/window-metadata/-/window-metadata-1.0.0.tgz#93b1cc685e6b9b202f29c26be550fde97800c4e5" - integrity sha512-9eFvmJxIKCC3YWOL97SgRkKhlyGXkrHwamfechmqszbypFspaSk+t2jQXAEU7YClHF6Qjw5eYOmy1//zFi9/GA== - dependencies: - "@walletconnect/window-getters" "^1.0.0" - "@walletconnect/window-metadata@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@walletconnect/window-metadata/-/window-metadata-1.0.1.tgz#2124f75447b7e989e4e4e1581d55d25bc75f7be5" @@ -3262,11 +3131,6 @@ aes-js@3.0.0: resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== -aes-js@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" - integrity sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ== - ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -3834,11 +3698,6 @@ bn.js@4.11.6: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" integrity sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA== -bn.js@4.11.8: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== - bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" @@ -4656,11 +4515,6 @@ destroy@1.2.0: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== -detect-browser@5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/detect-browser/-/detect-browser-5.2.0.tgz#c9cd5afa96a6a19fda0bbe9e9be48a6b6e1e9c97" - integrity sha512-tr7XntDAu50BVENgQfajMLzacmSe34D+qZc4zjnniz0ZVuw/TZcLcyxHQjYpJTM36sGEkZZlYLnIM1hH7alTMA== - detect-browser@5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/detect-browser/-/detect-browser-5.3.0.tgz#9705ef2bddf46072d0f7265a1fe300e36fe7ceca" @@ -6496,7 +6350,7 @@ is-typed-array@^1.1.10: gopd "^1.0.1" has-tostringtag "^1.0.0" -is-typedarray@1.0.0, is-typedarray@^1.0.0: +is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== @@ -8791,15 +8645,6 @@ qrcode@^1.5.1: pngjs "^5.0.0" yargs "^15.3.1" -query-string@6.13.5: - version "6.13.5" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.13.5.tgz#99e95e2fb7021db90a6f373f990c0c814b3812d8" - integrity sha512-svk3xg9qHR39P3JlHuD7g3nRnyay5mHbrPctEBDUxUkHRifPHXJDhBUycdCC0NBjXoDf44Gb+IsOZL1Uwn8M/Q== - dependencies: - decode-uri-component "^0.2.0" - split-on-first "^1.0.0" - strict-uri-encode "^2.0.0" - query-string@7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.1.3.tgz#a1cf90e994abb113a325804a972d98276fe02328" @@ -10418,7 +10263,7 @@ type-fest@^2.19.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b" integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA== -typedarray-to-buffer@3.1.5, typedarray-to-buffer@^3.1.5: +typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== @@ -10777,11 +10622,6 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== -ws@7.5.3: - version "7.5.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.3.tgz#160835b63c7d97bfab418fc1b8a9fced2ac01a74" - integrity sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg== - ws@^6.1.4: version "6.2.2" resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.2.tgz#dd5cdbd57a9979916097652d78f1cc5faea0c32e"