-
Notifications
You must be signed in to change notification settings - Fork 76
/
pool.tsx
101 lines (98 loc) · 2.03 KB
/
pool.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import React from "react";
import { Flex, Table, Space, Typography, Button } from "antd";
import type { TableProps } from "antd";
import WtfLayout from "@/components/WtfLayout";
import Link from "next/link";
import styles from "./pool.module.css";
const columns: TableProps["columns"] = [
{
title: "Token 0",
dataIndex: "token0",
key: "token0",
},
{
title: "Token 1",
dataIndex: "token1",
key: "token1",
},
{
title: "Index",
dataIndex: "index",
key: "index",
},
{
title: "Fee",
dataIndex: "fee",
key: "fee",
},
{
title: "Fee Protocol",
dataIndex: "feeProtocol",
key: "feeProtocol",
},
{
title: "Tick Lower",
dataIndex: "tickLower",
key: "tickLower",
},
{
title: "Tick Upper",
dataIndex: "tickUpper",
key: "tickUpper",
},
{
title: "Tick",
dataIndex: "tick",
key: "tick",
},
{
title: "Price",
dataIndex: "sqrtPriceX96",
key: "sqrtPriceX96",
render: (value: bigint) => {
return value.toString();
},
},
];
const PoolListTable: React.FC = () => {
const data = [
{
token0: "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",
token1: "0xEcd0D12E21805803f70de03B72B1C162dB0898d9",
index: 0,
fee: 3000,
feeProtocol: 0,
tickLower: -100000,
tickUpper: 100000,
tick: 1000,
sqrtPriceX96: BigInt("7922737261735934252089901697281"),
},
];
return (
<Table
title={() => (
<Flex justify="space-between">
<div>Pool List</div>
<Space>
<Link href="/wtfswap/positions">
<Button>My Positions</Button>
</Link>
<Button type="primary">Add Pool</Button>
</Space>
</Flex>
)}
columns={columns}
dataSource={data}
/>
);
};
export default function WtfswapPool() {
return (
<WtfLayout>
<div className={styles.container}>
<Typography.Title level={2}>Pool</Typography.Title>
<PoolListTable />
</div>
</WtfLayout>
);
}