Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove WC v1 #6214

Merged
merged 33 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c10dbf8
Remove handling of WC v1 deeplinks
jinchung Oct 18, 2024
6c7ee91
Remove AppStateChangeHandler which was just refreshing WC v1 on app s…
jinchung Oct 18, 2024
c720e1e
Remove WC v1 load state in refresh account data
jinchung Oct 18, 2024
b4b821e
Remove WC v1 load state from load account data hook
jinchung Oct 18, 2024
ad0f269
Remove v1 redux/walletconnect mock from walletConnect test
jinchung Oct 18, 2024
ed0dc63
Remove WC v1 test from skipped deeplinks test
jinchung Oct 18, 2024
0da3012
Remove unused useTransactionConfirmation hook
jinchung Oct 18, 2024
92c74aa
Move WC related types to walletConnect/types from redux
jinchung Oct 18, 2024
5131fd3
Remove use of useWalletConnectConnections hook for WC v1
jinchung Oct 18, 2024
613ba2c
Remove use of redux walletconnect in requestNavigationHandlers
jinchung Oct 18, 2024
25c0de5
Remove WC v1 handle wallet notif logic
jinchung Oct 18, 2024
3be44fb
Remove removeRequest function usage
jinchung Oct 18, 2024
2462687
Remove walletconnect redux
jinchung Oct 18, 2024
d6ceb76
Remove requests redux reset in init wallet
jinchung Oct 18, 2024
2496913
Remove redux requests load state in load account data
jinchung Oct 18, 2024
a792b2f
Move some request types to walletConnect types
jinchung Oct 18, 2024
19838bc
Use WC types that were moved to walletConnect types in requestNavHandler
jinchung Oct 18, 2024
2164b25
Move out types from requests to walletConnect
jinchung Oct 21, 2024
a6b3ea3
Remove requests redux
jinchung Oct 21, 2024
9db31e8
Remove useRequests hook and replace with new wc requests store
jinchung Oct 21, 2024
d884033
Update walletConnect v2 to use new requests store
jinchung Oct 21, 2024
0a6609e
Add support for removing requests in new wc requests store
jinchung Oct 21, 2024
6ba4712
Update RequestCoinRow to use remove request from new WC requests store
jinchung Oct 21, 2024
519b5d4
Fixup: add WC request
jinchung Oct 21, 2024
a22057e
Fixup: remove wc request
jinchung Oct 21, 2024
95049fc
Fixup: update usage of addNewWalletConnectRequest to exclude account …
jinchung Oct 22, 2024
da4b235
Update usage of removeWalletConnectRequest from walletConnect and Req…
jinchung Oct 22, 2024
0552f11
Use new remove WC requests in requestNavigationHandlers
jinchung Oct 22, 2024
f3799a5
Add sorted WC requests method on store
jinchung Oct 22, 2024
f47b53e
Remove localstorage for wc requests
jinchung Oct 22, 2024
326c170
Update comment for wc deeplink handler
jinchung Oct 22, 2024
a7c7d9f
Remove unused sendRpcCall
jinchung Oct 22, 2024
28b0e37
Remove unused WC active sessions dep
jinchung Oct 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { AppRegistry, Dimensions, LogBox, StyleSheet, View } from 'react-native'
import { Toaster } from 'sonner-native';
import { MobileWalletProtocolProvider } from '@coinbase/mobile-wallet-protocol-host';
import { DeeplinkHandler } from '@/components/DeeplinkHandler';
import { AppStateChangeHandler } from '@/components/AppStateChangeHandler';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing AppStateChangeHandler as it was being used only for WC v1 subscription when coming back from background

import { useApplicationSetup } from '@/hooks/useApplicationSetup';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context';
Expand Down Expand Up @@ -84,7 +83,6 @@ function App({ walletReady }: AppProps) {
</View>
<NotificationsHandler walletReady={walletReady} />
<DeeplinkHandler initialRoute={initialRoute} walletReady={walletReady} />
<AppStateChangeHandler walletReady={walletReady} />
<BackendNetworks />
</Portal>
);
Expand Down
38 changes: 0 additions & 38 deletions src/components/AppStateChangeHandler.tsx

This file was deleted.

