From 0abe4fb5a526be222d3e3d723f66fbf2fde33b08 Mon Sep 17 00:00:00 2001 From: shrinathprabhu Date: Mon, 15 Apr 2024 16:26:10 +0530 Subject: [PATCH 1/2] Replace polygon mumbai with Polygon Amoy Testnet --- src/components/send/requestSuccess.vue | 2 +- src/constants/chainList.ts | 25 ++++++++++++------------- src/constants/requestableTokens.ts | 16 ++++++++-------- src/constants/socket-ids.ts | 2 +- src/constants/unitMapping.ts | 2 +- src/services/ankr.service.ts | 8 ++++---- src/use/walletconnect.ts | 13 ++----------- 7 files changed, 29 insertions(+), 39 deletions(-) diff --git a/src/components/send/requestSuccess.vue b/src/components/send/requestSuccess.vue index 4472c8f9..b4c04f67 100644 --- a/src/components/send/requestSuccess.vue +++ b/src/components/send/requestSuccess.vue @@ -13,7 +13,7 @@ const emit = defineEmits(["close", "shoutout"]); const chainSpecificExplorers = { 56: "https://bscscan.com/", 97: "https://testnet.bscscan.com/", - 80001: "https://mumbai.polygonscan.com/", + 80002: "https://www.oklink.com/amoy", 137: "https://polygonscan.com/", 204: "https://opbnbscan.com/", }; diff --git a/src/constants/chainList.ts b/src/constants/chainList.ts index b44c3ca2..8b58b984 100644 --- a/src/constants/chainList.ts +++ b/src/constants/chainList.ts @@ -19,14 +19,13 @@ const chains = { explorer: "https://polygonscan.com", icon_url: "https://icons.llamao.fi/icons/chains/rsz_polygon.jpg", }, - 80001: { - name: "Polygon Mumbai", - chain_id: 80001, - rpc_url: - "https://polygon-testnet.blastapi.io/7c12fa10-4e46-4810-bf66-6b3148119501", - blockchain: "polygon_mumbai", + 80002: { + name: "Polygon Amoy Testnet", + chain_id: 80002, + rpc_url: "https://rpc-amoy.polygon.technology", + blockchain: "polygon_amoy", currency: "MATIC", - explorer: "https://mumbai.polygonscan.com", + explorer: "https://www.oklink.com/amoy", icon_url: "https://icons.llamao.fi/icons/chains/rsz_polygon.jpg", }, 42161: { @@ -90,11 +89,11 @@ const chains = { }, }; -export const testnetChains = [80001, 97]; +export const testnetChains = [80002, 97]; export const testnetChainFaucets = { 97: "https://testnet.binance.org/faucet-smart", - 80001: "https://mumbaifaucet.com", + 80002: "https://faucet.polygon.technology", }; export const gaslessChains = [137]; @@ -102,7 +101,7 @@ export const gaslessChains = [137]; export enum ChainNames { "eth" = "Ethereum", "polygon" = "Polygon PoS", - "polygon_mumbai" = "Polygon Mumbai", + "polygon_amoy" = "Polygon Amoy Testnet", "arbitrum" = "Arbitrum One", "bsc" = "BNB Smart Chain", "bsc_testnet_chapel" = "BNB Smart Chain Testnet", @@ -114,7 +113,7 @@ export enum ChainNames { export enum ChainIds { "eth" = 1, "polygon" = 137, - "polygon_mumbai" = 80001, + "polygon_amoy" = 80002, "arbitrum" = 42161, "bsc" = 56, "bsc_testnet_chapel" = 97, @@ -124,8 +123,8 @@ export enum ChainIds { } export const SupportedChainIdsForAccounts = { - eoa: [1, 137, 80001, 42161, 56, 97, 204], - scw: [137, 80001], + eoa: [1, 137, 80002, 42161, 56, 97, 204], + scw: [137], }; export default chains; diff --git a/src/constants/requestableTokens.ts b/src/constants/requestableTokens.ts index 99a35e2a..f3b18ca9 100644 --- a/src/constants/requestableTokens.ts +++ b/src/constants/requestableTokens.ts @@ -63,14 +63,14 @@ export const requestableTokens = { decimals: 18, }, ], - 80001: [ - { - symbol: "MATIC", - tokenType: "NATIVE", - address: "NATIVE", - decimals: 18, - }, - ], + // 80002: [ + // { + // symbol: "MATIC", + // tokenType: "NATIVE", + // address: "NATIVE", + // decimals: 18, + // }, + // ], 42161: [ { symbol: "ETH", diff --git a/src/constants/socket-ids.ts b/src/constants/socket-ids.ts index a8925c30..57ed337c 100644 --- a/src/constants/socket-ids.ts +++ b/src/constants/socket-ids.ts @@ -46,6 +46,6 @@ const TOKEN_TYPES = { ERC20: 1, }; -const GAS_SUPPORTED_CHAINS = [137, 80001]; +const GAS_SUPPORTED_CHAINS = [137]; export { SOCKET_IDS, LEADERBOARD_TYPES, TOKEN_TYPES, GAS_SUPPORTED_CHAINS }; diff --git a/src/constants/unitMapping.ts b/src/constants/unitMapping.ts index 17d7ebd5..6b1b9136 100644 --- a/src/constants/unitMapping.ts +++ b/src/constants/unitMapping.ts @@ -3,7 +3,7 @@ const nativeUnitMapping = { 5: "ETH", 11155111: "ETH", 137: "MATIC", - 80001: "MATIC", + 80002: "MATIC", 42161: "ETH", 56: "BNB", 97: "tBNB", diff --git a/src/services/ankr.service.ts b/src/services/ankr.service.ts index 18436054..e13028af 100644 --- a/src/services/ankr.service.ts +++ b/src/services/ankr.service.ts @@ -70,7 +70,7 @@ async function getNativeTokenBalances(walletAddress: string) { const ankrPromises = [ axios.post(chains[1].rpc_url, payload), axios.post(chains[137].rpc_url, payload), - axios.post(chains[80001].rpc_url, payload), + axios.post(chains[80002].rpc_url, payload), axios.post(chains[42161].rpc_url, payload), axios.post(chains[56].rpc_url, payload), axios.post(chains[97].rpc_url, payload), @@ -81,7 +81,7 @@ async function getNativeTokenBalances(walletAddress: string) { const [ eth, polygon, - polygon_mumbai, + polygon_amoy, arbitrum, bsc, bsc_testnet_chapel, @@ -109,8 +109,8 @@ async function getNativeTokenBalances(walletAddress: string) { { tokenType: "NATIVE", tokenSymbol: "MATIC", - blockchain: "polygon_mumbai", - balance: new Decimal(polygon_mumbai.data.result) + blockchain: "polygon_amoy", + balance: new Decimal(polygon_amoy.data.result) .mul(Decimal.pow(10, -18)) .toString(), }, diff --git a/src/use/walletconnect.ts b/src/use/walletconnect.ts index 6c24480a..564d7ae9 100644 --- a/src/use/walletconnect.ts +++ b/src/use/walletconnect.ts @@ -4,22 +4,13 @@ import { mainnet, polygon, sepolia, - polygonMumbai, arbitrum, bsc, bscTestnet, -} from "@wagmi/core/chains"; +} from "viem/chains"; function useWalletConnect() { - const chains = [ - mainnet, - polygon, - sepolia, - polygonMumbai, - arbitrum, - bsc, - bscTestnet, - ]; + const chains = [mainnet, polygon, sepolia, arbitrum, bsc, bscTestnet]; const projectId = import.meta.env.VITE_WALLETCONNECT_PROJECT_ID; const featuredWallets = { okx: "971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709", From 624aecd229cd3af14c58b2af9d2676982a60076e Mon Sep 17 00:00:00 2001 From: shrinathprabhu Date: Tue, 23 Apr 2024 11:19:44 +0530 Subject: [PATCH 2/2] Remove deposit for now --- src/pages/private/wallets/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/private/wallets/index.vue b/src/pages/private/wallets/index.vue index db7f599a..63ce178b 100644 --- a/src/pages/private/wallets/index.vue +++ b/src/pages/private/wallets/index.vue @@ -224,14 +224,14 @@ function handleSendToken(asset: any, accountType: string) {
- + -->