From ea60e8e1842cebbb018dc084638ca22ffa9d97a3 Mon Sep 17 00:00:00 2001 From: Grant Steuart Date: Wed, 20 Jul 2022 16:11:24 -0500 Subject: [PATCH] feat: walletconnect wallet (#1733) * feat: init walletconnect integration * chore: lint * fix: wallet init * fix: wallet init * fix: add imagedelivery to headers * chore: use package version * chore: show/hide WalletConnect based on flag * fix: headers for macos/ios safari * fix: show feature flag nav item for alt host * perf: add env var for better local development * chore: remove unecessary code * chore: remove package dep * chore: add hdwallet-walletconnect alpha dependency * fix: add walletconnect csp entries * fix: utilize feature flag * fix: add mobileEnabled field to WalletConnect config * chore: run linter * fix: remove usage of process.env * chore: run linter * fix: apply code review suggestions * fix: use structured logging * fix: apply code review suggestions * fix: update csp for wallet logos * chore: add flag to sample.env * chore: yarn.lock * docs: fleek info * fix: img source csp * chore: revert readme to develop * fix: image fetched by walletconnect * feat: WalletConnect rejection * chore: lint * chore: lint * chore: update hdwallet-walletconnect dependency * chore: upgrade hdwallet-walletconnect * fix: set wc connect modal error to null on init * chore: run linter * fix: walletconnect refresh bug * chore: upgrade hdwallet dependency * chore: bump hdwallet dependencies * fix: csp for walletconnect desktop logos * chore: bump hdwallet package versions * fix: disable trade max with walletconnect * fix: disable sendmax with walletconnect * chore: run linter * chore: update hdwallet dependencies * chore: run linter * fix: hide fiat sendMax with WalletConnect * fix: stylistic changes * fix: typo * feat: add copy to walletconnect option in selectmodal * fix: constrain icon width for selectmodal options * fix: update return value Co-authored-by: pastaghost Co-authored-by: 0xdef1cafe <88504456+0xdef1cafe@users.noreply.github.com> --- package.json | 2 + public/index.html | 5 +- .../headers/csps/wallets/walletconnect.ts | 9 + sample.env | 4 + src/Routes/RoutesCommon.tsx | 5 +- src/assets/translations/en/main.json | 18 +- src/assets/translations/es/main.json | 15 + src/assets/translations/fr/main.json | 15 + src/assets/translations/id/main.json | 15 + src/assets/translations/ko/main.json | 15 + src/assets/translations/pt/main.json | 16 + src/assets/translations/ru/main.json | 15 + src/assets/translations/zh/main.json | 15 + src/components/Icons/WalletConnectIcon.tsx | 19 + src/components/Modals/Send/views/Details.tsx | 15 +- src/components/Trade/TradeInput.tsx | 24 +- src/config.ts | 2 + src/context/WalletProvider/KeyManager.ts | 1 + src/context/WalletProvider/SelectModal.tsx | 19 +- .../WalletProvider/WalletConnect/Error.ts | 4 + .../WalletConnect/components/Connect.tsx | 111 ++++++ .../WalletConnect/components/Failure.tsx | 10 + .../WalletProvider/WalletConnect/config.ts | 9 + src/context/WalletProvider/WalletProvider.tsx | 49 ++- src/context/WalletProvider/config.ts | 10 + .../preferencesSlice/preferencesSlice.ts | 2 + src/test/mocks/store.ts | 2 + yarn.lock | 374 +++++++++++++++++- 28 files changed, 760 insertions(+), 40 deletions(-) create mode 100644 react-app-rewired/headers/csps/wallets/walletconnect.ts create mode 100644 src/components/Icons/WalletConnectIcon.tsx create mode 100644 src/context/WalletProvider/WalletConnect/Error.ts create mode 100644 src/context/WalletProvider/WalletConnect/components/Connect.tsx create mode 100644 src/context/WalletProvider/WalletConnect/components/Failure.tsx create mode 100644 src/context/WalletProvider/WalletConnect/config.ts diff --git a/package.json b/package.json index 11f6197d8e1..ba3cd032856 100644 --- a/package.json +++ b/package.json @@ -101,6 +101,7 @@ "@shapeshiftoss/hdwallet-native-vault": "^1.27.0", "@shapeshiftoss/hdwallet-portis": "^1.27.0", "@shapeshiftoss/hdwallet-tallyho": "^1.27.0", + "@shapeshiftoss/hdwallet-walletconnect": "^1.27.0", "@shapeshiftoss/hdwallet-xdefi": "^1.27.0", "@shapeshiftoss/investor-foxy": "^4.0.4", "@shapeshiftoss/investor-yearn": "^4.0.4", @@ -117,6 +118,7 @@ "@visx/responsive": "^2.10.0", "@visx/shape": "^2.10.0", "@visx/tooltip": "^2.10.0", + "@walletconnect/web3-provider": "^1.7.8", "allsettled-polyfill": "^1.0.4", "axios": "^0.26.1", "bignumber.js": "^9.0.2", diff --git a/public/index.html b/public/index.html index a9e4cf563d3..f1f9ff5e581 100644 --- a/public/index.html +++ b/public/index.html @@ -5,6 +5,9 @@ + + + @@ -19,8 +22,6 @@ name="description" content="ShapeShift DAO | Your Web3 & DeFi Portal" /> - -