|
|
@@ -8,6 +8,8 @@ interface TableData {
|
|
|
liquidity: string
|
|
|
earnedUsd: string
|
|
|
positionAgeMs: number
|
|
|
+ tokenAaddress?: string
|
|
|
+ tokenBaddress?: string
|
|
|
[key: string]: unknown
|
|
|
}
|
|
|
|
|
|
@@ -20,6 +22,7 @@ interface ApiResponse {
|
|
|
current: number
|
|
|
pageSize: number
|
|
|
pages: number
|
|
|
+ poolMap?: Record<string, PoolInfo>
|
|
|
}
|
|
|
}
|
|
|
retMsg?: string
|
|
|
@@ -33,14 +36,12 @@ interface PoolOption {
|
|
|
interface PoolInfo {
|
|
|
poolAddress: string
|
|
|
mintA?: {
|
|
|
- mintInfo?: {
|
|
|
- symbol?: string
|
|
|
- }
|
|
|
+ address: string
|
|
|
+ symbol?: string
|
|
|
}
|
|
|
mintB?: {
|
|
|
- mintInfo?: {
|
|
|
- symbol?: string
|
|
|
- }
|
|
|
+ address: string
|
|
|
+ symbol?: string
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -133,9 +134,14 @@ export default function DataTable() {
|
|
|
const result: ApiResponse = await response.json()
|
|
|
console.log(result)
|
|
|
if (result.result) {
|
|
|
- const { records, total, current, pageSize } = result.result.data
|
|
|
+ const { records, total, current, pageSize, poolMap } = result.result.data
|
|
|
+ const poolMapData = poolMap ? (Object.values(poolMap)[0] as PoolInfo) : undefined
|
|
|
+ const tokenAaddress = poolMapData?.mintA?.address
|
|
|
+ const tokenBaddress = poolMapData?.mintB?.address
|
|
|
setData(records.map((item, index) => ({
|
|
|
key: `${item.id || index}`,
|
|
|
+ tokenAaddress,
|
|
|
+ tokenBaddress,
|
|
|
...item,
|
|
|
})) as TableData[])
|
|
|
setExpandedRowKeys([])
|
|
|
@@ -256,7 +262,7 @@ export default function DataTable() {
|
|
|
dataIndex: 'walletAddress',
|
|
|
key: 'walletAddress',
|
|
|
render: (text: string, record: TableData) => {
|
|
|
- return <Typography.Link href={`https://www.byreal.io/en/portfolio?userAddress=${text}&tab=current&positionAddress=${record.positionAddress}`} target="_blank">复制</Typography.Link>
|
|
|
+ return <Typography.Link href={`https://www.byreal.io/en/portfolio?userAddress=${text}&tab=current&positionAddress=${record.positionAddress}&tokenAddress=${record.tokenAaddress}&tokenAddress=${record.tokenBaddress}`} target="_blank">复制</Typography.Link>
|
|
|
}
|
|
|
}
|
|
|
|