From 61245eb71cb260ec40760e8ce3a6bacb17501c99 Mon Sep 17 00:00:00 2001 From: holybasil Date: Wed, 29 May 2024 14:58:33 +0800 Subject: [PATCH 1/5] fix: new asset --- netlify.toml | 6 ++- public/imgs/sessions/tokens/Tranchess.svg | 15 ++++++ public/imgs/sessions/tokens/staYSTONE.svg | 16 ++++++ public/imgs/sessions/tokens/stoneQueen.svg | 48 +++++++++++++++++ public/imgs/sessions/tokens/turPSTONE.svg | 12 +++++ public/imgs/sessions/tokens/wrsETH.svg | 9 ++++ .../bridge/Send/SendTransaction/TokenList.tsx | 2 +- .../bridge/Send/SendTransaction/index.tsx | 8 +-- src/pages/sessions/SessionZeroMarks/List.tsx | 17 +++++-- src/pages/sessions/SessionZeroMarks/index.tsx | 39 ++------------ .../sessions/SessionZeroMarks/tokenList.ts | 51 +++++++++++++++++-- src/pages/sessions/TotalMarks/index.tsx | 20 +------- 12 files changed, 177 insertions(+), 66 deletions(-) create mode 100644 public/imgs/sessions/tokens/Tranchess.svg create mode 100644 public/imgs/sessions/tokens/staYSTONE.svg create mode 100644 public/imgs/sessions/tokens/stoneQueen.svg create mode 100644 public/imgs/sessions/tokens/turPSTONE.svg create mode 100644 public/imgs/sessions/tokens/wrsETH.svg diff --git a/netlify.toml b/netlify.toml index 1b3082c00..872ae561d 100644 --- a/netlify.toml +++ b/netlify.toml @@ -99,7 +99,7 @@ REACT_APP_CONNECT_WALLET_PROJECT_ID = "14efbaafcf5232a47d93a68229b71028" REACT_APP_UNIFRA_API_KEY = "9d431c1c-d717-4931-9595-ad0b3a246d13" REACT_APP_NFT_VIEWER_URL="https://nft.scroll.io" REACT_APP_NFT_API_URI="https://nft.scroll.io" -REACT_APP_OPEN_BLOCK_URI = "https://kx58j6x5me.execute-api.us-east-1.amazonaws.com" + [context.deploy-preview.environment] REACT_APP_SCROLL_ENVIRONMENT = "Staging" @@ -144,6 +144,7 @@ REACT_APP_SCROLL_ORIGINS_NFT="0x90a274D591d5AB1a25f0DD0F06F28533C34D7d9f" REACT_APP_SCROLL_ORIGINS_NFT_V2="0xDd7d857F570B0C211abfe05cd914A85BefEC2464" REACT_APP_L1_MESSAGE_QUEUE_WITH_GAS_PRICE_ORACLE="0xF0B2293F5D834eAe920c6974D50957A1732de763" REACT_APP_L1_BATCH_BRIDGE_GATEWAY_PROXY_ADDR = "0xE86ad3312FA693aDeD34dEc3899176d97ac883B2" +REACT_APP_OPEN_BLOCK_URI = "https://5x6x869ic0.execute-api.us-east-1.amazonaws.com" [context.staging.environment] @@ -189,6 +190,7 @@ REACT_APP_SCROLL_ORIGINS_NFT="0x90a274D591d5AB1a25f0DD0F06F28533C34D7d9f" REACT_APP_SCROLL_ORIGINS_NFT_V2="0xDd7d857F570B0C211abfe05cd914A85BefEC2464" REACT_APP_L1_MESSAGE_QUEUE_WITH_GAS_PRICE_ORACLE="0xF0B2293F5D834eAe920c6974D50957A1732de763" REACT_APP_L1_BATCH_BRIDGE_GATEWAY_PROXY_ADDR = "0xE86ad3312FA693aDeD34dEc3899176d97ac883B2" +REACT_APP_OPEN_BLOCK_URI = "https://5x6x869ic0.execute-api.us-east-1.amazonaws.com" [context.sepolia.environment] REACT_APP_SCROLL_ENVIRONMENT = "Sepolia" @@ -233,6 +235,7 @@ REACT_APP_SCROLL_ORIGINS_NFT="0x90a274D591d5AB1a25f0DD0F06F28533C34D7d9f" REACT_APP_SCROLL_ORIGINS_NFT_V2="0xDd7d857F570B0C211abfe05cd914A85BefEC2464" REACT_APP_L1_MESSAGE_QUEUE_WITH_GAS_PRICE_ORACLE="0xF0B2293F5D834eAe920c6974D50957A1732de763" REACT_APP_L1_BATCH_BRIDGE_GATEWAY_PROXY_ADDR = "0xE86ad3312FA693aDeD34dEc3899176d97ac883B2" +REACT_APP_OPEN_BLOCK_URI = "https://5x6x869ic0.execute-api.us-east-1.amazonaws.com" [context.mainnet.environment] REACT_APP_SCROLL_ENVIRONMENT = "Mainnet" @@ -276,3 +279,4 @@ REACT_APP_SCROLL_ORIGINS_NFT="0x74670A3998d9d6622E32D0847fF5977c37E0eC91" REACT_APP_SCROLL_ORIGINS_NFT_V2="0x42bCaCb8D24Ba588cab8Db0BB737DD2eFca408EC" REACT_APP_L1_MESSAGE_QUEUE_WITH_GAS_PRICE_ORACLE="0x0d7E906BD9cAFa154b048cFa766Cc1E54E39AF9B" REACT_APP_L1_BATCH_BRIDGE_GATEWAY_PROXY_ADDR = "0x5Bcfd99c34cf7E06fc756f6f5aE7400504852bc4" +REACT_APP_OPEN_BLOCK_URI = "https://kx58j6x5me.execute-api.us-east-1.amazonaws.com" diff --git a/public/imgs/sessions/tokens/Tranchess.svg b/public/imgs/sessions/tokens/Tranchess.svg new file mode 100644 index 000000000..8c0b017b5 --- /dev/null +++ b/public/imgs/sessions/tokens/Tranchess.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/public/imgs/sessions/tokens/staYSTONE.svg b/public/imgs/sessions/tokens/staYSTONE.svg new file mode 100644 index 000000000..7a2d34f09 --- /dev/null +++ b/public/imgs/sessions/tokens/staYSTONE.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/public/imgs/sessions/tokens/stoneQueen.svg b/public/imgs/sessions/tokens/stoneQueen.svg new file mode 100644 index 000000000..6eb34c2f8 --- /dev/null +++ b/public/imgs/sessions/tokens/stoneQueen.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/imgs/sessions/tokens/turPSTONE.svg b/public/imgs/sessions/tokens/turPSTONE.svg new file mode 100644 index 000000000..425339e39 --- /dev/null +++ b/public/imgs/sessions/tokens/turPSTONE.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/public/imgs/sessions/tokens/wrsETH.svg b/public/imgs/sessions/tokens/wrsETH.svg new file mode 100644 index 000000000..0fc32ca3a --- /dev/null +++ b/public/imgs/sessions/tokens/wrsETH.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/pages/bridge/Send/SendTransaction/TokenList.tsx b/src/pages/bridge/Send/SendTransaction/TokenList.tsx index 192214e18..edae83bbb 100644 --- a/src/pages/bridge/Send/SendTransaction/TokenList.tsx +++ b/src/pages/bridge/Send/SendTransaction/TokenList.tsx @@ -279,7 +279,7 @@ function List(props: TokenListProps) { .map((token: any) => { return { ...token, - earnMarks: tokenList.some(t => t.symbol === token.symbol), + earnMarks: tokenList.some(t => t.symbol === token.symbol || t.additionalToken === token.symbol), } }) }, [filteredTokens]) diff --git a/src/pages/bridge/Send/SendTransaction/index.tsx b/src/pages/bridge/Send/SendTransaction/index.tsx index c1cd2c38c..7559acb18 100644 --- a/src/pages/bridge/Send/SendTransaction/index.tsx +++ b/src/pages/bridge/Send/SendTransaction/index.tsx @@ -7,7 +7,7 @@ import { Box, Stack, SvgIcon, Typography } from "@mui/material" import { ReactComponent as WarningSvg } from "@/assets/svgs/bridge/warning.svg" import Button from "@/components/Button" import TextButton from "@/components/TextButton" -import { ETH_SYMBOL } from "@/constants" +import { ETH_SYMBOL, NATIVE_TOKEN_LIST } from "@/constants" import { BRIDGE_TOKEN_SYMBOL } from "@/constants/storageKey" import { useBridgeContext } from "@/contexts/BridgeContextProvider" import { usePriceFeeContext } from "@/contexts/PriceFeeProvider" @@ -65,8 +65,10 @@ const SendTransaction = props => { return fromNetwork.chainId ? tokenList.filter(item => item.chainId === fromNetwork.chainId) : [] }, [tokenList, fromNetwork]) - const selectedToken: any = useMemo(() => tokenOptions.find(item => item.symbol === tokenSymbol) ?? {}, [tokenOptions, tokenSymbol]) - + const selectedToken: any = useMemo( + () => tokenOptions.find(item => item.symbol === tokenSymbol) ?? NATIVE_TOKEN_LIST.find(item => item.chainId === fromNetwork.chainId), + [tokenOptions, tokenSymbol, fromNetwork], + ) // const { balance, isLoading: balanceLoading } = useBalance(selectedToken.address) const { balance, loading: balanceLoading } = useBalance(selectedToken, fromNetwork) diff --git a/src/pages/sessions/SessionZeroMarks/List.tsx b/src/pages/sessions/SessionZeroMarks/List.tsx index af8a8e037..0fa2a5bc6 100644 --- a/src/pages/sessions/SessionZeroMarks/List.tsx +++ b/src/pages/sessions/SessionZeroMarks/List.tsx @@ -1,15 +1,16 @@ import { isNumber } from "lodash" import { makeStyles } from "tss-react/mui" -import { Avatar, Box, Button, Link, List, ListItem, ListItemIcon, ListItemText, Skeleton, Tooltip, Typography } from "@mui/material" +import { Avatar, Box, Button, Link, List, ListItem, ListItemIcon, ListItemText, Skeleton, Stack, Tooltip, Typography } from "@mui/material" import { useTheme } from "@mui/material/styles" import { styled } from "@mui/system" -import { EXPLORER_URL } from "@/constants" import { commafy, formatLargeNumber, generateExploreLink, toPrecision, truncateHash } from "@/utils" import Statistic from "../components/Statistic" +const TOEKN_BASE_URL = "https://scrollscan.com" + export enum MarksType { ELIGIBLE_ASSETS, GAS_SPENT, @@ -113,12 +114,19 @@ const TokenList = props => { {type === MarksType.ELIGIBLE_ASSETS && ( <> - {item.symbol} + {item.name} {item.address && ( - + {truncateHash(item.address)} )} + {item.containedTokens && ( + + {item.containedTokens.map(({ symbol, logoURI }) => ( + + ))} + + )} )} @@ -154,6 +162,7 @@ const TokenList = props => { {type === MarksType.ELIGIBLE_ASSETS && (