From 5e80dededeb6c0110bb95e4734cfb7e1857adc45 Mon Sep 17 00:00:00 2001 From: Francisco Date: Tue, 4 Jul 2023 10:10:53 +0200 Subject: [PATCH 1/3] wc 2.0 support --- packages/bridge-ui/package.json | 5 +- packages/bridge-ui/src/chain/chains.ts | 12 +- .../src/components/AddressDropdown.svelte | 3 +- .../BridgeForm/AddCustomERC20.svelte | 2 +- .../components/BridgeForm/BridgeForm.svelte | 3 +- .../components/BridgeForm/SelectChain.svelte | 2 +- .../components/BridgeForm/SelectToken.svelte | 2 +- .../src/components/ChainDropdown.svelte | 2 +- .../src/components/ConnectWallet.svelte | 4 +- .../src/components/Faucet/Faucet.svelte | 2 +- .../src/components/NoticeModal.svelte | 2 +- .../bridge-ui/src/components/Router.svelte | 2 +- .../bridge-ui/src/components/Tabs/Tab.svelte | 2 +- .../bridge-ui/src/components/Tabs/Tabs.svelte | 4 +- .../Transactions/Transaction.svelte | 2 +- .../src/constants/__mocks__/envVars.ts | 2 + packages/bridge-ui/src/constants/envVars.ts | 5 +- packages/bridge-ui/src/domain/chain.ts | 2 +- packages/bridge-ui/src/domain/relayerApi.ts | 2 +- packages/bridge-ui/src/domain/token.ts | 2 +- .../src/relayer-api/RelayerAPIService.spec.ts | 2 +- .../src/relayer-api/RelayerAPIService.ts | 2 +- packages/bridge-ui/src/signer/subscriber.ts | 2 +- .../bridge-ui/src/storage/StorageService.ts | 2 +- .../bridge-ui/src/store/transaction.spec.ts | 2 +- .../bridge-ui/src/utils/getAddressForToken.ts | 2 +- .../bridge-ui/src/utils/switchNetwork.spec.ts | 4 +- packages/bridge-ui/src/utils/switchNetwork.ts | 2 +- packages/bridge-ui/src/vault/tokenVaults.ts | 2 +- packages/bridge-ui/src/vite-env.d.ts | 1 + packages/bridge-ui/src/wagmi/client.ts | 28 +- packages/bridge-ui/src/wagmi/watcher.ts | 2 +- pnpm-lock.yaml | 1807 +++++++++++++++-- 33 files changed, 1674 insertions(+), 246 deletions(-) diff --git a/packages/bridge-ui/package.json b/packages/bridge-ui/package.json index 69d86c3f4d5..4a56cda0053 100644 --- a/packages/bridge-ui/package.json +++ b/packages/bridge-ui/package.json @@ -73,14 +73,13 @@ "@lottiefiles/svelte-lottie-player": "^0.2.0", "@sentry/svelte": "^7.54.0", "@sveltestack/svelte-query": "^1.6.0", - "@wagmi/connectors": "^0.1.1", - "@wagmi/core": "^0.8.0", "axios": "^1.2.0", "buffer": "^6.0.3", "debug": "^4.3.4", "ethers": "^5.7.1", "identicon.js": "^2.3.3", "svelte-i18n": "^3.5.1", - "svelte-spa-router": "^3.2.0" + "svelte-spa-router": "^3.2.0", + "wagmi": "^0.12.16" } } diff --git a/packages/bridge-ui/src/chain/chains.ts b/packages/bridge-ui/src/chain/chains.ts index 5b01c0adba7..ff3f98d1f48 100644 --- a/packages/bridge-ui/src/chain/chains.ts +++ b/packages/bridge-ui/src/chain/chains.ts @@ -1,4 +1,4 @@ -import type { Chain as WagmiChain } from '@wagmi/core'; +import type { Chain as WagmiChain } from 'wagmi'; import Eth from '../components/icons/ETH.svelte'; import Taiko from '../components/icons/TKO.svelte'; @@ -56,9 +56,8 @@ export const mainnetWagmiChain: WagmiChain = { network: '', nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, rpcUrls: { - default: { - http: [L1_RPC], - }, + default: { http: [L1_RPC] }, + public: { http: [L1_RPC] }, }, blockExplorers: { default: { @@ -75,9 +74,8 @@ export const taikoWagmiChain: WagmiChain = { network: '', nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, rpcUrls: { - default: { - http: [L2_RPC], - }, + default: { http: [L2_RPC] }, + public: { http: [L2_RPC] }, }, blockExplorers: { default: { diff --git a/packages/bridge-ui/src/components/AddressDropdown.svelte b/packages/bridge-ui/src/components/AddressDropdown.svelte index 70018e845b8..11e004287a3 100644 --- a/packages/bridge-ui/src/components/AddressDropdown.svelte +++ b/packages/bridge-ui/src/components/AddressDropdown.svelte @@ -1,6 +1,7 @@