From 26c9555d2592096840b18fb6aeb3e97eabedaf4a Mon Sep 17 00:00:00 2001 From: cong_wang Date: Wed, 5 Jun 2024 14:24:23 +0800 Subject: [PATCH] fix: Fix the address resolution error and FundFlow button style issue on the Solscan website --- CHANGELOG.md | 4 +++ package.json | 2 +- src/common/utils/validator.ts | 12 +++++-- .../FundFlowButton/index.module.less | 1 - .../components/FundFlowButton/index.tsx | 14 +++++++-- .../solscan/feat-scripts/fund-flow.tsx | 31 ++++++++++++++----- src/content/solscan/page-scripts/account.tsx | 4 +-- src/content/solscan/page-scripts/token.tsx | 4 +-- .../components/ExportTableDataBtn/index.tsx | 4 +-- .../feat-scripts/compliance-score.tsx | 4 +-- .../feat-scripts/decompile-in-ethervm.tsx | 4 +-- .../tronscan/feat-scripts/fund-flow.tsx | 4 +-- .../feat-scripts/main-address-label.tsx | 4 +-- 13 files changed, 62 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd9a74e..fbff69e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### v5.0.5 + +- [fix] Fix the bug in the Fund Flow feature on the Solscan website that causes the current Solana address to be retrieved incorrectly + ### v5.0.4 - [feat] Enhance the address label functionality on the Solscan token page diff --git a/package.json b/package.json index b0d19d7..b0a3b62 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metasuites", - "version": "5.0.4", + "version": "5.0.5", "repository": { "type": "git", "url": "https://github.com/blocksecteam/metasuites.git" diff --git a/src/common/utils/validator.ts b/src/common/utils/validator.ts index a4b57f1..ec8fab2 100644 --- a/src/common/utils/validator.ts +++ b/src/common/utils/validator.ts @@ -37,8 +37,14 @@ export const isMethod = (str: string, isExact = true): boolean => { export const pickAddress = (str: string): string | undefined => { return ( str.match(PATTERN_EVM_ADDRESS_LOOSE)?.[0] || - str.match(PATTERN_BTC_ADDRESS_LOOSE)?.[0] || - str.match(PATTERN_TRX_ADDRESS_LOOSE)?.[0] || - str.match(PATTERN_SOLANA_ADDRESS_LOOSE)?.[0] + str.match(PATTERN_BTC_ADDRESS_LOOSE)?.[0] ) } + +export const pickTrxAddress = (str: string): string | undefined => { + return str.match(PATTERN_TRX_ADDRESS_LOOSE)?.[0] +} + +export const pickSolanaAddress = (str: string): string | undefined => { + return str.match(PATTERN_SOLANA_ADDRESS_LOOSE)?.[0] +} diff --git a/src/content/solscan/components/FundFlowButton/index.module.less b/src/content/solscan/components/FundFlowButton/index.module.less index 2d95217..7e4752d 100644 --- a/src/content/solscan/components/FundFlowButton/index.module.less +++ b/src/content/solscan/components/FundFlowButton/index.module.less @@ -2,6 +2,5 @@ .button { display: flex !important; - margin-left: 16px; .items-center; } diff --git a/src/content/solscan/components/FundFlowButton/index.tsx b/src/content/solscan/components/FundFlowButton/index.tsx index be42a83..8a25b20 100644 --- a/src/content/solscan/components/FundFlowButton/index.tsx +++ b/src/content/solscan/components/FundFlowButton/index.tsx @@ -1,17 +1,24 @@ import { type FC, useState } from 'react' import { Button, ConfigProvider } from 'antd' import { StyleProvider } from '@ant-design/cssinjs' +import cls from 'classnames' import { ModalFundFlow, IconFundflow } from '@common/components' +import type { BaseComponent } from '@common/types' import styles from './index.module.less' -interface Props { +interface Props extends BaseComponent { chain: string mainAddress: string } -const FundFlowButton: FC = ({ chain, mainAddress }) => { +const FundFlowButton: FC = ({ + chain, + mainAddress, + className, + style +}) => { const [visible, setVisible] = useState(false) return ( @@ -23,7 +30,8 @@ const FundFlowButton: FC = ({ chain, mainAddress }) => {