7 changes: 1 addition & 6 deletions src/components/asset-list/RecyclerAssetList2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ import { ProfileNameRow } from './profile-header/ProfileNameRow';
import AndroidContextMenu from '@/components/context-menu/ContextMenu.android';
import ContextMenuButton from '@/components/native-context-menu/contextMenu';
import { analytics } from '@/analytics';
import useWalletConnectConnections from '@/hooks/useWalletConnectConnections';
import lang from 'i18n-js';
import { useWalletConnectV2Sessions } from '@/walletConnect/hooks/useWalletConnectV2Sessions';
import { IS_ANDROID } from '@/env';

export type AssetListType = 'wallet' | 'ens-profile' | 'select-nft';
Expand Down Expand Up @@ -150,9 +148,6 @@ function NavbarOverlay({ accentColor, position }: { accentColor?: string; positi

// ////////////////////////////////////////////////////
// Context Menu
const { mostRecentWalletConnectors } = useWalletConnectConnections();
const { sessions: activeWCV2Sessions } = useWalletConnectV2Sessions();

const menuConfig = React.useMemo(
() => ({
menuItems: [
Expand All @@ -175,7 +170,7 @@ function NavbarOverlay({ accentColor, position }: { accentColor?: string; positi
].filter(Boolean),
...(ios ? { menuTitle: '' } : {}),
}),
[activeWCV2Sessions.length, mostRecentWalletConnectors.length]
[]
);

const handlePressMenuItem = React.useCallback(
Expand Down
10 changes: 5 additions & 5 deletions src/components/coin-row/RequestCoinRow.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { addHours, differenceInMinutes, isPast } from 'date-fns';
import lang from 'i18n-js';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useDispatch } from 'react-redux';
import { useTheme } from '../../theme/ThemeContext';
import { ButtonPressAnimation } from '../animations';
import { RequestCoinIcon } from '../coin-icon';
import { RowWithMargins } from '../layout';
import { Emoji, Text } from '../text';
import CoinName from './CoinName';
import CoinRow from './CoinRow';
import { removeRequest } from '@/redux/requests';
import styled from '@/styled-thing';
import { handleWalletConnectRequest } from '@/utils/requestNavigationHandlers';
import { removeWalletConnectRequest } from '@/state/walletConnectRequests';

const getPercentageOfTimeElapsed = (startDate, endDate) => {
const originalDifference = differenceInMinutes(endDate, startDate);
Expand Down Expand Up @@ -48,7 +47,6 @@ const TopRow = ({ expirationColor, expiresAt }) => {

const RequestCoinRow = ({ item, ...props }) => {
const buttonRef = useRef();
const dispatch = useDispatch();
const [expiresAt, setExpiresAt] = useState(null);
const [expirationColor, setExpirationColor] = useState(null);
const [percentElapsed, setPercentElapsed] = useState(null);
Expand All @@ -67,9 +65,11 @@ const RequestCoinRow = ({ item, ...props }) => {

const handleExpiredRequests = useCallback(() => {
if (isPast(expiresAt)) {
dispatch(removeRequest(item.requestId));
removeWalletConnectRequest({
walletConnectRequestId: item.requestId,
});
}
}, [dispatch, expiresAt, item.requestId]);
}, [expiresAt, item.requestId]);

const handlePressOpen = useCallback(() => {
handleWalletConnectRequest(item);
Expand Down
41 changes: 0 additions & 41 deletions src/components/qrcode-scanner/ConnectedDapps.tsx

This file was deleted.

8 changes: 2 additions & 6 deletions src/components/qrcode-scanner/EmulatorPasteUriButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,21 @@ import React, { useCallback } from 'react';
import { Alert } from 'react-native';
import { useIsEmulator } from 'react-native-device-info';
import { Button } from '../buttons';
import { useWalletConnectConnections } from '@/hooks';
import { pair as pairWalletConnect } from '@/walletConnect';
import { parseUri } from '@walletconnect/utils';

export default function EmulatorPasteUriButton() {
const { result: isEmulator } = useIsEmulator();
const { walletConnectOnSessionRequest } = useWalletConnectConnections();
const { colors } = useTheme();

const handlePastedUri = useCallback(
uri => {
const { version } = parseUri(uri);
if (version === 1) {
walletConnectOnSessionRequest(uri);
} else if (version === 2) {
if (version === 2) {
pairWalletConnect({ uri });
}
},
[pairWalletConnect, walletConnectOnSessionRequest]
[pairWalletConnect]
);

const handlePressPasteSessionUri = useCallback(() => {
Expand Down
44 changes: 0 additions & 44 deletions src/components/walletconnect-list/WalletConnectList.js

This file was deleted.

Loading
Loading