lushdog@outlook.com 15 ore fa
parent
commit
2a7415fe2d
1 ha cambiato i file con 13 aggiunte e 4 eliminazioni
  1. 13 4
      src/app/components/DataTable.tsx

+ 13 - 4
src/app/components/DataTable.tsx

@@ -4,8 +4,12 @@ import { TickMath } from '@/lib/byreal-clmm-sdk/src/instructions/utils/tickMath'
 import { useEffect, useState, useRef } from 'react'
 import { Table, Select, Typography, Tag, Button, InputNumber, App } from 'antd'
 
+// 黑名单表格不显示(小额/BOT地址)
+const BLACK_LIST_ADDRESSES = ['LoVe', 'HZEQ', 'mVBk', 'enVr', 'MV9K']
+
 interface TableData {
 	key: string
+	walletAddress: string
 	liquidity: string
 	earnedUsd: string
 	positionAgeMs: number
@@ -20,7 +24,7 @@ interface ApiResponse {
 	retCode: number
 	result: {
 		data: {
-			records: Record<string, unknown>[]
+			records: TableData[]
 			total: number
 			current: number
 			pageSize: number
@@ -252,13 +256,18 @@ function DataTableContent() {
 					})
 					return `${priceLower.toFixed(6)} - ${priceUpper.toFixed(6)}`
 				}
+				const filteredRecords = records.filter((item) => {
+					return !BLACK_LIST_ADDRESSES.some((address) =>
+						item.walletAddress.toLowerCase().includes(address.toLowerCase())
+					)
+				}) as TableData[]
 				setData(
-					records.map((item, index) => ({
+					filteredRecords.map((item, index) => ({
+						...item,
 						key: `${item.id || index}`,
 						priceRange: getPriceRange(item, poolMapData),
 						tokenAaddress,
 						tokenBaddress,
-						...item,
 					})) as TableData[]
 				)
 				setExpandedRowKeys([])
@@ -696,8 +705,8 @@ function DataTableContent() {
 			if (result.result) {
 				const { records } = result.result.data
 				const childData: TableData[] = records.map((item, index) => ({
-					key: `${parentPositionAddress}-${item.id || index}`,
 					...item,
+					key: `${parentPositionAddress}-${item.id || index}`,
 				})) as TableData[]
 				setChildTableData((prev) => ({
 					...prev,