From 698d0cb2d6bf7f6da18980c5070651c1cae46498 Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Wed, 28 Aug 2024 21:22:53 +0000 Subject: [PATCH 01/46] feat: tron --- apps/tron/.env.example | 5 +- apps/tron/.env.test | 0 apps/tron/next.config.mjs | 48 +- apps/tron/package.json | 9 +- .../src/app/api/pools/get-reserves/route.ts | 31 + .../src/app/api/pools/my-positions/route.ts | 39 + apps/tron/src/app/api/pools/route.ts | 30 + apps/tron/src/app/api/pricing/route.ts | 23 + apps/tron/src/app/api/token-info/route.ts | 30 + apps/tron/src/app/header.tsx | 121 +- apps/tron/src/app/layout.tsx | 107 +- apps/tron/src/app/pool/[poolId]/layout.tsx | 5 + apps/tron/src/app/pool/[poolId]/page.tsx | 73 ++ .../src/app/pool/[poolId]/remove-provider.tsx | 133 ++ apps/tron/src/app/pool/add/layout.tsx | 32 + apps/tron/src/app/pool/add/page.tsx | 11 + apps/tron/src/app/pool/layout.tsx | 10 + apps/tron/src/app/pool/page.tsx | 61 + apps/tron/src/app/pool/pool-provider.tsx | 160 +++ apps/tron/src/app/providers.tsx | 23 +- apps/tron/src/app/swap/_components/widget.tsx | 5 - apps/tron/src/app/swap/layout.tsx | 10 + apps/tron/src/app/swap/page.tsx | 42 +- apps/tron/src/app/swap/providers.tsx | 5 +- apps/tron/src/app/swap/swap-provider.tsx | 161 ++- apps/tron/src/bitquery/bitquery-endpoint.ts | 1 + apps/tron/src/bitquery/bitquery-headers.ts | 13 + apps/tron/src/bitquery/bitquery-options.ts | 11 + apps/tron/src/bitquery/queries/getAllPools.ts | 9 + apps/tron/src/bitquery/queries/getReserves.ts | 15 + .../tron/src/bitquery/queries/getTokenInfo.ts | 9 + .../bitquery/queries/getTransfersToPairs.ts | 15 + .../src/bitquery/queries/getTronInUSDT.ts | 9 + apps/tron/src/components/General/Icon.tsx | 29 + apps/tron/src/components/General/IconList.tsx | 32 + apps/tron/src/components/General/Title.tsx | 12 + .../components/General/TokenListSelect.tsx | 187 +++ apps/tron/src/components/Input/Search.tsx | 220 ++++ apps/tron/src/components/Input/TokenInput.tsx | 92 ++ .../src/components/Pools/Add/AddButton.tsx | 162 +++ .../components/Pools/Add/AmountInToken0.tsx | 52 + .../components/Pools/Add/AmountIntToken1.tsx | 52 + .../src/components/Pools/Add/DepositForm.tsx | 21 + apps/tron/src/components/Pools/Add/Plus.tsx | 9 + apps/tron/src/components/Pools/Add/Rate.tsx | 54 + .../components/Pools/Add/ReviewAddDialog.tsx | 98 ++ .../Pools/Add/ReviewAddDialogTrigger.tsx | 135 ++ .../components/Pools/Add/SelectTokensForm.tsx | 34 + apps/tron/src/components/Pools/BackButton.tsx | 25 + .../components/Pools/Manage/AddSection.tsx | 41 + .../src/components/Pools/Manage/Manage.tsx | 54 + .../components/Pools/Manage/RemoveSection.tsx | 31 + .../Pools/PoolDetails/LiquidityItem.tsx | 35 + .../Pools/PoolDetails/PoolHeader.tsx | 71 + .../Pools/PoolDetails/PoolLiquidity.tsx | 74 ++ .../Pools/PoolPosition/PoolPosition.tsx | 145 +++ .../Pools/PoolRewards/PoolRewards.tsx | 38 + .../src/components/Pools/PoolSearchBar.tsx | 38 + .../Pools/PoolsTable/PoolAprCell.tsx | 5 + .../Pools/PoolsTable/PoolColumns.tsx | 55 + .../Pools/PoolsTable/PoolNameCell.tsx | 38 + .../Pools/PoolsTable/PoolReservesCell.tsx | 28 + .../Pools/PoolsTable/PoolTvlCell.tsx | 39 + .../Pools/PoolsTable/PoolsTable.tsx | 75 ++ apps/tron/src/components/Pools/PoolsView.tsx | 83 ++ .../Pools/PositionsTable/PositionColumns.tsx | 56 + .../Pools/PositionsTable/PositionNameCell.tsx | 29 + .../Pools/PositionsTable/PositionSizeCell.tsx | 18 + .../Pools/PositionsTable/PositionTvlCell.tsx | 32 + .../Pools/PositionsTable/PositionsTable.tsx | 83 ++ .../Pools/Remove/MinimumReceive.tsx | 99 ++ .../components/Pools/Remove/RemoveButton.tsx | 195 +++ .../components/Pools/Remove/RemoveInput.tsx | 48 + .../Pools/Remove/RemoveLiquidity.tsx | 14 + .../src/components/Pools/ReserveHelper.tsx | 34 + .../src/components/Shared/ApproveToken.tsx | 151 +++ .../components/Shared/DollarAmountDisplay.tsx | 28 + .../components/Shared/TokenBalanceDisplay.tsx | 51 + apps/tron/src/components/Swap/AmountIn.tsx | 40 + apps/tron/src/components/Swap/AmountOut.tsx | 17 + .../src/components/Swap/ReviewSwapDialog.tsx | 141 ++ .../Swap/ReviewSwapDialogTrigger.tsx | 174 +++ apps/tron/src/components/Swap/SwapButton.tsx | 210 +++ .../src/components/Swap/SwapRoutesDialog.tsx | 49 + apps/tron/src/components/Swap/SwapStats.tsx | 116 ++ .../components/Swap/SwitchSwapDirection.tsx | 19 + .../src/components/Swap/SwitchSwapType.tsx | 11 + .../WalletConnector/DefaultView.tsx | 90 ++ .../WalletConnector/SettingsView.tsx | 65 + .../WalletConnector/WalletConnector.tsx | 66 + .../WalletConnector/WalletListView.tsx | 32 + apps/tron/src/constants/abis/factory-abi.ts | 83 ++ apps/tron/src/constants/abis/pair-abi.ts | 345 +++++ apps/tron/src/constants/abis/router-abi.ts | 335 +++++ apps/tron/src/constants/abis/trc20-abi.ts | 222 ++++ .../tron/src/constants/abis/tron-multicall.ts | 109 ++ .../src/constants/abis/wrapped-trx-abi.ts | 162 +++ apps/tron/src/constants/contracts.ts | 5 + apps/tron/src/constants/icon-size.ts | 1 + apps/tron/src/constants/is-testnet.ts | 1 + apps/tron/src/constants/max-uint256.ts | 1 + apps/tron/src/constants/pair-decimals.ts | 1 + apps/tron/src/constants/token-list.tsx | 110 ++ apps/tron/src/hooks/useAllowance.ts | 61 + apps/tron/src/hooks/useAmountsOut.ts | 37 + apps/tron/src/hooks/useCustomTokens.ts | 86 ++ apps/tron/src/hooks/useIsContract.ts | 19 + apps/tron/src/hooks/useMyPositions.ts | 206 +++ apps/tron/src/hooks/useNativeBalance.ts | 19 + apps/tron/src/hooks/usePairContract.ts | 37 + apps/tron/src/hooks/usePoolOwnership.tsx | 28 + apps/tron/src/hooks/usePools.ts | 153 +++ apps/tron/src/hooks/usePriceImpact.ts | 65 + apps/tron/src/hooks/useReserves.ts | 50 + apps/tron/src/hooks/useRoutes.ts | 91 ++ apps/tron/src/hooks/useSortedTokenList.ts | 28 + apps/tron/src/hooks/useStablePrice.ts | 191 +++ apps/tron/src/hooks/useTokenBalance.ts | 40 + apps/tron/src/hooks/useTokenInfo.ts | 39 + apps/tron/src/hooks/useTotalSupply.ts | 34 + apps/tron/src/hooks/useTronWeb.ts | 19 + apps/tron/src/hooks/useWalletAdapters.ts | 17 + apps/tron/src/lib/getAllPairAddresses.ts | 30 + apps/tron/src/lib/getTokenData.ts | 21 + apps/tron/src/lib/getTronPrice.ts | 18 + apps/tron/src/tronweb.d.ts | 1 + apps/tron/src/types/get-pools-type.ts | 70 + apps/tron/src/types/pricing-types.ts | 23 + apps/tron/src/types/router-selector-type.ts | 19 + apps/tron/src/types/token-type.ts | 34 + apps/tron/src/utils/formatters.ts | 106 ++ apps/tron/src/utils/helpers.ts | 512 ++++++++ apps/tron/src/utils/token-search-helpers.ts | 84 ++ apps/tron/src/utils/tronscan-helpers.ts | 17 + apps/tron/src/utils/warning-severity.ts | 35 + apps/tron/tsconfig.json | 48 +- pnpm-lock.yaml | 1146 ++++++++++++++++- 137 files changed, 9676 insertions(+), 271 deletions(-) delete mode 100644 apps/tron/.env.test create mode 100644 apps/tron/src/app/api/pools/get-reserves/route.ts create mode 100644 apps/tron/src/app/api/pools/my-positions/route.ts create mode 100644 apps/tron/src/app/api/pools/route.ts create mode 100644 apps/tron/src/app/api/pricing/route.ts create mode 100644 apps/tron/src/app/api/token-info/route.ts create mode 100644 apps/tron/src/app/pool/[poolId]/layout.tsx create mode 100644 apps/tron/src/app/pool/[poolId]/page.tsx create mode 100644 apps/tron/src/app/pool/[poolId]/remove-provider.tsx create mode 100644 apps/tron/src/app/pool/add/layout.tsx create mode 100644 apps/tron/src/app/pool/add/page.tsx create mode 100644 apps/tron/src/app/pool/layout.tsx create mode 100644 apps/tron/src/app/pool/page.tsx create mode 100644 apps/tron/src/app/pool/pool-provider.tsx delete mode 100644 apps/tron/src/app/swap/_components/widget.tsx create mode 100644 apps/tron/src/app/swap/layout.tsx create mode 100644 apps/tron/src/bitquery/bitquery-endpoint.ts create mode 100644 apps/tron/src/bitquery/bitquery-headers.ts create mode 100644 apps/tron/src/bitquery/bitquery-options.ts create mode 100644 apps/tron/src/bitquery/queries/getAllPools.ts create mode 100644 apps/tron/src/bitquery/queries/getReserves.ts create mode 100644 apps/tron/src/bitquery/queries/getTokenInfo.ts create mode 100644 apps/tron/src/bitquery/queries/getTransfersToPairs.ts create mode 100644 apps/tron/src/bitquery/queries/getTronInUSDT.ts create mode 100644 apps/tron/src/components/General/Icon.tsx create mode 100644 apps/tron/src/components/General/IconList.tsx create mode 100644 apps/tron/src/components/General/Title.tsx create mode 100644 apps/tron/src/components/General/TokenListSelect.tsx create mode 100644 apps/tron/src/components/Input/Search.tsx create mode 100644 apps/tron/src/components/Input/TokenInput.tsx create mode 100644 apps/tron/src/components/Pools/Add/AddButton.tsx create mode 100644 apps/tron/src/components/Pools/Add/AmountInToken0.tsx create mode 100644 apps/tron/src/components/Pools/Add/AmountIntToken1.tsx create mode 100644 apps/tron/src/components/Pools/Add/DepositForm.tsx create mode 100644 apps/tron/src/components/Pools/Add/Plus.tsx create mode 100644 apps/tron/src/components/Pools/Add/Rate.tsx create mode 100644 apps/tron/src/components/Pools/Add/ReviewAddDialog.tsx create mode 100644 apps/tron/src/components/Pools/Add/ReviewAddDialogTrigger.tsx create mode 100644 apps/tron/src/components/Pools/Add/SelectTokensForm.tsx create mode 100644 apps/tron/src/components/Pools/BackButton.tsx create mode 100644 apps/tron/src/components/Pools/Manage/AddSection.tsx create mode 100644 apps/tron/src/components/Pools/Manage/Manage.tsx create mode 100644 apps/tron/src/components/Pools/Manage/RemoveSection.tsx create mode 100644 apps/tron/src/components/Pools/PoolDetails/LiquidityItem.tsx create mode 100644 apps/tron/src/components/Pools/PoolDetails/PoolHeader.tsx create mode 100644 apps/tron/src/components/Pools/PoolDetails/PoolLiquidity.tsx create mode 100644 apps/tron/src/components/Pools/PoolPosition/PoolPosition.tsx create mode 100644 apps/tron/src/components/Pools/PoolRewards/PoolRewards.tsx create mode 100644 apps/tron/src/components/Pools/PoolSearchBar.tsx create mode 100644 apps/tron/src/components/Pools/PoolsTable/PoolAprCell.tsx create mode 100644 apps/tron/src/components/Pools/PoolsTable/PoolColumns.tsx create mode 100644 apps/tron/src/components/Pools/PoolsTable/PoolNameCell.tsx create mode 100644 apps/tron/src/components/Pools/PoolsTable/PoolReservesCell.tsx create mode 100644 apps/tron/src/components/Pools/PoolsTable/PoolTvlCell.tsx create mode 100644 apps/tron/src/components/Pools/PoolsTable/PoolsTable.tsx create mode 100644 apps/tron/src/components/Pools/PoolsView.tsx create mode 100644 apps/tron/src/components/Pools/PositionsTable/PositionColumns.tsx create mode 100644 apps/tron/src/components/Pools/PositionsTable/PositionNameCell.tsx create mode 100644 apps/tron/src/components/Pools/PositionsTable/PositionSizeCell.tsx create mode 100644 apps/tron/src/components/Pools/PositionsTable/PositionTvlCell.tsx create mode 100644 apps/tron/src/components/Pools/PositionsTable/PositionsTable.tsx create mode 100644 apps/tron/src/components/Pools/Remove/MinimumReceive.tsx create mode 100644 apps/tron/src/components/Pools/Remove/RemoveButton.tsx create mode 100644 apps/tron/src/components/Pools/Remove/RemoveInput.tsx create mode 100644 apps/tron/src/components/Pools/Remove/RemoveLiquidity.tsx create mode 100644 apps/tron/src/components/Pools/ReserveHelper.tsx create mode 100644 apps/tron/src/components/Shared/ApproveToken.tsx create mode 100644 apps/tron/src/components/Shared/DollarAmountDisplay.tsx create mode 100644 apps/tron/src/components/Shared/TokenBalanceDisplay.tsx create mode 100644 apps/tron/src/components/Swap/AmountIn.tsx create mode 100644 apps/tron/src/components/Swap/AmountOut.tsx create mode 100644 apps/tron/src/components/Swap/ReviewSwapDialog.tsx create mode 100644 apps/tron/src/components/Swap/ReviewSwapDialogTrigger.tsx create mode 100644 apps/tron/src/components/Swap/SwapButton.tsx create mode 100644 apps/tron/src/components/Swap/SwapRoutesDialog.tsx create mode 100644 apps/tron/src/components/Swap/SwapStats.tsx create mode 100644 apps/tron/src/components/Swap/SwitchSwapDirection.tsx create mode 100644 apps/tron/src/components/Swap/SwitchSwapType.tsx create mode 100644 apps/tron/src/components/WalletConnector/DefaultView.tsx create mode 100644 apps/tron/src/components/WalletConnector/SettingsView.tsx create mode 100644 apps/tron/src/components/WalletConnector/WalletConnector.tsx create mode 100644 apps/tron/src/components/WalletConnector/WalletListView.tsx create mode 100644 apps/tron/src/constants/abis/factory-abi.ts create mode 100644 apps/tron/src/constants/abis/pair-abi.ts create mode 100644 apps/tron/src/constants/abis/router-abi.ts create mode 100644 apps/tron/src/constants/abis/trc20-abi.ts create mode 100644 apps/tron/src/constants/abis/tron-multicall.ts create mode 100644 apps/tron/src/constants/abis/wrapped-trx-abi.ts create mode 100644 apps/tron/src/constants/contracts.ts create mode 100644 apps/tron/src/constants/icon-size.ts create mode 100644 apps/tron/src/constants/is-testnet.ts create mode 100644 apps/tron/src/constants/max-uint256.ts create mode 100644 apps/tron/src/constants/pair-decimals.ts create mode 100644 apps/tron/src/constants/token-list.tsx create mode 100644 apps/tron/src/hooks/useAllowance.ts create mode 100644 apps/tron/src/hooks/useAmountsOut.ts create mode 100644 apps/tron/src/hooks/useCustomTokens.ts create mode 100644 apps/tron/src/hooks/useIsContract.ts create mode 100644 apps/tron/src/hooks/useMyPositions.ts create mode 100644 apps/tron/src/hooks/useNativeBalance.ts create mode 100644 apps/tron/src/hooks/usePairContract.ts create mode 100644 apps/tron/src/hooks/usePoolOwnership.tsx create mode 100644 apps/tron/src/hooks/usePools.ts create mode 100644 apps/tron/src/hooks/usePriceImpact.ts create mode 100644 apps/tron/src/hooks/useReserves.ts create mode 100644 apps/tron/src/hooks/useRoutes.ts create mode 100644 apps/tron/src/hooks/useSortedTokenList.ts create mode 100644 apps/tron/src/hooks/useStablePrice.ts create mode 100644 apps/tron/src/hooks/useTokenBalance.ts create mode 100644 apps/tron/src/hooks/useTokenInfo.ts create mode 100644 apps/tron/src/hooks/useTotalSupply.ts create mode 100644 apps/tron/src/hooks/useTronWeb.ts create mode 100644 apps/tron/src/hooks/useWalletAdapters.ts create mode 100644 apps/tron/src/lib/getAllPairAddresses.ts create mode 100644 apps/tron/src/lib/getTokenData.ts create mode 100644 apps/tron/src/lib/getTronPrice.ts create mode 100644 apps/tron/src/tronweb.d.ts create mode 100644 apps/tron/src/types/get-pools-type.ts create mode 100644 apps/tron/src/types/pricing-types.ts create mode 100644 apps/tron/src/types/router-selector-type.ts create mode 100644 apps/tron/src/types/token-type.ts create mode 100644 apps/tron/src/utils/formatters.ts create mode 100644 apps/tron/src/utils/helpers.ts create mode 100644 apps/tron/src/utils/token-search-helpers.ts create mode 100644 apps/tron/src/utils/tronscan-helpers.ts create mode 100644 apps/tron/src/utils/warning-severity.ts diff --git a/apps/tron/.env.example b/apps/tron/.env.example index 218639a524..a8c0aae186 100644 --- a/apps/tron/.env.example +++ b/apps/tron/.env.example @@ -1 +1,4 @@ -NEXT_TELEMETRY_DISABLED=1 \ No newline at end of file +NEXT_TELEMETRY_DISABLED=1 +NEXT_PUBLIC_TRON_PRO_API_KEY='' +BITQUERY_API_KEY='' +BITQUERY_BEARER_TOKEN='' \ No newline at end of file diff --git a/apps/tron/.env.test b/apps/tron/.env.test deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/apps/tron/next.config.mjs b/apps/tron/next.config.mjs index a316dd26b1..19eb5099c8 100644 --- a/apps/tron/next.config.mjs +++ b/apps/tron/next.config.mjs @@ -1,20 +1,36 @@ -import defaultNextConfig from '@sushiswap/nextjs-config' +import defaultNextConfig from "@sushiswap/nextjs-config"; /** @type {import('next').NextConfig} */ const nextConfig = { - ...defaultNextConfig, - logging: { - fetches: { - fullUrl: true, - }, - }, - transpilePackages: [], - async redirects() { - return [] - }, - async rewrites() { - return [] - }, -} + ...defaultNextConfig, + logging: { + fetches: { + fullUrl: true, + }, + }, + transpilePackages: ["@sushiswap/ui"], + images: { + remotePatterns: [ + { + protocol: "https", + hostname: "static.tronscan.org", + port: "", + pathname: "**", + }, + ], + }, + async redirects() { + return [ + { + source: "/", + permanent: true, + destination: "/swap", + }, + ]; + }, + async rewrites() { + return []; + }, +}; -export default nextConfig +export default nextConfig; diff --git a/apps/tron/package.json b/apps/tron/package.json index f55c892e87..83be8a4f9b 100644 --- a/apps/tron/package.json +++ b/apps/tron/package.json @@ -12,6 +12,7 @@ "start": "next start" }, "dependencies": { + "@headlessui/react": "1.7.7", "@heroicons/react": "2.0.13", "@radix-ui/react-slot": "1.0.2", "@sentry/nextjs": "7.101.1", @@ -26,6 +27,11 @@ "@tanstack/react-table": "8.9.1", "@vercel/analytics": "1.3.1", "@vercel/edge-config": "1.2.0", + "@tronweb3/tronwallet-abstract-adapter": "^1.1.6", + "@tronweb3/tronwallet-adapter-react-hooks": "^1.1.7", + "@tronweb3/tronwallet-adapter-react-ui": "^1.1.8", + "@tronweb3/tronwallet-adapters": "^1.2.1", + "ethers": "^5.7.2", "lodash.once": "4.1.1", "next": "14.2.3", "next-themes": "0.2.1", @@ -37,7 +43,8 @@ "sharp": "0.32.6", "sushi": "workspace:*", "tiny-invariant": "1.3.1", - "zod": "3.23.8" + "zod": "3.23.8", + "tronweb": "^5.3.2" }, "devDependencies": { "@next/eslint-plugin-next": "14.2.3", diff --git a/apps/tron/src/app/api/pools/get-reserves/route.ts b/apps/tron/src/app/api/pools/get-reserves/route.ts new file mode 100644 index 0000000000..386f65dc36 --- /dev/null +++ b/apps/tron/src/app/api/pools/get-reserves/route.ts @@ -0,0 +1,31 @@ +import { NextResponse } from "next/server"; +import { BITQUERY_ENDPOINT } from "src/bitquery/bitquery-endpoint"; +import { getOptions } from "src/bitquery/bitquery-options"; +import { getReserves } from "src/bitquery/queries/getReserves"; + +export async function GET(req: Request): Promise { + const { searchParams } = new URL(req.url); + const pairAddresses = searchParams.get("pairAddresses"); + + if (!pairAddresses) { + return NextResponse.json({ success: false, message: "pairAddresses is required" }); + } + + try { + const pairAddressArray = pairAddresses.split(","); + const query = getReserves(pairAddressArray); + + const options = getOptions(query); + + const res = await fetch(BITQUERY_ENDPOINT, { ...options, next: { revalidate: 60 } }); + if (!res.ok) { + throw new Error("Failed to fetch data from Bitquery API"); + } + const data = await res.json(); + + return NextResponse.json({ ...data }); + } catch (error) { + console.error(error); + return NextResponse.json(undefined); + } +} diff --git a/apps/tron/src/app/api/pools/my-positions/route.ts b/apps/tron/src/app/api/pools/my-positions/route.ts new file mode 100644 index 0000000000..4d86332308 --- /dev/null +++ b/apps/tron/src/app/api/pools/my-positions/route.ts @@ -0,0 +1,39 @@ +import { NextResponse } from "next/server"; +import { BITQUERY_ENDPOINT } from "src/bitquery/bitquery-endpoint"; +import { getOptions } from "src/bitquery/bitquery-options"; +import { getTransfersToPairs } from "src/bitquery/queries/getTransfersToPairs"; + +export async function GET(req: Request): Promise { + const { searchParams } = new URL(req.url); + const pairAddresses = searchParams.get("pairAddresses"); + const walletAddress = searchParams.get("walletAddress"); + + if (!pairAddresses) { + return NextResponse.json({ success: false, message: "pairAddresses is required" }); + } + + if (!walletAddress) { + return NextResponse.json({ success: false, message: "walletAddress is required" }); + } + + try { + const pairAddressArray = pairAddresses.split(","); + const query = getTransfersToPairs(pairAddressArray, walletAddress); + + const options = getOptions(query); + + const res = await fetch(BITQUERY_ENDPOINT, { + ...options, + next: { revalidate: 60 }, + }); + if (!res.ok) { + throw new Error("Failed to fetch data from Bitquery API"); + } + const data = await res.json(); + + return NextResponse.json({ ...data }); + } catch (error) { + console.error(error); + return NextResponse.json(undefined); + } +} diff --git a/apps/tron/src/app/api/pools/route.ts b/apps/tron/src/app/api/pools/route.ts new file mode 100644 index 0000000000..c843ba2a7e --- /dev/null +++ b/apps/tron/src/app/api/pools/route.ts @@ -0,0 +1,30 @@ +import { NextResponse } from "next/server"; +import { BITQUERY_ENDPOINT } from "src/bitquery/bitquery-endpoint"; +import { getOptions } from "src/bitquery/bitquery-options"; +import { getAllPools } from "src/bitquery/queries/getAllPools"; + +export async function GET(req: Request): Promise { + const { searchParams } = new URL(req.url); + const factoryAddress = searchParams.get("factoryAddress"); + + if (!factoryAddress) { + return NextResponse.json({ success: false, message: "factoryAddress is required" }); + } + + try { + const query = getAllPools(factoryAddress); + + const options = getOptions(query); + + const res = await fetch(BITQUERY_ENDPOINT, { ...options, next: { revalidate: 120 } }); // revalidate every 2 minutes + if (!res.ok) { + throw new Error("Failed to fetch data from Bitquery API"); + } + const data = await res.json(); + + return NextResponse.json({ ...data }); + } catch (error) { + console.error(error); + return NextResponse.json(undefined); + } +} diff --git a/apps/tron/src/app/api/pricing/route.ts b/apps/tron/src/app/api/pricing/route.ts new file mode 100644 index 0000000000..d389b5524e --- /dev/null +++ b/apps/tron/src/app/api/pricing/route.ts @@ -0,0 +1,23 @@ +import { NextResponse } from "next/server"; +import { BITQUERY_ENDPOINT } from "src/bitquery/bitquery-endpoint"; +import { getOptions } from "src/bitquery/bitquery-options"; +import { getTronInUSDT } from "src/bitquery/queries/getTronInUSDT"; + +export async function GET(): Promise { + try { + const query = getTronInUSDT(); + + const options = getOptions(query); + + const res = await fetch(BITQUERY_ENDPOINT, { ...options, next: { revalidate: 120 } }); // revalidate every 2 minutes + if (!res.ok) { + throw new Error("Failed to fetch data from Bitquery API"); + } + const data = await res.json(); + + return NextResponse.json({ ...data }); + } catch (error) { + console.error(error); + return NextResponse.json(undefined); + } +} diff --git a/apps/tron/src/app/api/token-info/route.ts b/apps/tron/src/app/api/token-info/route.ts new file mode 100644 index 0000000000..0714000aa9 --- /dev/null +++ b/apps/tron/src/app/api/token-info/route.ts @@ -0,0 +1,30 @@ +import { NextResponse } from "next/server"; +import { BITQUERY_ENDPOINT } from "src/bitquery/bitquery-endpoint"; +import { getOptions } from "src/bitquery/bitquery-options"; +import { getTokenInfo } from "src/bitquery/queries/getTokenInfo"; + +export async function GET(req: Request): Promise { + const { searchParams } = new URL(req.url); + const contractAddress = searchParams.get("contractAddress"); + + if (!contractAddress) { + return NextResponse.json({ success: false, message: "contractAddress is required" }); + } + + try { + const query = getTokenInfo(contractAddress); + + const options = getOptions(query); + + const res = await fetch(BITQUERY_ENDPOINT, { ...options, next: { revalidate: Infinity } }); + if (!res.ok) { + throw new Error("Failed to fetch data from Bitquery API"); + } + const data = await res.json(); + + return NextResponse.json({ ...data }); + } catch (error) { + console.error(error); + return NextResponse.json(undefined); + } +} diff --git a/apps/tron/src/app/header.tsx b/apps/tron/src/app/header.tsx index 0c9826752d..b304e7eea9 100644 --- a/apps/tron/src/app/header.tsx +++ b/apps/tron/src/app/header.tsx @@ -1,109 +1,34 @@ 'use client' -import { classNames } from '@sushiswap/ui' import { - NavigationMenu, - NavigationMenuContent, - NavigationMenuItem, - NavigationMenuLink, - NavigationMenuList, - NavigationMenuTrigger, - navigationMenuTriggerStyle, + Navigation, + NavigationElement, + NavigationElementType, } from '@sushiswap/ui' -import { SushiIcon } from '@sushiswap/ui/icons/SushiIcon' -import Link from 'next/link' import React, { FC } from 'react' -interface NavigationListItemProps extends React.ComponentPropsWithoutRef<'a'> { - href: string -} +import { WalletConnector } from 'src/components/WalletConnector/WalletConnector' -const NavigationListItem: FC = ({ - className, - title, - children, - href, -}) => { - return ( -
  • - - -
    {title}
    -

    - {children} -

    - -
    -
  • - ) -} +const nagivationElements: NavigationElement[] = [ + { + title: 'Swap', + href: '/aptos/swap', + show: 'everywhere', + type: NavigationElementType.Single, + }, + { + title: 'Pool', + href: '/aptos/pool', + show: 'everywhere', + type: NavigationElementType.Single, + }, +] -export const Navigation: FC = () => { +export const Header: FC = () => { return ( -
    - -
    - - - - - Swap - - - - - Pool - - - - - Explore - -
      - - Pools - - - Tokens - - - Transactions - -
    -
    -
    -
    -
    -
    Wallet Connector
    -
    -
    + } + /> ) } - -export const Header: FC = () => { - return -} diff --git a/apps/tron/src/app/layout.tsx b/apps/tron/src/app/layout.tsx index 92e9065c1d..f3da27e400 100644 --- a/apps/tron/src/app/layout.tsx +++ b/apps/tron/src/app/layout.tsx @@ -1,70 +1,55 @@ -import '@sushiswap/ui/index.css' +import "@sushiswap/ui/index.css"; -import type { Metadata } from 'next' -import { Inter, Roboto_Mono } from 'next/font/google' -import React from 'react' -import { Header } from './header' -import { Providers } from './providers' -import { Trackers } from './trackers' +import type { Metadata } from "next"; +import { Inter, Roboto_Mono } from "next/font/google"; +import React from "react"; +import { Header } from "./header"; +import { Providers } from "./providers"; +import { Trackers } from "./trackers"; const inter = Inter({ - subsets: ['latin'], - display: 'swap', - variable: '--font-inter', -}) + subsets: ["latin"], + display: "swap", + variable: "--font-inter", +}); const roboto_mono = Roboto_Mono({ - subsets: ['latin'], - display: 'swap', - variable: '--font-roboto-mono', -}) + subsets: ["latin"], + display: "swap", + variable: "--font-roboto-mono", +}); export const metadata: Metadata = { - title: { - default: 'Sushi 🍣', - template: '%s | Sushi 🍣', - }, - description: - 'A Decentralised Finance (DeFi) app with features such as swap, cross chain swap, streaming, vesting, and permissionless market making for liquidity providers.', -} + title: { + default: "Sushi 🍣", + template: "%s | Sushi 🍣", + }, + description: + "A Decentralised Finance (DeFi) app with features such as swap, cross chain swap, streaming, vesting, and permissionless market making for liquidity providers.", +}; -export default function RootLayout({ - children, -}: { children: React.ReactNode }) { - return ( - // - - - - - - - - -
    -
    - {children} - -
    - - - ) +export default function RootLayout({ children }: { children: React.ReactNode }) { + return ( + // + + + + + + + + +
    + +
    + {children} + + +
    + + + ); } diff --git a/apps/tron/src/app/pool/[poolId]/layout.tsx b/apps/tron/src/app/pool/[poolId]/layout.tsx new file mode 100644 index 0000000000..105625e06a --- /dev/null +++ b/apps/tron/src/app/pool/[poolId]/layout.tsx @@ -0,0 +1,5 @@ +import { RemoveProvider } from "./remove-provider"; + +export default function RemoveLiqLayout({ children }: { children: React.ReactNode }) { + return {children}; +} diff --git a/apps/tron/src/app/pool/[poolId]/page.tsx b/apps/tron/src/app/pool/[poolId]/page.tsx new file mode 100644 index 0000000000..b5b371f3b7 --- /dev/null +++ b/apps/tron/src/app/pool/[poolId]/page.tsx @@ -0,0 +1,73 @@ +"use client"; +import { Breadcrumb, Container } from "@sushiswap/ui"; +import { useEffect } from "react"; +import { Manage } from "src/components/Pools/Manage/Manage"; +import { PoolHeader } from "src/components/Pools/PoolDetails/PoolHeader"; +import { PoolLiquidity } from "src/components/Pools/PoolDetails/PoolLiquidity"; +import { PoolPosition } from "src/components/Pools/PoolPosition/PoolPosition"; +import { PoolRewards } from "src/components/Pools/PoolRewards/PoolRewards"; +import { useTokenInfo } from "src/hooks/useTokenInfo"; +import { usePoolDispatch } from "../pool-provider"; +import { isAddress } from "src/utils/helpers"; + +export default function PoolByIdPage({ params }: { params: { poolId: string } }) { + const { poolId } = params; + const decodedPoolId = decodeURIComponent(poolId); + const token0 = decodedPoolId?.split(":")?.[0]; + const token1 = decodedPoolId?.split(":")?.[1]; + const pairAddress = decodedPoolId?.split(":")?.[2]; + const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ tokenAddress: token0 }); + const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ tokenAddress: token1 }); + const isLoadingTokens = isLoadingToken0 || isLoadingToken1; + const { setToken0, setToken1, setPairAddress } = usePoolDispatch(); + + useEffect(() => { + if (pairAddress && isAddress(pairAddress)) { + setPairAddress(pairAddress); + } + }, [pairAddress]); + + useEffect(() => { + if (token0Data) { + setToken0(token0Data); + } + if (token1Data) { + setToken1(token1Data); + } + }, [token0Data, token1Data]); + + return ( + <> +
    + + + + + + +
    +
    + +
    + + +
    +
    + + +
    +
    +
    + + ); +} diff --git a/apps/tron/src/app/pool/[poolId]/remove-provider.tsx b/apps/tron/src/app/pool/[poolId]/remove-provider.tsx new file mode 100644 index 0000000000..4742dd3236 --- /dev/null +++ b/apps/tron/src/app/pool/[poolId]/remove-provider.tsx @@ -0,0 +1,133 @@ +"use client"; + +import { FC, createContext, useContext, useMemo, useReducer } from "react"; + +type Action = + | { type: "setPercentage"; value: number } + | { type: "setIsTxnPending"; value: boolean } + | { type: "setAmountToken0PerLP"; value: string } + | { type: "setAmountToken1PerLP"; value: string } + | { type: "setTotalSupplyLP"; value: string } + | { type: "setLPBalance"; value: string } + | { type: "setLPToRemove"; value: string } + | { type: "setMinAmountToken0"; value: string } + | { type: "setMinAmountToken1"; value: string }; + +type Dispatch = { + setIsTxnPending(isPending: boolean): void; + setPercentage(percentage: number): void; + setAmountToken0PerLP(amount: string): void; + setAmountToken1PerLP(amount: string): void; + setTotalSupplyLP(amount: string): void; + setLPBalance(amount: string): void; + setLPToRemove(amount: string): void; + setMinAmountToken0(amount: string): void; + setMinAmountToken1(amount: string): void; +}; + +type State = { + percentage: number; + isTxnPending: boolean; + amountToken0PerLP: string; + amountToken1PerLP: string; + totalSupplyLP: string; + lpBalance: string; + lpToRemove: string; + minAmountToken0: string; + minAmountToken1: string; +}; + +type RemoveProviderProps = { children: React.ReactNode }; + +const RemoveContext = createContext<{ state: State; dispatch: Dispatch } | undefined>(undefined); + +function removeReducer(_state: State, action: Action) { + switch (action.type) { + case "setPercentage": { + return { ..._state, percentage: action.value }; + } + case "setIsTxnPending": { + return { ..._state, isTxnPending: action.value }; + } + case "setAmountToken0PerLP": { + return { ..._state, amountToken0PerLP: action.value }; + } + case "setAmountToken1PerLP": { + return { ..._state, amountToken1PerLP: action.value }; + } + case "setTotalSupplyLP": { + return { ..._state, totalSupplyLP: action.value }; + } + case "setLPBalance": { + return { ..._state, lpBalance: action.value }; + } + case "setLPToRemove": { + return { ..._state, lpToRemove: action.value }; + } + case "setMinAmountToken0": { + return { ..._state, minAmountToken0: action.value }; + } + case "setMinAmountToken1": { + return { ..._state, minAmountToken1: action.value }; + } + } +} + +const RemoveProvider: FC = ({ children }) => { + const [state, dispatch] = useReducer(removeReducer, { + percentage: 0, //0-100 + isTxnPending: false, + amountToken0PerLP: "", //will be formatted, will not be in wei amount + amountToken1PerLP: "", //will be formatted, will not be in wei amount + totalSupplyLP: "", //will be in wei + lpBalance: "", //will be in wei + lpToRemove: "", //will be in wei + minAmountToken0: "", //will be in wei + minAmountToken1: "", //will be in wei + }); + + const dispatchWithAction = useMemo( + () => ({ + setPercentage: (value: number) => dispatch({ type: "setPercentage", value }), + setIsTxnPending: (value: boolean) => dispatch({ type: "setIsTxnPending", value }), + setAmountToken0PerLP: (value: string) => dispatch({ type: "setAmountToken0PerLP", value }), + setAmountToken1PerLP: (value: string) => dispatch({ type: "setAmountToken1PerLP", value }), + setTotalSupplyLP: (value: string) => dispatch({ type: "setTotalSupplyLP", value }), + setLPBalance: (value: string) => dispatch({ type: "setLPBalance", value }), + setLPToRemove: (value: string) => dispatch({ type: "setLPToRemove", value }), + setMinAmountToken0: (value: string) => dispatch({ type: "setMinAmountToken0", value }), + setMinAmountToken1: (value: string) => dispatch({ type: "setMinAmountToken1", value }), + }), + [dispatch] + ); + + return ( + { + return { state, dispatch: dispatchWithAction }; + }, [state])}> + {children} + + ); +}; + +const useRemoveContext = () => { + const context = useContext(RemoveContext); + if (!context) { + throw new Error("Hook can only be used inside Remove Liq Provider"); + } + + return context; +}; + +const useRemoveLiqState = () => { + const context = useRemoveContext(); + return context.state; +}; + +const useRemoveLiqDispatch = () => { + const context = useRemoveContext(); + return context.dispatch; +}; + +export { RemoveProvider, useRemoveLiqState, useRemoveLiqDispatch }; diff --git a/apps/tron/src/app/pool/add/layout.tsx b/apps/tron/src/app/pool/add/layout.tsx new file mode 100644 index 0000000000..b0386a20df --- /dev/null +++ b/apps/tron/src/app/pool/add/layout.tsx @@ -0,0 +1,32 @@ +import { Container, typographyVariants } from "@sushiswap/ui"; +import { Metadata } from "next"; +import { BackButton } from "src/components/Pools/BackButton"; + +export const metadata: Metadata = { + title: "Pool 💦", +}; + +export default function CreatePositionLayout({ children }: { children: React.ReactNode }) { + return ( + <> + +
    +
    + +

    Add Liquidity

    +
    +

    + Create a new pool or create a liquidity position on an existing pool. +

    +
    +
    +
    +
    + + {children} + +
    +
    + + ); +} diff --git a/apps/tron/src/app/pool/add/page.tsx b/apps/tron/src/app/pool/add/page.tsx new file mode 100644 index 0000000000..b04a420110 --- /dev/null +++ b/apps/tron/src/app/pool/add/page.tsx @@ -0,0 +1,11 @@ +import { DepositForm } from "src/components/Pools/Add/DepositForm"; +import { SelectTokensForm } from "src/components/Pools/Add/SelectTokensForm"; + +export default function AddPage() { + return ( + <> + + + + ); +} diff --git a/apps/tron/src/app/pool/layout.tsx b/apps/tron/src/app/pool/layout.tsx new file mode 100644 index 0000000000..e218abb8ed --- /dev/null +++ b/apps/tron/src/app/pool/layout.tsx @@ -0,0 +1,10 @@ +import { Metadata } from "next"; +import { PoolProvider } from "./pool-provider"; + +export const metadata: Metadata = { + title: "Pool", +}; + +export default function PoolLayout({ children }: { children: React.ReactNode }) { + return {children}; +} diff --git a/apps/tron/src/app/pool/page.tsx b/apps/tron/src/app/pool/page.tsx new file mode 100644 index 0000000000..8cccf020b6 --- /dev/null +++ b/apps/tron/src/app/pool/page.tsx @@ -0,0 +1,61 @@ +"use client"; +import { ChevronRightIcon } from "@heroicons/react/24/outline"; +import { Container, LinkExternal, LinkInternal, typographyVariants } from "@sushiswap/ui"; +import { Button } from "@sushiswap/ui"; +import { DiscordIcon } from "@sushiswap/ui"; +import Link from "next/link"; +import { PoolsView } from "src/components/Pools/PoolsView"; + +export default function Pool() { + return ( + <> + +
    +
    +
    +

    + Put your funds to work
    + by providing liquidity. +

    +

    + When you add liquidity to a pool, you can receive a share of its trading volume and + potentially snag extra rewards when there are incentives involved! +

    +
    +
    +
    + +
    +
    +
    +
    +
    + Looking for a partnership with Sushi? + +
    +
    + Need Help? + +
    +
    +
    +
    + + + + ); +} diff --git a/apps/tron/src/app/pool/pool-provider.tsx b/apps/tron/src/app/pool/pool-provider.tsx new file mode 100644 index 0000000000..6dee0bd86e --- /dev/null +++ b/apps/tron/src/app/pool/pool-provider.tsx @@ -0,0 +1,160 @@ +"use client"; + +import { FC, createContext, useContext, useMemo, useReducer } from "react"; +import { ReserveHelper } from "src/components/Pools/ReserveHelper"; +import { DEFAULT_TOKEN_LIST } from "src/constants/token-list"; +import { IToken } from "src/types/token-type"; + +type InputFieldType = "token0" | "token1"; + +type Action = + | { type: "setToken0"; value: IToken } + | { type: "setToken1"; value: IToken } + | { type: "setIsTxnPending"; value: boolean } + | { type: "setAmountInToken0"; value: string } + | { type: "setAmountInToken1"; value: string } + | { type: "setPairAddress"; value: string | undefined | null } + | { type: "setReserve0"; value: string } + | { type: "setReserve1"; value: string } + | { type: "setInputField"; value: InputFieldType }; + +type Dispatch = { + setToken0(token: IToken): void; + setToken1(token: IToken): void; + setIsTxnPending(isPending: boolean): void; + setAmountInToken0(amount: string): void; + setAmountInToken1(amount: string): void; + setPairAddress(pairAddress: string | undefined | null): void; + setReserve0(reserve0: string): void; + setReserve1(reserve1: string): void; + setInputField(inputField: InputFieldType): void; +}; + +type State = { + token0: IToken | undefined; + token1: IToken | undefined; + isTxnPending: boolean; + amountInToken0: string; + amountInToken1: string; + pairAddress: string | undefined | null; + reserve0: string; + reserve1: string; + inputField: "token0" | "token1"; +}; + +type PoolProviderProps = { children: React.ReactNode }; + +const PoolContext = createContext<{ state: State; dispatch: Dispatch } | undefined>(undefined); + +function poolReducer(_state: State, action: Action) { + switch (action.type) { + case "setToken0": { + if (_state?.token1?.address === action.value.address) { + //if token1 is the same as the new token0, swap them + return { ..._state, token1: _state.token0, token0: action.value }; + } + //if token1 is TRX and the new token is WRTX or vice versa, go back to default pair + if ( + (_state?.token1?.symbol === "TRX" && action.value.symbol === "WTRX") || + (_state?.token1?.symbol === "WTRX" && action.value.symbol === "TRX") + ) { + return { ..._state, token0: DEFAULT_TOKEN_LIST[0], token1: DEFAULT_TOKEN_LIST[2] }; + } + return { ..._state, token0: action.value }; + } + case "setToken1": { + if (_state?.token0?.address === action.value.address) { + //if token0 is the same as the new token1, swap them + return { ..._state, token0: _state.token1, token1: action.value }; + } + if ( + (_state?.token0?.symbol === "TRX" && action.value.symbol === "WTRX") || + (_state?.token0?.symbol === "WTRX" && action.value.symbol === "TRX") + ) { + return { ..._state, token0: DEFAULT_TOKEN_LIST[0], token1: DEFAULT_TOKEN_LIST[2] }; + } + return { ..._state, token1: action.value }; + } + case "setIsTxnPending": { + return { ..._state, isTxnPending: action.value }; + } + case "setAmountInToken0": { + return { ..._state, amountInToken0: action.value }; + } + case "setAmountInToken1": { + return { ..._state, amountInToken1: action.value }; + } + case "setPairAddress": { + return { ..._state, pairAddress: action.value }; + } + case "setReserve0": { + return { ..._state, reserve0: action.value }; + } + case "setReserve1": { + return { ..._state, reserve1: action.value }; + } + case "setInputField": { + return { ..._state, inputField: action.value }; + } + } +} + +const PoolProvider: FC = ({ children }) => { + const [state, dispatch] = useReducer(poolReducer, { + token0: DEFAULT_TOKEN_LIST[0], + token1: DEFAULT_TOKEN_LIST[2], + isTxnPending: false, + amountInToken0: "", + amountInToken1: "", + pairAddress: undefined, + reserve0: "", + reserve1: "", + inputField: "token0", + }); + + const dispatchWithAction = useMemo( + () => ({ + setToken0: (value: IToken) => dispatch({ type: "setToken0", value }), + setToken1: (value: IToken) => dispatch({ type: "setToken1", value }), + setIsTxnPending: (value: boolean) => dispatch({ type: "setIsTxnPending", value }), + setAmountInToken0: (value: string) => dispatch({ type: "setAmountInToken0", value }), + setAmountInToken1: (value: string) => dispatch({ type: "setAmountInToken1", value }), + setPairAddress: (value: string | undefined | null) => dispatch({ type: "setPairAddress", value }), + setReserve0: (value: string) => dispatch({ type: "setReserve0", value }), + setReserve1: (value: string) => dispatch({ type: "setReserve1", value }), + setInputField: (value: InputFieldType) => dispatch({ type: "setInputField", value }), + }), + [dispatch] + ); + + return ( + { + return { state, dispatch: dispatchWithAction }; + }, [state])}> + + {children} + + ); +}; + +const usePoolContext = () => { + const context = useContext(PoolContext); + if (!context) { + throw new Error("Hook can only be used inside Pool Provider"); + } + + return context; +}; + +const usePoolState = () => { + const context = usePoolContext(); + return context.state; +}; + +const usePoolDispatch = () => { + const context = usePoolContext(); + return context.dispatch; +}; + +export { PoolProvider, usePoolState, usePoolDispatch }; diff --git a/apps/tron/src/app/providers.tsx b/apps/tron/src/app/providers.tsx index 04e09d4cc2..d9ed705505 100644 --- a/apps/tron/src/app/providers.tsx +++ b/apps/tron/src/app/providers.tsx @@ -1,12 +1,33 @@ 'use client' +import '@tronweb3/tronwallet-adapter-react-ui/style.css' + import { BaseProviders } from '@sushiswap/ui' +import { WalletError } from '@tronweb3/tronwallet-abstract-adapter' +import { WalletProvider } from '@tronweb3/tronwallet-adapter-react-hooks' +import { WalletModalProvider } from '@tronweb3/tronwallet-adapter-react-ui' +import { useCallback } from 'react' +import { useWalletAdapters } from 'src/hooks/useWalletAdapters' import { QueryClientProvider } from '../providers/query-client-provider' export function Providers({ children }: { children: React.ReactNode }) { + const { adapters } = useWalletAdapters() + const onError = useCallback((e: WalletError) => { + console.log(e) + // if (e instanceof WalletNotFoundError) { + // alert(e.message); + // } else if (e instanceof WalletDisconnectedError) { + // alert(e.message); + // } else alert(e.message); + }, []) + return ( - {children} + + + {children} + + ) } diff --git a/apps/tron/src/app/swap/_components/widget.tsx b/apps/tron/src/app/swap/_components/widget.tsx deleted file mode 100644 index 598c30c984..0000000000 --- a/apps/tron/src/app/swap/_components/widget.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { FC } from 'react' - -export const Widget: FC = () => { - return null -} diff --git a/apps/tron/src/app/swap/layout.tsx b/apps/tron/src/app/swap/layout.tsx new file mode 100644 index 0000000000..51d39e9728 --- /dev/null +++ b/apps/tron/src/app/swap/layout.tsx @@ -0,0 +1,10 @@ +import { Metadata } from "next"; +import { Providers } from "./providers"; + +export const metadata: Metadata = { + title: "SushiSwap on Tron", +}; + +export default function SwapLayout({ children }: { children: React.ReactNode }) { + return {children}; +} diff --git a/apps/tron/src/app/swap/page.tsx b/apps/tron/src/app/swap/page.tsx index c0b501220d..49f913e210 100644 --- a/apps/tron/src/app/swap/page.tsx +++ b/apps/tron/src/app/swap/page.tsx @@ -1,17 +1,31 @@ -import { Container } from '@sushiswap/ui' -import { Widget } from './_components/widget' -import { Providers } from './providers' - -export const metadata = { - title: 'SushiSwap on Tron', -} +"use client"; +import { Container, SettingsModule, SettingsOverlay } from "@sushiswap/ui"; +import { SwitchSwapType } from "src/components/Swap/SwitchSwapType"; +import { SwitchSwapDirection } from "src/components/Swap/SwitchSwapDirection"; +import { ReviewSwapDialog } from "src/components/Swap/ReviewSwapDialog"; +import { AmountIn } from "src/components/Swap/AmountIn"; +import { AmountOut } from "src/components/Swap/AmountOut"; +import { SwapStats } from "src/components/Swap/SwapStats"; +import { Title } from "src/components/General/Title"; export default function SwapSimplePage() { - return ( - - - - - - ) + return ( + + Trade +
    + + +
    +
    + + + +
    + + +
    + ); } diff --git a/apps/tron/src/app/swap/providers.tsx b/apps/tron/src/app/swap/providers.tsx index c60700dec1..eddff729fe 100644 --- a/apps/tron/src/app/swap/providers.tsx +++ b/apps/tron/src/app/swap/providers.tsx @@ -1,5 +1,6 @@ -import { SwapProvider } from './swap-provider' +"use client"; +import { SwapProvider } from "./swap-provider"; export async function Providers({ children }: { children: React.ReactNode }) { - return {children} + return {children}; } diff --git a/apps/tron/src/app/swap/swap-provider.tsx b/apps/tron/src/app/swap/swap-provider.tsx index f6c7e971a0..d715ea9daf 100644 --- a/apps/tron/src/app/swap/swap-provider.tsx +++ b/apps/tron/src/app/swap/swap-provider.tsx @@ -1,57 +1,136 @@ -'use client' +"use client"; -import { FC, createContext, useContext, useMemo, useReducer } from 'react' +import { FC, createContext, useContext, useMemo, useReducer } from "react"; +import { DEFAULT_TOKEN_LIST } from "src/constants/token-list"; +import { IToken } from "src/types/token-type"; -type Action = { type: 'bar' } -type Dispatch = (action: Action) => void -type State = { foo: string } -type SwapProviderProps = { children: React.ReactNode } +type Action = + | { type: "swapTokens" } + | { type: "setToken0"; value: IToken } + | { type: "setToken1"; value: IToken } + | { type: "setIsTxnPending"; value: boolean } + | { type: "setAmountIn"; value: string } + | { type: "setAmountOut"; value: string } + | { type: "setRoute"; value: string[] } + | { type: "setPriceImpactPercentage"; value: number }; -const SwapContext = createContext< - { state: State; dispatch: Dispatch } | undefined ->(undefined) +type Dispatch = { + swapTokens(): void; + setToken0(token: IToken): void; + setToken1(token: IToken): void; + setIsTxnPending(isPending: boolean): void; + setAmountIn(amount: string): void; + setAmountOut(amount: string): void; + setPriceImpactPercentage(priceImpactPercentage: number): void; + setRoute(route: string[]): void; +}; + +type State = { + token0: IToken; + token1: IToken; + isTxnPending: boolean; + amountIn: string; + amountOut: string; + priceImpactPercentage: number; + route: string[]; +}; + +type SwapProviderProps = { children: React.ReactNode }; + +const SwapContext = createContext<{ state: State; dispatch: Dispatch } | undefined>(undefined); function swapReducer(_state: State, action: Action) { - switch (action.type) { - case 'bar': { - return { foo: 'bar' } - } - default: { - throw new Error(`Unhandled action type: ${action.type}`) - } - } + switch (action.type) { + case "setToken0": { + if (_state.token1.address === action.value.address) { + //if token1 is the same as the new token0, swap them + return { ..._state, token1: _state.token0, token0: action.value }; + } + return { ..._state, token0: action.value }; + } + case "setToken1": { + if (_state.token0.address === action.value.address) { + //if token0 is the same as the new token1, swap them + return { ..._state, token0: _state.token1, token1: action.value }; + } + return { ..._state, token1: action.value }; + } + case "swapTokens": { + return { ..._state, token0: _state.token1, token1: _state.token0 }; + } + case "setIsTxnPending": { + return { ..._state, isTxnPending: action.value }; + } + case "setAmountIn": { + return { ..._state, amountIn: action.value }; + } + case "setAmountOut": { + return { ..._state, amountOut: action.value }; + } + case "setPriceImpactPercentage": { + return { ..._state, priceImpactPercentage: action.value }; + } + case "setRoute": { + return { ..._state, route: action.value }; + } + // default: { + // throw new Error(`Unhandled action type: ${action.type}`); + // } + } } const SwapProvider: FC = ({ children }) => { - const [state, dispatch] = useReducer(swapReducer, { foo: 'foo' }) - return ( - { - return { state, dispatch } - }, [state])} - > - {children} - - ) -} + const [state, dispatch] = useReducer(swapReducer, { + token0: DEFAULT_TOKEN_LIST[0], + token1: DEFAULT_TOKEN_LIST[1], + isTxnPending: false, + amountIn: "", + amountOut: "", + priceImpactPercentage: 0, + route: [], + }); + + const dispatchWithAction = useMemo( + () => ({ + setToken0: (value: IToken) => dispatch({ type: "setToken0", value }), + setToken1: (value: IToken) => dispatch({ type: "setToken1", value }), + swapTokens: () => dispatch({ type: "swapTokens" }), + setIsTxnPending: (value: boolean) => dispatch({ type: "setIsTxnPending", value }), + setAmountIn: (value: string) => dispatch({ type: "setAmountIn", value }), + setAmountOut: (value: string) => dispatch({ type: "setAmountOut", value }), + setPriceImpactPercentage: (value: number) => dispatch({ type: "setPriceImpactPercentage", value }), + setRoute: (value: string[]) => dispatch({ type: "setRoute", value }), + }), + [dispatch] + ); + + return ( + { + return { state, dispatch: dispatchWithAction }; + }, [state])}> + {children} + + ); +}; const useSwapContext = () => { - const context = useContext(SwapContext) - if (!context) { - throw new Error('Hook can only be used inside Swap Provider') - } + const context = useContext(SwapContext); + if (!context) { + throw new Error("Hook can only be used inside Swap Provider"); + } - return context -} + return context; +}; const useSwapState = () => { - const context = useSwapContext() - return context.state -} + const context = useSwapContext(); + return context.state; +}; const useSwapDispatch = () => { - const context = useSwapContext() - return context.dispatch -} + const context = useSwapContext(); + return context.dispatch; +}; -export { SwapProvider, useSwapState, useSwapDispatch } +export { SwapProvider, useSwapState, useSwapDispatch }; diff --git a/apps/tron/src/bitquery/bitquery-endpoint.ts b/apps/tron/src/bitquery/bitquery-endpoint.ts new file mode 100644 index 0000000000..36d0b74a11 --- /dev/null +++ b/apps/tron/src/bitquery/bitquery-endpoint.ts @@ -0,0 +1 @@ +export const BITQUERY_ENDPOINT = "https://graphql.bitquery.io"; diff --git a/apps/tron/src/bitquery/bitquery-headers.ts b/apps/tron/src/bitquery/bitquery-headers.ts new file mode 100644 index 0000000000..16261591c2 --- /dev/null +++ b/apps/tron/src/bitquery/bitquery-headers.ts @@ -0,0 +1,13 @@ +export const getBitqueryHeaders = () => { + if (!process.env.BITQUERY_API_KEY) { + throw new Error("BITQUERY_API_KEY is not set"); + } + if (!process.env.BITQUERY_BEARER_TOKEN) { + throw new Error("BITQUERY_BEARER_TOKEN is not set"); + } + const headers = new Headers(); + headers.append("Content-Type", "application/json"); + headers.append("X-API-KEY", process.env.BITQUERY_API_KEY); + headers.append("Authorization", `Bearer ${process.env.BITQUERY_BEARER_TOKEN}`); + return headers; +}; diff --git a/apps/tron/src/bitquery/bitquery-options.ts b/apps/tron/src/bitquery/bitquery-options.ts new file mode 100644 index 0000000000..7ac68b73e5 --- /dev/null +++ b/apps/tron/src/bitquery/bitquery-options.ts @@ -0,0 +1,11 @@ +import { getBitqueryHeaders } from "./bitquery-headers"; + +export const getOptions = (query: string) => { + const headers = getBitqueryHeaders(); + return { + method: "POST", + headers, + body: query, + redirect: "follow" as RequestRedirect, + }; +}; diff --git a/apps/tron/src/bitquery/queries/getAllPools.ts b/apps/tron/src/bitquery/queries/getAllPools.ts new file mode 100644 index 0000000000..65302bb2e0 --- /dev/null +++ b/apps/tron/src/bitquery/queries/getAllPools.ts @@ -0,0 +1,9 @@ +export const getAllPools = (factoryContract: string) => { + const query = JSON.stringify({ + query: + 'query ($factoryContract: String!) {\n tron {\n smartContractEvents(\n smartContractEvent: {is: "PairCreated"}\n smartContractAddress: {is: $factoryContract}\n options: {desc: "block.height"}\n ) {\n arguments {\n argument\n value\n }\n block {\n height\n }\n }\n }\n}\n', + variables: `{\n \"factoryContract\": \"${factoryContract}\"\n}`, + }); + + return query; +}; diff --git a/apps/tron/src/bitquery/queries/getReserves.ts b/apps/tron/src/bitquery/queries/getReserves.ts new file mode 100644 index 0000000000..af3de73e22 --- /dev/null +++ b/apps/tron/src/bitquery/queries/getReserves.ts @@ -0,0 +1,15 @@ +export const getReserves = (pairAddresses: string[]) => { + if (pairAddresses.length === 0 || pairAddresses.length > 100) { + throw new Error("Invalid pairAddresses length. Must be between 1 and 100."); + } + + const pairAddressesString = pairAddresses.map((address) => `"${address}"`).join(", "); + + const query = JSON.stringify({ + query: + 'query ($pairAddresses: [String!]) {\n tron {\n smartContractEvents(\n smartContractEvent: {is: "Sync"}\n smartContractAddress: {in: $pairAddresses}\n options: {desc: "block.height", limitBy: {limit: 1, each: "smartContract.address.address"}}\n ) {\n arguments {\n argument\n value\n }\n block {\n height\n }\n smartContract {\n address {\n address\n }\n }\n }\n }\n}\n', + variables: `{\n \"pairAddresses\": [\n ${pairAddressesString}\n ]\n}`, + }); + + return query; +}; diff --git a/apps/tron/src/bitquery/queries/getTokenInfo.ts b/apps/tron/src/bitquery/queries/getTokenInfo.ts new file mode 100644 index 0000000000..ba64993547 --- /dev/null +++ b/apps/tron/src/bitquery/queries/getTokenInfo.ts @@ -0,0 +1,9 @@ +export const getTokenInfo = (contractAddress: string) => { + const query = JSON.stringify({ + query: + "query ($contractAddress: String!) {\n tron {\n address(address: {is: $contractAddress}) {\n smartContract {\n currency {\n decimals\n name\n symbol\n }\n }\n }\n }\n}", + variables: `{\n \"contractAddress\": \"${contractAddress}\"\n}`, + }); + + return query; +}; diff --git a/apps/tron/src/bitquery/queries/getTransfersToPairs.ts b/apps/tron/src/bitquery/queries/getTransfersToPairs.ts new file mode 100644 index 0000000000..e6b7407c55 --- /dev/null +++ b/apps/tron/src/bitquery/queries/getTransfersToPairs.ts @@ -0,0 +1,15 @@ +export const getTransfersToPairs = (pairAddresses: string[], walletAddress: string) => { + if (pairAddresses.length === 0 || pairAddresses.length > 100) { + throw new Error("Invalid pairAddresses length. Must be between 1 and 100."); + } + + const pairAddressesString = pairAddresses.map((address) => `"${address}"`).join(", "); + + const query = JSON.stringify({ + query: + "query ($pairAddresses: [String!], $walletAddress: String!) {\n tron {\n transfers(\n sender: {is: $walletAddress}\n receiver: {in: $pairAddresses}\n ) {\n currency {\n address\n decimals\n name\n symbol\n }\n txHash\n receiver {\n address\n }\n }\n }\n}\n", + variables: `{\n \"walletAddress\": \"${walletAddress}\",\n \"pairAddresses\": [\n ${pairAddressesString}\n ]\n}`, + }); + + return query; +}; diff --git a/apps/tron/src/bitquery/queries/getTronInUSDT.ts b/apps/tron/src/bitquery/queries/getTronInUSDT.ts new file mode 100644 index 0000000000..fe63d3f852 --- /dev/null +++ b/apps/tron/src/bitquery/queries/getTronInUSDT.ts @@ -0,0 +1,9 @@ +export const getTronInUSDT = () => { + const query = JSON.stringify({ + query: + 'query GetTronInUSDT {\n tron {\n dexTrades(\n baseCurrency: {is: "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR"}\n quoteCurrency: {is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"}\n options: {limit: 1, desc: "block.timestamp.time"}\n ) {\n block {\n timestamp {\n time(format: "%Y-%m-%d %H:%M:%S")\n }\n }\n baseCurrency {\n address\n }\n quoteCurrency {\n address\n }\n quotePrice\n }\n }\n}\n', + variables: "{}", + }); + + return query; +}; diff --git a/apps/tron/src/components/General/Icon.tsx b/apps/tron/src/components/General/Icon.tsx new file mode 100644 index 0000000000..9d80a81242 --- /dev/null +++ b/apps/tron/src/components/General/Icon.tsx @@ -0,0 +1,29 @@ +import Image from "next/image"; +import { IToken } from "src/types/token-type"; +import { hashStringToColor } from "src/utils/formatters"; + +type IconProps = { + currency: IToken | undefined; + height?: number; + width?: number; +}; + +export const Icon = ({ currency, height = 40, width = 40 }: IconProps) => { + return ( + <> + {currency?.logoURI ? ( + + ) : ( +
    + {currency?.symbol?.substring(0, 2) ?? "??"} +
    + )} + + ); +}; diff --git a/apps/tron/src/components/General/IconList.tsx b/apps/tron/src/components/General/IconList.tsx new file mode 100644 index 0000000000..3261eb90ff --- /dev/null +++ b/apps/tron/src/components/General/IconList.tsx @@ -0,0 +1,32 @@ +import { classNames } from "@sushiswap/ui"; +import { Children, cloneElement, FC, isValidElement, ReactNode } from "react"; + +type IconListProps = { + children: ReactNode; + iconWidth: number; + iconHeight: number; +}; + +export const IconList: FC = ({ children, iconWidth, iconHeight }) => { + return ( +
    +
    + {Children.map(children, (child, index) => { + if (isValidElement(child)) { + return ( +
    0 ? -iconWidth / 3 : 0 }}> + {cloneElement(child, { + ...child.props, + width: iconWidth || child.props.width, + height: iconHeight || child.props.height, + })} +
    + ); + } + })} +
    +
    + ); +}; diff --git a/apps/tron/src/components/General/Title.tsx b/apps/tron/src/components/General/Title.tsx new file mode 100644 index 0000000000..44a2422197 --- /dev/null +++ b/apps/tron/src/components/General/Title.tsx @@ -0,0 +1,12 @@ +import { ReactNode } from "react"; + +export const Title = ({ children, className }: { children: ReactNode; className?: string }) => { + return ( +

    + {children} +

    + ); +}; diff --git a/apps/tron/src/components/General/TokenListSelect.tsx b/apps/tron/src/components/General/TokenListSelect.tsx new file mode 100644 index 0000000000..6602915377 --- /dev/null +++ b/apps/tron/src/components/General/TokenListSelect.tsx @@ -0,0 +1,187 @@ +import { + Badge, + Button, + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, + List, + SelectIcon, +} from "@sushiswap/ui"; +import { Search } from "../Input/Search"; +import { useMemo, useRef, useState } from "react"; +import { Icon } from "./Icon"; +import { IToken } from "src/types/token-type"; +import { DEFAULT_TOKEN_LIST, DEFAULT_TOKEN_LIST_WITH_KEY } from "src/constants/token-list"; +import { useDebounce } from "@sushiswap/hooks"; +import { useTokenInfo } from "src/hooks/useTokenInfo"; +import { useCustomTokens } from "src/hooks/useCustomTokens"; +import { useSortedTokenList } from "src/hooks/useSortedTokenList"; +import { classNames } from "@sushiswap/ui"; +import { CheckCircleIcon } from "@heroicons/react/20/solid"; + +export const TokenListSelect = ({ + token, + setToken, + className, +}: { + token: IToken | undefined; + setToken: (token: IToken) => void; + className?: string; +}) => { + const [query, setQuery] = useState(""); + const debouncedQuery = useDebounce(query, 500); + const closeBtnRef = useRef(null); + const { data: newToken } = useTokenInfo({ tokenAddress: debouncedQuery }); + const { customTokens, addOrRemoveToken, hasToken } = useCustomTokens(); + const { data: sortedTokenList } = useSortedTokenList({ + query: debouncedQuery, + tokenMap: DEFAULT_TOKEN_LIST_WITH_KEY(), + customTokenMap: customTokens, + }); + + const closeModal = () => { + closeBtnRef?.current?.click(); + setQuery(""); + }; + + const selectToken = (token: IToken) => { + setToken(token); + closeModal(); + }; + + return ( + + + + + + + + Select a token + + Select a token from our default list or search for a token by symbol or address. + + +
    + +
    + +
    + + + {newToken ? ( + [newToken].map((_token) => ( + + )) + ) : sortedTokenList?.length === 0 ? ( +

    No tokens found

    + ) : ( + sortedTokenList?.map((_token) => ( + + )) + )} +
    +
    +
    +
    +
    + ); +}; + +const TokenButton = ({ + token, + selectToken, + hasToken, + addOrRemoveToken, + isSelected, +}: { + token: IToken; + selectToken: (_token: IToken) => void; + hasToken?: (currency: IToken) => boolean; + isSelected: boolean; + addOrRemoveToken?: (type: "add" | "remove", currency: IToken[]) => void; +}) => { + const isOnDefaultList = useMemo(() => DEFAULT_TOKEN_LIST.some((t) => t.address === token.address), [token]); + const isNew = hasToken && !hasToken(token); + const isCustomAdded = hasToken && hasToken(token); + + return ( +
    +
    + + {isNew && !isOnDefaultList ? ( + + ) : null} + {isCustomAdded && !isOnDefaultList ? ( + + ) : null} + + ); +}; diff --git a/apps/tron/src/components/Input/Search.tsx b/apps/tron/src/components/Input/Search.tsx new file mode 100644 index 0000000000..4bdc789f1f --- /dev/null +++ b/apps/tron/src/components/Input/Search.tsx @@ -0,0 +1,220 @@ +import { classNames } from "@sushiswap/ui"; +import React, { FC, KeyboardEvent, ReactElement, forwardRef, useCallback, useEffect, useState } from "react"; +import { MagnifyingGlassIcon, XMarkIcon } from "@heroicons/react/24/outline"; +import { Loader } from "@sushiswap/ui"; + +interface Search { + className?: string; + id: string; + input?(props: any): ReactElement | null; + value: string; + loading: boolean; + onChange(val: string): void; + size?: "sm" | "default"; + delimiter?: string; + placeholder?: string; +} + +export const Search: FC = forwardRef(function Search( + { className, id, loading, input: Input, value, onChange, size = "default", delimiter, placeholder }, + ref +) { + const [values, setValues] = useState({ + all: value.split(delimiter || " "), + typed: "", + }); + const _onChange = useCallback( + (val: string) => { + if (val.slice(-1) === (delimiter || " ")) { + setValues((prev) => ({ + typed: "", + all: [...prev.all, prev.typed], + })); + } else { + setValues((prev) => ({ + typed: val, + all: prev.all, + })); + } + }, + [delimiter] + ); + + const remove = useCallback((val: string) => { + setValues((prev) => ({ + typed: prev.typed, + all: prev.all.filter((_val) => _val !== val), + })); + }, []); + + const handleKeyDown = useCallback((event: KeyboardEvent) => { + if (event.key === "Backspace") { + setValues((prev) => ({ + typed: prev.typed, + all: prev.all.slice(0, -1), + })); + } + if (event.key === "Enter") { + setValues((prev) => ({ + typed: "", + all: [...prev.all, prev.typed], + })); + } + }, []); + + useEffect(() => { + if (delimiter) { + onChange(`${values.typed} ${values.all.filter((el) => el !== " " && el !== "").join(" ")}`); + } + }, [delimiter, onChange, values]); + + if (delimiter) { + return ( +
    +
    + +
    + +
    + {values.all + .filter((el) => el !== " " && el !== "") + .map((el, i) => ( +
    remove(el)} + key={i} + className="font-semibold text-gray-600 dark:text-slate-300 flex items-center text-sm rounded-full p-1 pl-2.5 bg-black/[0.08] dark:bg-white/[0.16] gap-1"> + {el} +
    + +
    +
    + ))} +
    + _onChange(e.target.value)} + onKeyDown={handleKeyDown} + className={classNames( + "truncate outline-none font-semibold w-full bg-transparent !p-0 placeholder:font-medium placeholder:text-gray-400 placeholder:dark:text-slate-500 text-gray-900 dark:text-slate-200" + )} + autoCorrect="off" + autoCapitalize="off" + spellCheck="false" + autoComplete="off" + /> + {(loading || value) && ( +
    + {loading ? ( +
    + +
    + ) : value ? ( +
    + setValues({ + all: [], + typed: "", + }) + }> + +
    + ) : ( + <> + )} +
    + )} +
    + ); + } + return ( +
    + + {Input ? ( + + ) : ( + onChange(e.target.value)} + className={classNames( + "truncate font-semibold w-full bg-transparent !p-0 placeholder:font-medium placeholder:text-gray-400 placeholder:dark:text-slate-500 text-gray-900 dark:text-slate-200" + )} + autoCorrect="off" + autoCapitalize="off" + spellCheck="false" + autoComplete="off" + /> + )} + {(loading || value) && ( +
    + {loading ? ( +
    + +
    + ) : value ? ( +
    onChange("")}> + +
    + ) : ( + <> + )} +
    + )} +
    + ); +}); diff --git a/apps/tron/src/components/Input/TokenInput.tsx b/apps/tron/src/components/Input/TokenInput.tsx new file mode 100644 index 0000000000..1fa8cd1994 --- /dev/null +++ b/apps/tron/src/components/Input/TokenInput.tsx @@ -0,0 +1,92 @@ +import { Button, TextField } from "@sushiswap/ui"; +import { TokenListSelect } from "../General/TokenListSelect"; +import { DollarAmountDisplay } from "../Shared/DollarAmountDisplay"; +import { TokenBalanceDisplay } from "../Shared/TokenBalanceDisplay"; +import { IToken } from "src/types/token-type"; +import { useTokenBalance } from "src/hooks/useTokenBalance"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { formatUnitsForInput } from "src/utils/formatters"; +import { useStablePrice } from "src/hooks/useStablePrice"; +import { Icon } from "../General/Icon"; + +type TokenInputProps = { + type: "input" | "output"; + token: IToken | undefined; + setToken: (token: IToken) => void; + amount: string; + setAmount: (amount: string) => void; + hasTokenListSelect?: boolean; +}; + +export const TokenInput = ({ + type, + token, + setToken, + amount, + setAmount, + hasTokenListSelect = true, +}: TokenInputProps) => { + const { address } = useWallet(); + const { data: tokenBalance, isInitialLoading: isInitialLoadingTokenBalance } = useTokenBalance({ + accountAddress: address, + tokenAddress: token?.address, + }); + const { data: usdValue, isLoading: isUSDValueLoading } = useStablePrice({ token: token }); + + const usdAmount = amount ? (Number(amount) * (usdValue ? Number(usdValue) : 0)).toString(10) : "0.00"; + + return ( +
    +
    + { + if (type === "output") return; + const value = e.target.value; + + setAmount(value); + }} + // isError={true} + /> + {hasTokenListSelect ? ( + + ) : ( + + )} +
    +
    + + { + if (type === "output") return; + if (tokenBalance === "0") { + setAmount(""); + return; + } + setAmount(formatUnitsForInput(tokenBalance ?? "0", token?.decimals ?? 0)); + }} + /> +
    +
    + ); +}; diff --git a/apps/tron/src/components/Pools/Add/AddButton.tsx b/apps/tron/src/components/Pools/Add/AddButton.tsx new file mode 100644 index 0000000000..88c46eeae2 --- /dev/null +++ b/apps/tron/src/components/Pools/Add/AddButton.tsx @@ -0,0 +1,162 @@ +import { useSlippageTolerance } from "@sushiswap/hooks"; +import { Button, Dots, createFailedToast, createInfoToast, createSuccessToast } from "@sushiswap/ui"; +import { useQueryClient } from "@tanstack/react-query"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { useMemo } from "react"; +import { usePoolDispatch, usePoolState } from "src/app/pool/pool-provider"; +import { useTronWeb } from "src/hooks/useTronWeb"; +import { parseUnits } from "src/utils/formatters"; +import { + cleanArgs, + getArgsForAddLiquidity, + getDeadline, + getLiquidityFunctionSelector, + getTransactionInfo, + parseTxnError, + safeGasEstimates, +} from "src/utils/helpers"; +import { getTronscanTxnLink } from "src/utils/tronscan-helpers"; + +export const AddButton = ({ closeModal }: { closeModal: () => void }) => { + const queryClient = useQueryClient(); + + const { token0, token1, isTxnPending, amountInToken0, amountInToken1, pairAddress } = usePoolState(); + const { setIsTxnPending, setAmountInToken0, setAmountInToken1 } = usePoolDispatch(); + const { address, signTransaction } = useWallet(); + const { tronWeb } = useTronWeb(); + const [slippageTolerance] = useSlippageTolerance("sushi-tron-slippage-add-liq"); + const slippage = slippageTolerance === "AUTO" ? 0.005 : Number(slippageTolerance) / 100; + + const pairExists = !!pairAddress; + + const minAmountToken0 = useMemo(() => { + if (!amountInToken0) return ""; + const output = Number(amountInToken0) * (1 - slippage); + return output.toString(); + }, [slippage, amountInToken0]); + + const minAmountToken1 = useMemo(() => { + if (!amountInToken1) return ""; + const output = Number(amountInToken1) * (1 - slippage); + return output.toString(); + }, [slippage, amountInToken1]); + + const addLiquidity = async () => { + if (!token0 || !token1 || !amountInToken0 || !amountInToken1 || !address) return; + try { + setIsTxnPending(true); + const methodName = getLiquidityFunctionSelector(token0, token1); + const deadline = getDeadline(); + const parsedAmount0 = parseUnits(amountInToken0, token0.decimals); + const parsedAmount1 = parseUnits(amountInToken1, token1.decimals); + const parsedMinAmount0 = parseUnits(minAmountToken0, token0.decimals); + const parsedMinAmount1 = parseUnits(minAmountToken1, token1.decimals); + + const args = getArgsForAddLiquidity( + methodName, + token0.address, + token1.address, + parsedAmount0, + parsedAmount1, + parsedMinAmount0, + parsedMinAmount1, + address, + deadline + ); + console.log("args", args); + const estimates = await safeGasEstimates(tronWeb, [args]); + console.log(estimates); + const safeGasEstimate = estimates.findIndex((predicate) => predicate !== undefined); + console.log("safeGasEstimate", safeGasEstimate); + + if (safeGasEstimate === -1) { + throw new Error("Failed to estimate energy. Transaction will fail."); + } + const feeLimit = pairExists ? undefined : 3000000000; //3000 trx since contract will need to be deployed + const cleanedArgs = cleanArgs(args, feeLimit); + console.log("cleanedArgs", cleanedArgs); + const { transaction } = await tronWeb.transactionBuilder.triggerSmartContract(...cleanedArgs); + const signedTransation = await signTransaction(transaction); + + const result = await tronWeb.trx.sendRawTransaction(signedTransation); + + if (!result.result && "code" in result) { + throw new Error(parseTxnError(result.code)); + } + const txId = result?.txid; + + createInfoToast({ + summary: "Add liquidity initiated...", + type: "swap", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + txHash: txId, + href: getTronscanTxnLink(txId), + }); + + const transactionInfo = await getTransactionInfo(tronWeb, txId); + if (transactionInfo?.receipt?.result !== "SUCCESS") { + throw new Error("Transaction failed"); + } + + //create success toast + createSuccessToast({ + summary: "Add liquidity successful", + txHash: txId, + type: "swap", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + href: getTronscanTxnLink(txId), + }); + + onSuccess(); + } catch (error) { + const errorMessage = + typeof error === "string" + ? error + : (error as Error)?.message ?? "An error occurred while trying to add liquidity"; + //create error toast + createFailedToast({ + summary: errorMessage, + type: "swap", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + }); + console.log(error); + setIsTxnPending(false); + } + }; + + const onSuccess = () => { + setIsTxnPending(false); + setAmountInToken0(""); + setAmountInToken1(""); + closeModal(); + queryClient.invalidateQueries([ + "useTokenBalance", + { accountAddress: address, tokenAddress: token0?.address }, + ]); + queryClient.invalidateQueries([ + "useTokenBalance", + { accountAddress: address, tokenAddress: token1?.address }, + ]); + }; + + return ( + + ); +}; diff --git a/apps/tron/src/components/Pools/Add/AmountInToken0.tsx b/apps/tron/src/components/Pools/Add/AmountInToken0.tsx new file mode 100644 index 0000000000..6eada5b211 --- /dev/null +++ b/apps/tron/src/components/Pools/Add/AmountInToken0.tsx @@ -0,0 +1,52 @@ +import { useEffect, useMemo } from "react"; +import { usePoolDispatch, usePoolState } from "src/app/pool/pool-provider"; +import { TokenInput } from "src/components/Input/TokenInput"; +import { formatUnitsForInput, parseUnits } from "src/utils/formatters"; +import { getToken1AmountForLiquidity } from "src/utils/helpers"; + +export const AmountInToken0 = () => { + const { token0, token1, amountInToken0, reserve0, reserve1, pairAddress, inputField } = usePoolState(); + const { setToken0, setAmountInToken0, setAmountInToken1, setInputField } = usePoolDispatch(); + + const pairExists = !!pairAddress; + + const rateOfToken1 = useMemo(() => { + if (!reserve0 || !reserve1) return; + if (!token0 || !token1) return; + return getToken1AmountForLiquidity(parseUnits(amountInToken0 ?? 0, token0?.decimals), reserve0, reserve1); + }, [token0, token1, reserve0, reserve1, amountInToken0]); + + useEffect(() => { + if (inputField === "token1") { + return; + } + if (pairExists && amountInToken0 === "") { + setAmountInToken1(""); + return; + } + if (pairExists && rateOfToken1 && rateOfToken1 !== "NaN" && token1) { + const amountFormatted = formatUnitsForInput(rateOfToken1, token1?.decimals); + if (amountFormatted) { + setAmountInToken1(amountFormatted); + } else { + setAmountInToken1(""); + } + } + }, [amountInToken0, pairExists, rateOfToken1, rateOfToken1, token1, inputField]); + + const setAmount = (amount: string) => { + setInputField("token0"); + setAmountInToken0(amount); + }; + + return ( + + ); +}; diff --git a/apps/tron/src/components/Pools/Add/AmountIntToken1.tsx b/apps/tron/src/components/Pools/Add/AmountIntToken1.tsx new file mode 100644 index 0000000000..97501e067f --- /dev/null +++ b/apps/tron/src/components/Pools/Add/AmountIntToken1.tsx @@ -0,0 +1,52 @@ +import { useEffect, useMemo } from "react"; +import { usePoolDispatch, usePoolState } from "src/app/pool/pool-provider"; +import { TokenInput } from "src/components/Input/TokenInput"; +import { formatUnitsForInput, parseUnits } from "src/utils/formatters"; +import { getToken0AmountForLiquidity } from "src/utils/helpers"; + +export const AmountInToken1 = () => { + const { token0, token1, amountInToken1, pairAddress, reserve0, reserve1, inputField } = usePoolState(); + const { setToken1, setAmountInToken1, setAmountInToken0, setInputField } = usePoolDispatch(); + + const pairExists = !!pairAddress; + + const rateOfToken0 = useMemo(() => { + if (!reserve0 || !reserve1) return; + if (!token0 || !token1) return; + return getToken0AmountForLiquidity(parseUnits(amountInToken1 ?? 0, token1?.decimals), reserve0, reserve1); + }, [token0, token1, reserve0, reserve1, amountInToken1]); + + useEffect(() => { + if (inputField === "token0") { + return; + } + if (pairExists && amountInToken1 === "") { + setAmountInToken0(""); + return; + } + if (pairExists && rateOfToken0 && rateOfToken0 !== "NaN" && token0) { + const amountFormatted = formatUnitsForInput(rateOfToken0, token0?.decimals); + if (amountFormatted) { + setAmountInToken0(amountFormatted); + } else { + setAmountInToken0(""); + } + } + }, [amountInToken1, pairExists, rateOfToken0, token0, inputField]); + + const setAmount = (amount: string) => { + setInputField("token1"); + setAmountInToken1(amount); + }; + + return ( + + ); +}; diff --git a/apps/tron/src/components/Pools/Add/DepositForm.tsx b/apps/tron/src/components/Pools/Add/DepositForm.tsx new file mode 100644 index 0000000000..557551d5e1 --- /dev/null +++ b/apps/tron/src/components/Pools/Add/DepositForm.tsx @@ -0,0 +1,21 @@ +"use client"; +import { FormSection } from "@sushiswap/ui"; +import { AmountInToken0 } from "./AmountInToken0"; +import { Plus } from "./Plus"; +import { AmountInToken1 } from "./AmountIntToken1"; +import { ReviewAddDialog } from "./ReviewAddDialog"; + +export const DepositForm = () => { + return ( + +
    + + + +
    +
    + +
    +
    + ); +}; diff --git a/apps/tron/src/components/Pools/Add/Plus.tsx b/apps/tron/src/components/Pools/Add/Plus.tsx new file mode 100644 index 0000000000..667efd3327 --- /dev/null +++ b/apps/tron/src/components/Pools/Add/Plus.tsx @@ -0,0 +1,9 @@ +import { PlusIcon } from "@heroicons/react/20/solid"; + +export const Plus = () => { + return ( +
    + +
    + ); +}; diff --git a/apps/tron/src/components/Pools/Add/Rate.tsx b/apps/tron/src/components/Pools/Add/Rate.tsx new file mode 100644 index 0000000000..b269ea8eae --- /dev/null +++ b/apps/tron/src/components/Pools/Add/Rate.tsx @@ -0,0 +1,54 @@ +import { Button, SkeletonBox } from "@sushiswap/ui"; +import { useMemo, useState } from "react"; +import { usePoolState } from "src/app/pool/pool-provider"; +import { formatUnits, parseUnits } from "src/utils/formatters"; +import { getToken0AmountForLiquidity, getToken1AmountForLiquidity } from "src/utils/helpers"; +import { formatUSD } from "sushi/format"; + +export const Rate = ({ + token0Price, + token1Price, + isLoading, +}: { + token0Price: string | undefined; + token1Price: string | undefined; + isLoading: boolean; +}) => { + const [showToken0First, setShowToken0First] = useState(false); + const { token0, token1, reserve0, reserve1 } = usePoolState(); + + const handleToggleRate = () => { + setShowToken0First(!showToken0First); + }; + + const rateOfToken0 = useMemo(() => { + if (!reserve0 || !reserve1) return; + if (!token0 || !token1) return; + return getToken0AmountForLiquidity(parseUnits("1", token1?.decimals), reserve0, reserve1); + }, [token0, token1, reserve0, reserve1]); + + const rateOfToken1 = useMemo(() => { + if (!reserve0 || !reserve1) return; + if (!token0 || !token1) return; + return getToken1AmountForLiquidity(parseUnits("1", token0?.decimals), reserve0, reserve1); + }, [token0, token1, reserve0, reserve1]); + + return ( +
    + + {isLoading ? ( + + ) : ( +
    + {showToken0First ? formatUSD(token0Price ?? "") : formatUSD(token1Price ?? "")} +
    + )} +
    + ); +}; diff --git a/apps/tron/src/components/Pools/Add/ReviewAddDialog.tsx b/apps/tron/src/components/Pools/Add/ReviewAddDialog.tsx new file mode 100644 index 0000000000..9816291a5a --- /dev/null +++ b/apps/tron/src/components/Pools/Add/ReviewAddDialog.tsx @@ -0,0 +1,98 @@ +import { List, SkeletonBox } from "@sushiswap/ui"; +import { Icon } from "../../General/Icon"; +import { + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, +} from "@sushiswap/ui"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { useRef } from "react"; +import { WalletConnector } from "../../WalletConnector/WalletConnector"; +import { usePoolState } from "src/app/pool/pool-provider"; +import { Rate } from "./Rate"; +import { ReviewAddDialogTrigger } from "./ReviewAddDialogTrigger"; +import { useStablePrice } from "src/hooks/useStablePrice"; +import { AddButton } from "./AddButton"; +import { formatUSD } from "sushi/format"; +import { formatUnits } from "src/utils/formatters"; + +export const ReviewAddDialog = () => { + const { token0, token1, amountInToken0, amountInToken1 } = usePoolState(); + const closeBtnRef = useRef(null); + const { address, connected } = useWallet(); + const isConnected = address && connected; + const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice({ token: token0 }); + const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice({ token: token1 }); + + const closeModal = () => { + closeBtnRef?.current?.click(); + }; + + return ( + + {isConnected ? ( + + ) : ( + + )} + + + + Add liquidity + Please review your entered details. + +
    +
    + + + +
    +
    + + {/* show max 12 decimals so nothing is cut off */} +
    {formatUnits(amountInToken0, 0, 12)}
    {token0?.symbol}
    +
    + {isLoadingToken0Price ? ( + + ) : ( +
    + {formatUSD(Number(token0Price) * Number(amountInToken0))} +
    + )} +
    +
    + +
    +
    + + {/* show max 12 decimals so nothing is cut off */} +
    {formatUnits(amountInToken1, 0, 12)}
    {token1?.symbol}
    +
    + {isLoadingToken1Price ? ( + + ) : ( +
    + {formatUSD(Number(token1Price) * Number(amountInToken1))} +
    + )} +
    +
    + + + +
    +
    + +
    +
    +
    +
    + ); +}; diff --git a/apps/tron/src/components/Pools/Add/ReviewAddDialogTrigger.tsx b/apps/tron/src/components/Pools/Add/ReviewAddDialogTrigger.tsx new file mode 100644 index 0000000000..c255f04c62 --- /dev/null +++ b/apps/tron/src/components/Pools/Add/ReviewAddDialogTrigger.tsx @@ -0,0 +1,135 @@ +import { Button, DialogTrigger } from "@sushiswap/ui"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { useMemo } from "react"; +import { usePoolState } from "src/app/pool/pool-provider"; +import { ApproveToken } from "src/components/Shared/ApproveToken"; +import { ROUTER_CONTRACT } from "src/constants/contracts"; +import { useAllowance } from "src/hooks/useAllowance"; +import { useTokenBalance } from "src/hooks/useTokenBalance"; +import { formatUnitsForInput } from "src/utils/formatters"; + +export const ReviewAddDialogTrigger = () => { + const { token0, token1, isTxnPending, amountInToken0, amountInToken1 } = usePoolState(); + const { address } = useWallet(); + + const { data: token0Balance, isLoading: isLoadingToken0Balance } = useTokenBalance({ + accountAddress: address, + tokenAddress: token0?.address, + }); + + const { data: token1Balance, isLoading: isLoadingToken1Balance } = useTokenBalance({ + accountAddress: address, + tokenAddress: token1?.address, + }); + + const { data: token0AllowanceAmount, refetch: refetchToken0Allowance } = useAllowance({ + tokenAddress: token0?.address as string, + ownerAddress: address as string, + spenderAddress: ROUTER_CONTRACT, + }); + + const { data: token1AllowanceAmount, refetch: refetchToken1Allowance } = useAllowance({ + tokenAddress: token1?.address as string, + ownerAddress: address as string, + spenderAddress: ROUTER_CONTRACT, + }); + + const hasInsufficientToken0Balance = useMemo(() => { + if (isLoadingToken0Balance) return true; + return Number(formatUnitsForInput(token0Balance ?? "0", token0?.decimals ?? 18)) < Number(amountInToken0); + }, [token0Balance, token0, amountInToken0, isLoadingToken0Balance]); + + const hasInsufficientToken1Balance = useMemo(() => { + if (isLoadingToken1Balance) return true; + return Number(formatUnitsForInput(token1Balance ?? "0", token1?.decimals ?? 18)) < Number(amountInToken1); + }, [token1Balance, token1, amountInToken1, isLoadingToken1Balance]); + + const token0AllowanceFormatted = formatUnitsForInput(token0AllowanceAmount ?? "0", token0?.decimals ?? 18); + + const token1AllowanceFormatted = formatUnitsForInput(token1AllowanceAmount ?? "0", token1?.decimals ?? 18); + + const hasInsufficientToken0Allowance = useMemo(() => { + return !!token1AllowanceAmount && Number(token0AllowanceFormatted) < Number(amountInToken0); + }, [token0AllowanceFormatted, amountInToken0, token1AllowanceAmount]); + + const hasInsufficientToken1Allowance = useMemo(() => { + return !!token1AllowanceAmount && Number(token1AllowanceFormatted) < Number(amountInToken1); + }, [token1AllowanceFormatted, amountInToken1, token1AllowanceAmount]); + + const invalidAmount = useMemo(() => { + return ( + amountInToken0 === "" || + amountInToken1 === "" || + Number(amountInToken0) === 0 || + Number(amountInToken1) === 0 + ); + }, [amountInToken0, amountInToken1]); + + const buttonText = useMemo(() => { + if (isTxnPending) { + return "Adding Liquidity"; + } + if (invalidAmount) { + return "Enter Amount"; + } + if (hasInsufficientToken0Balance) { + return `Insufficient ${token0?.symbol} Balance`; + } + if (hasInsufficientToken1Balance) { + return `Insufficient ${token1?.symbol} Balance`; + } + if (hasInsufficientToken0Allowance) { + return `Approve ${token0?.symbol} Token`; + } + if (hasInsufficientToken1Allowance) { + return `Approve ${token1?.symbol} Token`; + } + + return "Add Liquidity"; + }, [ + hasInsufficientToken0Balance, + hasInsufficientToken1Balance, + hasInsufficientToken0Allowance, + hasInsufficientToken1Allowance, + invalidAmount, + token0, + token1, + isTxnPending, + ]); + + if (buttonText === `Approve ${token0?.symbol} Token`) { + return ( + { + await refetchToken0Allowance(); + }} + /> + ); + } + + if (buttonText === `Approve ${token1?.symbol} Token`) { + return ( + { + await refetchToken1Allowance(); + }} + /> + ); + } + + return ( + + + + ); +}; diff --git a/apps/tron/src/components/Pools/Add/SelectTokensForm.tsx b/apps/tron/src/components/Pools/Add/SelectTokensForm.tsx new file mode 100644 index 0000000000..0f559592b1 --- /dev/null +++ b/apps/tron/src/components/Pools/Add/SelectTokensForm.tsx @@ -0,0 +1,34 @@ +"use client"; +import { FormSection } from "@sushiswap/ui"; +import { useEffect } from "react"; +import { usePoolDispatch, usePoolState } from "src/app/pool/pool-provider"; +import { TokenListSelect } from "src/components/General/TokenListSelect"; +import { useIsContract } from "src/hooks/useIsContract"; +import { usePairContract } from "src/hooks/usePairContract"; + +export const SelectTokensForm = () => { + const { token0, token1 } = usePoolState(); + const { setToken0, setToken1, setPairAddress } = usePoolDispatch(); + const { data: _pairAddress } = usePairContract({ + token0Address: token0?.address, + token1Address: token1?.address, + }); + const { data: isContract } = useIsContract({ address: _pairAddress }); + + useEffect(() => { + if (isContract && _pairAddress) { + setPairAddress(_pairAddress); + } else { + setPairAddress(undefined); + } + }, [isContract, _pairAddress]); + + return ( + +
    + + +
    +
    + ); +}; diff --git a/apps/tron/src/components/Pools/BackButton.tsx b/apps/tron/src/components/Pools/BackButton.tsx new file mode 100644 index 0000000000..c8a9431c9b --- /dev/null +++ b/apps/tron/src/components/Pools/BackButton.tsx @@ -0,0 +1,25 @@ +'use client' + +import { ChevronLeftIcon } from '@heroicons/react/24/outline' +import { IconButton, IconButtonProps } from '@sushiswap/ui' +import { useRouter } from 'next/navigation' +import { forwardRef } from 'react' + +const BackButton = forwardRef>( + ({ ...props }, ref) => { + const { back } = useRouter() + return ( + + ) + }, +) + +BackButton.displayName = 'BackButton' + +export { BackButton } diff --git a/apps/tron/src/components/Pools/Manage/AddSection.tsx b/apps/tron/src/components/Pools/Manage/AddSection.tsx new file mode 100644 index 0000000000..d765336e9f --- /dev/null +++ b/apps/tron/src/components/Pools/Manage/AddSection.tsx @@ -0,0 +1,41 @@ +import { CogIcon } from "@heroicons/react/24/outline"; +import { + IconButton, + SettingsModule, + SettingsOverlay, + Widget, + WidgetAction, + WidgetDescription, + WidgetHeader, + WidgetTitle, +} from "@sushiswap/ui"; +import { AmountInToken0 } from "../Add/AmountInToken0"; +import { AmountInToken1 } from "../Add/AmountIntToken1"; +import { Plus } from "../Add/Plus"; +import { ReviewAddDialog } from "../Add/ReviewAddDialog"; + +export const AddSection = () => { + return ( + + + Add Liquidity + Provide liquidity to receive SLP tokens. + + + + + + +
    + + + +
    +
    + +
    +
    + ); +}; diff --git a/apps/tron/src/components/Pools/Manage/Manage.tsx b/apps/tron/src/components/Pools/Manage/Manage.tsx new file mode 100644 index 0000000000..4909505ad0 --- /dev/null +++ b/apps/tron/src/components/Pools/Manage/Manage.tsx @@ -0,0 +1,54 @@ +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, + Separator, + Tabs, + TabsContent, + TabsList, + TabsTrigger, +} from "@sushiswap/ui"; +import { useState } from "react"; +import { AddSection } from "./AddSection"; +import { RemoveSection } from "./RemoveSection"; + +export const Manage = () => { + const [tab, setTab] = useState("add"); + + return ( + + + Manage + Manage your position + + + + + + Add + + + Remove + + + +
    + +
    + + + + + + + + + + + +
    +
    + ); +}; diff --git a/apps/tron/src/components/Pools/Manage/RemoveSection.tsx b/apps/tron/src/components/Pools/Manage/RemoveSection.tsx new file mode 100644 index 0000000000..0f3d8706b3 --- /dev/null +++ b/apps/tron/src/components/Pools/Manage/RemoveSection.tsx @@ -0,0 +1,31 @@ +import { CogIcon } from "@heroicons/react/24/outline"; +import { + IconButton, + SettingsModule, + SettingsOverlay, + Widget, + WidgetAction, + WidgetDescription, + WidgetHeader, + WidgetTitle, +} from "@sushiswap/ui"; +import { RemoveLiquidity } from "../Remove/RemoveLiquidity"; + +export const RemoveSection = () => { + return ( + + + Remove Liquidity + Trade in your LP tokens to receive your underlying tokens + + + + + + + + + ); +}; diff --git a/apps/tron/src/components/Pools/PoolDetails/LiquidityItem.tsx b/apps/tron/src/components/Pools/PoolDetails/LiquidityItem.tsx new file mode 100644 index 0000000000..77876db52f --- /dev/null +++ b/apps/tron/src/components/Pools/PoolDetails/LiquidityItem.tsx @@ -0,0 +1,35 @@ +import { CardItem } from "@sushiswap/ui"; +import { Icon } from "src/components/General/Icon"; +import { IToken } from "src/types/token-type"; +import { formatUnits } from "src/utils/formatters"; +import { formatNumber, formatUSD } from "sushi/format"; + +export const LiquidityItem = ({ + isLoading, + token, + amount, + usdAmount, +}: { + isLoading: boolean; + token: IToken | undefined; + amount: string; + usdAmount: string; +}) => { + if (isLoading || !token) { + return ; + } + return ( + + + {token?.symbol} + + }> + + {formatNumber(formatUnits(amount ?? "", token?.decimals ?? 0, 4))}{" "} + {formatUSD(usdAmount)} + + + ); +}; diff --git a/apps/tron/src/components/Pools/PoolDetails/PoolHeader.tsx b/apps/tron/src/components/Pools/PoolDetails/PoolHeader.tsx new file mode 100644 index 0000000000..8dc2c23d58 --- /dev/null +++ b/apps/tron/src/components/Pools/PoolDetails/PoolHeader.tsx @@ -0,0 +1,71 @@ +import { ArrowTopRightOnSquareIcon } from "@heroicons/react/24/solid"; +import { + Button, + LinkExternal, + SkeletonCircle, + SkeletonText, + classNames, + typographyVariants, +} from "@sushiswap/ui"; +import { IconList } from "@sushiswap/ui/components/currency/IconList"; +import { Icon } from "src/components/General/Icon"; +import { IToken } from "src/types/token-type"; + +export const PoolHeader = ({ + token0, + token1, + isLoading, + pairAddress, +}: { + token0: IToken | undefined; + token1: IToken | undefined; + isLoading: boolean; + pairAddress: string; +}) => { + return ( +
    +
    + + {isLoading ? : } + {isLoading ? : } + + +
    + +
    + Network + Tron +
    +
    + ); +}; diff --git a/apps/tron/src/components/Pools/PoolDetails/PoolLiquidity.tsx b/apps/tron/src/components/Pools/PoolDetails/PoolLiquidity.tsx new file mode 100644 index 0000000000..be25140cf4 --- /dev/null +++ b/apps/tron/src/components/Pools/PoolDetails/PoolLiquidity.tsx @@ -0,0 +1,74 @@ +import { formatUSD, formatNumber } from "sushi/format"; +import { + Card, + CardContent, + CardDescription, + CardGroup, + CardHeader, + CardItem, + CardLabel, + CardTitle, + List, + SkeletonCircle, + SkeletonText, +} from "@sushiswap/ui"; +import { Icon } from "src/components/General/Icon"; +import { IToken } from "src/types/token-type"; +import { useReserves } from "src/hooks/useReserves"; +import { formatUnits, formatUnitsForInput } from "src/utils/formatters"; +import { useStablePrice } from "src/hooks/useStablePrice"; +import { LiquidityItem } from "./LiquidityItem"; + +export const PoolLiquidity = ({ + token0, + token1, + isLoading, + pairAddress, +}: { + token0: IToken | undefined; + token1: IToken | undefined; + isLoading: boolean; + pairAddress: string; +}) => { + const { data, isLoading: isLoadingReserves } = useReserves({ pairAddress, token0, token1 }); + + const reserve0 = data?.[0]?.reserve ?? "0"; + const reserve0Formatted = formatUnitsForInput(reserve0, token0?.decimals ?? 0); + + const reserve1 = data?.[1]?.reserve ?? "0"; + const reserve1Formatted = formatUnitsForInput(reserve1, token1?.decimals ?? 0); + + const { data: token0Price } = useStablePrice({ token: token0 }); + const { data: token1Price } = useStablePrice({ token: token1 }); + + const token0PoolPrice = (Number(token0Price) * Number(reserve0Formatted)).toString(10); + const token1PoolPrice = (Number(token1Price) * Number(reserve1Formatted)).toString(10); + + const isLoadingData = isLoading || isLoadingReserves; + + return ( + + + Pool Liquidity + {formatUSD(Number(token0PoolPrice) + Number(token1PoolPrice))} + + + + Tokens + + + + + + ); +}; diff --git a/apps/tron/src/components/Pools/PoolPosition/PoolPosition.tsx b/apps/tron/src/components/Pools/PoolPosition/PoolPosition.tsx new file mode 100644 index 0000000000..8a4858c1db --- /dev/null +++ b/apps/tron/src/components/Pools/PoolPosition/PoolPosition.tsx @@ -0,0 +1,145 @@ +import { formatUSD } from "sushi/format"; +import { IToken } from "src/types/token-type"; +import { + Card, + CardContent, + CardDescription, + CardGroup, + CardHeader, + CardLabel, + CardTitle, +} from "@sushiswap/ui"; +import { usePoolState } from "src/app/pool/pool-provider"; +import { useTotalSupply } from "src/hooks/useTotalSupply"; +import { useEffect, useMemo } from "react"; +import { useRemoveLiqDispatch } from "src/app/pool/[poolId]/remove-provider"; +import { formatUnitsForInput, parseUnits, toBigNumber } from "src/utils/formatters"; +import { PAIR_DECIMALS } from "src/constants/pair-decimals"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { useTokenBalance } from "src/hooks/useTokenBalance"; +import { LiquidityItem } from "../PoolDetails/LiquidityItem"; +import { useStablePrice } from "src/hooks/useStablePrice"; + +export const PoolPosition = ({ + token0, + token1, + isLoading, +}: { + token0: IToken | undefined; + token1: IToken | undefined; + isLoading: boolean; +}) => { + const token0StakedInUsd = 0; + const token1StakedInUsd = 0; + const { reserve0, reserve1, pairAddress } = usePoolState(); + const { setTotalSupplyLP, setAmountToken0PerLP, setAmountToken1PerLP, setLPBalance } = + useRemoveLiqDispatch(); + const { data: totalSupply, isLoading: isLoadingTotalSupply } = useTotalSupply({ + tokenAddress: pairAddress, + }); + const { address } = useWallet(); + const { data: lpBalance, isLoading: isLoadingLPBalance } = useTokenBalance({ + accountAddress: address, + tokenAddress: pairAddress, + }); + const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice({ token: token0 }); + const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice({ token: token1 }); + + useEffect(() => { + if (lpBalance && !isLoadingLPBalance) { + setLPBalance(lpBalance); + } + }, [lpBalance, isLoadingLPBalance]); + + useEffect(() => { + if (totalSupply && !isLoadingTotalSupply) { + setTotalSupplyLP(totalSupply); + } + }, [totalSupply, isLoadingTotalSupply]); + + const _amountToken0PerLP = useMemo(() => { + if (!totalSupply || !reserve0) return ""; + const formattedReserve0 = formatUnitsForInput(reserve0, token0?.decimals ?? 0); + const formattedTotalSupply = formatUnitsForInput(totalSupply, PAIR_DECIMALS); + const resBN = toBigNumber(formattedReserve0); + const totalSupplyBN = toBigNumber(formattedTotalSupply); + return String(resBN.div(totalSupplyBN)); + }, [reserve0, totalSupply, token0]); + + useEffect(() => { + if (_amountToken0PerLP) { + setAmountToken0PerLP(_amountToken0PerLP); + } + }, [_amountToken0PerLP]); + + const _amountToken1PerLP = useMemo(() => { + if (!totalSupply || !reserve1) return ""; + const formattedReserve1 = formatUnitsForInput(reserve1, token1?.decimals ?? 0); + const formattedTotalSupply = formatUnitsForInput(totalSupply, PAIR_DECIMALS); + const resBN = toBigNumber(formattedReserve1); + const totalSupplyBN = toBigNumber(formattedTotalSupply); + return String(resBN.div(totalSupplyBN)); + }, [reserve1, totalSupply, token1]); + + useEffect(() => { + if (_amountToken1PerLP) { + setAmountToken1PerLP(_amountToken1PerLP); + } + }, [_amountToken1PerLP]); + + const amountToken0 = useMemo(() => { + if (!lpBalance || !_amountToken0PerLP) return "0"; + const formattedLP = formatUnitsForInput(lpBalance, PAIR_DECIMALS); + const lpTokenAmountBeingRemovedBN = toBigNumber(formattedLP); + const amountToken0PerLPBN = toBigNumber(_amountToken0PerLP); + return String(lpTokenAmountBeingRemovedBN.times(amountToken0PerLPBN)); + }, [lpBalance, _amountToken0PerLP]); + + const amountToken1 = useMemo(() => { + if (!lpBalance || !_amountToken1PerLP) return "0"; + const formattedLP = formatUnitsForInput(lpBalance, PAIR_DECIMALS); + const lpTokenAmountBeingRemovedBN = toBigNumber(formattedLP); + const amountToken1PerLPBN = toBigNumber(_amountToken1PerLP); + return String(lpTokenAmountBeingRemovedBN.times(amountToken1PerLPBN)); + }, [lpBalance, _amountToken1PerLP]); + + const loading = isLoading || isLoadingToken0Price || isLoadingToken1Price; + + const token0UnstakedInUsd = Number(token0Price) * Number(amountToken0); + const token1UnstakedInUsd = Number(token1Price) * Number(amountToken1); + + return ( + + + My Position + + + {formatUSD(token0StakedInUsd + token1StakedInUsd + token0UnstakedInUsd + token1UnstakedInUsd)} + + + + + + Unstaked + + + + + Staked + + + + + + ); +}; diff --git a/apps/tron/src/components/Pools/PoolRewards/PoolRewards.tsx b/apps/tron/src/components/Pools/PoolRewards/PoolRewards.tsx new file mode 100644 index 0000000000..542d799c4d --- /dev/null +++ b/apps/tron/src/components/Pools/PoolRewards/PoolRewards.tsx @@ -0,0 +1,38 @@ +import { + Card, + CardContent, + CardDescription, + CardGroup, + CardHeader, + CardLabel, + CardTitle, +} from "@sushiswap/ui"; +import { CardItem } from "@sushiswap/ui"; +import Image from "next/image"; +import { WTRX } from "src/constants/token-list"; + +export const PoolRewards = () => { + return ( + + + Pool Rewards + + Distributed to everyone who provides liquidity to this pool.
    +
    +
    + + + Tokens (per day) + + TRX + + }> + {"0"} + + + +
    + ); +}; diff --git a/apps/tron/src/components/Pools/PoolSearchBar.tsx b/apps/tron/src/components/Pools/PoolSearchBar.tsx new file mode 100644 index 0000000000..f7e08b2dad --- /dev/null +++ b/apps/tron/src/components/Pools/PoolSearchBar.tsx @@ -0,0 +1,38 @@ +import { FC, useCallback, useState, useTransition } from "react"; +import { ChipInput } from "@sushiswap/ui"; +import { MagnifyingGlassIcon } from "@heroicons/react/20/solid"; + +type PoolSearchBarProps = { + query: string; + setQuery: React.Dispatch>; + placeholder: string; +}; + +export const PoolSearchBar: FC = ({ setQuery, query, placeholder }) => { + const [isPending, startTransition] = useTransition(); + const [values, setValues] = useState(query.split(" ")); + + const onValueChange = useCallback( + (values: string[]) => { + const value = values?.[0]?.replaceAll(" ", ""); + setValues([value ?? ""]); + startTransition(() => setQuery(values.join(" "))); + }, + [setQuery] + ); + + return ( +
    + +
    + ); +}; diff --git a/apps/tron/src/components/Pools/PoolsTable/PoolAprCell.tsx b/apps/tron/src/components/Pools/PoolsTable/PoolAprCell.tsx new file mode 100644 index 0000000000..2a2f45fa8c --- /dev/null +++ b/apps/tron/src/components/Pools/PoolsTable/PoolAprCell.tsx @@ -0,0 +1,5 @@ +import { formatPercent } from "sushi/format"; + +export const PoolAprCell = () => { + return
    {formatPercent(0)}
    ; +}; diff --git a/apps/tron/src/components/Pools/PoolsTable/PoolColumns.tsx b/apps/tron/src/components/Pools/PoolsTable/PoolColumns.tsx new file mode 100644 index 0000000000..4f1466c625 --- /dev/null +++ b/apps/tron/src/components/Pools/PoolsTable/PoolColumns.tsx @@ -0,0 +1,55 @@ +import { SkeletonCircle, SkeletonText } from "@sushiswap/ui"; +import { PoolNameCell } from "./PoolNameCell"; +import { ICON_SIZE } from "src/constants/icon-size"; +import { PoolTvlCell } from "./PoolTvlCell"; +import { ColumnDef } from "@tanstack/react-table"; +import { PoolReservesCell } from "./PoolReservesCell"; + +export const NAME_COLUMN: ColumnDef = { + id: "name", + header: "Name", + cell: (props) => , + meta: { + skeleton: ( +
    +
    + + +
    +
    + +
    +
    + ), + }, +}; + +export const TVL_COLUMN: ColumnDef = { + id: "TVL", + header: "TVL", + cell: (props) => , + meta: { + skeleton: ( +
    +
    + +
    +
    + ), + }, +}; + +export const RESERVES_COLUMN: ColumnDef = { + id: "reserves", + header: "Reserves", + cell: (props) => , + meta: { + skeleton: ( +
    +
    + +
    +
    + ), + }, +}; diff --git a/apps/tron/src/components/Pools/PoolsTable/PoolNameCell.tsx b/apps/tron/src/components/Pools/PoolsTable/PoolNameCell.tsx new file mode 100644 index 0000000000..3071263af9 --- /dev/null +++ b/apps/tron/src/components/Pools/PoolsTable/PoolNameCell.tsx @@ -0,0 +1,38 @@ +import { SkeletonText, classNames } from "@sushiswap/ui"; +import { Icon } from "../../General/Icon"; +import { IconList } from "@sushiswap/ui/components/currency/IconList"; +import { getBase58Address } from "src/utils/helpers"; +import { useTokenInfo } from "src/hooks/useTokenInfo"; +import { IRowData } from "./PoolsTable"; + +export const PoolNameCell = ({ data }: { data: IRowData }) => { + const { token0Address, token1Address } = data; + const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ + tokenAddress: getBase58Address(token0Address), + }); + + const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ + tokenAddress: getBase58Address(token1Address), + }); + + return ( +
    +
    + {token0Address && token1Address && ( + + + + + )} +
    +
    + + {isLoadingToken0 ? : token0Data?.symbol} + / + {isLoadingToken1 ? : token1Data?.symbol} +
    +
    +
    +
    + ); +}; diff --git a/apps/tron/src/components/Pools/PoolsTable/PoolReservesCell.tsx b/apps/tron/src/components/Pools/PoolsTable/PoolReservesCell.tsx new file mode 100644 index 0000000000..68c0619024 --- /dev/null +++ b/apps/tron/src/components/Pools/PoolsTable/PoolReservesCell.tsx @@ -0,0 +1,28 @@ +import { getBase58Address } from "src/utils/helpers"; +import { IRowData } from "./PoolsTable"; +import { useTokenInfo } from "src/hooks/useTokenInfo"; +import { formatUnits } from "src/utils/formatters"; +import { SkeletonText } from "@sushiswap/ui"; +import { formatNumber } from "sushi/format"; + +export const PoolReservesCell = ({ data }: { data: IRowData }) => { + const { token0Address, token1Address, reserve0, reserve1 } = data; + const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ + tokenAddress: getBase58Address(token0Address), + }); + + const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ + tokenAddress: getBase58Address(token1Address), + }); + + if (isLoadingToken0 || isLoadingToken1) { + return ; + } + + return ( +
    + {formatNumber(formatUnits(reserve0, token0Data?.decimals ?? 18, 4))} {token0Data?.symbol} /{" "} + {formatNumber(formatUnits(reserve1, token1Data?.decimals ?? 18, 4))} {token1Data?.symbol} +
    + ); +}; diff --git a/apps/tron/src/components/Pools/PoolsTable/PoolTvlCell.tsx b/apps/tron/src/components/Pools/PoolsTable/PoolTvlCell.tsx new file mode 100644 index 0000000000..9b44c51eae --- /dev/null +++ b/apps/tron/src/components/Pools/PoolsTable/PoolTvlCell.tsx @@ -0,0 +1,39 @@ +import { formatUSD } from "sushi/format"; +import { IRowData } from "./PoolsTable"; +import { useStablePrice } from "src/hooks/useStablePrice"; +import { getBase58Address } from "src/utils/helpers"; +import { useTokenInfo } from "src/hooks/useTokenInfo"; +import { SkeletonText } from "@sushiswap/ui"; + +export const PoolTvlCell = ({ data }: { data: IRowData }) => { + const { token0Address, token1Address, reserve0, reserve1 } = data; + const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ + tokenAddress: getBase58Address(token0Address), + }); + + const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ + tokenAddress: getBase58Address(token1Address), + }); + + const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice({ token: token0Data }); + const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice({ token: token1Data }); + + if (isLoadingToken0 || isLoadingToken1 || isLoadingToken0Price || isLoadingToken1Price) { + return ; + } + + const reserve0Usd = (Number(token0Price) ?? 0) * (Number(reserve0) / 10 ** (token0Data?.decimals ?? 18)); + const reserve1Usd = (Number(token1Price) ?? 0) * (Number(reserve1) / 10 ** (token1Data?.decimals ?? 18)); + + const poolTvl = reserve0Usd + reserve1Usd; + + return ( +
    +
    + + {formatUSD(poolTvl)} + +
    +
    + ); +}; diff --git a/apps/tron/src/components/Pools/PoolsTable/PoolsTable.tsx b/apps/tron/src/components/Pools/PoolsTable/PoolsTable.tsx new file mode 100644 index 0000000000..6d6a4d08c4 --- /dev/null +++ b/apps/tron/src/components/Pools/PoolsTable/PoolsTable.tsx @@ -0,0 +1,75 @@ +import { DataTable } from "@sushiswap/ui"; +import { TVL_COLUMN, NAME_COLUMN, RESERVES_COLUMN } from "./PoolColumns"; +import { usePools } from "src/hooks/usePools"; +import { PaginationState } from "@tanstack/react-table"; +import { useEffect, useMemo, useState } from "react"; +import { useDebounce } from "@sushiswap/hooks"; + +export type IRowData = { + name: string; + pairAddress: string; + token0Address: string; + token1Address: string; + reserve0: string; + reserve1: string; +}; + +type PoolsTableProps = { + query: string; + handlePoolsOnView: (pools: number) => void; +}; + +export const PoolsTable = ({ query, handlePoolsOnView }: PoolsTableProps) => { + const [paginationState, setPaginationState] = useState({ + pageIndex: 0, + pageSize: 10, + }); + const debouncedQuery = useDebounce(query, 250); + const { data, isLoading } = usePools(); + + const filteredData = useMemo(() => { + if (!data) return []; + if (!debouncedQuery) return data; + const lowercasedQuery = debouncedQuery.toLowerCase()?.replaceAll(" ", ""); + + return data.filter((pool) => { + return (["pairAddress", "token0Address", "token1Address"] as Array).some( + (key) => pool[key].toLowerCase().includes(lowercasedQuery) + ); + }); + }, [data, debouncedQuery]); + + useEffect(() => { + if (filteredData && !isLoading) { + handlePoolsOnView(filteredData.length); + } + }, [filteredData, isLoading]); + + return ( + ({ + name: pool.token0Address + "/" + pool.token1Address, + pairAddress: pool.pairAddress, + token0Address: pool.token0Address, + token1Address: pool.token1Address, + reserve0: pool.reserve0, + reserve1: pool.reserve1, + })) ?? [] + } + columns={[NAME_COLUMN, TVL_COLUMN, RESERVES_COLUMN]} + linkFormatter={(data) => { + const token0 = data.name.split("/")[0]; + const token1 = data.name.split("/")[1]; + return `/pool/${token0}:${token1}:${data.pairAddress}`; + }} + pagination={true} + externalLink={false} + onPaginationChange={setPaginationState} + state={{ + pagination: paginationState, + }} + /> + ); +}; diff --git a/apps/tron/src/components/Pools/PoolsView.tsx b/apps/tron/src/components/Pools/PoolsView.tsx new file mode 100644 index 0000000000..d6ffbd5626 --- /dev/null +++ b/apps/tron/src/components/Pools/PoolsView.tsx @@ -0,0 +1,83 @@ +import { Tab } from "@headlessui/react"; +import { Card, CardHeader, CardTitle, Container } from "@sushiswap/ui"; +import { Button } from "@sushiswap/ui"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import React, { Fragment, useState } from "react"; +import { PoolSearchBar } from "./PoolSearchBar"; +import { PoolsTable } from "./PoolsTable/PoolsTable"; +import { PositionsTable } from "./PositionsTable/PositionsTable"; + +export const PoolsView = () => { + const [tab, setTab] = useState(0); + const { address } = useWallet(); + const [query, setQuery] = useState(""); + const [poolsOnView, setPoolsOnView] = useState(-1); + const [myPositionsOnView, setMyPositionsOnView] = useState(-1); + + const handlePoolsOnView = (pools: number) => { + setPoolsOnView(pools); + }; + + const handleMyPositionsOnView = (positions: number) => { + setMyPositionsOnView(positions); + }; + + return ( +
    + + +
    + + {({ selected }) => ( + + )} + + {address && ( + <> + + {({ selected }) => ( + + )} + + + )} +
    +
    + + + + + +
    + + + Pools ({poolsOnView === -1 ? "-" : poolsOnView}) + + + +
    +
    + +
    + + + My Positions ({myPositionsOnView === -1 ? "-" : myPositionsOnView}) + + + +
    +
    + +
    +
    +
    + ); +}; diff --git a/apps/tron/src/components/Pools/PositionsTable/PositionColumns.tsx b/apps/tron/src/components/Pools/PositionsTable/PositionColumns.tsx new file mode 100644 index 0000000000..341b1c11d3 --- /dev/null +++ b/apps/tron/src/components/Pools/PositionsTable/PositionColumns.tsx @@ -0,0 +1,56 @@ +import { SkeletonCircle, SkeletonText } from "@sushiswap/ui"; +import { PositionSizeCell } from "./PositionSizeCell"; +import { ColumnDef } from "@tanstack/react-table"; +import { ICON_SIZE } from "src/constants/icon-size"; +import { PositionNameCell } from "./PositionNameCell"; +import { IMyPositionData } from "src/types/get-pools-type"; +import { PositionTvlCell } from "./PositionTvlCell"; + +export const POSITION_NAME_COLUMN: ColumnDef = { + id: "name", + header: "Name", + cell: (props) => , + meta: { + skeleton: ( +
    +
    + + +
    +
    + +
    +
    + ), + }, +}; + +export const TVL_COLUMN: ColumnDef = { + id: "TVL", + header: "TVL", + cell: (props) => , + meta: { + skeleton: ( +
    +
    + +
    +
    + ), + }, +}; + +export const SIZE_COLUMN: ColumnDef = { + id: "size", + header: "Size", + cell: (props) => , + meta: { + skeleton: ( +
    +
    + +
    +
    + ), + }, +}; diff --git a/apps/tron/src/components/Pools/PositionsTable/PositionNameCell.tsx b/apps/tron/src/components/Pools/PositionsTable/PositionNameCell.tsx new file mode 100644 index 0000000000..10abc4b499 --- /dev/null +++ b/apps/tron/src/components/Pools/PositionsTable/PositionNameCell.tsx @@ -0,0 +1,29 @@ +import { classNames } from "@sushiswap/ui"; +import { Icon } from "../../General/Icon"; +import { IconList } from "@sushiswap/ui/components/currency/IconList"; +import { IMyPositionData } from "src/types/get-pools-type"; + +export const PositionNameCell = ({ data }: { data: IMyPositionData }) => { + const { token0, token1 } = data; + + return ( +
    +
    + {token0 && token1 && ( + + + + + )} +
    +
    + + {token0?.symbol} + / + {token1?.symbol} +
    +
    +
    +
    + ); +}; diff --git a/apps/tron/src/components/Pools/PositionsTable/PositionSizeCell.tsx b/apps/tron/src/components/Pools/PositionsTable/PositionSizeCell.tsx new file mode 100644 index 0000000000..fbb6a7a018 --- /dev/null +++ b/apps/tron/src/components/Pools/PositionsTable/PositionSizeCell.tsx @@ -0,0 +1,18 @@ +import { IMyPositionData } from "src/types/get-pools-type"; +import { formatPercent } from "sushi/format"; +import { usePoolOwnership } from "../../../hooks/usePoolOwnership"; + +export const PositionSizeCell = ({ data }: { data: IMyPositionData }) => { + const { pairAddress } = data; + const { data: ownership } = usePoolOwnership({ pairAddress }); + + return ( +
    +
    + + {formatPercent(ownership?.ownership)} + +
    +
    + ); +}; diff --git a/apps/tron/src/components/Pools/PositionsTable/PositionTvlCell.tsx b/apps/tron/src/components/Pools/PositionsTable/PositionTvlCell.tsx new file mode 100644 index 0000000000..655c8b4e88 --- /dev/null +++ b/apps/tron/src/components/Pools/PositionsTable/PositionTvlCell.tsx @@ -0,0 +1,32 @@ +import { formatUSD } from "sushi/format"; +import { useStablePrice } from "src/hooks/useStablePrice"; +import { SkeletonText } from "@sushiswap/ui"; +import { IPositionRowData } from "./PositionsTable"; +import { usePoolOwnership } from "src/hooks/usePoolOwnership"; + +export const PositionTvlCell = ({ data }: { data: IPositionRowData }) => { + const { token0, token1, reserve0, reserve1, pairAddress } = data; + const { data: ownership } = usePoolOwnership({ pairAddress }); + + const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice({ token: token0 }); + const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice({ token: token1 }); + + if (isLoadingToken0Price || isLoadingToken1Price) { + return ; + } + + const reserve0Usd = (Number(token0Price) ?? 0) * (Number(reserve0) / 10 ** token0?.decimals); + const reserve1Usd = (Number(token1Price) ?? 0) * (Number(reserve1) / 10 ** token1?.decimals); + + const poolTvl = (reserve0Usd + reserve1Usd) * (Number(ownership?.ownership) ?? 0); + + return ( +
    +
    + + {formatUSD(poolTvl)} + +
    +
    + ); +}; diff --git a/apps/tron/src/components/Pools/PositionsTable/PositionsTable.tsx b/apps/tron/src/components/Pools/PositionsTable/PositionsTable.tsx new file mode 100644 index 0000000000..b70c480407 --- /dev/null +++ b/apps/tron/src/components/Pools/PositionsTable/PositionsTable.tsx @@ -0,0 +1,83 @@ +import { DataTable } from "@sushiswap/ui"; +import { POSITION_NAME_COLUMN, SIZE_COLUMN, TVL_COLUMN } from "./PositionColumns"; +import { useMyPositions } from "src/hooks/useMyPositions"; +import { useEffect, useMemo, useState } from "react"; +import { PaginationState } from "@tanstack/react-table"; +import { useDebounce } from "@sushiswap/hooks"; +import { IMyPositionData } from "src/types/get-pools-type"; +import { IToken } from "src/types/token-type"; + +type PositionsTableProps = { + query: string; + handleMyPositionsOnView: (positions: number) => void; +}; + +export type IPositionRowData = { + token0: IToken; + token1: IToken; + pairAddress: string; + reserve0: string; + reserve1: string; +}; + +export const PositionsTable = ({ query, handleMyPositionsOnView }: PositionsTableProps) => { + const [paginationState, setPaginationState] = useState({ + pageIndex: 0, + pageSize: 10, + }); + const debouncedQuery = useDebounce(query, 250); + const { data, isLoading } = useMyPositions(); + + const filteredData = useMemo(() => { + if (!data) return []; + if (!debouncedQuery) return data; + const lowercasedQuery = debouncedQuery.toLowerCase()?.replaceAll(" ", ""); + + return data.filter((pool) => { + const poolValues = [ + pool.pairAddress, + pool.token0?.address, + pool.token1?.address, + pool.token0?.symbol, + pool.token1?.symbol, + pool.token0?.name, + pool.token1?.name, + ]; + + return poolValues.some((value) => value?.toLowerCase().includes(lowercasedQuery)); + }); + }, [data, debouncedQuery]); + + useEffect(() => { + if (filteredData && !isLoading) { + handleMyPositionsOnView(filteredData.length); + } + }, [filteredData, isLoading]); + + return ( + ({ + token0: pool?.token0, + token1: pool?.token1, + pairAddress: pool?.pairAddress, + reserve0: pool?.reserve0, + reserve1: pool?.reserve1, + })) ?? [] + } + columns={[POSITION_NAME_COLUMN, TVL_COLUMN, SIZE_COLUMN]} + linkFormatter={(data: IMyPositionData) => { + const token0 = data?.token0?.address; + const token1 = data?.token1?.address; + return `/pool/${token0}:${token1}:${data?.pairAddress}`; + }} + externalLink={false} + pagination={true} + state={{ + pagination: paginationState, + }} + onPaginationChange={setPaginationState} + /> + ); +}; diff --git a/apps/tron/src/components/Pools/Remove/MinimumReceive.tsx b/apps/tron/src/components/Pools/Remove/MinimumReceive.tsx new file mode 100644 index 0000000000..b26690fc16 --- /dev/null +++ b/apps/tron/src/components/Pools/Remove/MinimumReceive.tsx @@ -0,0 +1,99 @@ +import { Card, CardGroup, CardLabel } from "@sushiswap/ui"; +import { useRemoveLiqDispatch, useRemoveLiqState } from "src/app/pool/[poolId]/remove-provider"; +import { LiquidityItem } from "../PoolDetails/LiquidityItem"; +import { usePoolState } from "src/app/pool/pool-provider"; +import { useEffect, useMemo } from "react"; +import { formatUnitsForInput, parseUnits, removeDecimals, toBigNumber } from "src/utils/formatters"; +import { PAIR_DECIMALS } from "src/constants/pair-decimals"; +import { useSlippageTolerance } from "@sushiswap/hooks"; +import { useStablePrice } from "src/hooks/useStablePrice"; + +export const MinimumReceive = () => { + const { percentage, lpBalance, totalSupplyLP, amountToken0PerLP, amountToken1PerLP } = useRemoveLiqState(); + const { setLPToRemove, setMinAmountToken0, setMinAmountToken1 } = useRemoveLiqDispatch(); + const { token0, token1 } = usePoolState(); + const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice({ token: token0 }); + const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice({ token: token1 }); + const [slippageTolerance] = useSlippageTolerance("sushi-tron-slippage-remove-liq"); + const slippage = slippageTolerance === "AUTO" ? 0.005 : Number(slippageTolerance) / 100; + + const lpTokenAmountBeingRemoved = useMemo(() => { + if (!lpBalance) return "0"; + const lpBalanceBN = toBigNumber(lpBalance); + const percentageBN = toBigNumber(percentage).div(100); + //will be in wei + return removeDecimals(lpBalanceBN.times(percentageBN)); + }, [lpBalance, percentage]); + + useEffect(() => { + if (lpTokenAmountBeingRemoved) { + setLPToRemove(lpTokenAmountBeingRemoved); + } + }, [lpTokenAmountBeingRemoved]); + + const amountToken0 = useMemo(() => { + if (!lpTokenAmountBeingRemoved || !amountToken0PerLP) return "0"; + const formattedLP = formatUnitsForInput(lpTokenAmountBeingRemoved, PAIR_DECIMALS); + const lpTokenAmountBeingRemovedBN = toBigNumber(formattedLP); + const amountToken0PerLPBN = toBigNumber(amountToken0PerLP); + return String(lpTokenAmountBeingRemovedBN.times(amountToken0PerLPBN)); + }, [lpTokenAmountBeingRemoved, amountToken0PerLP]); + + const amountToken1 = useMemo(() => { + if (!lpTokenAmountBeingRemoved || !amountToken1PerLP) return "0"; + const formattedLP = formatUnitsForInput(lpTokenAmountBeingRemoved, PAIR_DECIMALS); + const lpTokenAmountBeingRemovedBN = toBigNumber(formattedLP); + const amountToken1PerLPBN = toBigNumber(amountToken1PerLP); + return String(lpTokenAmountBeingRemovedBN.times(amountToken1PerLPBN)); + }, [lpTokenAmountBeingRemoved, amountToken1PerLP]); + + const minAmountToken0 = useMemo(() => { + if (!amountToken0) return ""; + const output = Number(amountToken0) * (1 - slippage); + return output.toString(); + }, [slippageTolerance, amountToken0, slippage]); + + useEffect(() => { + if (minAmountToken0) { + const parsedAmount = parseUnits(minAmountToken0, token0?.decimals ?? 18); + + setMinAmountToken0(parsedAmount); + } + }, [minAmountToken0]); + + const minAmountToken1 = useMemo(() => { + if (!amountToken1) return ""; + const output = Number(amountToken1) * (1 - slippage); + return output.toString(); + }, [slippageTolerance, amountToken1, slippage]); + + useEffect(() => { + if (minAmountToken1) { + const parsedAmount = parseUnits(minAmountToken1, token1?.decimals ?? 18); + + setMinAmountToken1(parsedAmount); + } + }, [minAmountToken1]); + + const isLoading = !totalSupplyLP || isLoadingToken0Price || isLoadingToken1Price; + + return ( + + + You'll receive at least: + + + + + ); +}; diff --git a/apps/tron/src/components/Pools/Remove/RemoveButton.tsx b/apps/tron/src/components/Pools/Remove/RemoveButton.tsx new file mode 100644 index 0000000000..12662fc19a --- /dev/null +++ b/apps/tron/src/components/Pools/Remove/RemoveButton.tsx @@ -0,0 +1,195 @@ +import { Button, Dots, createFailedToast, createInfoToast, createSuccessToast } from "@sushiswap/ui"; +import { useQueryClient } from "@tanstack/react-query"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { useMemo } from "react"; +import { useRemoveLiqDispatch, useRemoveLiqState } from "src/app/pool/[poolId]/remove-provider"; +import { usePoolState } from "src/app/pool/pool-provider"; +import { ApproveToken } from "src/components/Shared/ApproveToken"; +import { WalletConnector } from "src/components/WalletConnector/WalletConnector"; +import { ROUTER_CONTRACT } from "src/constants/contracts"; +import { PAIR_DECIMALS } from "src/constants/pair-decimals"; +import { useAllowance } from "src/hooks/useAllowance"; +import { useTronWeb } from "src/hooks/useTronWeb"; +import { formatUnitsForInput } from "src/utils/formatters"; +import { + cleanArgs, + getArgsForRemoveLiquidity, + getDeadline, + getRemoveLiquidityFunctionSelector, + getTransactionInfo, + parseTxnError, + safeGasEstimates, +} from "src/utils/helpers"; +import { getTronscanTxnLink } from "src/utils/tronscan-helpers"; + +export const RemoveButton = () => { + const queryClient = useQueryClient(); + const { address, connected, signTransaction } = useWallet(); + const isConnected = address && connected; + const { percentage, isTxnPending, lpToRemove, minAmountToken0, minAmountToken1 } = useRemoveLiqState(); + const { setIsTxnPending, setPercentage } = useRemoveLiqDispatch(); + const { token0, token1, pairAddress } = usePoolState(); + const { tronWeb } = useTronWeb(); + const { data: allowanceAmount, refetch } = useAllowance({ + tokenAddress: pairAddress as string, + ownerAddress: address as string, + spenderAddress: ROUTER_CONTRACT, + }); + + const removeLiquidity = async () => { + if ( + !isConnected || + !address || + !token0 || + !token1 || + !lpToRemove || + !minAmountToken0 || + !minAmountToken1 + ) { + return; + } + try { + setIsTxnPending(true); + const methodNames = getRemoveLiquidityFunctionSelector(token0, token1); + const deadline = getDeadline(); + const args = []; + for (let i = 0; i < methodNames.length; i++) { + const _args = getArgsForRemoveLiquidity( + methodNames[i], + token0.address, + token1.address, + lpToRemove, + minAmountToken0, + minAmountToken1, + address, + deadline + ); + args.push(_args); + } + console.log(args); + const estimates = await safeGasEstimates(tronWeb, args); + console.log("estimates", estimates); + const safeGasEstimate = estimates.findIndex((predicate) => predicate !== undefined); + console.log("safeGasEstimate", safeGasEstimate); + if (safeGasEstimate === -1) { + throw new Error("Failed to estimate energy. Transaction will fail."); + } + const argsForTransaction = cleanArgs(args[safeGasEstimate]); + console.log("argsForTransaction", argsForTransaction); + + const { transaction } = await tronWeb.transactionBuilder.triggerSmartContract(...argsForTransaction); + const signedTransation = await signTransaction(transaction); + const result = await tronWeb.trx.sendRawTransaction(signedTransation); + + if (!result.result && "code" in result) { + throw new Error(parseTxnError(result.code)); + } + const txId = result?.txid; + + createInfoToast({ + summary: `Removing liquidity from the ${token0.symbol}/${token1.symbol} pair.`, + type: "swap", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + txHash: txId, + href: getTronscanTxnLink(txId), + }); + + const transactionInfo = await getTransactionInfo(tronWeb, txId); + if (transactionInfo?.receipt?.result !== "SUCCESS") { + throw new Error("Transaction failed"); + } + + //create success toast + createSuccessToast({ + summary: "Successfully removed liquidity!", + txHash: txId, + type: "swap", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + href: getTronscanTxnLink(txId), + }); + onSuccess(); + } catch (error) { + const errorMessage = + typeof error === "string" + ? error + : (error as Error)?.message ?? "An error occurred while trying to remove liquidity."; + //create error toast + createFailedToast({ + summary: errorMessage, + type: "swap", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + }); + console.log(error); + setIsTxnPending(false); + } + }; + + const onSuccess = () => { + setPercentage(0); + setIsTxnPending(false); + queryClient.invalidateQueries([ + "useTokenBalance", + { accountAddress: address, tokenAddress: pairAddress }, + ]); + }; + + const allowanceFormatted = formatUnitsForInput(allowanceAmount ?? "0", token0?.decimals ?? 18); + + const buttonText = useMemo(() => { + if (isTxnPending) { + ("Removing"); + } + if (percentage === 0) { + return "Enter Amount"; + } + if ( + allowanceAmount && + Number(formatUnitsForInput(lpToRemove, PAIR_DECIMALS)) > Number(allowanceFormatted) + ) { + return "Approve"; + } + return "Remove"; + }, [percentage, isTxnPending, allowanceFormatted, allowanceAmount, lpToRemove]); + + if (!isConnected) { + return ; + } + + if (buttonText === "Approve") { + return ( + { + await refetch(); + }} + /> + ); + } + + return ( + + ); +}; diff --git a/apps/tron/src/components/Pools/Remove/RemoveInput.tsx b/apps/tron/src/components/Pools/Remove/RemoveInput.tsx new file mode 100644 index 0000000000..e1921292db --- /dev/null +++ b/apps/tron/src/components/Pools/Remove/RemoveInput.tsx @@ -0,0 +1,48 @@ +import { Button, Card, Message } from "@sushiswap/ui"; +import { useRemoveLiqDispatch, useRemoveLiqState } from "src/app/pool/[poolId]/remove-provider"; + +const PercentageOptions = [25, 50, 75, 100]; + +export const RemoveInput = () => { + const { percentage, lpBalance } = useRemoveLiqState(); + const { setPercentage } = useRemoveLiqDispatch(); + + const noLpToken = Number(lpBalance) <= 0; + + return ( + <> + {noLpToken ? ( + + No LP tokens found. + + ) : null} + +
    +
    {`${percentage}%`}
    +
    + {PercentageOptions.map((option) => ( + + ))} +
    +
    + setPercentage(Number(e.target.value))} + type="range" + min="1" + max="100" + className="w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer range-lg dark:bg-gray-700" + disabled={noLpToken} + /> +
    + + ); +}; diff --git a/apps/tron/src/components/Pools/Remove/RemoveLiquidity.tsx b/apps/tron/src/components/Pools/Remove/RemoveLiquidity.tsx new file mode 100644 index 0000000000..f0081793a5 --- /dev/null +++ b/apps/tron/src/components/Pools/Remove/RemoveLiquidity.tsx @@ -0,0 +1,14 @@ +"use client"; +import { RemoveInput } from "./RemoveInput"; +import { MinimumReceive } from "./MinimumReceive"; +import { RemoveButton } from "./RemoveButton"; + +export const RemoveLiquidity = () => { + return ( +
    + + + +
    + ); +}; diff --git a/apps/tron/src/components/Pools/ReserveHelper.tsx b/apps/tron/src/components/Pools/ReserveHelper.tsx new file mode 100644 index 0000000000..dc891269d9 --- /dev/null +++ b/apps/tron/src/components/Pools/ReserveHelper.tsx @@ -0,0 +1,34 @@ +import { useEffect } from "react"; +import { usePoolDispatch, usePoolState } from "src/app/pool/pool-provider"; +import { useReserves } from "src/hooks/useReserves"; +import { getValidTokenAddress } from "src/utils/helpers"; + +export const ReserveHelper = () => { + const { token0, token1, pairAddress } = usePoolState(); + const { setReserve0, setReserve1 } = usePoolDispatch(); + + const { data, isLoading } = useReserves({ + pairAddress: pairAddress, + token0: token0, + token1: token1, + }); + + useEffect(() => { + if (!pairAddress) { + setReserve0(""); + setReserve1(""); + } + if (!isLoading && data && data?.length > 0 && pairAddress && token0 && token1) { + const reserve0 = data.find( + (d) => getValidTokenAddress(d.address!) === getValidTokenAddress(token0?.address) + ); + const reserve1 = data.find( + (d) => getValidTokenAddress(d.address!) === getValidTokenAddress(token1?.address) + ); + setReserve0(reserve0?.reserve ?? ""); + setReserve1(reserve1?.reserve ?? ""); + } + }, [data, isLoading, pairAddress, token0, token1]); + + return null; +}; diff --git a/apps/tron/src/components/Shared/ApproveToken.tsx b/apps/tron/src/components/Shared/ApproveToken.tsx new file mode 100644 index 0000000000..914aea2cc1 --- /dev/null +++ b/apps/tron/src/components/Shared/ApproveToken.tsx @@ -0,0 +1,151 @@ +import { getTronscanTxnLink } from "src/utils/tronscan-helpers"; +import { + Button, + Command, + CommandGroup, + CommandItem, + Dots, + Popover, + PopoverContent, + PopoverTrigger, + createFailedToast, + createInfoToast, + createSuccessToast, +} from "@sushiswap/ui"; +import { useState } from "react"; +import { IToken } from "src/types/token-type"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { useTronWeb } from "src/hooks/useTronWeb"; +import { parseUnits, toBigNumber } from "src/utils/formatters"; +import { getTransactionInfo, parseTxnError } from "src/utils/helpers"; +import { MAX_UINT256 } from "src/constants/max-uint256"; + +export const ApproveToken = ({ + tokenToApprove, + amount, + spenderAddress, + onSuccess, +}: { + tokenToApprove: IToken; + amount: string; + spenderAddress: string; + onSuccess: () => Promise; +}) => { + const [isApproving, setIsApproving] = useState(false); + const { address, signTransaction } = useWallet(); + const { tronWeb } = useTronWeb(); + + const approveToken = async (type: "one-time" | "unlimited") => { + try { + setIsApproving(true); + const parsedAmount = parseUnits(amount, tokenToApprove.decimals); + const approvalAmount = type === "one-time" ? parsedAmount : MAX_UINT256; + const { transaction } = await tronWeb.transactionBuilder.triggerSmartContract( + tokenToApprove.address, //contract address + "approve(address,uint256)", //function name + {}, // options + [ + { type: "address", value: spenderAddress }, + { type: "uint256", value: approvalAmount }, + ], //parameters + address //issuerAddress + ); + const signedTransation = await signTransaction(transaction); + const _result = await tronWeb.trx.sendRawTransaction(signedTransation); + if (!_result.result && "code" in _result) { + throw new Error(parseTxnError(_result.code)); + } + const txId = _result?.txid; + createInfoToast({ + summary: type === "one-time" ? "Approving One Time..." : "Approval Unlimited Amount...", + type: "approval", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + txHash: txId, + href: getTronscanTxnLink(txId), + }); + const transactionInfo = await getTransactionInfo(tronWeb, txId); + if (transactionInfo?.receipt?.result !== "SUCCESS") { + throw new Error("Approval failed"); + } + //create success toast + createSuccessToast({ + summary: "Approval successful", + txHash: txId, + type: "swap", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + href: getTronscanTxnLink(txId), + }); + await onSuccess(); + setIsApproving(false); + } catch (error) { + const errorMessage = + typeof error === "string" + ? error + : (error as Error)?.message ?? "An error occurred while setting approval"; + //create error toast + createFailedToast({ + summary: errorMessage, + type: "swap", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + }); + console.log(error); + setIsApproving(false); + } + }; + + return ( + + + + + + + +
    { + await approveToken("one-time"); + }} + className="flex flex-col"> +

    Approve one-time only

    +

    + You'll give your approval to spend {toBigNumber(amount).toString(10)}{" "} + {tokenToApprove.symbol} on your behalf +

    +
    +
    + +
    { + await approveToken("unlimited"); + }} + className="flex flex-col"> +

    Approve unlimited amount

    +

    + You won't need to approve again next time you want to spend {tokenToApprove.symbol}. +

    +
    +
    +
    +
    +
    +
    +
    + ); +}; diff --git a/apps/tron/src/components/Shared/DollarAmountDisplay.tsx b/apps/tron/src/components/Shared/DollarAmountDisplay.tsx new file mode 100644 index 0000000000..222a1a7a66 --- /dev/null +++ b/apps/tron/src/components/Shared/DollarAmountDisplay.tsx @@ -0,0 +1,28 @@ +import { SkeletonText } from "@sushiswap/ui"; + +type DollarAmountDisplayProps = { + isLoading: boolean; + error?: string; + value: string; +}; +export const DollarAmountDisplay = ({ isLoading, error, value }: DollarAmountDisplayProps) => { + const [big, portion] = (value ? `${Number(value).toFixed(2)}` : "0.00").split("."); + + if (isLoading) { + return ( +
    + +
    + ); + } + + if (error) { + return

    {error}

    ; + } + + return ( +

    + $ {big}.{portion} +

    + ); +}; diff --git a/apps/tron/src/components/Shared/TokenBalanceDisplay.tsx b/apps/tron/src/components/Shared/TokenBalanceDisplay.tsx new file mode 100644 index 0000000000..e7df08f3b8 --- /dev/null +++ b/apps/tron/src/components/Shared/TokenBalanceDisplay.tsx @@ -0,0 +1,51 @@ +import { classNames } from "@sushiswap/ui"; +import { WalletIcon } from "@sushiswap/ui"; +import { SkeletonText } from "@sushiswap/ui"; +import { useMemo } from "react"; +import { formatUnits } from "src/utils/formatters"; + +type TokenBalanceDisplayProps = { + amount: number; + isLoading: boolean; + decimals: number; + maxAmount?: () => void; + type: "input" | "output"; +}; + +export const TokenBalanceDisplay = ({ + amount, + isLoading, + decimals, + maxAmount, + type, +}: TokenBalanceDisplayProps) => { + const [big, portion] = useMemo( + () => (amount ? formatUnits(amount, decimals, 4) : "0.00")?.split("."), + [amount, decimals] + ); + + return ( + + ); +}; diff --git a/apps/tron/src/components/Swap/AmountIn.tsx b/apps/tron/src/components/Swap/AmountIn.tsx new file mode 100644 index 0000000000..1a5bebfdc2 --- /dev/null +++ b/apps/tron/src/components/Swap/AmountIn.tsx @@ -0,0 +1,40 @@ +import { useSwapDispatch, useSwapState } from "src/app/swap/swap-provider"; +import { TokenInput } from "../Input/TokenInput"; +import { useDebounce } from "@sushiswap/hooks"; +import { useAmountsOut } from "src/hooks/useAmountsOut"; +import { formatUnitsForInput, parseUnits } from "src/utils/formatters"; +import { useEffect } from "react"; + +export const AmountIn = () => { + const { token0, amountIn, token1 } = useSwapState(); + const { setToken0, setAmountIn, setAmountOut } = useSwapDispatch(); + + const debouncedAmountIn = useDebounce(amountIn, 500); + + const { data: amountsOut } = useAmountsOut({ + amountIn: parseUnits(debouncedAmountIn, token0.decimals), + }); + + useEffect(() => { + if (amountsOut && amountsOut?.length !== 0) { + const _amountOut = formatUnitsForInput(amountsOut[amountsOut?.length - 1], token1.decimals); + if (_amountOut === "0") { + setAmountOut(""); + } else { + setAmountOut(_amountOut); + } + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [amountsOut, token1?.decimals]); + + useEffect(() => { + if (Number(amountIn) === 0) { + setAmountOut(""); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [amountIn]); + + return ( + + ); +}; diff --git a/apps/tron/src/components/Swap/AmountOut.tsx b/apps/tron/src/components/Swap/AmountOut.tsx new file mode 100644 index 0000000000..246df62d88 --- /dev/null +++ b/apps/tron/src/components/Swap/AmountOut.tsx @@ -0,0 +1,17 @@ +import { useSwapDispatch, useSwapState } from "src/app/swap/swap-provider"; +import { TokenInput } from "../Input/TokenInput"; + +export const AmountOut = () => { + const { token1, amountOut } = useSwapState(); + const { setToken1, setAmountOut } = useSwapDispatch(); + + return ( + + ); +}; diff --git a/apps/tron/src/components/Swap/ReviewSwapDialog.tsx b/apps/tron/src/components/Swap/ReviewSwapDialog.tsx new file mode 100644 index 0000000000..0ed1c538ea --- /dev/null +++ b/apps/tron/src/components/Swap/ReviewSwapDialog.tsx @@ -0,0 +1,141 @@ +import { PlusIcon } from "@heroicons/react/24/outline"; +import { useSlippageTolerance } from "@sushiswap/hooks"; +import { Badge } from "@sushiswap/ui"; +import { List } from "@sushiswap/ui"; +import { SkeletonCircle } from "@sushiswap/ui"; +import { Icon } from "../General/Icon"; +import { Dialog, DialogClose, DialogContent, classNames } from "@sushiswap/ui"; +import { useSwapState } from "src/app/swap/swap-provider"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { warningSeverity, warningSeverityClassName } from "src/utils/warning-severity"; +import Link from "next/link"; +import { truncateText } from "src/utils/formatters"; +import { getTronscanAddressLink } from "src/utils/tronscan-helpers"; +import { useMemo, useRef } from "react"; +import { WalletConnector } from "../WalletConnector/WalletConnector"; +import { ReviewSwapDialogTrigger } from "./ReviewSwapDialogTrigger"; +import { formatPercent } from "sushi/format"; +import { SwapButton } from "./SwapButton"; + +export const ReviewSwapDialog = () => { + const { token0, token1, amountIn, amountOut, priceImpactPercentage } = useSwapState(); + const closeBtnRef = useRef(null); + const { address, connected } = useWallet(); + const isConnected = address && connected; + const [slippageTolerance] = useSlippageTolerance("sushi-tron-slippage"); + const slippage = slippageTolerance === "AUTO" ? 0.005 : Number(slippageTolerance) / 100; + + const closeModal = () => { + closeBtnRef?.current?.click(); + }; + + const minOutput = useMemo(() => { + if (!amountOut) return ""; + if ( + (token0?.symbol === "WTRX" && token1?.address === "TRON") || + (token0?.address === "TRON" && token1?.symbol === "WTRX") + ) { + return amountIn; + } + + const output = Number(amountOut) * (1 - slippage); + return String(output); + }, [amountOut, slippage, token0, token1, amountIn]); + + const severityClass = useMemo(() => { + return warningSeverityClassName(warningSeverity(priceImpactPercentage)); + }, [priceImpactPercentage]); + + return ( + + {isConnected ? ( + + ) : ( + + )} + + +
    +
    +
    +

    + Buy {amountOut} {token1?.symbol} +

    +

    + Sell {amountIn} {token0?.symbol} +

    +
    +
    +
    + + +
    + }> + {token1 ? ( + + ) : ( + + )} + +
    +
    +
    +
    + + + TRON + + + -{formatPercent(priceImpactPercentage / 100)} + + + + {minOutput} {token1?.symbol} + + + ~$0.00 + + + {address && ( + + + + + {truncateText(address)} + + + + + )} + +
    +
    +
    + +
    +
    + +
    +
    + ); +}; diff --git a/apps/tron/src/components/Swap/ReviewSwapDialogTrigger.tsx b/apps/tron/src/components/Swap/ReviewSwapDialogTrigger.tsx new file mode 100644 index 0000000000..61bb460a4a --- /dev/null +++ b/apps/tron/src/components/Swap/ReviewSwapDialogTrigger.tsx @@ -0,0 +1,174 @@ +import { Button, Checkbox, DialogTrigger } from "@sushiswap/ui"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { useEffect, useMemo, useState } from "react"; +import { useSwapDispatch, useSwapState } from "src/app/swap/swap-provider"; +import { ROUTER_CONTRACT } from "src/constants/contracts"; +import { useAllowance } from "src/hooks/useAllowance"; +import { useTokenBalance } from "src/hooks/useTokenBalance"; +import { formatUnitsForInput } from "src/utils/formatters"; +import { ApproveToken } from "../Shared/ApproveToken"; +import { useReserves } from "src/hooks/useReserves"; +import { usePriceImpact } from "src/hooks/usePriceImpact"; +import { warningSeverity } from "src/utils/warning-severity"; +import { useRoutes } from "src/hooks/useRoutes"; +import { getIfWrapOrUnwrap } from "src/utils/helpers"; + +export const ReviewSwapDialogTrigger = () => { + const [isChecked, setIsChecked] = useState(false); + const { token0, token1, amountIn, amountOut, isTxnPending } = useSwapState(); + const { setPriceImpactPercentage, setRoute } = useSwapDispatch(); + const { address } = useWallet(); + const { data: allowanceAmount, refetch } = useAllowance({ + tokenAddress: token0?.address as string, + ownerAddress: address as string, + spenderAddress: ROUTER_CONTRACT, + }); + const { data: tokenBalance, isLoading } = useTokenBalance({ + accountAddress: address, + tokenAddress: token0.address, + }); + const { data: routeData, isLoading: isLoadingRoutes } = useRoutes({ token0, token1 }); + //these reserves are always going to be defined if a pair exists + const { data: reserves, isLoading: isReservesLoading } = useReserves({ + pairAddress: routeData?.pairs?.[0], + token0, + token1, + }); + //these reserves are for is the swap needs an intermediate pair + const { data: reserves1, isLoading: isReserves1Loading } = useReserves({ + pairAddress: routeData?.pairs?.[1], + token0, + token1, + }); + + //this number is always going to be defined if the reserves exists + const { data: priceImpactPercentage } = usePriceImpact({ + amount: amountIn, + token: token0, + reserves, + }); + + //this number is for the price impact of the second pair in a hop is needed + const { data: priceImpactPercentage1 } = usePriceImpact({ + amount: amountOut, + token: token1, + reserves: reserves1, + }); + + const priceImpactTotal = (priceImpactPercentage ?? 0) + (priceImpactPercentage1 ?? 0); + + useEffect(() => { + if (isLoadingRoutes) { + setRoute([]); + } + if (routeData && routeData.route.length > 0 && !isLoadingRoutes) { + setRoute(routeData.route); + } + }, [routeData, isLoadingRoutes]); + + const swapType = useMemo(() => { + return getIfWrapOrUnwrap(token0, token1); + }, [token0, token1]); + + useEffect(() => { + setPriceImpactPercentage(priceImpactTotal ?? 0); + }, [priceImpactTotal]); + + const refreshAllowance = async () => { + await refetch(); + }; + + const hasInsufficientBalance = useMemo(() => { + if (isLoading) return true; + return Number(formatUnitsForInput(tokenBalance ?? "0", token0.decimals)) < Number(amountIn); + }, [tokenBalance, token0, amountIn, isLoading]); + + const noRoutes = swapType === "swap" && !isLoadingRoutes && routeData && routeData.route?.length === 0; + + const allowanceFormatted = formatUnitsForInput(allowanceAmount ?? "0", token0?.decimals); + + const insufficientLiquidity = priceImpactTotal && priceImpactTotal >= 100; + + const buttonText = useMemo(() => { + if (isTxnPending) { + return "Swapping"; + } + if (!amountIn || amountIn === "0") { + return "Enter Amount"; + } + if (hasInsufficientBalance) { + return "Insufficient Balance"; + } + if (swapType === "unwrap") { + return "Unwrap"; + } + if (swapType === "wrap") { + return "Wrap"; + } + if (noRoutes) { + return "No Routes Found"; + } + if (insufficientLiquidity) { + return "Insufficient Liquidity"; + } + if (allowanceAmount && Number(amountIn) > Number(allowanceFormatted) && swapType === "swap") { + return "Approve"; + } + return "Review Swap"; + }, [ + amountIn, + allowanceAmount, + hasInsufficientBalance, + noRoutes, + allowanceFormatted, + swapType, + insufficientLiquidity, + isTxnPending, + ]); + + const userConfirmationNeeded = useMemo(() => { + if ( + warningSeverity(priceImpactPercentage ?? 0) > 3 && + (buttonText === "Review Swap" || buttonText === "Approve") + ) { + return true; + } + return false; + }, [priceImpactPercentage, buttonText]); + + return ( + <> + {buttonText === "Approve" ? ( + + ) : ( + + + + )} + {userConfirmationNeeded && !isChecked ? ( +
    setIsChecked(!isChecked)} + className="flex items-start px-4 py-3 mt-4 rounded-xl bg-red/20 dark:bg-red/40 cursor-pointer"> + + +
    + ) : null} + + ); +}; diff --git a/apps/tron/src/components/Swap/SwapButton.tsx b/apps/tron/src/components/Swap/SwapButton.tsx new file mode 100644 index 0000000000..b4e81493ca --- /dev/null +++ b/apps/tron/src/components/Swap/SwapButton.tsx @@ -0,0 +1,210 @@ +import { Button, Dots, createFailedToast, createInfoToast, createSuccessToast } from "@sushiswap/ui"; +import { useQueryClient } from "@tanstack/react-query"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { useMemo } from "react"; +import { useSwapDispatch, useSwapState } from "src/app/swap/swap-provider"; +import { WTRX } from "src/constants/token-list"; + +import { useTronWeb } from "src/hooks/useTronWeb"; +import { parseUnits } from "src/utils/formatters"; +import { + cleanArgs, + getArgsForSwap, + getDeadline, + getIfWrapOrUnwrap, + getRouterFunctionSelectors, + getTransactionInfo, + parseTxnError, + safeGasEstimates, +} from "src/utils/helpers"; +import { getTronscanTxnLink } from "src/utils/tronscan-helpers"; + +export const SwapButton = ({ closeModal, minOutput }: { closeModal: () => void; minOutput: string }) => { + const queryClient = useQueryClient(); + const { token0, token1, isTxnPending, amountIn, amountOut, route } = useSwapState(); + const { setIsTxnPending, setAmountIn, setAmountOut, setPriceImpactPercentage } = useSwapDispatch(); + const { tronWeb } = useTronWeb(); + const { address, signTransaction } = useWallet(); + + const swapType = useMemo(() => { + return getIfWrapOrUnwrap(token0, token1); + }, [token0, token1]); + + const swapToken = async () => { + if (!address) return; + let txId: string = ""; + try { + setIsTxnPending(true); + const parsedAmountIn = parseUnits(amountIn, token0?.decimals); + const parsedAmountOut = parseUnits(amountOut, token1?.decimals); + + if (swapType === "wrap") { + const { transaction } = await tronWeb.transactionBuilder.triggerSmartContract( + WTRX.address, //contract address + "deposit()", //function name + { callValue: parsedAmountIn }, // options + [], //parameters + address //issuerAddress + ); + const signedTransation = await signTransaction(transaction); + const _result = await tronWeb.trx.sendRawTransaction(signedTransation); + console.log("_result", _result); + if (!_result.result && "code" in _result) { + throw new Error(parseTxnError(_result.code)); + } + txId = _result?.txid; + createInfoToast({ + summary: "Wrapping TRX...", + type: "swap", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + txHash: txId, + href: getTronscanTxnLink(txId), + }); + } else if (swapType === "unwrap") { + const { transaction } = await tronWeb.transactionBuilder.triggerSmartContract( + WTRX.address, //contract address + "withdraw(uint256)", //function name + {}, // options + [{ type: "uint256", value: parsedAmountIn }], //parameters + address //issuerAddress + ); + const signedTransation = await signTransaction(transaction); + const _result = await tronWeb.trx.sendRawTransaction(signedTransation); + console.log("_result", _result); + if (!_result.result && "code" in _result) { + throw new Error(parseTxnError(_result.code)); + } + + txId = _result?.txid; + createInfoToast({ + summary: "Unwrapping WTRX...", + type: "swap", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + txHash: txId, + href: getTronscanTxnLink(txId), + }); + } else { + const methodNames = getRouterFunctionSelectors(route); + console.log("methodNames", methodNames); + const deadline = getDeadline(); + const parsedAmountOutMin = parseUnits(minOutput, token1?.decimals); + + const args = []; + for (let i = 0; i < methodNames.length; i++) { + const _args = getArgsForSwap( + methodNames[i], + parsedAmountIn, + parsedAmountOut, + parsedAmountIn, + parsedAmountOutMin, + route, + address, + deadline, + address + ); + args.push(_args); + } + console.log("args", args); + + const estimates = await safeGasEstimates(tronWeb, args); + console.log("estimates", estimates); + const safeGasEstimate = estimates.findIndex((predicate) => predicate !== undefined); + console.log("safeGasEstimate", safeGasEstimate); + if (safeGasEstimate === -1) { + throw new Error("Failed to estimate energy. Transaction will fail."); + } + const argsForTransaction = cleanArgs(args[safeGasEstimate]); + console.log("argsForTransaction", argsForTransaction); + + const { transaction } = await tronWeb.transactionBuilder.triggerSmartContract(...argsForTransaction); + + const signedTransation = await signTransaction(transaction); + const _result = await tronWeb.trx.sendRawTransaction(signedTransation); + + if (!_result.result && "code" in _result) { + throw new Error(parseTxnError(_result.code)); + } + txId = _result?.txid; + createInfoToast({ + summary: "Swap initiated...", + type: "swap", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + txHash: txId, + href: getTronscanTxnLink(txId), + }); + } + + const transactionInfo = await getTransactionInfo(tronWeb, txId); + if (transactionInfo?.receipt?.result !== "SUCCESS") { + throw new Error("Transaction failed"); + } + //create success toast + createSuccessToast({ + summary: "Swap successful", + txHash: txId, + type: "swap", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + href: getTronscanTxnLink(txId), + }); + onSuccess(); + } catch (error) { + const errorMessage = + typeof error === "string" + ? error + : (error as Error)?.message ?? "An error occurred while trying to swap"; + //create error toast + createFailedToast({ + summary: errorMessage, + type: "swap", + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + href: txId ? getTronscanTxnLink(txId) : undefined, + }); + console.log(error); + + setIsTxnPending(false); + } + }; + + const onSuccess = () => { + setAmountIn(""); + setAmountOut(""); + setPriceImpactPercentage(0); + setIsTxnPending(false); + closeModal(); + queryClient.invalidateQueries([ + "useTokenBalance", + { accountAddress: address, tokenAddress: token0?.address }, + ]); + queryClient.invalidateQueries([ + "useTokenBalance", + { accountAddress: address, tokenAddress: token1?.address }, + ]); + }; + + return ( + + ); +}; diff --git a/apps/tron/src/components/Swap/SwapRoutesDialog.tsx b/apps/tron/src/components/Swap/SwapRoutesDialog.tsx new file mode 100644 index 0000000000..7923187f14 --- /dev/null +++ b/apps/tron/src/components/Swap/SwapRoutesDialog.tsx @@ -0,0 +1,49 @@ +import { Button } from "@sushiswap/ui"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@sushiswap/ui"; +import { Icon } from "../General/Icon"; +import { useSwapState } from "src/app/swap/swap-provider"; +import { useTokenInfo } from "src/hooks/useTokenInfo"; + +export const SwapRoutesDialog = () => { + const { route } = useSwapState(); + + return ( + + + + + + + + Trade Route + Optimized route to get the best price + +
    +
    + {route?.map((tokenAddress, idx) => ( + + ))} +
    +
    +
    +
    + ); +}; + +const SwapItem = ({ tokenAddress }: { tokenAddress: string }) => { + const { data } = useTokenInfo({ tokenAddress }); + + return ( +
    + + {data?.symbol} +
    + ); +}; diff --git a/apps/tron/src/components/Swap/SwapStats.tsx b/apps/tron/src/components/Swap/SwapStats.tsx new file mode 100644 index 0000000000..408d4269ce --- /dev/null +++ b/apps/tron/src/components/Swap/SwapStats.tsx @@ -0,0 +1,116 @@ +import { Transition } from "@headlessui/react"; +import { classNames } from "@sushiswap/ui"; +import { SkeletonBox } from "@sushiswap/ui"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import Link from "next/link"; +import { useSwapState } from "src/app/swap/swap-provider"; +import { truncateText } from "src/utils/formatters"; +import { getTronscanAddressLink } from "src/utils/tronscan-helpers"; +import { warningSeverity, warningSeverityClassName } from "src/utils/warning-severity"; +import { SwapRoutesDialog } from "./SwapRoutesDialog"; +import { useSlippageTolerance } from "@sushiswap/hooks"; +import { useMemo } from "react"; +import { formatPercent } from "sushi/format"; +import { getIfWrapOrUnwrap } from "src/utils/helpers"; + +export const SwapStats = () => { + const { token0, token1, amountOut, amountIn, priceImpactPercentage, route } = useSwapState(); + const { address } = useWallet(); + + const swapType = useMemo(() => { + return getIfWrapOrUnwrap(token0, token1); + }, [token0, token1]); + + const isLoading = + priceImpactPercentage === undefined || + (priceImpactPercentage === 0 && swapType === "swap") || + amountOut === "" || + amountOut === ""; + + const [slippageTolerance] = useSlippageTolerance("sushi-tron-slippage"); + + const slippage = slippageTolerance === "AUTO" ? 0.005 : Number(slippageTolerance) / 100; + + const minOutput = useMemo(() => { + if (!amountOut) return ""; + if ( + (token0?.symbol === "WTRX" && token1?.address === "TRON") || + (token0?.address === "TRON" && token1?.symbol === "WTRX") + ) { + return amountIn; + } + + const output = Number(amountOut) * (1 - slippage); + return output; + }, [amountOut, slippage, token0, token1, amountIn]); + + const severityColor = useMemo(() => { + return warningSeverityClassName(warningSeverity(priceImpactPercentage)); + }, [priceImpactPercentage]); + + return ( + 0} + enter="transition duration-300 ease-out" + enterFrom="transform translate-y-[16px] opacity-0" + enterTo="transform translate-y-0 opacity-100" + leave="transition duration-300 ease-out" + leaveFrom="transform translate-y-0 opacity-100" + leaveTo="transform translate-y-[16px] opacity-0"> +
    +
    + Price impact + + {isLoading ? ( + + ) : ( + + {priceImpactPercentage ? `-${formatPercent(priceImpactPercentage / 100)}` : formatPercent(0)} + + )} + +
    +
    + Est. received + + {isLoading ? ( + + ) : ( + `${amountOut} ${token1.symbol}` + )} + +
    +
    + Min. received + + {isLoading ? ( + + ) : ( + `${minOutput} ${token1.symbol}` + )} + +
    +
    + Route + + {isLoading ? : } + +
    + {address && ( +
    + Recipient + + + {truncateText(address)} + + +
    + )} +
    +
    + ); +}; diff --git a/apps/tron/src/components/Swap/SwitchSwapDirection.tsx b/apps/tron/src/components/Swap/SwitchSwapDirection.tsx new file mode 100644 index 0000000000..0c2aaac80c --- /dev/null +++ b/apps/tron/src/components/Swap/SwitchSwapDirection.tsx @@ -0,0 +1,19 @@ +import React from "react"; +import { ArrowsUpDownIcon } from "@heroicons/react/24/outline"; +import { useSwapDispatch } from "src/app/swap/swap-provider"; + +export const SwitchSwapDirection = () => { + const { swapTokens } = useSwapDispatch(); + return ( +
    + +
    + ); +}; diff --git a/apps/tron/src/components/Swap/SwitchSwapType.tsx b/apps/tron/src/components/Swap/SwitchSwapType.tsx new file mode 100644 index 0000000000..adf6916b5d --- /dev/null +++ b/apps/tron/src/components/Swap/SwitchSwapType.tsx @@ -0,0 +1,11 @@ +import { Button } from "@sushiswap/ui/components/button"; + +export const SwitchSwapType = () => { + return ( +
    + +
    + ); +}; diff --git a/apps/tron/src/components/WalletConnector/DefaultView.tsx b/apps/tron/src/components/WalletConnector/DefaultView.tsx new file mode 100644 index 0000000000..22fdb56007 --- /dev/null +++ b/apps/tron/src/components/WalletConnector/DefaultView.tsx @@ -0,0 +1,90 @@ +import { Cog6ToothIcon, DocumentDuplicateIcon, LinkIcon } from "@heroicons/react/24/outline"; +import { ArrowLeftOnRectangleIcon } from "@heroicons/react/24/outline"; +import { IconButton, JazzIcon } from "@sushiswap/ui"; +import React, { Dispatch, SetStateAction } from "react"; +import { IProfileView } from "./WalletConnector"; +import { SkeletonText } from "@sushiswap/ui"; +import { formatUSD, formatNumber } from "sushi/format"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { truncateText } from "src/utils/formatters"; +import { useNativeBalance } from "src/hooks/useNativeBalance"; +import Link from "next/link"; +import { getTronscanAddressLink } from "src/utils/tronscan-helpers"; +import { ClipboardController } from "@sushiswap/ui"; +import { useStablePrice } from "src/hooks/useStablePrice"; +import { WTRX } from "src/constants/token-list"; + +type DefaultViewProps = { + setView: Dispatch>; +}; + +export const DefaultView = ({ setView }: DefaultViewProps) => { + const { address, disconnect } = useWallet(); + const { data, isLoading: isLoadingBalance } = useNativeBalance(); + + const { data: price, isLoading: isLoadingPrice } = useStablePrice({ token: WTRX }); + + const isLoading = isLoadingBalance || isLoadingPrice; + + return ( +
    +
    +
    + {address && } + + {({ setCopied }) => ( + setCopied(address ?? "")}> + {truncateText(address ?? "")} + + )} + +
    +
    + setView("settings")} + name="Settings" + description="Settings" + size="xs" + /> + + {({ setCopied }) => ( + setCopied(address ?? "")} + name={"Copy Address"} + description={"Copy Address"} + size="xs" + /> + )} + + + + + await disconnect()} + name="Disconnect" + size="xs" + description="Disconnect" + /> +
    +
    +
    + {isLoading || !price || data?.formattedBalance === undefined ? ( +
    + + TRX +
    + ) : ( +

    {formatNumber(data?.formattedBalance)} TRX

    + )} + {isLoading || !price || data?.formattedBalance === undefined ? ( + + ) : ( +

    {formatUSD(Number(price) * data?.formattedBalance)}

    + )} +
    +
    + ); +}; diff --git a/apps/tron/src/components/WalletConnector/SettingsView.tsx b/apps/tron/src/components/WalletConnector/SettingsView.tsx new file mode 100644 index 0000000000..bc0e086661 --- /dev/null +++ b/apps/tron/src/components/WalletConnector/SettingsView.tsx @@ -0,0 +1,65 @@ +import { ArrowLeftIcon } from "@heroicons/react/20/solid"; +import { List } from "@sushiswap/ui"; +import React, { FC, Fragment } from "react"; +import { IconButton } from "@sushiswap/ui"; +import { RadioGroup } from "@headlessui/react"; +import { classNames } from "@sushiswap/ui"; +import { MoonIcon, SunIcon } from "@heroicons/react/24/outline"; +import { useTheme } from "next-themes"; +import { IProfileView } from "./WalletConnector"; + +type SettingsViewProps = { + setView: React.Dispatch>; +}; + +const options = { + system: Auto, + light: , + dark: , +}; + +export const SettingsView: FC = ({ setView }) => { + const { theme, setTheme } = useTheme(); + return ( +
    +
    +
    + setView("default")} + icon={ArrowLeftIcon} + name="Back" + className="bg-transparent" + /> +
    + Settings +
    +
    + + Preferences + + + +
    + {Object.entries(options).map(([k, v], i) => ( + + {({ checked }) => ( + + )} + + ))} +
    +
    +
    +
    +
    +
    + ); +}; diff --git a/apps/tron/src/components/WalletConnector/WalletConnector.tsx b/apps/tron/src/components/WalletConnector/WalletConnector.tsx new file mode 100644 index 0000000000..de5f6b423f --- /dev/null +++ b/apps/tron/src/components/WalletConnector/WalletConnector.tsx @@ -0,0 +1,66 @@ +import { Button, Popover, PopoverContent, PopoverTrigger, SelectIcon, JazzIcon, Chip } from "@sushiswap/ui"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { truncateText } from "src/utils/formatters"; +import { WalletListView } from "./WalletListView"; +import { useState } from "react"; +import { DefaultView } from "./DefaultView"; +import { SettingsView } from "./SettingsView"; +import { IS_TESTNET } from "src/constants/is-testnet"; + +export type IProfileView = "default" | "settings"; + +type WalletConnectorProps = { + hideChevron?: boolean; + fullWidth?: boolean; + size?: "default" | "lg"; + variant?: "secondary" | "default"; +}; + +export const WalletConnector = ({ + hideChevron, + fullWidth, + size = "default", + variant = "secondary", +}: WalletConnectorProps) => { + const [view, setView] = useState("default"); + const { connected, connecting, address } = useWallet(); + const isConnected = address && connected; + + return ( + + + + {IS_TESTNET && isConnected ? ( + + Testnet + + ) : null} + + + + {!isConnected ? : null} + {view === "default" && isConnected ? : null} + {view === "settings" && isConnected ? : null} + + + ); +}; diff --git a/apps/tron/src/components/WalletConnector/WalletListView.tsx b/apps/tron/src/components/WalletConnector/WalletListView.tsx new file mode 100644 index 0000000000..46ec6896d7 --- /dev/null +++ b/apps/tron/src/components/WalletConnector/WalletListView.tsx @@ -0,0 +1,32 @@ +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { useWalletAdapters } from "src/hooks/useWalletAdapters"; +import Image from "next/image"; +import { SelectIcon, List } from "@sushiswap/ui"; + +export const WalletListView = () => { + const { adapters } = useWalletAdapters(); + const { select } = useWallet(); + + return ( + + + {adapters.map((adapter) => ( + {adapter.name}} + className="w-full items-center text-left justify-start flex" + key={adapter.name} + title={adapter.name} + onClick={async () => { + if (adapter.readyState === "Found") { + select(adapter.name); + } else { + window.open(adapter.url, "_blank"); + } + }} + hoverIcon={() => } + /> + ))} + + + ); +}; diff --git a/apps/tron/src/constants/abis/factory-abi.ts b/apps/tron/src/constants/abis/factory-abi.ts new file mode 100644 index 0000000000..c3e2dccf98 --- /dev/null +++ b/apps/tron/src/constants/abis/factory-abi.ts @@ -0,0 +1,83 @@ +export const FACTORY_ABI = [ + { + outputs: [{ type: "address" }], + constant: true, + name: "feeTo", + stateMutability: "view", + type: "function", + }, + { + outputs: [{ type: "address" }], + constant: true, + name: "feeToSetter", + stateMutability: "view", + type: "function", + }, + { + outputs: [{ type: "address" }], + constant: true, + inputs: [{ type: "uint256" }], + name: "allPairs", + stateMutability: "view", + type: "function", + }, + { + outputs: [{ type: "uint256" }], + constant: true, + name: "allPairsLength", + stateMutability: "view", + type: "function", + }, + { + outputs: [{ type: "bytes32" }], + constant: true, + name: "getPairHash", + stateMutability: "view", + type: "function", + }, + { + inputs: [{ name: "_feeToSetter", type: "address" }], + name: "setFeeToSetter", + stateMutability: "Nonpayable", + type: "Function", + }, + { + outputs: [{ name: "pair", type: "address" }], + inputs: [ + { name: "tokenA", type: "address" }, + { name: "tokenB", type: "address" }, + ], + name: "createPair", + stateMutability: "Nonpayable", + type: "Function", + }, + { + outputs: [{ type: "address" }], + constant: true, + inputs: [{ type: "address" }, { type: "address" }], + name: "getPair", + stateMutability: "view", + type: "function", + }, + { + inputs: [{ name: "_feeTo", type: "address" }], + name: "setFeeTo", + stateMutability: "Nonpayable", + type: "Function", + }, + { + inputs: [{ name: "_feeToSetter", type: "address" }], + stateMutability: "Nonpayable", + type: "Constructor", + }, + { + inputs: [ + { indexed: true, name: "token0", type: "address" }, + { indexed: true, name: "token1", type: "address" }, + { name: "pair", type: "address" }, + { type: "uint256" }, + ], + name: "PairCreated", + type: "Event", + }, +]; diff --git a/apps/tron/src/constants/abis/pair-abi.ts b/apps/tron/src/constants/abis/pair-abi.ts new file mode 100644 index 0000000000..e9575156d9 --- /dev/null +++ b/apps/tron/src/constants/abis/pair-abi.ts @@ -0,0 +1,345 @@ +export const PAIR_ABI = [ + { inputs: [], payable: false, stateMutability: "nonpayable", type: "constructor" }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "owner", type: "address" }, + { indexed: true, internalType: "address", name: "spender", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "sender", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount0", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amount1", type: "uint256" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + ], + name: "Burn", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "sender", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount0", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amount1", type: "uint256" }, + ], + name: "Mint", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "sender", type: "address" }, + { indexed: false, internalType: "uint256", name: "amount0In", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amount1In", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amount0Out", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amount1Out", type: "uint256" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + ], + name: "Swap", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: false, internalType: "uint112", name: "reserve0", type: "uint112" }, + { indexed: false, internalType: "uint112", name: "reserve1", type: "uint112" }, + ], + name: "Sync", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: "address", name: "from", type: "address" }, + { indexed: true, internalType: "address", name: "to", type: "address" }, + { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "Transfer", + type: "event", + }, + { + constant: true, + inputs: [], + name: "DOMAIN_SEPARATOR", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "MINIMUM_LIQUIDITY", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "PERMIT_TYPEHASH", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "address", name: "", type: "address" }, + ], + name: "allowance", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "approve", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [{ internalType: "address", name: "to", type: "address" }], + name: "burn", + outputs: [ + { internalType: "uint256", name: "amount0", type: "uint256" }, + { internalType: "uint256", name: "amount1", type: "uint256" }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "decimals", + outputs: [{ internalType: "uint8", name: "", type: "uint8" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "factory", + outputs: [{ internalType: "address", name: "", type: "address" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getReserves", + outputs: [ + { internalType: "uint112", name: "_reserve0", type: "uint112" }, + { internalType: "uint112", name: "_reserve1", type: "uint112" }, + { internalType: "uint32", name: "_blockTimestampLast", type: "uint32" }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { internalType: "address", name: "_token0", type: "address" }, + { internalType: "address", name: "_token1", type: "address" }, + ], + name: "initialize", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "kLast", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [{ internalType: "address", name: "to", type: "address" }], + name: "mint", + outputs: [{ internalType: "uint256", name: "liquidity", type: "uint256" }], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "name", + outputs: [{ internalType: "string", name: "", type: "string" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "nonces", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "spender", type: "address" }, + { internalType: "uint256", name: "value", type: "uint256" }, + { internalType: "uint256", name: "deadline", type: "uint256" }, + { internalType: "uint8", name: "v", type: "uint8" }, + { internalType: "bytes32", name: "r", type: "bytes32" }, + { internalType: "bytes32", name: "s", type: "bytes32" }, + ], + name: "permit", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "price0CumulativeLast", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "price1CumulativeLast", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [{ internalType: "address", name: "to", type: "address" }], + name: "skim", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { internalType: "uint256", name: "amount0Out", type: "uint256" }, + { internalType: "uint256", name: "amount1Out", type: "uint256" }, + { internalType: "address", name: "to", type: "address" }, + { internalType: "bytes", name: "data", type: "bytes" }, + ], + name: "swap", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "symbol", + outputs: [{ internalType: "string", name: "", type: "string" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "sync", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "token0", + outputs: [{ internalType: "address", name: "", type: "address" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "token1", + outputs: [{ internalType: "address", name: "", type: "address" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "totalSupply", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "transfer", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { internalType: "address", name: "from", type: "address" }, + { internalType: "address", name: "to", type: "address" }, + { internalType: "uint256", name: "value", type: "uint256" }, + ], + name: "transferFrom", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, +]; diff --git a/apps/tron/src/constants/abis/router-abi.ts b/apps/tron/src/constants/abis/router-abi.ts new file mode 100644 index 0000000000..d6c7bc7ffb --- /dev/null +++ b/apps/tron/src/constants/abis/router-abi.ts @@ -0,0 +1,335 @@ +export const ROUTER_ABI = [ + { + inputs: [ + { name: "_factory", type: "address" }, + { name: "_WETH", type: "address" }, + ], + stateMutability: "Nonpayable", + type: "Constructor", + }, + { outputs: [{ type: "address" }], name: "WETH", stateMutability: "View", type: "Function" }, + { + outputs: [ + { name: "amountA", type: "uint256" }, + { name: "amountB", type: "uint256" }, + { name: "liquidity", type: "uint256" }, + ], + inputs: [ + { name: "tokenA", type: "address" }, + { name: "tokenB", type: "address" }, + { name: "amountADesired", type: "uint256" }, + { name: "amountBDesired", type: "uint256" }, + { name: "amountAMin", type: "uint256" }, + { name: "amountBMin", type: "uint256" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "addLiquidity", + stateMutability: "Nonpayable", + type: "Function", + }, + { + outputs: [ + { name: "amountToken", type: "uint256" }, + { name: "amountETH", type: "uint256" }, + { name: "liquidity", type: "uint256" }, + ], + inputs: [ + { name: "token", type: "address" }, + { name: "amountTokenDesired", type: "uint256" }, + { name: "amountTokenMin", type: "uint256" }, + { name: "amountETHMin", type: "uint256" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "addLiquidityETH", + stateMutability: "Payable", + type: "Function", + }, + { outputs: [{ type: "address" }], name: "factory", stateMutability: "View", type: "Function" }, + { + outputs: [{ name: "amountIn", type: "uint256" }], + inputs: [ + { name: "amountOut", type: "uint256" }, + { name: "reserveIn", type: "uint256" }, + { name: "reserveOut", type: "uint256" }, + ], + name: "getAmountIn", + stateMutability: "Pure", + type: "Function", + }, + { + outputs: [{ name: "amountOut", type: "uint256" }], + inputs: [ + { name: "amountIn", type: "uint256" }, + { name: "reserveIn", type: "uint256" }, + { name: "reserveOut", type: "uint256" }, + ], + name: "getAmountOut", + stateMutability: "Pure", + type: "Function", + }, + { + outputs: [{ name: "amounts", type: "uint256[]" }], + inputs: [ + { name: "amountOut", type: "uint256" }, + { name: "path", type: "address[]" }, + ], + name: "getAmountsIn", + stateMutability: "View", + type: "Function", + }, + { + outputs: [{ name: "amounts", type: "uint256[]" }], + inputs: [ + { name: "amountIn", type: "uint256" }, + { name: "path", type: "address[]" }, + ], + name: "getAmountsOut", + stateMutability: "View", + type: "Function", + }, + { + outputs: [{ name: "pair", type: "address" }], + inputs: [ + { name: "tokenA", type: "address" }, + { name: "tokenB", type: "address" }, + ], + name: "getPairOffChain", + stateMutability: "View", + type: "Function", + }, + { + outputs: [{ name: "amountB", type: "uint256" }], + inputs: [ + { name: "amountA", type: "uint256" }, + { name: "reserveA", type: "uint256" }, + { name: "reserveB", type: "uint256" }, + ], + name: "quote", + stateMutability: "Pure", + type: "Function", + }, + { + outputs: [ + { name: "amountA", type: "uint256" }, + { name: "amountB", type: "uint256" }, + ], + inputs: [ + { name: "tokenA", type: "address" }, + { name: "tokenB", type: "address" }, + { name: "liquidity", type: "uint256" }, + { name: "amountAMin", type: "uint256" }, + { name: "amountBMin", type: "uint256" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "removeLiquidity", + stateMutability: "Nonpayable", + type: "Function", + }, + { + outputs: [ + { name: "amountToken", type: "uint256" }, + { name: "amountETH", type: "uint256" }, + ], + inputs: [ + { name: "token", type: "address" }, + { name: "liquidity", type: "uint256" }, + { name: "amountTokenMin", type: "uint256" }, + { name: "amountETHMin", type: "uint256" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "removeLiquidityETH", + stateMutability: "Nonpayable", + type: "Function", + }, + { + outputs: [{ name: "amountETH", type: "uint256" }], + inputs: [ + { name: "token", type: "address" }, + { name: "liquidity", type: "uint256" }, + { name: "amountTokenMin", type: "uint256" }, + { name: "amountETHMin", type: "uint256" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "removeLiquidityETHSupportingFeeOnTransferTokens", + stateMutability: "Nonpayable", + type: "Function", + }, + { + outputs: [ + { name: "amountToken", type: "uint256" }, + { name: "amountETH", type: "uint256" }, + ], + inputs: [ + { name: "token", type: "address" }, + { name: "liquidity", type: "uint256" }, + { name: "amountTokenMin", type: "uint256" }, + { name: "amountETHMin", type: "uint256" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + { name: "approveMax", type: "bool" }, + { name: "v", type: "uint8" }, + { name: "r", type: "bytes32" }, + { name: "s", type: "bytes32" }, + ], + name: "removeLiquidityETHWithPermit", + stateMutability: "Nonpayable", + type: "Function", + }, + { + outputs: [{ name: "amountETH", type: "uint256" }], + inputs: [ + { name: "token", type: "address" }, + { name: "liquidity", type: "uint256" }, + { name: "amountTokenMin", type: "uint256" }, + { name: "amountETHMin", type: "uint256" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + { name: "approveMax", type: "bool" }, + { name: "v", type: "uint8" }, + { name: "r", type: "bytes32" }, + { name: "s", type: "bytes32" }, + ], + name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens", + stateMutability: "Nonpayable", + type: "Function", + }, + { + outputs: [ + { name: "amountA", type: "uint256" }, + { name: "amountB", type: "uint256" }, + ], + inputs: [ + { name: "tokenA", type: "address" }, + { name: "tokenB", type: "address" }, + { name: "liquidity", type: "uint256" }, + { name: "amountAMin", type: "uint256" }, + { name: "amountBMin", type: "uint256" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + { name: "approveMax", type: "bool" }, + { name: "v", type: "uint8" }, + { name: "r", type: "bytes32" }, + { name: "s", type: "bytes32" }, + ], + name: "removeLiquidityWithPermit", + stateMutability: "Nonpayable", + type: "Function", + }, + { + outputs: [{ name: "amounts", type: "uint256[]" }], + inputs: [ + { name: "amountOut", type: "uint256" }, + { name: "path", type: "address[]" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "swapETHForExactTokens", + stateMutability: "Payable", + type: "Function", + }, + { + outputs: [{ name: "amounts", type: "uint256[]" }], + inputs: [ + { name: "amountOutMin", type: "uint256" }, + { name: "path", type: "address[]" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "swapExactETHForTokens", + stateMutability: "Payable", + type: "Function", + }, + { + inputs: [ + { name: "amountOutMin", type: "uint256" }, + { name: "path", type: "address[]" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "swapExactETHForTokensSupportingFeeOnTransferTokens", + stateMutability: "Payable", + type: "Function", + }, + { + outputs: [{ name: "amounts", type: "uint256[]" }], + inputs: [ + { name: "amountIn", type: "uint256" }, + { name: "amountOutMin", type: "uint256" }, + { name: "path", type: "address[]" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "swapExactTokensForETH", + stateMutability: "Nonpayable", + type: "Function", + }, + { + inputs: [ + { name: "amountIn", type: "uint256" }, + { name: "amountOutMin", type: "uint256" }, + { name: "path", type: "address[]" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "swapExactTokensForETHSupportingFeeOnTransferTokens", + stateMutability: "Nonpayable", + type: "Function", + }, + { + outputs: [{ name: "amounts", type: "uint256[]" }], + inputs: [ + { name: "amountIn", type: "uint256" }, + { name: "amountOutMin", type: "uint256" }, + { name: "path", type: "address[]" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "swapExactTokensForTokens", + stateMutability: "Nonpayable", + type: "Function", + }, + { + inputs: [ + { name: "amountIn", type: "uint256" }, + { name: "amountOutMin", type: "uint256" }, + { name: "path", type: "address[]" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "swapExactTokensForTokensSupportingFeeOnTransferTokens", + stateMutability: "Nonpayable", + type: "Function", + }, + { + outputs: [{ name: "amounts", type: "uint256[]" }], + inputs: [ + { name: "amountOut", type: "uint256" }, + { name: "amountInMax", type: "uint256" }, + { name: "path", type: "address[]" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "swapTokensForExactETH", + stateMutability: "Nonpayable", + type: "Function", + }, + { + outputs: [{ name: "amounts", type: "uint256[]" }], + inputs: [ + { name: "amountOut", type: "uint256" }, + { name: "amountInMax", type: "uint256" }, + { name: "path", type: "address[]" }, + { name: "to", type: "address" }, + { name: "deadline", type: "uint256" }, + ], + name: "swapTokensForExactTokens", + stateMutability: "Nonpayable", + type: "Function", + }, + { stateMutability: "Payable", type: "Receive" }, +]; diff --git a/apps/tron/src/constants/abis/trc20-abi.ts b/apps/tron/src/constants/abis/trc20-abi.ts new file mode 100644 index 0000000000..a74091f2fc --- /dev/null +++ b/apps/tron/src/constants/abis/trc20-abi.ts @@ -0,0 +1,222 @@ +export const TRC_20_ABI = [ + { + constant: true, + inputs: [], + name: "name", + outputs: [ + { + name: "", + type: "string", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_spender", + type: "address", + }, + { + name: "_value", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "totalSupply", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_from", + type: "address", + }, + { + name: "_to", + type: "address", + }, + { + name: "_value", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "decimals", + outputs: [ + { + name: "", + type: "uint8", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + name: "_owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + name: "balance", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "symbol", + outputs: [ + { + name: "", + type: "string", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_to", + type: "address", + }, + { + name: "_value", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + name: "_owner", + type: "address", + }, + { + name: "_spender", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + payable: true, + stateMutability: "payable", + type: "fallback", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: "owner", + type: "address", + }, + { + indexed: true, + name: "spender", + type: "address", + }, + { + indexed: false, + name: "value", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: "from", + type: "address", + }, + { + indexed: true, + name: "to", + type: "address", + }, + { + indexed: false, + name: "value", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, +]; diff --git a/apps/tron/src/constants/abis/tron-multicall.ts b/apps/tron/src/constants/abis/tron-multicall.ts new file mode 100644 index 0000000000..36566dd75c --- /dev/null +++ b/apps/tron/src/constants/abis/tron-multicall.ts @@ -0,0 +1,109 @@ +export const TRON_MULTICALL_ABI = [ + { + inputs: [ + { + components: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + ], + internalType: "struct TronMulticall.Call[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "aggregate", + outputs: [ + { internalType: "uint256", name: "blockNumber", type: "uint256" }, + { internalType: "bytes[]", name: "returnData", type: "bytes[]" }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getBasefee", + outputs: [{ internalType: "uint256", name: "basefee", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "uint256", name: "blockNumber", type: "uint256" }], + name: "getBlockHash", + outputs: [{ internalType: "bytes32", name: "blockHash", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getBlockNumber", + outputs: [{ internalType: "uint256", name: "blockNumber", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getChainId", + outputs: [{ internalType: "uint256", name: "chainid", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getCurrentBlockCoinbase", + outputs: [{ internalType: "address", name: "coinbase", type: "address" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getCurrentBlockDifficulty", + outputs: [{ internalType: "uint256", name: "difficulty", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getCurrentBlockTimestamp", + outputs: [{ internalType: "uint256", name: "timestamp", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "addr", type: "address" }], + name: "getEthBalance", + outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getLastBlockHash", + outputs: [{ internalType: "bytes32", name: "blockHash", type: "bytes32" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "accountAddress", type: "address" }, + { internalType: "trcToken", name: "id", type: "trcToken" }, + ], + name: "getTokenBalance", + outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "addr", type: "address" }], + name: "isContract", + outputs: [{ internalType: "bool", name: "result", type: "bool" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], + name: "multicall", + outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], + stateMutability: "view", + type: "function", + }, +]; diff --git a/apps/tron/src/constants/abis/wrapped-trx-abi.ts b/apps/tron/src/constants/abis/wrapped-trx-abi.ts new file mode 100644 index 0000000000..72053f81e9 --- /dev/null +++ b/apps/tron/src/constants/abis/wrapped-trx-abi.ts @@ -0,0 +1,162 @@ +export const WRAPPED_TRX_ABI = [ + { + constant: true, + inputs: [], + name: "name", + outputs: [{ name: "", type: "string" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { name: "guy", type: "address" }, + { name: "sad", type: "uint256" }, + ], + name: "approve", + outputs: [{ name: "", type: "bool" }], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "totalSupply", + outputs: [{ name: "", type: "uint256" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { name: "src", type: "address" }, + { name: "dst", type: "address" }, + { name: "sad", type: "uint256" }, + ], + name: "transferFrom", + outputs: [{ name: "", type: "bool" }], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [{ name: "sad", type: "uint256" }], + name: "withdraw", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "decimals", + outputs: [{ name: "", type: "uint8" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [{ name: "guy", type: "address" }], + name: "balanceOf", + outputs: [{ name: "", type: "uint256" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "symbol", + outputs: [{ name: "", type: "string" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { name: "dst", type: "address" }, + { name: "sad", type: "uint256" }, + ], + name: "transfer", + outputs: [{ name: "", type: "bool" }], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [], + name: "deposit", + outputs: [], + payable: true, + stateMutability: "payable", + type: "function", + }, + { + constant: false, + inputs: [{ name: "guy", type: "address" }], + name: "approve", + outputs: [{ name: "", type: "bool" }], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { name: "src", type: "address" }, + { name: "guy", type: "address" }, + ], + name: "allowance", + outputs: [{ name: "", type: "uint256" }], + payable: false, + stateMutability: "view", + type: "function", + }, + { payable: true, stateMutability: "payable", type: "fallback" }, + { + anonymous: false, + inputs: [ + { indexed: true, name: "src", type: "address" }, + { indexed: true, name: "guy", type: "address" }, + { indexed: false, name: "sad", type: "uint256" }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, name: "src", type: "address" }, + { indexed: true, name: "dst", type: "address" }, + { indexed: false, name: "sad", type: "uint256" }, + ], + name: "Transfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, name: "dst", type: "address" }, + { indexed: false, name: "sad", type: "uint256" }, + ], + name: "Deposit", + type: "event", + }, + { + anonymous: false, + inputs: [ + { indexed: true, name: "src", type: "address" }, + { indexed: false, name: "sad", type: "uint256" }, + ], + name: "Withdrawal", + type: "event", + }, +]; diff --git a/apps/tron/src/constants/contracts.ts b/apps/tron/src/constants/contracts.ts new file mode 100644 index 0000000000..d166f5ce4b --- /dev/null +++ b/apps/tron/src/constants/contracts.ts @@ -0,0 +1,5 @@ +import { IS_TESTNET } from "./is-testnet"; + +export const FACTORY_CONTRACT = IS_TESTNET ? "" : "TKWJdrQkqHisa1X8HUdHEfREvTzw4pMAaY"; //sun.io factory contract address +export const ROUTER_CONTRACT = IS_TESTNET ? "" : "TKzxdSv2FZKQrEqkKVgp5DcwEXBEKMg2Ax"; //sun.io router contract address +export const MULTICALL_CONTRACT = IS_TESTNET ? "" : "TGXuuKAb4bnrn137u39EKbYzKNXvdCes98"; diff --git a/apps/tron/src/constants/icon-size.ts b/apps/tron/src/constants/icon-size.ts new file mode 100644 index 0000000000..615d6e241e --- /dev/null +++ b/apps/tron/src/constants/icon-size.ts @@ -0,0 +1 @@ +export const ICON_SIZE = 26; diff --git a/apps/tron/src/constants/is-testnet.ts b/apps/tron/src/constants/is-testnet.ts new file mode 100644 index 0000000000..d7f94e5fde --- /dev/null +++ b/apps/tron/src/constants/is-testnet.ts @@ -0,0 +1 @@ +export const IS_TESTNET: boolean = false; diff --git a/apps/tron/src/constants/max-uint256.ts b/apps/tron/src/constants/max-uint256.ts new file mode 100644 index 0000000000..c8d7feb6d8 --- /dev/null +++ b/apps/tron/src/constants/max-uint256.ts @@ -0,0 +1 @@ +export const MAX_UINT256 = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"; diff --git a/apps/tron/src/constants/pair-decimals.ts b/apps/tron/src/constants/pair-decimals.ts new file mode 100644 index 0000000000..84e19a822d --- /dev/null +++ b/apps/tron/src/constants/pair-decimals.ts @@ -0,0 +1 @@ +export const PAIR_DECIMALS = 18; diff --git a/apps/tron/src/constants/token-list.tsx b/apps/tron/src/constants/token-list.tsx new file mode 100644 index 0000000000..e3254eb770 --- /dev/null +++ b/apps/tron/src/constants/token-list.tsx @@ -0,0 +1,110 @@ +import { IToken } from "src/types/token-type"; +import { IS_TESTNET } from "./is-testnet"; + +export const TRON: IToken = { + address: "TRON", + decimals: 6, + logoURI: + "https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415", + name: "TRX (TRON)", + symbol: "TRX", +}; + +export const WTRX: IToken = { + address: "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR", + decimals: 6, + logoURI: + "https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415", + name: "Wrapped TRX", + symbol: "WTRX", +}; + +export const INTERMEDIATE_TOKEN = WTRX; + +const MAINNET_TOKENS: IToken[] = [ + { + address: "TRON", + decimals: 6, + logoURI: + "https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415", + name: "TRX (TRON)", + symbol: "TRX", + }, + { + address: "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR", + decimals: 6, + logoURI: + "https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415", + name: "Wrapped TRX", + symbol: "WTRX", + }, + { + address: "TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4", + decimals: 18, + logoURI: "https://static.tronscan.org/production/logo/TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4.png", + name: "TrueUSD", + symbol: "TUSD", + }, + { + address: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", + decimals: 6, + logoURI: "https://static.tronscan.org/production/logo/usdtlogo.png", + name: "Tether USD", + symbol: "USDT", + }, + { + address: "TPYmHEhy5n8TCEfYGqW2rPxsghSfzghPDn", + decimals: 18, + logoURI: "https://static.tronscan.org/production/upload/logo/TPYmHEhy5n8TCEfYGqW2rPxsghSfzghPDn.png", + name: "Decentralized USD", + symbol: "USDD", + }, +]; + +const TESTNET_TOKENS: IToken[] = [ + { + address: "TRON", + decimals: 6, + logoURI: + "https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415", + name: "TRX (TRON)", + symbol: "TRX", + }, + { + address: "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR", //mainnet address currently + decimals: 6, + logoURI: + "https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415", + name: "Wrapped TRX", + symbol: "WTRX", + }, + { + address: "TSdZwNqpHofzP6BsBKGQUWdBeJphLmF6id", + decimals: 6, + logoURI: "https://static.tronscan.org/production/upload/logo/TEkxiTehnzSmSe2XqrBj4w32RUN966rdz81.png", + name: "USDC Coin", + symbol: "USDC", + }, +]; + +export const DEFAULT_TOKEN_LIST = IS_TESTNET ? TESTNET_TOKENS : MAINNET_TOKENS; + +export const DEFAULT_TOKEN_LIST_WITH_KEY = () => { + return DEFAULT_TOKEN_LIST.reduce>( + (acc, { address, decimals, name, symbol, logoURI }) => { + acc[address] = { + name, + decimals, + symbol, + address, + logoURI, + }; + return acc; + }, + {} + ); +}; + +export const STABLE_TOKENS = DEFAULT_TOKEN_LIST.filter( + (token) => token.symbol === "USDT" || token.symbol === "TUSD" || token.symbol === "USDD" +); diff --git a/apps/tron/src/hooks/useAllowance.ts b/apps/tron/src/hooks/useAllowance.ts new file mode 100644 index 0000000000..8880e08268 --- /dev/null +++ b/apps/tron/src/hooks/useAllowance.ts @@ -0,0 +1,61 @@ +import { useTronWeb } from "./useTronWeb"; +import { useQuery } from "@tanstack/react-query"; +import { MAX_UINT256 } from "src/constants/max-uint256"; +import { isAddress } from "src/utils/helpers"; + +const abi = [ + { + constant: true, + inputs: [ + { + name: "_owner", + type: "address", + }, + { + name: "_spender", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, +]; + +export const useAllowance = ({ + tokenAddress, + ownerAddress, + spenderAddress, +}: { + tokenAddress: string; + ownerAddress: string; + spenderAddress: string; +}) => { + const { tronWeb } = useTronWeb(); + + return useQuery({ + queryKey: ["useAllowance", { tokenAddress, ownerAddress, spenderAddress }], + queryFn: async () => { + if (tokenAddress === "TRON") { + return MAX_UINT256; + } + tronWeb.setAddress(tokenAddress); + const tokenContract = await tronWeb.contract(abi, tokenAddress); + const allowance = await tokenContract.allowance(ownerAddress, spenderAddress).call(); + + return allowance?.toString() as string; + }, + enabled: + (isAddress(tokenAddress) || tokenAddress === "TRON") && + isAddress(ownerAddress) && + isAddress(spenderAddress) && + !!tronWeb, + }); +}; diff --git a/apps/tron/src/hooks/useAmountsOut.ts b/apps/tron/src/hooks/useAmountsOut.ts new file mode 100644 index 0000000000..91b6e6e9b2 --- /dev/null +++ b/apps/tron/src/hooks/useAmountsOut.ts @@ -0,0 +1,37 @@ +import { useTronWeb } from "./useTronWeb"; +import { useQuery } from "@tanstack/react-query"; +import TronWeb from "tronweb"; +import { ROUTER_CONTRACT } from "src/constants/contracts"; +import { getIfWrapOrUnwrap, getValidTokenAddress } from "src/utils/helpers"; +import { ROUTER_ABI } from "src/constants/abis/router-abi"; +import { useSwapState } from "src/app/swap/swap-provider"; + +export const useAmountsOut = ({ amountIn }: { amountIn: string }) => { + const { tronWeb } = useTronWeb(); + const { route, token0, token1 } = useSwapState(); + + return useQuery({ + queryKey: ["useAmountsOut", { route, amountIn }], + queryFn: async () => { + const swapType = getIfWrapOrUnwrap(token0, token1); + if (swapType === "wrap" || swapType === "unwrap") { + return [amountIn, amountIn]; + } + if (!route) return []; + + const cleanedAddressRoute = route?.map((i) => getValidTokenAddress(i)); + if (!amountIn || isNaN(Number(amountIn))) return []; + try { + tronWeb.setAddress(ROUTER_CONTRACT); + const routerContract = await tronWeb.contract(ROUTER_ABI, ROUTER_CONTRACT); + const amountsOuts = await routerContract.getAmountsOut(amountIn, cleanedAddressRoute).call(); + + return amountsOuts?.amounts?.map((i: typeof TronWeb.BigNumber) => i.toString()) as string[]; + } catch (error) { + console.log("useAmountsOut error", error); + return [amountIn, ""]; + } + }, + enabled: !!amountIn && !!tronWeb, + }); +}; diff --git a/apps/tron/src/hooks/useCustomTokens.ts b/apps/tron/src/hooks/useCustomTokens.ts new file mode 100644 index 0000000000..e2665331ee --- /dev/null +++ b/apps/tron/src/hooks/useCustomTokens.ts @@ -0,0 +1,86 @@ +import { useLocalStorage } from "@sushiswap/hooks"; +import { useCallback, useMemo } from "react"; +import { IToken } from "src/types/token-type"; +import { IS_TESTNET } from "src/constants/is-testnet"; +import { isAddress } from "src/utils/helpers"; + +const localStorageKey = IS_TESTNET ? "sushi.customTokens.shasta" : "sushi.customTokens.tron"; + +export const useCustomTokens = () => { + const [value, setValue] = useLocalStorage>(localStorageKey, {}); + + const hydrate = useCallback((data: Record) => { + return Object.entries(data).reduce>( + (acc, [k, { address, decimals, name, symbol }]) => { + acc[k] = { address, decimals, name: String(name), symbol: String(symbol) }; + return acc; + }, + {} + ); + }, []); + + const addCustomToken = useCallback( + (currencies: IToken[]) => { + const data: IToken[] = currencies.map((currency) => ({ + address: currency.address, + name: currency.name, + symbol: currency.symbol, + decimals: currency.decimals, + })); + + setValue((prev) => { + return data.reduce( + (acc, cur) => { + acc[`${cur.address}`] = cur; + return acc; + }, + { ...prev } + ); + }); + }, + [setValue] + ); + + const removeCustomToken = useCallback( + (currency: IToken) => { + setValue((prev) => { + return Object.entries(prev).reduce>((acc, cur) => { + if (cur[0] === `${currency.address}`) { + return acc; // filter + } + acc[cur[0]] = cur[1]; // add + return acc; + }, {}); + }); + }, + [setValue] + ); + + const hasToken = useCallback( + (currency: IToken): boolean => { + if (currency.address === "TRON") return false; + if (!isAddress(currency.address)) { + throw new Error("Invalid address"); + } + + return !!value[currency.address]; + }, + [value] + ); + + const addOrRemoveToken = useCallback( + (type: "add" | "remove", currency: IToken[]) => { + if (type === "add") addCustomToken(currency); + if (type === "remove") removeCustomToken(currency[0]); + }, + [addCustomToken, removeCustomToken] + ); + + return useMemo(() => { + return { + customTokens: hydrate(value), + addOrRemoveToken, + hasToken, + }; + }, [hydrate, addOrRemoveToken, hasToken, value]); +}; diff --git a/apps/tron/src/hooks/useIsContract.ts b/apps/tron/src/hooks/useIsContract.ts new file mode 100644 index 0000000000..ecc7464f17 --- /dev/null +++ b/apps/tron/src/hooks/useIsContract.ts @@ -0,0 +1,19 @@ +import { isContract } from "src/utils/helpers"; +import { useTronWeb } from "./useTronWeb"; +import { useQuery } from "@tanstack/react-query"; + +export const useIsContract = ({ address }: { address: string | null | undefined }) => { + const { tronWeb } = useTronWeb(); + + return useQuery({ + queryKey: ["useIsContract", { address }], + queryFn: async () => { + if (!address) return false; + return await isContract(tronWeb, address); + }, + enabled: !!address && !!tronWeb, + refetchOnMount: false, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + }); +}; diff --git a/apps/tron/src/hooks/useMyPositions.ts b/apps/tron/src/hooks/useMyPositions.ts new file mode 100644 index 0000000000..517045608f --- /dev/null +++ b/apps/tron/src/hooks/useMyPositions.ts @@ -0,0 +1,206 @@ +import { useQuery } from "@tanstack/react-query"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { DEFAULT_TOKEN_LIST, TRON } from "src/constants/token-list"; +import { getAllPairAddresses } from "src/lib/getAllPairAddresses"; +import { IReserveDataResponse } from "src/types/get-pools-type"; +import { IToken } from "src/types/token-type"; +import { sortTokenAddresses } from "src/utils/formatters"; +import { chunk, flatten, getValidTokenAddress, isAddress } from "src/utils/helpers"; + +type IPairDataResponse = { + data: { + tron: { + transfers: { + currency: { + address: string; + decimals: number; + name: string; + symbol: string; + }; + txHash: string; + receiver: { + address: string; + }; + }[]; + }; + }; +}; + +type _IPools = { + token0: IToken; + token1: IToken; + pairAddress: string; + reserve0: string; + reserve1: string; +}[]; + +const getPairContributions = async ({ + pairAddresses, + walletAddress, +}: { + pairAddresses: string[]; + walletAddress: string; +}) => { + try { + const res = await fetch( + `/api/pools/my-positions?pairAddresses=${pairAddresses}&walletAddress=${walletAddress}`, + { method: "GET" } + ); + if (!res.ok) { + throw new Error("Failed to fetch data from my-positions API"); + } + const data: IPairDataResponse | undefined = await res.json(); + + if (!data?.data?.tron.transfers) return []; + const groupedData = data?.data?.tron.transfers.reduce( + (acc, curr) => { + if (!acc[curr.txHash]) { + acc[curr.txHash] = []; + } + + acc[curr.txHash].push({ + currency: curr.currency, + receiver: curr.receiver.address, + }); + return acc; + }, + {} as Record< + string, + { + currency: { + address: string; + decimals: number; + name: string; + symbol: string; + }; + receiver: string; + }[] + > + ); + if (!groupedData) return []; + + const groupedDataArray = Object.entries(groupedData).map(([txHash, data]) => { + const [token0, token1] = sortTokenAddresses( + data?.[0]?.currency?.address ?? getValidTokenAddress(TRON.address), + data?.[1]?.currency?.address ?? getValidTokenAddress(TRON.address) + ); + const pairAddress = data?.[0]?.receiver as string; + + //if token0 or token1 is equal to pairAddress, skip this pair + if (token0 === pairAddress || token1 === pairAddress) { + return; + } + + const _token0: IToken = { + address: token0, + decimals: data.find((i) => i?.currency?.address === token0)?.currency?.decimals ?? TRON.decimals, + name: data.find((i) => i.currency.address === token0)?.currency.name ?? TRON.name, + symbol: data.find((i) => i.currency.address === token0)?.currency.symbol ?? TRON.symbol, + logoURI: + DEFAULT_TOKEN_LIST.find((i) => getValidTokenAddress(i.address) === getValidTokenAddress(token0)) + ?.logoURI ?? undefined, + }; + const _token1: IToken = { + address: token1, + decimals: data.find((i) => i.currency.address === token1)?.currency.decimals ?? TRON.decimals, + name: data.find((i) => i.currency.address === token1)?.currency.name ?? TRON.name, + symbol: data.find((i) => i.currency.address === token1)?.currency.symbol ?? TRON.symbol, + logoURI: + DEFAULT_TOKEN_LIST.find((i) => getValidTokenAddress(i.address) === getValidTokenAddress(token1)) + ?.logoURI ?? undefined, + }; + return { + token0: _token0, + token1: _token1, + pairAddress: pairAddress, + reserve0: "0", + reserve1: "0", + }; + }); + // //filter out all objects that have duplicate pair addresses or are undefined + const filteredDataArray = groupedDataArray.filter( + (v, i, a) => v && a.findIndex((t) => t?.pairAddress === v.pairAddress) === i + ); + + return filteredDataArray; + } catch (error) { + console.log(error); + return []; + } +}; + +const injectReserves = async (pools: _IPools) => { + try { + const chunkedPools = chunk(pools, 100); + const poolsCopy = [...pools]; + + for (const chunk of chunkedPools) { + const pairAddresses = chunk.map((pool) => pool.pairAddress); + const res = await fetch(`/api/pools/get-reserves?pairAddresses=${pairAddresses}`, { method: "GET" }); + if (!res.ok) { + throw new Error("Failed to fetch data from Tron API"); + } + const data: IReserveDataResponse | undefined = await res.json(); + if (!data) return []; + // find the reserves in the data and inject them into the pool object by pairAddress + + for (const pool of chunk) { + const reserveData = data?.data?.tron.smartContractEvents.find( + (event) => + event?.smartContract?.address?.address?.toLowerCase() === pool?.pairAddress?.toLowerCase() + ); + + if (reserveData) { + const reserve0 = reserveData.arguments.find((arg) => arg.argument === "reserve0")?.value ?? "0"; + const reserve1 = reserveData.arguments.find((arg) => arg.argument === "reserve1")?.value ?? "0"; + + const _pool = poolsCopy.find((p) => p.pairAddress === pool.pairAddress); + if (_pool) { + _pool.reserve0 = reserve0; + _pool.reserve1 = reserve1; + } + } + } + } + return poolsCopy; + } catch (error) { + console.log(error); + return []; + } +}; + +export const useMyPositions = () => { + const { address } = useWallet(); + return useQuery({ + queryKey: ["useMyPositions", { address: address }], + queryFn: async (data) => { + if (!address) return []; + if (!isAddress(address)) return []; + const allPairs = await getAllPairAddresses(); + //split allPairs into chunks of 100 + const chunkedPairs = chunk(allPairs, 100); + //get pair contributions for each chunk + let _result = []; + for (const chunk of chunkedPairs) { + const _data = await getPairContributions({ + pairAddresses: chunk.map((pair) => pair.pairAddress), + walletAddress: address, + }); + _result.push(_data); + } + const pools = flatten(_result); + if (!pools || pools?.length === 0) { + return []; + } + console.log({ pools }); + const poolsWithReserves = await injectReserves(pools as _IPools); + + return poolsWithReserves; + }, + + enabled: !!address, + refetchOnMount: false, + refetchOnWindowFocus: false, + refetchOnReconnect: false, + }); +}; diff --git a/apps/tron/src/hooks/useNativeBalance.ts b/apps/tron/src/hooks/useNativeBalance.ts new file mode 100644 index 0000000000..8a3514e071 --- /dev/null +++ b/apps/tron/src/hooks/useNativeBalance.ts @@ -0,0 +1,19 @@ +import { useQuery } from "@tanstack/react-query"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { useTronWeb } from "./useTronWeb"; + +export const useNativeBalance = () => { + const { address } = useWallet(); + const { tronWeb } = useTronWeb(); + return useQuery({ + queryKey: ["useNativeBalance"], + queryFn: async () => { + const balance = await tronWeb.trx.getUnconfirmedBalance(address); + const formattedBalance = tronWeb.fromSun(balance); + return { balance, formattedBalance }; + }, + refetchOnMount: true, + refetchOnWindowFocus: true, + enabled: !!address && !!tronWeb, + }); +}; diff --git a/apps/tron/src/hooks/usePairContract.ts b/apps/tron/src/hooks/usePairContract.ts new file mode 100644 index 0000000000..d0bffee8ce --- /dev/null +++ b/apps/tron/src/hooks/usePairContract.ts @@ -0,0 +1,37 @@ +import { useMemo } from "react"; +import { useTronWeb } from "./useTronWeb"; +import { sortTokenAddresses } from "src/utils/formatters"; +import { useQuery } from "@tanstack/react-query"; +import { FACTORY_CONTRACT } from "src/constants/contracts"; +import { getBase58Address, getValidTokenAddress } from "src/utils/helpers"; +import { FACTORY_ABI } from "src/constants/abis/factory-abi"; + +export const usePairContract = ({ + token0Address, + token1Address, +}: { + token0Address: string | undefined; + token1Address: string | undefined; +}) => { + const { tronWeb } = useTronWeb(); + const [token0, token1] = useMemo(() => { + if (!token0Address || !token1Address) return [undefined, undefined]; + return sortTokenAddresses(getValidTokenAddress(token0Address), getValidTokenAddress(token1Address)); + }, [token0Address, token1Address]); + return useQuery({ + queryKey: ["usePairContract", { token0Address, token1Address }], + queryFn: async () => { + if (!token0 || !token1 || !tronWeb) return null; + if (token0 === token1) return null; + tronWeb.setAddress(FACTORY_CONTRACT); + const factoryContract = await tronWeb.contract(FACTORY_ABI, FACTORY_CONTRACT); + const pairAddress: string | undefined = await factoryContract.getPair(token0, token1).call(); + if (!pairAddress) return null; + return getBase58Address(pairAddress); + }, + enabled: !!token0 && !!token1 && !!tronWeb, + refetchOnMount: false, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + }); +}; diff --git a/apps/tron/src/hooks/usePoolOwnership.tsx b/apps/tron/src/hooks/usePoolOwnership.tsx new file mode 100644 index 0000000000..144b91498e --- /dev/null +++ b/apps/tron/src/hooks/usePoolOwnership.tsx @@ -0,0 +1,28 @@ +import { useTronWeb } from "./useTronWeb"; +import { useQuery } from "@tanstack/react-query"; +import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; +import { PAIR_ABI } from "../constants/abis/pair-abi"; +import { isAddress } from "../utils/helpers"; + +export const usePoolOwnership = ({ pairAddress }: { pairAddress: string | undefined | null }) => { + const { tronWeb } = useTronWeb(); + const { address } = useWallet(); + + return useQuery({ + queryKey: ["usePoolOwnership", { pairAddress }], + queryFn: async () => { + if (!pairAddress || !tronWeb || !isAddress(pairAddress) || !address || !isAddress(address)) { + return { ownership: "0", ownedSupply: "0" }; + } + tronWeb.setAddress(pairAddress); + const pairInstance = await tronWeb.contract(PAIR_ABI, pairAddress); + const totalSupply = await pairInstance.totalSupply().call(); + const ownedSupply = await pairInstance.balanceOf(address).call(); + + const ownership = (ownedSupply / totalSupply).toString(); + + return { ownership, ownedSupply: ownedSupply.toString() }; + }, + enabled: !!address && isAddress(address) && !!pairAddress && isAddress(pairAddress) && !!tronWeb, + }); +}; diff --git a/apps/tron/src/hooks/usePools.ts b/apps/tron/src/hooks/usePools.ts new file mode 100644 index 0000000000..bf7c8469e1 --- /dev/null +++ b/apps/tron/src/hooks/usePools.ts @@ -0,0 +1,153 @@ +import { useQuery } from "@tanstack/react-query"; +import { FACTORY_CONTRACT } from "src/constants/contracts"; +import { IPoolDataResponse, IReserveDataResponse } from "src/types/get-pools-type"; +import { useTronWeb } from "./useTronWeb"; +import { chunk } from "src/utils/helpers"; + +type _IPools = { + token0Address: string; + token1Address: string; + pairAddress: string; + reserve0: string; + reserve1: string; +}[]; + +const getPoolsByEvent = async ({ factoryAddress }: { factoryAddress: string }): Promise<_IPools> => { + try { + const res = await fetch(`/api/pools?factoryAddress=${factoryAddress}`, { method: "GET" }); + if (!res.ok) { + throw new Error("Failed to fetch data from Tron API"); + } + const data: IPoolDataResponse | undefined = await res.json(); + if (!data) return []; + + const cleanedData = data?.data?.tron.smartContractEvents.map((event) => { + const pairAddress = event.arguments.find((arg) => arg.argument === "pair")?.value ?? ""; + const token0Address = event.arguments.find((arg) => arg.argument === "token0")?.value ?? ""; + const token1Address = event.arguments.find((arg) => arg.argument === "token1")?.value ?? ""; + + return { + pairAddress, + token0Address, + token1Address, + reserve0: "0", + reserve1: "0", + }; + }); + + return cleanedData; + } catch (error) { + console.log(error); + return []; + } +}; + +const injectReserves = async (pools: _IPools) => { + try { + const chunkedPools = chunk(pools, 100); + const poolsCopy = [...pools]; + + for (const chunk of chunkedPools) { + const pairAddresses = chunk.map((pool) => pool.pairAddress); + const res = await fetch(`/api/pools/get-reserves?pairAddresses=${pairAddresses}`, { method: "GET" }); + if (!res.ok) { + throw new Error("Failed to fetch data from Tron API"); + } + const data: IReserveDataResponse | undefined = await res.json(); + if (!data) return []; + // find the reserves in the data and inject them into the pool object by pairAddress + + for (const pool of chunk) { + const reserveData = data?.data?.tron.smartContractEvents.find( + (event) => event.smartContract.address.address.toLowerCase() === pool.pairAddress.toLowerCase() + ); + + if (reserveData) { + const reserve0 = reserveData.arguments.find((arg) => arg.argument === "reserve0")?.value ?? "0"; + const reserve1 = reserveData.arguments.find((arg) => arg.argument === "reserve1")?.value ?? "0"; + + // Find the corresponding pool in the original array and update its reserve0 and reserve1 properties + const originalPool = poolsCopy.find((p) => p.pairAddress === pool.pairAddress); + if (originalPool) { + originalPool.reserve0 = reserve0; + originalPool.reserve1 = reserve1; + } + } + } + } + + return poolsCopy; + } catch (error) { + console.log(error); + return pools; + } +}; +export const usePools = () => { + const { tronWeb } = useTronWeb(); + return useQuery({ + queryKey: ["usePools"], + staleTime: Infinity, //TODO: remove after testing + queryFn: async () => { + if (!tronWeb) return []; + const pools = await getPoolsByEvent({ factoryAddress: FACTORY_CONTRACT }); + const _pools = await injectReserves(pools); + + return _pools; + }, + keepPreviousData: true, + enabled: !!tronWeb, + refetchOnMount: false, + refetchOnWindowFocus: false, + refetchOnReconnect: false, + }); +}; + +// const multicallAddress = "TGXuuKAb4bnrn137u39EKbYzKNXvdCes98"; +// tronWeb.setAddress(multicallAddress); +// const multicall = await tronWeb.contract(TRON_MULTICALL_ABI, multicallAddress); + +// //loop through all the pools and get the reserves in chunks so the tron vm doesn't timeout +// //TODO: find way to optimize this so the user isnt waiting so long + +// const chunkSize = 20; +// const chunkedPools = chunk(_pools, chunkSize); + +// let chunkIndex = 0; + +// while (chunkIndex < chunkedPools.length) { +// try { +// const pools = chunkedPools[chunkIndex]; +// const calls = pools.map((pool) => { +// return [ +// pool.pairAddress, +// "0x0902f1ac", //getReserves encoded +// ]; +// }); + +// const _multicallReturn = await multicall.aggregate(calls).call(); +// const { returnData } = _multicallReturn; + +// for (let i = 0; i < returnData.length; i++) { +// const decoded = ethers.utils.defaultAbiCoder.decode( +// ["uint112", "uint112", "uint32"], +// returnData[i] +// ); +// const _reserve0 = decoded[0].toString(); +// const _reserve1 = decoded[1].toString(); + +// //add the reserves to the pool object with the pair address as the key +// const pool = _pools.find( +// (pool) => getBase58Address(pool.pairAddress) === getBase58Address(calls[i][0]) +// ); +// if (pool) { +// pool.reserve0 = _reserve0; +// pool.reserve1 = _reserve1; +// } +// } + +// chunkIndex++; // Move to the next chunk only if the current chunk was processed successfully +// } catch (error) { +// console.error(`Error processing chunk ${chunkIndex}: ${error}`); +// // If a CPU timeout error occurred, the while loop will retry processing the current chunk +// } +// } diff --git a/apps/tron/src/hooks/usePriceImpact.ts b/apps/tron/src/hooks/usePriceImpact.ts new file mode 100644 index 0000000000..77a075b0c8 --- /dev/null +++ b/apps/tron/src/hooks/usePriceImpact.ts @@ -0,0 +1,65 @@ +import { useTronWeb } from "./useTronWeb"; +import { useQuery } from "@tanstack/react-query"; +import { IReserves, IToken } from "src/types/token-type"; +import { parseUnits, toBigNumber } from "src/utils/formatters"; +import { getValidTokenAddress, isAddress } from "src/utils/helpers"; + +const calculatePriceImpact = ({ + initialReserve0, + initialReserve1, + tokenAmount0, +}: { + initialReserve0: any; + initialReserve1: any; + tokenAmount0: any; +}): number => { + const k = initialReserve0.times(initialReserve1); // Constant product + const newReserveX = initialReserve0.plus(tokenAmount0); // Updated reserve of token X + const newReserveY = k.div(newReserveX); // Updated reserve of token Y using constant product formula + const receivedTokenY = initialReserve1.minus(newReserveY); // Amount of token Y received + const priceImpact = receivedTokenY.div(newReserveY).times(toBigNumber(100)); // Price impact percentage + return Number(priceImpact); +}; +export const usePriceImpact = ({ + amount, + token, + reserves, +}: { + amount: string; + token: IToken; + reserves: IReserves[] | undefined; +}) => { + const { tronWeb } = useTronWeb(); + + return useQuery({ + queryKey: ["usePriceImpact", { reserves, token, amount }], + queryFn: async () => { + if (!reserves || !token || !amount) return 0; + + const reserve0 = reserves?.find( + (reserve) => getValidTokenAddress(reserve.address as string) === getValidTokenAddress(token.address) + ); + const reserve1 = reserves?.find( + (reserve) => getValidTokenAddress(reserve.address as string) !== getValidTokenAddress(token.address) + ); + if (!reserve0 || !reserve1) return 0; + + const priceImpactPercentage = calculatePriceImpact({ + initialReserve0: toBigNumber(reserve0.reserve ?? ""), + initialReserve1: toBigNumber(reserve1.reserve ?? ""), + tokenAmount0: toBigNumber(Number(parseUnits(amount, token.decimals))), + }); + + return priceImpactPercentage; + }, + enabled: + !!amount && + !!token && + !!reserves?.[0]?.address && + !!reserves?.[1]?.address && + isAddress(getValidTokenAddress(token?.address)) && + isAddress(getValidTokenAddress(reserves?.[0]?.address)) && + isAddress(getValidTokenAddress(reserves?.[1]?.address)) && + !!tronWeb, + }); +}; diff --git a/apps/tron/src/hooks/useReserves.ts b/apps/tron/src/hooks/useReserves.ts new file mode 100644 index 0000000000..2f435f036e --- /dev/null +++ b/apps/tron/src/hooks/useReserves.ts @@ -0,0 +1,50 @@ +import { useMemo } from "react"; +import { useTronWeb } from "./useTronWeb"; +import { useQuery } from "@tanstack/react-query"; +import { PAIR_ABI } from "src/constants/abis/pair-abi"; +import { IToken } from "src/types/token-type"; +import { sortTokens } from "src/utils/formatters"; +import { isAddress } from "src/utils/helpers"; + +export const useReserves = ({ + pairAddress, + token0, + token1, + refetchInterval = false, +}: { + pairAddress: string | undefined | null; + token0: IToken | undefined; + token1: IToken | undefined; + refetchInterval?: number | false; +}) => { + const { tronWeb } = useTronWeb(); + const [_token0, _token1] = useMemo(() => { + if (!token0 || !token1) return []; + return sortTokens(token0, token1); + }, [token0, token1]); + + return useQuery({ + queryKey: ["useReserves", { pairAddress, token0, token1 }], + queryFn: async () => { + if (!pairAddress || !tronWeb || !isAddress(pairAddress) || !token0 || !token1) return []; + tronWeb.setAddress(pairAddress); + try { + const pairInstance = await tronWeb.contract(PAIR_ABI, pairAddress); + const [reserve0, reserve1] = await pairInstance.getReserves().call(); + //@DEV reserves are returned in order of token0, token1 in the pair contract + return [ + { + ..._token0, + reserve: reserve0.toString() as string, + }, + { ..._token1, reserve: reserve1.toString() as string }, + ]; + } catch (error) { + console.error("useReserves error", error); + return []; + } + }, + enabled: !!pairAddress && isAddress(pairAddress) && !!tronWeb && !!token0 && !!token1, + refetchInterval, + }); +}; diff --git a/apps/tron/src/hooks/useRoutes.ts b/apps/tron/src/hooks/useRoutes.ts new file mode 100644 index 0000000000..38cb8af59a --- /dev/null +++ b/apps/tron/src/hooks/useRoutes.ts @@ -0,0 +1,91 @@ +import { useQuery } from "@tanstack/react-query"; +import { IToken } from "../types/token-type"; +import { useTronWeb } from "./useTronWeb"; +import { INTERMEDIATE_TOKEN } from "src/constants/token-list"; +import { FACTORY_CONTRACT, MULTICALL_CONTRACT } from "src/constants/contracts"; +import { TRON_MULTICALL_ABI } from "src/constants/abis/tron-multicall"; +import { ethers } from "ethers"; +import { getBase58Address, getIfWrapOrUnwrap, getValidTokenAddress, isContract } from "src/utils/helpers"; + +const abi = { + outputs: [{ type: "address" }], + constant: true, + inputs: [{ type: "address" }, { type: "address" }], + name: "getPair", + stateMutability: "View", + type: "Function", +}; + +const functionSignature = "getPair(address,address)"; + +const getPairsToCall = (token0Address: string, token1Address: string, intermediateTokenAddress: string) => { + return [ + { token0Address, token1Address }, + { token0Address, token1Address: intermediateTokenAddress }, + { token0Address: intermediateTokenAddress, token1Address }, + ]; +}; + +export const useRoutes = ({ token0, token1 }: { token0: IToken; token1: IToken }) => { + const { tronWeb } = useTronWeb(); + return useQuery({ + queryKey: ["useRoutes", { token0, token1 }], + queryFn: async () => { + const swapType = getIfWrapOrUnwrap(token0, token1); + if (swapType === "wrap" || swapType === "unwrap") { + return { + pairs: [], + route: [], + }; + } + + const functionSelector = tronWeb.sha3(functionSignature).slice(0, 10); // first 4 bytes + const token0Address = getValidTokenAddress(token0.address); + const token1Address = getValidTokenAddress(token1.address); + const intermediateTokenAddress = INTERMEDIATE_TOKEN.address; + + const pairsToCall = getPairsToCall(token0Address, token1Address, intermediateTokenAddress); + + const calls = pairsToCall.map(({ token0Address, token1Address }) => { + const parameters = tronWeb.utils.abi.encodeParamsV2ByABI(abi, [token0Address, token1Address]); + const callData = functionSelector + parameters.replace(/^0x/, ""); + + return [FACTORY_CONTRACT, callData]; + }); + + tronWeb.setAddress(MULTICALL_CONTRACT); + const multicallInstance = await tronWeb.contract(TRON_MULTICALL_ABI, MULTICALL_CONTRACT); + + const _multicallReturn = await multicallInstance.aggregate(calls).call(); + const { returnData } = _multicallReturn; + + const _pairs: string[] = []; + for (let i = 0; i < returnData.length; i++) { + const pairAddress = ethers.utils.defaultAbiCoder.decode(["address"], returnData[i]); + _pairs.push(getBase58Address(pairAddress?.[0] as string)); + } + + //using multicall, check if there is a direct pair (index 0), if not check if there is a pair with intermediate token (index 1 or 2) + if (await isContract(tronWeb, _pairs?.[0])) { + return { + pairs: [_pairs?.[0]], + route: [token0.address, token1.address], + }; + } + if ((await isContract(tronWeb, _pairs?.[1])) && (await isContract(tronWeb, _pairs?.[2]))) { + return { + pairs: [_pairs?.[1], _pairs?.[2]], + route: [token0.address, INTERMEDIATE_TOKEN.address, token1.address], + }; + } + return { + pairs: [], + route: [], + }; + }, + enabled: !!token0 && !!token1 && !!tronWeb, + refetchOnMount: false, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + }); +}; diff --git a/apps/tron/src/hooks/useSortedTokenList.ts b/apps/tron/src/hooks/useSortedTokenList.ts new file mode 100644 index 0000000000..87fef10604 --- /dev/null +++ b/apps/tron/src/hooks/useSortedTokenList.ts @@ -0,0 +1,28 @@ +import { useDebounce } from "@sushiswap/hooks"; +import { useQuery } from "@tanstack/react-query"; +import { IToken } from "src/types/token-type"; +import { filterTokens, getSortedTokensByQuery, tokenComparator } from "src/utils/token-search-helpers"; + +type TokenListParams = { + query: string; + tokenMap: Record | undefined; + customTokenMap: Record | undefined; +}; + +export const useSortedTokenList = ({ query, tokenMap, customTokenMap }: TokenListParams) => { + const debouncedQuery = useDebounce(query, 250); + return useQuery({ + queryKey: ["sortedTokenList", { debouncedQuery, tokenMap, customTokenMap }], + queryFn: async () => { + const tokenMapValues = tokenMap ? Object.values(tokenMap) : []; + const customTokenMapValues = customTokenMap ? Object.values(customTokenMap) : []; + const filteredTokens: IToken[] = filterTokens(tokenMapValues, debouncedQuery); + const filteredCustomTokens: IToken[] = filterTokens(customTokenMapValues, debouncedQuery); + // const sortedTokens + const sortedTokens: IToken[] = [...filteredTokens, ...filteredCustomTokens].sort(tokenComparator()); + const filteredSortedTokens = getSortedTokensByQuery(sortedTokens, debouncedQuery); + return filteredSortedTokens; + }, + keepPreviousData: false, + }); +}; diff --git a/apps/tron/src/hooks/useStablePrice.ts b/apps/tron/src/hooks/useStablePrice.ts new file mode 100644 index 0000000000..6a3c916f02 --- /dev/null +++ b/apps/tron/src/hooks/useStablePrice.ts @@ -0,0 +1,191 @@ +import { STABLE_TOKENS, WTRX } from "src/constants/token-list"; +import { IToken } from "../types/token-type"; +import { getToken0Price, getToken1Price, getValidTokenAddress } from "src/utils/helpers"; +import { getAllPairAddresses } from "src/lib/getAllPairAddresses"; +import { IReserveDataResponse } from "src/types/get-pools-type"; +import { getTronPrice } from "src/lib/getTronPrice"; +import { useQuery } from "@tanstack/react-query"; + +type Pair = { + token0Address: string; + token1Address: string; + pairAddress: string; +}[]; + +//USDT +const BEST_STABLE = STABLE_TOKENS.find((token) => token.symbol === "USDT"); + +const getBestStable = (stablePairs: Pair) => { + const bestStable = stablePairs.find( + (pair) => pair.token0Address === BEST_STABLE?.address || pair.token1Address === BEST_STABLE?.address + ); + if (bestStable) { + return bestStable; + } else { + return stablePairs[0]; + } +}; + +const getTokenPrice = async (token: IToken | undefined) => { + //if token is undefined return 0 + if (!token) return "0"; + + //if token in STABLE_TOKENS return 1 + if ( + STABLE_TOKENS.find( + (stableToken) => + getValidTokenAddress(stableToken.address).toLowerCase() === + getValidTokenAddress(token.address).toLowerCase() + ) + ) { + return "1"; + } + //if native coin or WTRX, return native usd price + const isNativeOrWrappedTrx = + getValidTokenAddress(token.address).toLowerCase() === WTRX.address.toLowerCase(); + + if (isNativeOrWrappedTrx) { + const tronInUSDT = await getTronPrice(); + return tronInUSDT.toString(); + } + + const { stablePairs, wtrxPairs } = await getPairsIfItExists(token); + + //if pairs dont exist, return 0 + if (!stablePairs && !wtrxPairs) { + return "0"; + } + + if (stablePairs?.length > 0) { + const pair = getBestStable(stablePairs); + const { reserve0, reserve1 } = await getReserves(pair.pairAddress); + if (token.address === pair.token0Address) { + const token1Data = STABLE_TOKENS.find( + (stableToken) => + getValidTokenAddress(stableToken.address).toLowerCase() === + getValidTokenAddress(pair.token1Address).toLowerCase() + ); + if (!token1Data) return "0"; + + return getToken0Price(reserve0, reserve1, token.decimals, token1Data?.decimals); + } else if (token.address === pair.token1Address) { + const token0Data = STABLE_TOKENS.find( + (stableToken) => + getValidTokenAddress(stableToken.address).toLowerCase() === + getValidTokenAddress(pair.token0Address).toLowerCase() + ); + if (!token0Data) return "0"; + + return getToken1Price(reserve0, reserve1, token0Data?.decimals, token.decimals); + } + } + + // if token0Address or token1Address is WRTX in pair, then use getTronPrice to calculate the price of the other token + if (wtrxPairs?.length > 0) { + const pair = wtrxPairs[0]; + const { reserve0, reserve1 } = await getReserves(pair.pairAddress); + const tronInUSDT = await getTronPrice(); + if (getValidTokenAddress(pair.token0Address).toLowerCase() === WTRX.address.toLowerCase()) { + // token0 is WRTX, so token1 is the other token + const decimals0 = WTRX.decimals; + const decimals1 = token.decimals; + return (Number(getToken1Price(reserve0, reserve1, decimals0, decimals1)) * tronInUSDT).toString(10); + } else if (getValidTokenAddress(pair.token1Address).toLowerCase() === WTRX.address.toLowerCase()) { + // token1 is WRTX, so token0 is the other token + const decimals0 = token.decimals; + const decimals1 = WTRX.decimals; + return (Number(getToken0Price(reserve0, reserve1, decimals0, decimals1)) * tronInUSDT).toString(10); + } + } + + //if exotic pair, a usd price is not available + return "0"; +}; + +const getPairsIfItExists = async (token: IToken) => { + try { + const allPairs = await getAllPairAddresses(); + if (!allPairs) { + return { + stablePairs: undefined, + wtrxPairs: undefined, + }; + } + //find all stable and WRTX pairs that include the token + const stablePairsThatIncludeToken = allPairs.filter( + (pair) => + STABLE_TOKENS.find( + (stableToken) => + getValidTokenAddress(stableToken.address).toLowerCase() === + getValidTokenAddress(pair.token0Address).toLowerCase() || + getValidTokenAddress(stableToken.address).toLowerCase() === + getValidTokenAddress(pair.token1Address).toLowerCase() + ) && + (getValidTokenAddress(pair.token0Address).toLowerCase() === token.address.toLowerCase() || + getValidTokenAddress(pair.token1Address).toLowerCase() === token.address.toLowerCase()) + ); + const wtrxPairsThatIncludeToken = allPairs.filter( + (pair) => + (getValidTokenAddress(pair.token0Address).toLowerCase() === WTRX.address.toLowerCase() || + getValidTokenAddress(pair.token1Address).toLowerCase() === WTRX.address.toLowerCase()) && + (getValidTokenAddress(pair.token0Address).toLowerCase() === token.address.toLowerCase() || + getValidTokenAddress(pair.token1Address).toLowerCase() === token.address.toLowerCase()) + ); + return { + stablePairs: stablePairsThatIncludeToken, + wtrxPairs: wtrxPairsThatIncludeToken, + }; + } catch (error) { + console.log("getPairIfItExists Error: ", error); + return { + stablePairs: undefined, + wtrxPairs: undefined, + }; + } +}; + +const getReserves = async (pairAddress: string) => { + try { + const res = await fetch(`/api/pools/get-reserves?pairAddresses=${[pairAddress]}`, { method: "GET" }); + if (!res.ok) { + throw new Error("Failed to fetch data from Tron API"); + } + const data: IReserveDataResponse | undefined = await res.json(); + if (!data) { + return { + reserve0: "0", + reserve1: "0", + }; + } + return { + reserve0: + data?.data?.tron.smartContractEvents[0].arguments.find((arg) => arg.argument === "reserve0")?.value ?? + "", + reserve1: + data?.data?.tron.smartContractEvents[0].arguments.find((arg) => arg.argument === "reserve1")?.value ?? + "", + }; + } catch (error) { + console.log("getReserves Error: ", error); + return { + reserve0: "0", + reserve1: "0", + }; + } +}; + +export const useStablePrice = ({ token }: { token: IToken | undefined }) => { + return useQuery({ + queryKey: ["useStablePrice", { token: token?.address }], + queryFn: async () => { + const tokenPrice = await getTokenPrice(token); + + return tokenPrice; + }, + keepPreviousData: true, + enabled: !!token, + refetchOnMount: false, + refetchOnWindowFocus: false, + refetchOnReconnect: false, + }); +}; diff --git a/apps/tron/src/hooks/useTokenBalance.ts b/apps/tron/src/hooks/useTokenBalance.ts new file mode 100644 index 0000000000..5ea0740d0c --- /dev/null +++ b/apps/tron/src/hooks/useTokenBalance.ts @@ -0,0 +1,40 @@ +import { useTronWeb } from "./useTronWeb"; +import { useQuery } from "@tanstack/react-query"; + +const abi = [ + { + constant: true, + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + payable: false, + stateMutability: "view", + type: "function", + }, +]; + +export const useTokenBalance = ({ + accountAddress, + tokenAddress, +}: { + accountAddress: string | null; + tokenAddress: string | undefined | null; +}) => { + const { tronWeb } = useTronWeb(); + + return useQuery({ + queryKey: ["useTokenBalance", { accountAddress, tokenAddress }], + queryFn: async () => { + if (!accountAddress || !tokenAddress) return "0"; + if (tokenAddress === "TRON") { + const balance = await tronWeb.trx.getUnconfirmedBalance(accountAddress); + return balance?.toString() as string; + } + tronWeb.setAddress(tokenAddress); + const contractInstance = await tronWeb.contract(abi, tokenAddress); + const balanceOf = await contractInstance.balanceOf(accountAddress).call(); + return balanceOf?.toString() as string; + }, + enabled: !!accountAddress && !!tokenAddress && !!tronWeb, + }); +}; diff --git a/apps/tron/src/hooks/useTokenInfo.ts b/apps/tron/src/hooks/useTokenInfo.ts new file mode 100644 index 0000000000..e69b9ae23b --- /dev/null +++ b/apps/tron/src/hooks/useTokenInfo.ts @@ -0,0 +1,39 @@ +import { useQuery } from "@tanstack/react-query"; +import { DEFAULT_TOKEN_LIST, TRON, WTRX } from "src/constants/token-list"; +import { getTokenData } from "src/lib/getTokenData"; +import { getValidTokenAddress, isAddress } from "src/utils/helpers"; + +export const useTokenInfo = ({ tokenAddress }: { tokenAddress: string }) => { + return useQuery({ + queryKey: ["useTokenInfo2", { tokenAddress }], + staleTime: Infinity, + queryFn: async () => { + if (tokenAddress === "TRON") { + return TRON; + } + if (tokenAddress.toLowerCase() === WTRX.address.toLowerCase()) { + return WTRX; + } + + if (!isAddress(tokenAddress)) return undefined; + const foundInTokenList = DEFAULT_TOKEN_LIST.find( + (i) => getValidTokenAddress(i.address) === getValidTokenAddress(tokenAddress) + ); + if (foundInTokenList) return foundInTokenList; + + const tokenData = await getTokenData({ contractAddress: tokenAddress }); + + return { + address: tokenAddress, + decimals: Number(tokenData?.decimals ?? 0), + name: tokenData?.name ?? "N/A", + symbol: tokenData?.symbol ?? "N/A", + logoURI: + DEFAULT_TOKEN_LIST.find( + (i) => getValidTokenAddress(i.address) === getValidTokenAddress(tokenAddress) + )?.logoURI ?? undefined, + }; + }, + enabled: !!tokenAddress, + }); +}; diff --git a/apps/tron/src/hooks/useTotalSupply.ts b/apps/tron/src/hooks/useTotalSupply.ts new file mode 100644 index 0000000000..fad9fb98c6 --- /dev/null +++ b/apps/tron/src/hooks/useTotalSupply.ts @@ -0,0 +1,34 @@ +import { useTronWeb } from "./useTronWeb"; +import { useQuery } from "@tanstack/react-query"; + +const abi = [ + { + constant: true, + inputs: [], + name: "totalSupply", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, +]; + +export const useTotalSupply = ({ tokenAddress }: { tokenAddress: string | undefined | null }) => { + const { tronWeb } = useTronWeb(); + + return useQuery({ + queryKey: ["useTotalSupply", { tokenAddress }], + queryFn: async () => { + tronWeb.setAddress(tokenAddress); + const contractInstance = await tronWeb.contract(abi, tokenAddress); + const totalSupply = await contractInstance.totalSupply().call(); + return totalSupply?.toString() as string; + }, + enabled: !!tokenAddress && !!tronWeb, + }); +}; diff --git a/apps/tron/src/hooks/useTronWeb.ts b/apps/tron/src/hooks/useTronWeb.ts new file mode 100644 index 0000000000..ce8744ba73 --- /dev/null +++ b/apps/tron/src/hooks/useTronWeb.ts @@ -0,0 +1,19 @@ +import { useMemo } from "react"; +import { IS_TESTNET } from "src/constants/is-testnet"; +import TronWeb from "tronweb"; + +if (!process.env.NEXT_PUBLIC_TRON_PRO_API_KEY) { + throw new Error("NEXT_PUBLIC_TRON_PRO_API_KEY is not set"); +} + +export const useTronWeb = () => { + const tronWeb = useMemo(() => { + const host = IS_TESTNET ? "https://api.shasta.trongrid.io/" : "https://api.trongrid.io/"; + return new TronWeb({ + fullHost: host, + + headers: { "TRON-PRO-API-KEY": process.env.NEXT_PUBLIC_TRON_PRO_API_KEY }, + }); + }, []); + return { tronWeb }; +}; diff --git a/apps/tron/src/hooks/useWalletAdapters.ts b/apps/tron/src/hooks/useWalletAdapters.ts new file mode 100644 index 0000000000..6d491431ad --- /dev/null +++ b/apps/tron/src/hooks/useWalletAdapters.ts @@ -0,0 +1,17 @@ +import { TronLinkAdapter, WalletConnectAdapter } from "@tronweb3/tronwallet-adapters"; +import { useMemo } from "react"; +import { IS_TESTNET } from "src/constants/is-testnet"; + +export const useWalletAdapters = () => { + const adapters = useMemo(() => { + return [ + new TronLinkAdapter({ dappName: "SushiSwap on Tron" }), + new WalletConnectAdapter({ + network: IS_TESTNET ? "Shasta" : "Mainnet", + //TODO: Get real prjoect ID from sushi team + options: { projectId: "74b1794741f5f9376c04ca8af64705d8" }, + }), + ]; + }, []); + return { adapters }; +}; diff --git a/apps/tron/src/lib/getAllPairAddresses.ts b/apps/tron/src/lib/getAllPairAddresses.ts new file mode 100644 index 0000000000..b7e6ef8ede --- /dev/null +++ b/apps/tron/src/lib/getAllPairAddresses.ts @@ -0,0 +1,30 @@ +import { FACTORY_CONTRACT } from "src/constants/contracts"; +import { IPoolDataResponse } from "src/types/get-pools-type"; + +export const getAllPairAddresses = async () => { + try { + const res = await fetch(`/api/pools?factoryAddress=${FACTORY_CONTRACT}`, { method: "GET" }); + if (!res.ok) { + throw new Error("Failed to fetch data from Tron API"); + } + const data: IPoolDataResponse | undefined = await res.json(); + + const cleanedData = data?.data?.tron.smartContractEvents.map((event) => { + const pairAddress = event.arguments.find((arg) => arg.argument === "pair")?.value ?? ""; + const token0Address = event.arguments.find((arg) => arg.argument === "token0")?.value ?? ""; + const token1Address = event.arguments.find((arg) => arg.argument === "token1")?.value ?? ""; + + return { + token0Address, + token1Address, + pairAddress, + }; + }); + if (!cleanedData) return []; + + return cleanedData; + } catch (error) { + console.log(error); + return []; + } +}; diff --git a/apps/tron/src/lib/getTokenData.ts b/apps/tron/src/lib/getTokenData.ts new file mode 100644 index 0000000000..9a394544d7 --- /dev/null +++ b/apps/tron/src/lib/getTokenData.ts @@ -0,0 +1,21 @@ +import { ITokenDataResponse } from "src/types/token-type"; + +export const getTokenData = async ({ contractAddress }: { contractAddress: string }) => { + try { + const res = await fetch(`/api/token-info?contractAddress=${contractAddress}`, { method: "GET" }); + if (!res.ok) { + throw new Error("Failed to fetch data from Tron API"); + } + const data: ITokenDataResponse | undefined = await res.json(); + + const cleanedData = { + decimals: data?.data?.tron.address[0].smartContract.currency.decimals ?? 0, + name: data?.data?.tron.address[0].smartContract.currency.name ?? "N/A", + symbol: data?.data?.tron.address[0].smartContract.currency.symbol ?? "N/A", + }; + return cleanedData; + } catch (error) { + console.log(error); + return undefined; + } +}; diff --git a/apps/tron/src/lib/getTronPrice.ts b/apps/tron/src/lib/getTronPrice.ts new file mode 100644 index 0000000000..97b7274d00 --- /dev/null +++ b/apps/tron/src/lib/getTronPrice.ts @@ -0,0 +1,18 @@ +import { ITronInUSDTResponse } from "src/types/pricing-types"; + +export const getTronPrice = async () => { + try { + const res = await fetch(`/api/pricing`, { method: "GET" }); + if (!res.ok) { + throw new Error("Failed to fetch data from Tron API"); + } + const data: ITronInUSDTResponse | undefined = await res.json(); + if (!data) return 0; + + const cleanedQuotePrice = data?.data?.tron.dexTrades[0]?.quotePrice ?? 0; + return cleanedQuotePrice; + } catch (error) { + console.log("getTronPrice Error: ", error); + return 0; + } +}; diff --git a/apps/tron/src/tronweb.d.ts b/apps/tron/src/tronweb.d.ts new file mode 100644 index 0000000000..21b02562ad --- /dev/null +++ b/apps/tron/src/tronweb.d.ts @@ -0,0 +1 @@ +declare module "tronweb"; diff --git a/apps/tron/src/types/get-pools-type.ts b/apps/tron/src/types/get-pools-type.ts new file mode 100644 index 0000000000..8ea87390bd --- /dev/null +++ b/apps/tron/src/types/get-pools-type.ts @@ -0,0 +1,70 @@ +import { IToken } from "./token-type"; + +export type IPoolData = { + token0Address: string; + token1Address: string; + pairAddress: string; +}[]; + +export type IPoolDataResponse = { + data: { + tron: { + smartContractEvents: { + arguments: [ + { + argument: "token0"; + value: string; + }, + { + argument: "token1"; + value: string; + }, + { + argument: "pair"; + value: string; + }, + { + argument: ""; + value: string; + } + ]; + block: { + height: number; + }; + }[]; + }; + }; +}; + +export type IMyPositionData = { + token0: IToken | undefined; + token1: IToken | undefined; + pairAddress: string | undefined; +}; + +export type IReserveDataResponse = { + data: { + tron: { + smartContractEvents: { + arguments: [ + { + argument: "reserve0"; + value: string; + }, + { + argument: "reserve1"; + value: string; + } + ]; + block: { + height: number; + }; + smartContract: { + address: { + address: string; + }; + }; + }[]; + }; + }; +}; diff --git a/apps/tron/src/types/pricing-types.ts b/apps/tron/src/types/pricing-types.ts new file mode 100644 index 0000000000..8d193af058 --- /dev/null +++ b/apps/tron/src/types/pricing-types.ts @@ -0,0 +1,23 @@ +export type ITronInUSDTResponse = { + data: { + tron: { + dexTrades: [ + { + block: { + timestamp: { + time: string; + // 2024-05-31 15:52:36 in this format + }; + }; + baseCurrency: { + address: "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR"; + }; + quoteCurrency: { + address: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"; + }; + quotePrice: number; + } + ]; + }; + }; +}; diff --git a/apps/tron/src/types/router-selector-type.ts b/apps/tron/src/types/router-selector-type.ts new file mode 100644 index 0000000000..ebf2e2ef7c --- /dev/null +++ b/apps/tron/src/types/router-selector-type.ts @@ -0,0 +1,19 @@ +export type IRouterFunctionSelector = + | "swapExactETHForTokens(uint256,address[],address,uint256)" + | "swapETHForExactTokens(uint256,address[],address,uint256)" + | "swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)" + | "swapExactTokensForETH(uint256,uint256,address[],address,uint256)" + | "swapTokensForExactETH(uint256,uint256,address[],address,uint256)" + | "swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)" + | "swapExactTokensForTokens(uint256,uint256,address[],address,uint256)" + | "swapTokensForExactTokens(uint256,uint256,address[],address,uint256)" + | "swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)"; + +export type IRouterLiquidityFunctionSelector = + | "addLiquidityETH(address,uint256,uint256,uint256,address,uint256)" + | "addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)"; + +export type IRouterRemoveLiquidityFunctionSelector = + | "removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)" + | "removeLiquidityETHSupportingFeeOnTransferTokens(address,uint256,uint256,uint256,address,uint256)" + | "removeLiquidity(address,address,uint256,uint256,uint256,address,uint256)"; diff --git a/apps/tron/src/types/token-type.ts b/apps/tron/src/types/token-type.ts new file mode 100644 index 0000000000..6f29968135 --- /dev/null +++ b/apps/tron/src/types/token-type.ts @@ -0,0 +1,34 @@ +export type IToken = { + address: string; + decimals: number; + logoURI?: string; + name: string; + symbol: string; +}; + +export type IReserves = { + reserve: string; + address?: string | undefined; + decimals?: number | undefined; + logoURI?: string | undefined; + name?: string | undefined; + symbol?: string | undefined; +}; + +export type ITokenDataResponse = { + data: { + tron: { + address: [ + { + smartContract: { + currency: { + decimals: number; + name: string; + symbol: string; + }; + }; + } + ]; + }; + }; +}; diff --git a/apps/tron/src/utils/formatters.ts b/apps/tron/src/utils/formatters.ts new file mode 100644 index 0000000000..e35aa2f4ac --- /dev/null +++ b/apps/tron/src/utils/formatters.ts @@ -0,0 +1,106 @@ +import { IToken } from "src/types/token-type"; +import TronWeb from "tronweb"; +import { getValidTokenAddress } from "./helpers"; + +export const truncateText = (str: string | `0x${string}`, n = 5): string => { + if (str) { + if (str.length <= n) { + return str; + } + return `${str.slice(0, n)}...${str.slice(str.length - n)}`; + } + return ""; +}; + +export const hashStringToColor = (str: string) => { + const hash = _djb2(str); + const r = (hash & 0xff0000) >> 16; + const g = (hash & 0x00ff00) >> 8; + const b = hash & 0x0000ff; + return ( + "#" + + ("0" + r.toString(16)).substr(-2) + + ("0" + g.toString(16)).substr(-2) + + ("0" + b.toString(16)).substr(-2) + ); +}; + +const _djb2 = (str: string) => { + let hash = 5381; + for (let i = 0; i < str.length; i++) { + hash = (hash << 5) + hash + str.charCodeAt(i); /* hash * 33 + c */ + } + return hash; +}; + +export const sortTokenAddresses = (token0: string, token1: string): [string, string] => { + return token0.toLowerCase() < token1.toLowerCase() ? [token0, token1] : [token1, token0]; +}; + +export const sortTokens = (token0: IToken, token1: IToken): [IToken, IToken] => { + return getValidTokenAddress(token0.address).toLowerCase() < + getValidTokenAddress(token1.address).toLowerCase() + ? [token0, token1] + : [token1, token0]; +}; + +export const formatUnits = (amount: string | number, decimals: number, maxDecimals?: number): string => { + if (isNaN(Number(amount))) { + return "0"; + } + const val = TronWeb.toBigNumber(amount).div(10 ** decimals); + if (Number(val) < 0.0001) { + return "<0.0001"; + } + if (maxDecimals) { + return toBigNumber(parseFloat(val.toFixed(maxDecimals)).toString()).toString(10); + } + return toBigNumber(parseFloat(val.toFixed(decimals)).toString()).toString(10); +}; + +export const formatUnitsForInput = (amount: string | number, decimals: number): string => { + if (isNaN(Number(amount))) { + return "0"; + } + + const _decimals = toBigNumber(10).pow(decimals); + + const val = TronWeb.toBigNumber(amount).div(_decimals); + if (isNaN(val)) { + return "0"; + } + + return toBigNumber(parseFloat(val.toFixed(decimals)).toString()).toString(10); +}; + +export const parseUnits = (amount: string | number, decimals: number): string => { + if (isNaN(Number(amount))) { + return "0"; + } + + const val = TronWeb.toBigNumber(amount) + .times(10 ** decimals) + .toString(10); + + if (!toBigNumber(val).isInteger()) { + return toBigNumber(val) + .toFormat(0, { groupSeparator: "", decimalSeparator: ".", padFractionalPart: false }) + .toString(10); + } + + return val; +}; + +export const toBigNumber = (amount: string | number) => { + return TronWeb.toBigNumber(amount); +}; + +export const removeDecimals = (amount: string | number): string => { + const val = TronWeb.toBigNumber(amount); + if (!toBigNumber(val).isInteger()) { + return toBigNumber(val) + .toFormat(0, { groupSeparator: "", decimalSeparator: ".", padFractionalPart: false }) + .toString(10); + } + return val.toString(10); +}; diff --git a/apps/tron/src/utils/helpers.ts b/apps/tron/src/utils/helpers.ts new file mode 100644 index 0000000000..0564d11031 --- /dev/null +++ b/apps/tron/src/utils/helpers.ts @@ -0,0 +1,512 @@ +import { ROUTER_CONTRACT } from "src/constants/contracts"; +import { DEFAULT_TOKEN_LIST } from "src/constants/token-list"; +import { + IRouterFunctionSelector, + IRouterLiquidityFunctionSelector, + IRouterRemoveLiquidityFunctionSelector, +} from "src/types/router-selector-type"; +import { IToken } from "src/types/token-type"; +import TronWeb from "tronweb"; + +export const isAddress = (address: string): boolean => { + if (!address) return false; + return TronWeb.isAddress(address); +}; + +export const getValidTokenAddress = (address: string): string => { + let _tokenAddress = address; + if (address === "TRON") { + _tokenAddress = DEFAULT_TOKEN_LIST.find((token) => token.symbol === "WTRX")?.address as string; + } + return _tokenAddress; +}; + +export const getBase58Address = (address: string): string => { + return TronWeb.address.fromHex(address); +}; + +export const getHexAddress = (address: string): string => { + return TronWeb.address.toHex(address); +}; + +export const chunk = (arr: T[], chunkSize: number): T[][] => { + return Array.from({ length: Math.ceil(arr.length / chunkSize) }, (_, i) => + arr.slice(i * chunkSize, i * chunkSize + chunkSize) + ); +}; + +export const flatten = (arr: T[][]): T[] => { + return arr.flat(); +}; + +export const chunkAndFlatten = (arr: T[], chunkSize: number): T[] => { + const chunked = chunk(arr, chunkSize); + return flatten(chunked); +}; + +export const timer = (ms: number) => new Promise((res) => setTimeout(res, ms)); + +export const getToken0Price = ( + reserve0Amount: string, + reserve1Amount: string, + reserve0Decimals: number, + reserve1Decimals: number +): string => { + const reserve0 = TronWeb.toBigNumber(reserve0Amount).div(10 ** reserve0Decimals); + const reserve1 = TronWeb.toBigNumber(reserve1Amount).div(10 ** reserve1Decimals); + return reserve1.div(reserve0).toString(10); +}; + +export const getToken1Price = ( + reserve0Amount: string, + reserve1Amount: string, + reserve0Decimals: number, + reserve1Decimals: number +): string => { + const reserve0 = TronWeb.toBigNumber(reserve0Amount).div(10 ** reserve0Decimals); + const reserve1 = TronWeb.toBigNumber(reserve1Amount).div(10 ** reserve1Decimals); + return reserve0.div(reserve1).toString(10); +}; + +export const getToken0AmountForLiquidity = ( + token1Amount: string, + reserve0: string, + reserv1: string +): string => { + //@DEV parseUnits for token1Amount + const token1 = TronWeb.toBigNumber(token1Amount); + const reserve0BN = TronWeb.toBigNumber(reserve0); + const reserve1BN = TronWeb.toBigNumber(reserv1); + return token1.times(reserve0BN).div(reserve1BN).toString(10); +}; + +export const getToken1AmountForLiquidity = ( + token0Amount: string, + reserve0: string, + reserv1: string +): string => { + //@DEV parseUnits for token0Amount + const token0 = TronWeb.toBigNumber(token0Amount); + const reserve0BN = TronWeb.toBigNumber(reserve0); + const reserve1BN = TronWeb.toBigNumber(reserv1); + return token0.times(reserve1BN).div(reserve0BN).toString(10); +}; + +export const getIfWrapOrUnwrap = (token0: IToken, token1: IToken): "wrap" | "unwrap" | "swap" => { + if (token0.symbol === "WTRX" && token1.symbol === "TRX") { + return "unwrap"; + } + if (token0.symbol === "TRX" && token1.symbol === "WTRX") { + return "wrap"; + } + return "swap"; +}; + +export const isContract = async (tronWebInstace: any, address: string) => { + const code = await tronWebInstace.trx.getContract(address); + // will be empty object if not a contract + return "contract_address" in code; +}; + +export const parseTxnError = (error: string): string => { + console.log("parseTxnError: ", error); + switch (error) { + case "CONTRACT_VALIDATE_ERROR": + return "Insufficient TRX balance"; + + default: + return "An error occurred while processing the transaction."; + } +}; + +//TODO: Add type for transactionInfo +export const getTransactionInfo = async ( + tronWebInstance: any, + txId: string, + waitIntervalMs: number = 6000, + maxTries: number = 15 +) => { + //avg txn is 1min till confirmed + let transactionInfo; + for (let i = 0; i < maxTries; i++) { + transactionInfo = await tronWebInstance.trx.getUnconfirmedTransactionInfo(txId); + console.log({ transactionInfo }); + if (transactionInfo && transactionInfo.receipt) { + return transactionInfo; + } + await timer(waitIntervalMs); + } + throw new Error("Transaction not found or timeout reached"); +}; + +//TODO: Add type for result +export const estimateEnergy = async ( + tronWebInstance: any, + contractAddress: string, + functionSelector: string, + option: Record, + paramater: { type: string; value: string }[], + issuerAddress: string +) => { + // console.log("estimateEnergy", contractAddress, functionSelector, option, paramater, issuerAddress); + const data = await tronWebInstance.transactionBuilder.triggerConstantContract( + contractAddress, //contract address + functionSelector, //function name + option, // options + paramater, //parameters + issuerAddress //issuerAddress + ); + + return data; +}; + +//TODO: Add type for result +export const safeGasEstimates = async (tronWebInstance: any, args: any[][]): Promise => { + const safeGasEstimates = await Promise.all( + args.map((i: any) => + //@ts-expect-error + estimateEnergy(tronWebInstance, ...i) + .then((c) => { + return c; + }) + .catch((error) => { + console.error(`estimateEnergy failed`, error); + return undefined; + }) + ) + ); + return safeGasEstimates.sort((a, b) => a?.energy_used - b?.energy_used); +}; + +export const getDeadline = (deadlineInMinutes: number = 20): number => { + const currentTimestamp = Math.floor(Date.now() / 1000); + const bufferTime = deadlineInMinutes * 60; + return Math.floor(currentTimestamp + bufferTime); +}; + +export const getRouterFunctionSelectors = (route: string[]): IRouterFunctionSelector[] => { + const routeHasTron = route.some((address) => address === "TRON"); + if (routeHasTron) { + const token0IsTron = route[0] === "TRON"; + + if (token0IsTron) { + return [ + "swapExactETHForTokens(uint256,address[],address,uint256)", + "swapETHForExactTokens(uint256,address[],address,uint256)", + "swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)", + ]; + } else { + return [ + "swapExactTokensForETH(uint256,uint256,address[],address,uint256)", + "swapTokensForExactETH(uint256,uint256,address[],address,uint256)", + "swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)", + ]; + } + } else { + return [ + "swapExactTokensForTokens(uint256,uint256,address[],address,uint256)", + "swapTokensForExactTokens(uint256,uint256,address[],address,uint256)", + "swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)", + ]; + } +}; + +//TODO: clean this up!! +export const getArgsForSwap = ( + functionSelector: IRouterFunctionSelector, + amountIn: string, + amountOut: string, + amountInMax: string, + amountOutMin: string, + route: string[], + to: string, + deadline: number, + issuerAddress: string +) => { + const cleanedRoute = route.map((address) => getValidTokenAddress(address)); + + switch (functionSelector) { + case "swapETHForExactTokens(uint256,address[],address,uint256)": + return [ + ROUTER_CONTRACT, + functionSelector, + { callValue: amountIn }, + [ + { type: "uint256", value: amountOut }, + { type: "address[]", value: cleanedRoute }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + issuerAddress, + ]; + case "swapExactETHForTokens(uint256,address[],address,uint256)": + return [ + ROUTER_CONTRACT, + functionSelector, + { callValue: amountIn }, + [ + { type: "uint256", value: amountOutMin }, + { type: "address[]", value: cleanedRoute }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + issuerAddress, + ]; + case "swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)": + return [ + ROUTER_CONTRACT, + functionSelector, + { callValue: amountIn }, + [ + { type: "uint256", value: amountOutMin }, + { type: "address[]", value: cleanedRoute }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + issuerAddress, + ]; + case "swapExactTokensForETH(uint256,uint256,address[],address,uint256)": + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: "uint256", value: amountIn }, + { type: "uint256", value: amountOutMin }, + { type: "address[]", value: cleanedRoute }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + issuerAddress, + ]; + case "swapTokensForExactETH(uint256,uint256,address[],address,uint256)": + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: "uint256", value: amountOut }, + { type: "uint256", value: amountInMax }, + { type: "address[]", value: cleanedRoute }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + issuerAddress, + ]; + case "swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)": + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: "uint256", value: amountIn }, + { type: "uint256", value: amountOutMin }, + { type: "address[]", value: cleanedRoute }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + issuerAddress, + ]; + case "swapExactTokensForTokens(uint256,uint256,address[],address,uint256)": + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: "uint256", value: amountIn }, + { type: "uint256", value: amountOutMin }, + { type: "address[]", value: cleanedRoute }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + issuerAddress, + ]; + case "swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)": + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: "uint256", value: amountIn }, + { type: "uint256", value: amountOutMin }, + { type: "address[]", value: cleanedRoute }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + issuerAddress, + ]; + case "swapTokensForExactTokens(uint256,uint256,address[],address,uint256)": + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: "uint256", value: amountOut }, + { type: "uint256", value: amountInMax }, + { type: "address[]", value: cleanedRoute }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + issuerAddress, + ]; + + default: + throw new Error("Invalid function selector"); + } +}; + +export const getLiquidityFunctionSelector = ( + token0: IToken, + token1: IToken +): IRouterLiquidityFunctionSelector => { + if (token0.symbol === "TRX" || token1.symbol === "TRX") { + return "addLiquidityETH(address,uint256,uint256,uint256,address,uint256)"; + } + return "addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)"; +}; + +export const getArgsForAddLiquidity = ( + functionSelector: IRouterLiquidityFunctionSelector, + token0Address: string, + token1Address: string, + amount0Desired: string, + amount1Desired: string, + amount0Min: string, + amount1Min: string, + to: string, //same as issuerAddress + deadline: number +): any[] => { + switch (functionSelector) { + case "addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)": + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: "address", value: token0Address }, + { type: "address", value: token1Address }, + { type: "uint256", value: amount0Desired }, + { type: "uint256", value: amount1Desired }, + { type: "uint256", value: amount0Min }, + { type: "uint256", value: amount1Min }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + to, + ]; + case "addLiquidityETH(address,uint256,uint256,uint256,address,uint256)": + const tokenAddress = token0Address === "TRON" ? token1Address : token0Address; + const tokenAmount = token0Address === "TRON" ? amount1Desired : amount0Desired; + const tokenMinAmount = token0Address === "TRON" ? amount1Min : amount0Min; + const ethAmount = token0Address === "TRON" ? amount0Desired : amount1Desired; + const ethMinAmount = token0Address === "TRON" ? amount0Min : amount1Min; + return [ + ROUTER_CONTRACT, + functionSelector, + { callValue: ethAmount }, + [ + { type: "address", value: tokenAddress }, + { type: "uint256", value: tokenAmount }, + { type: "uint256", value: tokenMinAmount }, + { type: "uint256", value: ethMinAmount }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + to, + ]; + + default: + throw new Error("Invalid function selector"); + } +}; + +export const getRemoveLiquidityFunctionSelector = ( + token0: IToken, + token1: IToken +): IRouterRemoveLiquidityFunctionSelector[] => { + if (token0.symbol === "TRX" || token1.symbol === "TRX") { + return [ + "removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)", + "removeLiquidityETHSupportingFeeOnTransferTokens(address,uint256,uint256,uint256,address,uint256)", + ]; + } + return ["removeLiquidity(address,address,uint256,uint256,uint256,address,uint256)"]; +}; + +export const getArgsForRemoveLiquidity = ( + functionSelector: IRouterRemoveLiquidityFunctionSelector, + token0Address: string, + token1Address: string, + lpToRemove: string, + amountToken0Min: string, + amountToken1Min: string, + to: string, //same as issuerAddress + deadline: number +) => { + switch (functionSelector) { + case "removeLiquidity(address,address,uint256,uint256,uint256,address,uint256)": + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: "address", value: token0Address }, + { type: "address", value: token1Address }, + { type: "uint256", value: lpToRemove }, + { type: "uint256", value: amountToken0Min }, + { type: "uint256", value: amountToken1Min }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + to, + ]; + case "removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)": + const tokenAddress = token0Address === "TRON" ? token1Address : token0Address; + const tokenMinAmount = token0Address === "TRON" ? amountToken1Min : amountToken0Min; + const ethMinAmount = token0Address === "TRON" ? amountToken0Min : amountToken1Min; + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: "address", value: tokenAddress }, + { type: "uint256", value: lpToRemove }, + { type: "uint256", value: tokenMinAmount }, + { type: "uint256", value: ethMinAmount }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + to, + ]; + case "removeLiquidityETHSupportingFeeOnTransferTokens(address,uint256,uint256,uint256,address,uint256)": + const _tokenAddress = token0Address === "TRON" ? token1Address : token0Address; + const _tokenMinAmount = token0Address === "TRON" ? amountToken1Min : amountToken0Min; + const _ethMinAmount = token0Address === "TRON" ? amountToken0Min : amountToken1Min; + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: "address", value: _tokenAddress }, + { type: "uint256", value: lpToRemove }, + { type: "uint256", value: _tokenMinAmount }, + { type: "uint256", value: _ethMinAmount }, + { type: "address", value: to }, + { type: "uint256", value: deadline }, + ], + to, + ]; + } +}; + +export const cleanArgs = (args: any[], feeLimit?: string | number) => { + let _args = args; + if (_args?.[2] && _args?.[2]?._isConstant === true) { + delete _args[2]._isConstant; + } + if (feeLimit) { + _args[2].feeLimit = feeLimit; + } + + return _args; +}; diff --git a/apps/tron/src/utils/token-search-helpers.ts b/apps/tron/src/utils/token-search-helpers.ts new file mode 100644 index 0000000000..56dfe4210b --- /dev/null +++ b/apps/tron/src/utils/token-search-helpers.ts @@ -0,0 +1,84 @@ +import { IToken } from "src/types/token-type"; + +const alwaysTrue = () => true; + +export function createTokenFilterFunction(search: string): (tokens: T) => boolean { + // const isValidAddress = isAddress(search) + + // if (isValidAddress) { + // } + // if ((search.startsWith("0x") && search.length > 65) || search == "0x1::aptos_coin::AptosCoin") { + // return (t: T) => search.toLowerCase() === t.address.toLowerCase(); + // } + + const lowerSearchParts = search + .toLowerCase() + .split(/\s+/) + .filter((s) => s.length > 0); + + if (lowerSearchParts.length === 0) return alwaysTrue; + + const matchesSearch = (s: string): boolean => { + const sParts = s + .toLowerCase() + .split(/\s+/) + .filter((s) => s.length > 0); + + return lowerSearchParts.every( + (p) => p.length === 0 || sParts.some((sp) => sp.startsWith(p) || sp.endsWith(p)) + ); + }; + + return ({ name, symbol }: T): boolean => + Boolean((symbol && matchesSearch(symbol)) || (name && matchesSearch(name))); +} + +export function filterTokens(tokens: T[], search: string): T[] { + return tokens.filter(createTokenFilterFunction(search)); +} + +export const tokenComparator = () => { + return (tokenA: IToken, tokenB: IToken): number => { + if (tokenA.symbol && tokenB.symbol) { + return tokenA.symbol.toLowerCase() < tokenB.symbol.toLowerCase() ? -1 : 1; + } else { + return tokenA.symbol ? -1 : tokenB.symbol ? -1 : 0; + } + }; +}; + +export function getSortedTokensByQuery(tokens: IToken[] | undefined, searchQuery: string): IToken[] { + if (!tokens) { + return []; + } + + if (searchQuery === "") { + return tokens; + } + + const symbolMatch = searchQuery + .toLowerCase() + .split(/\s+/) + .filter((s) => s.length > 0); + + if (symbolMatch.length > 1) { + return tokens; + } + + const exactMatches: IToken[] = []; + const symbolSubstrings: IToken[] = []; + const rest: IToken[] = []; + + // sort tokens by exact match -> subtring on symbol match -> rest + tokens.map((token) => { + if (token.symbol?.toLowerCase() === symbolMatch[0]) { + return exactMatches.push(token); + } else if (token.symbol?.toLowerCase().startsWith(searchQuery.toLowerCase().trim())) { + return symbolSubstrings.push(token); + } else { + return rest.push(token); + } + }); + + return [...exactMatches, ...symbolSubstrings, ...rest]; +} diff --git a/apps/tron/src/utils/tronscan-helpers.ts b/apps/tron/src/utils/tronscan-helpers.ts new file mode 100644 index 0000000000..cbeef69b49 --- /dev/null +++ b/apps/tron/src/utils/tronscan-helpers.ts @@ -0,0 +1,17 @@ +import { IS_TESTNET } from "src/constants/is-testnet"; + +export const getTronscanAddressLink = (address: string) => { + if (IS_TESTNET) { + return `https://shasta.tronscan.org/#/address/${address}`; + } else { + return `https://tronscan.org/#/address/${address}`; + } +}; + +export const getTronscanTxnLink = (txnHash: string) => { + if (IS_TESTNET) { + return `https://shasta.tronscan.org/#/transaction/${txnHash}`; + } else { + return `https://tronscan.org/#/transaction/${txnHash}`; + } +}; diff --git a/apps/tron/src/utils/warning-severity.ts b/apps/tron/src/utils/warning-severity.ts new file mode 100644 index 0000000000..e789d7f92a --- /dev/null +++ b/apps/tron/src/utils/warning-severity.ts @@ -0,0 +1,35 @@ +import sharedConfig from "@sushiswap/tailwindcss-config"; + +// one basis JSBI.BigInt +// const BIPS_BASE = BigInt(10000); + +// // used for warning states +// export const ALLOWED_PRICE_IMPACT_LOW: Percent = new Percent(BigInt(100), BIPS_BASE); // 1% +// export const ALLOWED_PRICE_IMPACT_MEDIUM: Percent = new Percent(BigInt(300), BIPS_BASE); // 3% +// export const ALLOWED_PRICE_IMPACT_HIGH: Percent = new Percent(BigInt(500), BIPS_BASE); // 5% +// export const BLOCKED_PRICE_IMPACT_NON_EXPERT: Percent = new Percent(BigInt(1500), BIPS_BASE); // 15% + +// const IMPACT_TIERS = [ +// BLOCKED_PRICE_IMPACT_NON_EXPERT, +// ALLOWED_PRICE_IMPACT_HIGH, +// ALLOWED_PRICE_IMPACT_MEDIUM, +// ALLOWED_PRICE_IMPACT_LOW, +// ]; + +type WarningSeverity = 0 | 1 | 2 | 3 | 4; +export function warningSeverity(priceImpactPercentage: number | undefined): WarningSeverity { + if (!priceImpactPercentage) return 0; + if (priceImpactPercentage < 1) return 0; + if (priceImpactPercentage < 3) return 1; + if (priceImpactPercentage < 5) return 2; + if (priceImpactPercentage < 15) return 3; + return 4; +} + +export const warningSeverityClassName = (severity: WarningSeverity): string => { + if (severity === 0) return ""; + if (severity <= 1) return sharedConfig.theme.extend.colors.green.DEFAULT; + if (severity <= 2) return "rgb(250 204 21)"; //text-yellow-400 + if (severity <= 3) return sharedConfig.theme.extend.colors.yellow.DEFAULT; + return sharedConfig.theme.extend.colors.red.DEFAULT; +}; diff --git a/apps/tron/tsconfig.json b/apps/tron/tsconfig.json index d74d5101bd..6b99f56a08 100644 --- a/apps/tron/tsconfig.json +++ b/apps/tron/tsconfig.json @@ -1,26 +1,26 @@ { - "compilerOptions": { - "baseUrl": ".", - "target": "ESNext", - "lib": ["DOM", "DOM.Iterable", "ESNext"], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "plugins": [ - { - "name": "next" - } - ] - }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"] + "compilerOptions": { + "baseUrl": ".", + "target": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ] + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7cfd714098..54badeeb09 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -373,6 +373,9 @@ importers: apps/tron: dependencies: + '@headlessui/react': + specifier: 1.7.7 + version: 1.7.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@heroicons/react': specifier: 2.0.13 version: 2.0.13(react@18.2.0) @@ -409,12 +412,27 @@ importers: '@tanstack/react-table': specifier: 8.9.1 version: 8.9.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@tronweb3/tronwallet-abstract-adapter': + specifier: ^1.1.6 + version: 1.1.6 + '@tronweb3/tronwallet-adapter-react-hooks': + specifier: ^1.1.7 + version: 1.1.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@tronweb3/tronwallet-adapter-react-ui': + specifier: ^1.1.8 + version: 1.1.8(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@tronweb3/tronwallet-adapters': + specifier: ^1.2.1 + version: 1.2.2(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) '@vercel/analytics': specifier: 1.3.1 version: 1.3.1(next@14.2.3(@babel/core@7.24.4)(@opentelemetry/api@1.9.0)(@playwright/test@1.45.0)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0) '@vercel/edge-config': specifier: 1.2.0 version: 1.2.0(@opentelemetry/api@1.9.0) + ethers: + specifier: ^5.7.2 + version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) lodash.once: specifier: 4.1.1 version: 4.1.1 @@ -448,6 +466,9 @@ importers: tiny-invariant: specifier: 1.3.1 version: 1.3.1 + tronweb: + specifier: ^5.3.2 + version: 5.3.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) zod: specifier: 3.23.8 version: 3.23.8 @@ -2017,6 +2038,12 @@ packages: '@adraffy/ens-normalize@1.10.0': resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} + '@adraffy/ens-normalize@1.10.1': + resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} + + '@adraffy/ens-normalize@1.9.0': + resolution: {integrity: sha512-iowxq3U30sghZotgl4s/oJRci6WPBfNO5YYgk2cIOMCHr3LeGPcsZjCEr+33Q4N+oV3OABDAtA+pyvWjbvBifQ==} + '@alloc/quick-lru@5.2.0': resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -3592,6 +3619,10 @@ packages: resolution: {integrity: sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==} engines: {node: '>=6.9.0'} + '@babel/runtime@7.25.4': + resolution: {integrity: sha512-DSgLeL/FNcpXuzav5wfYvHCGvynXkJbn3Zvc3823AEe9nPwW9IK4UoCSS5yGymmQzN0pCPvivtgS6/8U2kkm1w==} + engines: {node: '>=6.9.0'} + '@babel/template@7.22.15': resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} engines: {node: '>=6.9.0'} @@ -3682,6 +3713,9 @@ packages: cpu: [x64] os: [win32] + '@bitget-wallet/web3-sdk@0.0.8': + resolution: {integrity: sha512-WFk6URUxTCukKrU3YpTdWTCScrj6/wwd/0O7eSANeQl1KDbDs+yj/fAkN1Wy6ebI3NMcW6sqN9mrmfwz53dPMQ==} + '@blocto/aptos-wallet-adapter-plugin@0.2.9': resolution: {integrity: sha512-0hPdNa+AknlTKQPYZ1m2FwqwGVXZqoPr12ai5+M9McNN+H+J2aY7ujPxI74e991MXh7Ah4zsdOeHI0LDWhxU+g==} @@ -5270,6 +5304,30 @@ packages: peerDependencies: axios: '*' + '@ledgerhq/devices@6.27.1': + resolution: {integrity: sha512-jX++oy89jtv7Dp2X6gwt3MMkoajel80JFWcdc0HCouwDsV1mVJ3SQdwl/bQU0zd8HI6KebvUP95QTwbQLLK/RQ==} + + '@ledgerhq/devices@8.4.2': + resolution: {integrity: sha512-oWNTp3jCMaEvRHsXNYE/yo+PFMgXAJGFHLOU1UdE4/fYkniHbD9wdxwyZrZvrxr9hNw4/9wHiThyITwPtMzG7g==} + + '@ledgerhq/errors@6.18.0': + resolution: {integrity: sha512-L3jQWAGyooxRDk/MRlW2v4Ji9+kloBtdmz9wBkHaj2j0n+05rweJSV3GHw9oye1BYMbVFqFffmT4H3hlXlCasw==} + + '@ledgerhq/hw-app-trx@6.29.2': + resolution: {integrity: sha512-sLb5IiGf2Sqc64iUMcudt+YyJ/J68YhpupxAQDnEsyhDTrxxrn4ihRIxeYTYOSUwsSP/VNZaAuL+zqn3IqsA0w==} + + '@ledgerhq/hw-transport-webhid@6.27.1': + resolution: {integrity: sha512-u74rBYlibpbyGblSn74fRs2pMM19gEAkYhfVibq0RE1GNFjxDMFC1n7Sb+93Jqmz8flyfB4UFJsxs8/l1tm2Kw==} + + '@ledgerhq/hw-transport@6.27.1': + resolution: {integrity: sha512-hnE4/Fq1YzQI4PA1W0H8tCkI99R3UWDb3pJeZd6/Xs4Qw/q1uiQO+vNLC6KIPPhK0IajUfuI/P2jk0qWcMsuAQ==} + + '@ledgerhq/hw-transport@6.31.2': + resolution: {integrity: sha512-B27UIzMzm2IXPGYnEB95R7eHxpXBkTBHh6MUJJQZVknt8LilEz1tfpTYUdzAKDGQ+Z5MZyYb01Eh3Zqm3kn3uw==} + + '@ledgerhq/logs@6.12.0': + resolution: {integrity: sha512-ExDoj1QV5eC6TEbMdLUMMk9cfvNKhhv5gXol4SmULRVCx/3iyCPhJ74nsb3S0Vb+/f+XujBEj3vQn5+cwS0fNA==} + '@leichtgewicht/ip-codec@2.0.5': resolution: {integrity: sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==} @@ -5587,22 +5645,38 @@ packages: '@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1': resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} + '@noble/curves@1.0.0': + resolution: {integrity: sha512-2upgEu0iLiDVDZkNLeFV2+ht0BAVgQnEmCk6JsOch9Rp8xfkMCbvbAZlA2pBHQc73dbl+vFOXfqkf4uemdn0bw==} + '@noble/curves@1.1.0': resolution: {integrity: sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==} + '@noble/curves@1.2.0': + resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + '@noble/curves@1.4.0': resolution: {integrity: sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==} + '@noble/curves@1.5.0': + resolution: {integrity: sha512-J5EKamIHnKPyClwVrzmaf5wSdQXgdHcPZIZLu3bwnbeCx8/7NPK5q2ZBWF+5FvYGByjiQQsJYX6jfgB2wDPn3A==} + '@noble/hashes@1.1.3': resolution: {integrity: sha512-CE0FCR57H2acVI5UOzIGSSIYxZ6v/HOhDR0Ro9VLyhnzLwx0o8W1mmgaqlEUx4049qJDlIBRztv5k+MM8vbO3A==} '@noble/hashes@1.2.0': resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==} + '@noble/hashes@1.3.0': + resolution: {integrity: sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==} + '@noble/hashes@1.3.1': resolution: {integrity: sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==} engines: {node: '>= 16'} + '@noble/hashes@1.3.2': + resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} + engines: {node: '>= 16'} + '@noble/hashes@1.3.3': resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} engines: {node: '>= 16'} @@ -7474,6 +7548,9 @@ packages: '@safe-global/safe-apps-provider@0.18.3': resolution: {integrity: sha512-f/0cNv3S4v7p8rowAjj0hDCg8Q8P/wBjp5twkNWeBdvd0RDr7BuRBPPk74LCqmjQ82P+1ltLlkmVFSmxTIT7XQ==} + '@safe-global/safe-apps-sdk@8.1.0': + resolution: {integrity: sha512-XJbEPuaVc7b9n23MqlF6c+ToYIS3f7P2Sel8f3cSBQ9WORE4xrSuvhMpK9fDSFqJ7by/brc+rmJR/5HViRr0/w==} + '@safe-global/safe-apps-sdk@9.1.0': resolution: {integrity: sha512-N5p/ulfnnA2Pi2M3YeWjULeWbjo7ei22JwU/IXnhoHzKq3pYCN6ynL9mJBOlvDVv892EgLPCWCOwQk/uBT2v0Q==} @@ -7489,9 +7566,15 @@ packages: '@scure/bip32@1.1.5': resolution: {integrity: sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==} + '@scure/bip32@1.3.0': + resolution: {integrity: sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q==} + '@scure/bip32@1.3.1': resolution: {integrity: sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==} + '@scure/bip32@1.3.2': + resolution: {integrity: sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==} + '@scure/bip32@1.4.0': resolution: {integrity: sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==} @@ -7501,6 +7584,9 @@ packages: '@scure/bip39@1.1.1': resolution: {integrity: sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==} + '@scure/bip39@1.2.0': + resolution: {integrity: sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg==} + '@scure/bip39@1.2.1': resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} @@ -7994,6 +8080,13 @@ packages: '@socket.io/component-emitter@3.1.0': resolution: {integrity: sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==} + '@solana/buffer-layout@4.0.1': + resolution: {integrity: sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==} + engines: {node: '>=5.10'} + + '@solana/web3.js@1.95.3': + resolution: {integrity: sha512-O6rPUN0w2fkNqx/Z3QJMB9L225Ex10PRDH8bTaIUPZXMPV0QP8ZpPvjQnXK+upUczlRgzHzd6SjKIha1p+I6og==} + '@solidity-parser/parser@0.14.5': resolution: {integrity: sha512-6dKnHZn7fg/iQATVEzqyUOyEidbn05q7YA2mQ9hC0MMXhhV3/JrsxmFSYZAcr7j1yUP700LLhTruvJ3MiQmjJg==} @@ -8582,6 +8675,9 @@ packages: '@swc/counter@0.1.3': resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} + '@swc/helpers@0.5.12': + resolution: {integrity: sha512-KMZNXiGibsW9kvZAO1Pam2JPTDBm+KSHMMHWdsyI/1DbIZjT2A6Gy3hblVXUMEDvUAKq+e0vL0X0o54owWji7g==} + '@swc/helpers@0.5.5': resolution: {integrity: sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==} @@ -8688,6 +8784,58 @@ packages: '@tootallnate/quickjs-emscripten@0.23.0': resolution: {integrity: sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==} + '@tronweb3/google-protobuf@3.21.2': + resolution: {integrity: sha512-IVcT2GfWX3K6tHUVhs14NP5uzKhQt4KeDya1g9ACxuZsUzsaoGUIGzceK2Ltu7xp1YV94AaHOf4yxLAivlvEkQ==} + + '@tronweb3/tronwallet-abstract-adapter@1.1.6': + resolution: {integrity: sha512-3T2ojxzSKIAw4ucEcg4p5Nwr4lN1g1Om8s1ty77DOHIa0oS1YDvZmlRQekptWEppKOoRDYFWST1ERCvt2Xxm0A==} + engines: {node: '>=16', pnpm: '>=7'} + + '@tronweb3/tronwallet-adapter-bitkeep@1.1.1': + resolution: {integrity: sha512-Ny3I9ePL0R/oH2YjN7c+LTnCTPBe6SQDA3uyHYDWuH8R6Kdp8/t2n8sChDlu1NBQCUF3pt6THHQEUoXJkmjfJA==} + engines: {node: '>=16', pnpm: '>=7'} + + '@tronweb3/tronwallet-adapter-ledger@1.1.8': + resolution: {integrity: sha512-Tg8plalHNErkp9o+AOCjzlFcWzzI4ewBljaZYc6ue/5W83PNzRHSmUqlwGIDScJD/oSU9gZ/avYPCfJI1MPKtQ==} + engines: {node: '>=16', pnpm: '>=7'} + + '@tronweb3/tronwallet-adapter-okxwallet@1.0.3': + resolution: {integrity: sha512-43suyRr/RuJCueRaspSlNKxd0rMt/2VTmq5tkRF/WlxGI4CTEIEYk3NqdKBrVFobfsILOXQBiQg0cI+FF5lxtw==} + engines: {node: '>=16', pnpm: '>=7'} + + '@tronweb3/tronwallet-adapter-react-hooks@1.1.7': + resolution: {integrity: sha512-nW0FnS0N6523EjNYx8WGmob22bEG6V+N3vZa+EaaJLJ1toKJBDPpktFaldSq14czc6Q8N1banUmftUl2/RyASA==} + engines: {node: '>=16', pnpm: '>=7'} + peerDependencies: + react: '*' + react-dom: '*' + + '@tronweb3/tronwallet-adapter-react-ui@1.1.8': + resolution: {integrity: sha512-WGZuma6tDgJyh9iy5SCGtmKfqzjSsU7kz3E1d/4PZU3rrOqcO7Pj/NeEBNByQci5fujTRy2C6ECVYVcbor236w==} + engines: {node: '>=16', pnpm: '>=7'} + peerDependencies: + react: '*' + react-dom: '*' + + '@tronweb3/tronwallet-adapter-tokenpocket@1.0.3': + resolution: {integrity: sha512-vG1JLnlH0fodTY2YdezzWJKeW2VkCERsJYTa6d9oId1dgOaiEvjIO9UbHL/kdTPs1L1M484tM6Rh6pPBJzh/gA==} + engines: {node: '>=16', pnpm: '>=7'} + + '@tronweb3/tronwallet-adapter-tronlink@1.1.9': + resolution: {integrity: sha512-fIDKt822OmESLVeYCG9XbXGI34lM/79/jzJ3rd81xOZD8y7V0/DuDLdg5gFiCH4g9OIutKslDXiwoMpQry9O3w==} + engines: {node: '>=16', pnpm: '>=7'} + + '@tronweb3/tronwallet-adapter-walletconnect@2.0.0': + resolution: {integrity: sha512-YPiTTYxNkaCHG1QOQvKSaLz/xqtojEv5TOBYEyGB+/GWeL5ddfNLrjyAZpLkQ6nSX90TJV+wkLGqBArsNLJpUQ==} + engines: {node: '>=16', pnpm: '>=7'} + + '@tronweb3/tronwallet-adapters@1.2.2': + resolution: {integrity: sha512-rY45p6K+wpAfzWA6F1VpoB+oC9dKGdPkaCA9u4jd8I+CuDunEo1Kz2bODCHCJgI0lP5acKmiwAM5xA+RgglLHQ==} + engines: {node: '>=16', pnpm: '>=7'} + + '@tronweb3/walletconnect-tron@3.0.0': + resolution: {integrity: sha512-aYFbUsZHYumdGXt+1VN4mN9Cjr1+GWYr7cXOLawoQ1WqiHOlAiovSnsTpGhUFLn2FZV8m6rdnXTZ59S/0Mv9mw==} + '@tryghost/content-api@1.11.17': resolution: {integrity: sha512-n4hWUzrVYevZioJCyaSoWt9SaDajbjrLQ20/A6p34OO3G/VvrV2hWZPW78L8TPtPjLacXspIdS7XX5b85goUkA==} @@ -9180,6 +9328,9 @@ packages: '@types/node@18.11.18': resolution: {integrity: sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==} + '@types/node@18.15.13': + resolution: {integrity: sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==} + '@types/node@20.14.14': resolution: {integrity: sha512-d64f00982fS9YoOgJkAMolK7MN8Iq3TDdVjchbYHdEmjth/DHowx82GnoA+tVUAN+7vxfYUgAzi+JXbKNd2SDQ==} @@ -9749,6 +9900,23 @@ packages: '@vue/shared@3.4.27': resolution: {integrity: sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA==} + '@wagmi/chains@1.0.0': + resolution: {integrity: sha512-eNbqRWyHbivcMNq5tbXJks4NaOzVLHnNQauHPeE/EDT9AlpqzcrMc+v2T1/2Iw8zN4zgqB86NCsxeJHJs7+xng==} + peerDependencies: + typescript: 5.5.4 + peerDependenciesMeta: + typescript: + optional: true + + '@wagmi/connectors@3.1.11': + resolution: {integrity: sha512-wzxp9f9PtSUFjDUP/QDjc1t7HON4D8wrVKsw35ejdO8hToDpx1gU9lwH/47Zo/1zExGezQc392sjoHSszYd7OA==} + peerDependencies: + typescript: 5.5.4 + viem: '>=0.3.35' + peerDependenciesMeta: + typescript: + optional: true + '@wagmi/connectors@5.1.10': resolution: {integrity: sha512-ybgKV09PIhgUgQ4atXTs2KOy4Hevd6f972SXfx6HTgsnFXlzxzN6o0aWjhavZOYjvx5tjuL3+8Mgqo0R7uP5Cg==} peerDependencies: @@ -9769,6 +9937,15 @@ packages: typescript: optional: true + '@wagmi/core@1.4.13': + resolution: {integrity: sha512-ytMCvXbBOgfDu9Qw67279wq/jNEe7EZLjLyekX7ROnvHRADqFr3lwZI6ih41UmtRZAmXAx8Ghyuqy154EjB5mQ==} + peerDependencies: + typescript: 5.5.4 + viem: '>=0.3.35' + peerDependenciesMeta: + typescript: + optional: true + '@wagmi/core@2.13.5': resolution: {integrity: sha512-lvX/hApJTSA/H2kOklokjIYiUpnT8CpBH80GeOiKxU0CGK1wNHTu20GRTCy0GF1t7jkNwPSG3m0SmnXmgYMmHw==} peerDependencies: @@ -9801,6 +9978,9 @@ packages: resolution: {integrity: sha512-qkhJeuQU2afQTZ02yMZE5SFc91Fo3hyFjFkpQglHudENNyiSG0oUKcIjky8X32xVSaumgTZSQUAzpXnCTWHzKQ==} engines: {node: '>=16'} + '@walletconnect/core@2.11.0': + resolution: {integrity: sha512-2Tjp5BCevI7dbmqo/OrCjX4tqgMqwJNQLlQAlphqPfvwlF9+tIu6pGcVbSN3U9zyXzWIZCeleqEaWUeSeET4Ew==} + '@walletconnect/core@2.14.0': resolution: {integrity: sha512-E/dgBM9q3judXnTfZQ5ILvDpeSdDpabBLsXtYXa3Nyc26cfNplfLJ2nXm9FgtTdhM1nZ7yx4+zDPiXawBRZl2g==} @@ -9808,9 +9988,18 @@ packages: resolution: {integrity: sha512-UlsnEMT5wwFvmxEjX8s4oju7R3zadxNbZgsFeHEsjh7uknY2zgmUe1Lfc5XU6zyPb1Jx7Nqpdx1KN485ee8ogw==} engines: {node: '>=18'} + '@walletconnect/crypto@1.0.3': + resolution: {integrity: sha512-+2jdORD7XQs76I2Odgr3wwrtyuLUXD/kprNVsjWRhhhdO9Mt6WqVzOPu0/t7OHSmgal8k7SoBQzUc5hu/8zL/g==} + + '@walletconnect/encoding@1.0.2': + resolution: {integrity: sha512-CrwSBrjqJ7rpGQcTL3kU+Ief+Bcuu9PH6JLOb+wM6NITX1GTxR/MfNwnQfhLKK6xpRAyj2/nM04OOH6wS8Imag==} + '@walletconnect/environment@1.0.1': resolution: {integrity: sha512-T426LLZtHj8e8rYnKfzsw1aG6+M0BT1ZxayMdv/p8yM0MU+eJDISqNY3/bccxRr4LrF9csq02Rhqt08Ibl0VRg==} + '@walletconnect/ethereum-provider@2.11.0': + resolution: {integrity: sha512-YrTeHVjuSuhlUw7SQ6xBJXDuJ6iAC+RwINm9nVhoKYJSHAy3EVSJZOofMKrnecL0iRMtD29nj57mxAInIBRuZA==} + '@walletconnect/ethereum-provider@2.14.0': resolution: {integrity: sha512-Cc2/DCn85VciA10BrsNWFM//3VC1D8yjwrjfUKjGndLPDz0YIdAxTgYZViIlMjE0lzQC/DMvPYEAnGfW0O1Bwg==} @@ -9820,15 +10009,24 @@ packages: '@walletconnect/events@1.0.1': resolution: {integrity: sha512-NPTqaoi0oPBVNuLv7qPaJazmGHs5JGyO8eEAk5VGKmJzDR7AHzD4k6ilox5kxk1iwiOnFopBOOMLs86Oa76HpQ==} + '@walletconnect/heartbeat@1.2.1': + resolution: {integrity: sha512-yVzws616xsDLJxuG/28FqtZ5rzrTA4gUjdEMTbWB5Y8V1XHRmqq4efAxCw5ie7WjbXFSUyBHaWlMR+2/CpQC5Q==} + '@walletconnect/heartbeat@1.2.2': resolution: {integrity: sha512-uASiRmC5MwhuRuf05vq4AT48Pq8RMi876zV8rr8cV969uTOzWdB/k+Lj5yI2PBtB1bGQisGen7MM1GcZlQTBXw==} '@walletconnect/jsonrpc-http-connection@1.0.8': resolution: {integrity: sha512-+B7cRuaxijLeFDJUq5hAzNyef3e3tBDIxyaCNmFtjwnod5AGis3RToNqzFU33vpVcxFhofkpE7Cx+5MYejbMGw==} + '@walletconnect/jsonrpc-provider@1.0.13': + resolution: {integrity: sha512-K73EpThqHnSR26gOyNEL+acEex3P7VWZe6KE12ZwKzAt2H4e5gldZHbjsu2QR9cLeJ8AXuO7kEMOIcRv1QEc7g==} + '@walletconnect/jsonrpc-provider@1.0.14': resolution: {integrity: sha512-rtsNY1XqHvWj0EtITNeuf8PHMvlCLiS3EjQL+WOkxEOA4KPxsohFnBDeyPYiNm4ZvkQdLnece36opYidmtbmow==} + '@walletconnect/jsonrpc-types@1.0.3': + resolution: {integrity: sha512-iIQ8hboBl3o5ufmJ8cuduGad0CQm3ZlsHtujv9Eu16xq89q+BG7Nh5VLxxUgmtpnrePgFkTwXirCTkwJH1v+Yw==} + '@walletconnect/jsonrpc-types@1.0.4': resolution: {integrity: sha512-P6679fG/M+wuWg9TY8mh6xFSdYnFyFjwFelxyISxMDrlbXokorEVXYOxiqEbrU3x1BmBoCAJJ+vtEaEoMlpCBQ==} @@ -9846,6 +10044,21 @@ packages: '@react-native-async-storage/async-storage': optional: true + '@walletconnect/legacy-client@2.0.0': + resolution: {integrity: sha512-v5L7rYk9loVnfvUf0mF+76bUPFaU5/Vh7mzL6/950CD/yoGdzYZ3Kj+L7mkC6HPMEGeQsBP1+sqBuiVGZ/aODA==} + + '@walletconnect/legacy-modal@2.0.0': + resolution: {integrity: sha512-jckNd8lMhm4X7dX9TDdxM3bXKJnaqkRs6K2Mo5j6GmbIF9Eyx40jZ5+q457RVxvM6ciZEDT5s1wBHWdWoOo+9Q==} + + '@walletconnect/legacy-provider@2.0.0': + resolution: {integrity: sha512-A8xPebMI1A+50HbWwTpFCbwP7G+1NGKdTKyg8BUUg3h3Y9JucpC1W6w/x0v1Xw7qFEqQnz74LoIN/A3ytH9xrQ==} + + '@walletconnect/legacy-types@2.0.0': + resolution: {integrity: sha512-sOVrA7HUdbI1OwKyPOQU0/DdvTSVFlsXWpAk2K2WvP2erTkBWPMTJq6cv2BmKdoJ3p6gLApT7sd+jHi3OF71uw==} + + '@walletconnect/legacy-utils@2.0.0': + resolution: {integrity: sha512-CPWxSVVXw0kgNCxvU126g4GiV3mzXmC8IPJ15twE46aJ1FX+RHEIfAzFMFz2F2+fEhBxL63A7dwNQKDXorRPcQ==} + '@walletconnect/logger@2.1.2': resolution: {integrity: sha512-aAb28I3S6pYXZHQm5ESB+V6rDqIYfsnHaQyzFbwUUBFY4H0OXx/YtTl8lvhUNhMMfb9UxbwEBS253TlXUYJWSw==} @@ -9858,6 +10071,9 @@ packages: '@walletconnect/modal@2.6.2': resolution: {integrity: sha512-eFopgKi8AjKf/0U4SemvcYw9zlLpx9njVN8sf6DAkowC2Md0gPU/UNEbH1Wwj407pEKnEds98pKWib1NN1ACoA==} + '@walletconnect/randombytes@1.0.3': + resolution: {integrity: sha512-35lpzxcHFbTN3ABefC9W+uBpNZl1GC4Wpx0ed30gibfO/y9oLdy1NznbV96HARQKSBV9J9M/rrtIvf6a23jfYw==} + '@walletconnect/relay-api@1.0.10': resolution: {integrity: sha512-tqrdd4zU9VBNqUaXXQASaexklv6A54yEyQQEXYOCr+Jz8Ket0dmPBDyg19LVSNUN2cipAghQc45/KVmfFJ0cYw==} @@ -9870,6 +10086,10 @@ packages: '@walletconnect/safe-json@1.0.2': resolution: {integrity: sha512-Ogb7I27kZ3LPC3ibn8ldyUr5544t3/STow9+lzz7Sfo808YD7SBWk7SAsdBFlYgP2zDRy2hS3sKRcuSRM0OTmA==} + '@walletconnect/sign-client@2.11.0': + resolution: {integrity: sha512-H2ukscibBS+6WrzQWh+WyVBqO5z4F5et12JcwobdwgHnJSlqIoZxqnUYYWNCI5rUR5UKsKWaUyto4AE9N5dw4Q==} + deprecated: Reliability and performance greatly improved - please see https://github.com/WalletConnect/walletconnect-monorepo/releases + '@walletconnect/sign-client@2.14.0': resolution: {integrity: sha512-UrB3S3eLjPYfBLCN3WJ5u7+WcZ8kFMe/QIDqLf76Jk6TaLwkSUy563LvnSw4KW/kA+/cY1KBSdUDfX1tzYJJXg==} @@ -9879,18 +10099,27 @@ packages: '@walletconnect/time@1.0.2': resolution: {integrity: sha512-uzdd9woDcJ1AaBZRhqy5rNC9laqWGErfc4dxA9a87mPdKOgWMD85mcFo9dIYIts/Jwocfwn07EC6EzclKubk/g==} + '@walletconnect/types@2.11.0': + resolution: {integrity: sha512-AB5b1lrEbCGHxqS2vqfCkIoODieH+ZAUp9rA1O2ftrhnqDJiJK983Df87JhYhECsQUBHHfALphA8ydER0q+9sw==} + '@walletconnect/types@2.14.0': resolution: {integrity: sha512-vevMi4jZLJ55vLuFOicQFmBBbLyb+S0sZS4IsaBdZkQflfGIq34HkN13c/KPl4Ye0aoR4/cUcUSitmGIzEQM5g==} '@walletconnect/types@2.16.1': resolution: {integrity: sha512-9P4RG4VoDEF+yBF/n2TF12gsvT/aTaeZTVDb/AOayafqiPnmrQZMKmNCJJjq1sfdsDcHXFcZWMGsuCeSJCmrXA==} + '@walletconnect/universal-provider@2.11.0': + resolution: {integrity: sha512-zgJv8jDvIMP4Qse/D9oIRXGdfoNqonsrjPZanQ/CHNe7oXGOBiQND2IIeX+tS0H7uNA0TPvctljCLiIN9nw4eA==} + '@walletconnect/universal-provider@2.14.0': resolution: {integrity: sha512-Mr8uoTmD6H0+Hh+3gxBu4l3T2uP/nNPR02sVtwEujNum++F727mMk+ifPRIpkVo21V/bvXFEy8sHTs5hqyq5iA==} '@walletconnect/universal-provider@2.16.1': resolution: {integrity: sha512-q/tyWUVNenizuClEiaekx9FZj/STU1F3wpDK4PUIh3xh+OmUI5fw2dY3MaNDjyb5AyrS0M8BuQDeuoSuOR/Q7w==} + '@walletconnect/utils@2.11.0': + resolution: {integrity: sha512-hxkHPlTlDQILHfIKXlmzgNJau/YcSBC3XHUSuZuKZbNEw3duFT6h6pm3HT/1+j1a22IG05WDsNBuTCRkwss+BQ==} + '@walletconnect/utils@2.14.0': resolution: {integrity: sha512-vRVomYQEtEAyCK2c5bzzEvtgxaGGITF8mWuIL+WYSAMyEJLY97mirP2urDucNwcUczwxUgI+no9RiNFbUHreQQ==} @@ -10004,6 +10233,15 @@ packages: resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + abitype@0.8.7: + resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} + peerDependencies: + typescript: 5.5.4 + zod: ^3 >=3.19.1 + peerDependenciesMeta: + zod: + optional: true + abitype@0.9.8: resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} peerDependencies: @@ -10126,6 +10364,9 @@ packages: aes-js@3.1.2: resolution: {integrity: sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==} + aes-js@4.0.0-beta.5: + resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} + agent-base@5.1.1: resolution: {integrity: sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==} engines: {node: '>= 6.0.0'} @@ -10954,6 +11195,10 @@ packages: big.js@6.2.1: resolution: {integrity: sha512-bCtHMwL9LeDIozFn+oNhhFoq+yQ3BNdnsLSASUxLciOb1vgvpHsIO1dsENiGMgbb4SkP5TrzWzRiLddn8ahVOQ==} + bigint-buffer@1.1.5: + resolution: {integrity: sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==} + engines: {node: '>= 10.0.0'} + bigint-crypto-utils@3.3.0: resolution: {integrity: sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==} engines: {node: '>=14.0.0'} @@ -11009,6 +11254,9 @@ packages: boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + borsh@0.7.0: + resolution: {integrity: sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==} + bottleneck@2.19.5: resolution: {integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==} @@ -13801,6 +14049,10 @@ packages: ethers@5.7.2: resolution: {integrity: sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==} + ethers@6.13.2: + resolution: {integrity: sha512-9VkriTTed+/27BGuY1s0hf441kqwHJ1wtN2edksEtiRvXx+soxRX3iSXTfFqq2+YwrOqbDoTHjIhQnjJRlzKmg==} + engines: {node: '>=14.0.0'} + ethjs-unit@0.1.6: resolution: {integrity: sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==} engines: {node: '>=6.5.0', npm: '>=3'} @@ -13819,6 +14071,9 @@ packages: eventemitter3@1.1.1: resolution: {integrity: sha512-idmH3G0vJjQv2a5N74b+oXcOUKYBqSGJGN1eVV6ELGdUnesAO8RZsU74eaS3VfldRet8N9pFupxppBUKztrBdQ==} + eventemitter3@3.1.2: + resolution: {integrity: sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==} + eventemitter3@4.0.4: resolution: {integrity: sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==} @@ -13968,6 +14223,9 @@ packages: fast-safe-stringify@2.1.1: resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + fast-stable-stringify@1.0.0: + resolution: {integrity: sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==} + fast-url-parser@1.1.3: resolution: {integrity: sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==} @@ -15183,6 +15441,9 @@ packages: resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + injectpromise@1.0.0: + resolution: {integrity: sha512-qNq5wy4qX4uWHcVFOEU+RqZkoVG65FhvGkyDWbuBxILMjK6A1LFf5A1mgXZkD4nRx5FCorD81X/XvPKp/zVfPA==} + inquirer@6.5.2: resolution: {integrity: sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==} engines: {node: '>=6.0.0'} @@ -15647,6 +15908,16 @@ packages: peerDependencies: ws: '*' + isomorphic-ws@5.0.0: + resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} + peerDependencies: + ws: '*' + + isows@1.0.3: + resolution: {integrity: sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==} + peerDependencies: + ws: '*' + isows@1.0.4: resolution: {integrity: sha512-hEzjY+x9u9hPmBom9IIAqdJCwNLax+xrPb51vEPpERoFlIxgmZcHzsT5jKG06nvInKOBGvReAVz80Umed5CczQ==} peerDependencies: @@ -15705,6 +15976,11 @@ packages: engines: {node: '>=8'} hasBin: true + jayson@4.1.2: + resolution: {integrity: sha512-5nzMWDHy6f+koZOuYsArh2AXs73NfWYVlFyJJuCedr93GpY+Ku8qq10ropSXVfHK+H0T6paA88ww+/dV+1fBNA==} + engines: {node: '>=8'} + hasBin: true + jest-changed-files@27.5.1: resolution: {integrity: sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -19015,10 +19291,18 @@ packages: resolution: {integrity: sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==} engines: {node: '>=0.10.0'} + query-string@6.14.1: + resolution: {integrity: sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw==} + engines: {node: '>=6'} + query-string@7.1.3: resolution: {integrity: sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==} engines: {node: '>=6'} + querystring-es3@0.2.1: + resolution: {integrity: sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==} + engines: {node: '>=0.4.x'} + querystring@0.2.0: resolution: {integrity: sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==} engines: {node: '>=0.4.x'} @@ -20080,6 +20364,9 @@ packages: rpc-websockets@7.11.0: resolution: {integrity: sha512-IkLYjayPv6Io8C/TdCL5gwgzd1hFz2vmBZrjMw/SPEXo51ETOhnzgS4Qy5GWi2JQN7HKHa66J3+2mv0fgNh/7w==} + rpc-websockets@9.0.2: + resolution: {integrity: sha512-YzggvfItxMY3Lwuax5rC18inhbjJv9Py7JXRHxTIi94JOLrqBsSsUUc5bbl5W6c11tXhdfpDPK0KzBhoGe8jjw==} + run-applescript@5.0.0: resolution: {integrity: sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==} engines: {node: '>=12'} @@ -20107,6 +20394,9 @@ packages: resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} engines: {npm: '>=2.0.0'} + rxjs@7.8.1: + resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} + sade@1.8.1: resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} engines: {node: '>=6'} @@ -21036,6 +21326,10 @@ packages: resolution: {integrity: sha512-8iTn3oSS8nRGn+C2pgXSKPI3jmpm6FExNazNpjvqS6ZUJQCej3PUXEKM8NjHBOs54ExM+LPW/FBRhymrdcCiSg==} engines: {node: '>=14.0.0'} + superstruct@2.0.2: + resolution: {integrity: sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==} + engines: {node: '>=14.0.0'} + supports-color@2.0.0: resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} engines: {node: '>=0.8.0'} @@ -21280,6 +21574,9 @@ packages: resolution: {integrity: sha512-afH1hO+SQ/VPlmaLUFj2636QMeDvPCeQMc/9RBMW0IfjNe9gFD9Ra3ShqYkB7py0do1ZcCna/9acHyzTJ+GcNA==} deprecated: testrpc has been renamed to ganache-cli, please use this package from now on. + text-encoding-utf-8@1.0.2: + resolution: {integrity: sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==} + text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} @@ -21464,6 +21761,9 @@ packages: resolution: {integrity: sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw==} engines: {node: '>=0.10.0'} + tronweb@5.3.2: + resolution: {integrity: sha512-iPcIjMCxb6H7FXMntAj47F3L+7jSideyQ7ZOvRj9MeZBh46SHevMrDDR57HzakUa/tT8VvlPFHtqFK4hzTLkXw==} + trough@2.1.0: resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} @@ -22205,6 +22505,10 @@ packages: validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + validator@13.12.0: + resolution: {integrity: sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==} + engines: {node: '>= 0.10'} + valtio@1.11.2: resolution: {integrity: sha512-1XfIxnUXzyswPAPXo1P3Pdx2mq/pIqZICkWN60Hby0d9Iqb+MEIpqgYVlbflvHdrp2YR/q3jyKWRPJJ100yxaw==} engines: {node: '>=12.20.0'} @@ -22248,6 +22552,17 @@ packages: vfile@5.3.7: resolution: {integrity: sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==} + viem@0.3.50: + resolution: {integrity: sha512-s+LxCYZTR9F/qPk1/n1YDVAX9vSeVz7GraqBZWGrDuenCJxo9ArCoIceJ6ksI0WwSeNzcZ0VVbD/kWRzTxkipw==} + + viem@1.21.4: + resolution: {integrity: sha512-BNVYdSaUjeS2zKQgPs+49e5JKocfo60Ib2yiXOWBT6LuVxY1I/6fFX3waEtpXvL1Xn4qu+BVitVtMh9lyThyhQ==} + peerDependencies: + typescript: 5.5.4 + peerDependenciesMeta: + typescript: + optional: true + viem@2.21.4: resolution: {integrity: sha512-4E61XWhErjuXh5ObEoosKSy4iMvYnkuQq9jGLW5Isod68dNrENnyNV0QlVpn0LB3qunJ4ZMFMhYdfTjETqe7cQ==} peerDependencies: @@ -22504,6 +22819,7 @@ packages: web3-provider-engine@14.2.1: resolution: {integrity: sha512-iSv31h2qXkr9vrL6UZDm4leZMc32SjWJFGOp/D92JXfcEboCqraZyuExDkpxKw8ziTufXieNM7LSXNHzszYdJw==} + deprecated: 'This package has been deprecated, see the README for details: https://github.com/MetaMask/web3-provider-engine' web3-providers-http@1.10.3: resolution: {integrity: sha512-6dAgsHR3MxJ0Qyu3QLFlQEelTapVfWNTu5F45FYh8t7Y03T1/o+YAkVxsbY5AdmD+y5bXG/XPJ4q8tjL6MgZHw==} @@ -22907,6 +23223,18 @@ packages: utf-8-validate: optional: true + ws@7.5.10: + resolution: {integrity: sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==} + engines: {node: '>=8.3.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + ws@7.5.9: resolution: {integrity: sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==} engines: {node: '>=8.3.0'} @@ -22931,6 +23259,30 @@ packages: utf-8-validate: optional: true + ws@8.12.0: + resolution: {integrity: sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + ws@8.13.0: + resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + ws@8.17.1: resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} engines: {node: '>=10.0.0'} @@ -23193,6 +23545,10 @@ snapshots: '@adraffy/ens-normalize@1.10.0': {} + '@adraffy/ens-normalize@1.10.1': {} + + '@adraffy/ens-normalize@1.9.0': {} + '@alloc/quick-lru@5.2.0': {} '@ampproject/remapping@2.2.1': @@ -25892,6 +26248,10 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 + '@babel/runtime@7.25.4': + dependencies: + regenerator-runtime: 0.14.1 + '@babel/template@7.22.15': dependencies: '@babel/code-frame': 7.22.13 @@ -25993,6 +26353,16 @@ snapshots: '@biomejs/cli-win32-x64@1.5.2': optional: true + '@bitget-wallet/web3-sdk@0.0.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@metamask/safe-event-emitter': 3.1.1 + '@solana/web3.js': 1.95.3(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) + eventemitter3: 5.0.1 + transitivePeerDependencies: + - bufferutil + - encoding + - utf-8-validate + '@blocto/aptos-wallet-adapter-plugin@0.2.9(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: '@aptos-labs/wallet-adapter-core': 2.6.0(aptos@1.21.0) @@ -27876,6 +28246,48 @@ snapshots: dependencies: axios: 1.6.8 + '@ledgerhq/devices@6.27.1': + dependencies: + '@ledgerhq/errors': 6.18.0 + '@ledgerhq/logs': 6.12.0 + rxjs: 6.6.7 + semver: 7.6.0 + + '@ledgerhq/devices@8.4.2': + dependencies: + '@ledgerhq/errors': 6.18.0 + '@ledgerhq/logs': 6.12.0 + rxjs: 7.8.1 + semver: 7.6.0 + + '@ledgerhq/errors@6.18.0': {} + + '@ledgerhq/hw-app-trx@6.29.2': + dependencies: + '@ledgerhq/hw-transport': 6.31.2 + + '@ledgerhq/hw-transport-webhid@6.27.1': + dependencies: + '@ledgerhq/devices': 6.27.1 + '@ledgerhq/errors': 6.18.0 + '@ledgerhq/hw-transport': 6.27.1 + '@ledgerhq/logs': 6.12.0 + + '@ledgerhq/hw-transport@6.27.1': + dependencies: + '@ledgerhq/devices': 6.27.1 + '@ledgerhq/errors': 6.18.0 + events: 3.3.0 + + '@ledgerhq/hw-transport@6.31.2': + dependencies: + '@ledgerhq/devices': 8.4.2 + '@ledgerhq/errors': 6.18.0 + '@ledgerhq/logs': 6.12.0 + events: 3.3.0 + + '@ledgerhq/logs@6.12.0': {} + '@leichtgewicht/ip-codec@2.0.5': {} '@lit-labs/react@1.2.1': {} @@ -28424,20 +28836,36 @@ snapshots: dependencies: eslint-scope: 5.1.1 + '@noble/curves@1.0.0': + dependencies: + '@noble/hashes': 1.3.0 + '@noble/curves@1.1.0': dependencies: '@noble/hashes': 1.3.1 + '@noble/curves@1.2.0': + dependencies: + '@noble/hashes': 1.3.2 + '@noble/curves@1.4.0': dependencies: '@noble/hashes': 1.4.0 + '@noble/curves@1.5.0': + dependencies: + '@noble/hashes': 1.4.0 + '@noble/hashes@1.1.3': {} '@noble/hashes@1.2.0': {} + '@noble/hashes@1.3.0': {} + '@noble/hashes@1.3.1': {} + '@noble/hashes@1.3.2': {} + '@noble/hashes@1.3.3': {} '@noble/hashes@1.4.0': {} @@ -30604,7 +31032,7 @@ snapshots: nocache: 3.0.4 pretty-format: 26.6.2 serve-static: 1.15.0 - ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - encoding @@ -30865,7 +31293,7 @@ snapshots: '@react-three/fiber@8.16.2(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.24.4)(@babel/preset-env@7.24.4(@babel/core@7.24.4))(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(three@0.163.0)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.25.4 '@types/react-reconciler': 0.26.7 '@types/webxr': 0.5.15 base64-js: 1.5.1 @@ -31010,6 +31438,17 @@ snapshots: - utf-8-validate - zod + '@safe-global/safe-apps-sdk@8.1.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8)': + dependencies: + '@safe-global/safe-gateway-typescript-sdk': 3.9.0(encoding@0.1.13) + viem: 1.21.4(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) + transitivePeerDependencies: + - bufferutil + - encoding + - typescript + - utf-8-validate + - zod + '@safe-global/safe-apps-sdk@9.1.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8)': dependencies: '@safe-global/safe-gateway-typescript-sdk': 3.9.0(encoding@0.1.13) @@ -31037,12 +31476,24 @@ snapshots: '@noble/secp256k1': 1.7.1 '@scure/base': 1.1.6 + '@scure/bip32@1.3.0': + dependencies: + '@noble/curves': 1.0.0 + '@noble/hashes': 1.3.3 + '@scure/base': 1.1.6 + '@scure/bip32@1.3.1': dependencies: '@noble/curves': 1.1.0 '@noble/hashes': 1.3.3 '@scure/base': 1.1.8 + '@scure/bip32@1.3.2': + dependencies: + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.3 + '@scure/base': 1.1.6 + '@scure/bip32@1.4.0': dependencies: '@noble/curves': 1.4.0 @@ -31059,6 +31510,11 @@ snapshots: '@noble/hashes': 1.2.0 '@scure/base': 1.1.6 + '@scure/bip39@1.2.0': + dependencies: + '@noble/hashes': 1.3.3 + '@scure/base': 1.1.6 + '@scure/bip39@1.2.1': dependencies: '@noble/hashes': 1.3.3 @@ -31839,6 +32295,32 @@ snapshots: '@socket.io/component-emitter@3.1.0': {} + '@solana/buffer-layout@4.0.1': + dependencies: + buffer: 6.0.3 + + '@solana/web3.js@1.95.3(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@babel/runtime': 7.25.4 + '@noble/curves': 1.5.0 + '@noble/hashes': 1.4.0 + '@solana/buffer-layout': 4.0.1 + agentkeepalive: 4.5.0 + bigint-buffer: 1.1.5 + bn.js: 5.2.1 + borsh: 0.7.0 + bs58: 4.0.1 + buffer: 6.0.3 + fast-stable-stringify: 1.0.0 + jayson: 4.1.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) + node-fetch: 2.7.0(encoding@0.1.13) + rpc-websockets: 9.0.2 + superstruct: 2.0.2 + transitivePeerDependencies: + - bufferutil + - encoding + - utf-8-validate + '@solidity-parser/parser@0.14.5': dependencies: antlr4ts: 0.5.0-alpha.4 @@ -33013,6 +33495,10 @@ snapshots: '@swc/counter@0.1.3': {} + '@swc/helpers@0.5.12': + dependencies: + tslib: 2.7.0 + '@swc/helpers@0.5.5': dependencies: '@swc/counter': 0.1.3 @@ -33126,6 +33612,146 @@ snapshots: '@tootallnate/quickjs-emscripten@0.23.0': {} + '@tronweb3/google-protobuf@3.21.2': {} + + '@tronweb3/tronwallet-abstract-adapter@1.1.6': + dependencies: + eventemitter3: 4.0.7 + + '@tronweb3/tronwallet-adapter-bitkeep@1.1.1(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@bitget-wallet/web3-sdk': 0.0.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@tronweb3/tronwallet-abstract-adapter': 1.1.6 + '@tronweb3/tronwallet-adapter-tronlink': 1.1.9 + transitivePeerDependencies: + - bufferutil + - encoding + - utf-8-validate + + '@tronweb3/tronwallet-adapter-ledger@1.1.8': + dependencies: + '@ledgerhq/hw-app-trx': 6.29.2 + '@ledgerhq/hw-transport': 6.27.1 + '@ledgerhq/hw-transport-webhid': 6.27.1 + '@tronweb3/tronwallet-abstract-adapter': 1.1.6 + buffer: 6.0.3 + eventemitter3: 4.0.7 + preact: 10.17.0 + + '@tronweb3/tronwallet-adapter-okxwallet@1.0.3': + dependencies: + '@tronweb3/tronwallet-abstract-adapter': 1.1.6 + '@tronweb3/tronwallet-adapter-tronlink': 1.1.9 + + '@tronweb3/tronwallet-adapter-react-hooks@1.1.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@tronweb3/tronwallet-abstract-adapter': 1.1.6 + '@tronweb3/tronwallet-adapter-tronlink': 1.1.9 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + + '@tronweb3/tronwallet-adapter-react-ui@1.1.8(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@tronweb3/tronwallet-abstract-adapter': 1.1.6 + '@tronweb3/tronwallet-adapter-react-hooks': 1.1.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + + '@tronweb3/tronwallet-adapter-tokenpocket@1.0.3': + dependencies: + '@tronweb3/tronwallet-abstract-adapter': 1.1.6 + '@tronweb3/tronwallet-adapter-tronlink': 1.1.9 + + '@tronweb3/tronwallet-adapter-tronlink@1.1.9': + dependencies: + '@tronweb3/tronwallet-abstract-adapter': 1.1.6 + + '@tronweb3/tronwallet-adapter-walletconnect@2.0.0(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8)': + dependencies: + '@tronweb3/tronwallet-abstract-adapter': 1.1.6 + '@tronweb3/walletconnect-tron': 3.0.0(@types/react@18.2.14)(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10) + '@wagmi/core': 1.4.13(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) + '@walletconnect/sign-client': 2.16.1(@upstash/redis@1.22.1)(bufferutil@4.0.8)(utf-8-validate@5.0.10) + '@walletconnect/types': 2.14.0(@upstash/redis@1.22.1) + viem: 0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/kv' + - bufferutil + - encoding + - immer + - react + - supports-color + - typescript + - utf-8-validate + - zod + + '@tronweb3/tronwallet-adapters@1.2.2(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8)': + dependencies: + '@tronweb3/tronwallet-adapter-bitkeep': 1.1.1(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@tronweb3/tronwallet-adapter-ledger': 1.1.8 + '@tronweb3/tronwallet-adapter-okxwallet': 1.0.3 + '@tronweb3/tronwallet-adapter-tokenpocket': 1.0.3 + '@tronweb3/tronwallet-adapter-tronlink': 1.1.9 + '@tronweb3/tronwallet-adapter-walletconnect': 2.0.0(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/kv' + - bufferutil + - encoding + - immer + - react + - supports-color + - typescript + - utf-8-validate + - zod + + '@tronweb3/walletconnect-tron@3.0.0(@types/react@18.2.14)(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)': + dependencies: + '@walletconnect/modal': 2.6.2(@types/react@18.2.14)(react@18.2.0) + '@walletconnect/sign-client': 2.16.1(@upstash/redis@1.22.1)(bufferutil@4.0.8)(utf-8-validate@5.0.10) + '@walletconnect/utils': 2.14.0(@upstash/redis@1.22.1) + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/kv' + - bufferutil + - react + - supports-color + - utf-8-validate + '@tryghost/content-api@1.11.17': dependencies: axios: 1.6.8 @@ -33691,6 +34317,8 @@ snapshots: '@types/node@18.11.18': {} + '@types/node@18.15.13': {} + '@types/node@20.14.14': dependencies: undici-types: 5.26.5 @@ -34530,6 +35158,45 @@ snapshots: '@vue/shared@3.4.27': {} + '@wagmi/chains@1.0.0(typescript@5.5.4)': + optionalDependencies: + typescript: 5.5.4 + + '@wagmi/connectors@3.1.11(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8)': + dependencies: + '@coinbase/wallet-sdk': 3.9.3 + '@safe-global/safe-apps-provider': 0.18.3(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) + '@safe-global/safe-apps-sdk': 8.1.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) + '@walletconnect/ethereum-provider': 2.11.0(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10) + '@walletconnect/legacy-provider': 2.0.0(encoding@0.1.13) + '@walletconnect/modal': 2.6.2(@types/react@18.2.14)(react@18.2.0) + '@walletconnect/utils': 2.11.0 + abitype: 0.8.7(typescript@5.5.4)(zod@3.23.8) + eventemitter3: 4.0.7 + viem: 0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/kv' + - bufferutil + - encoding + - react + - supports-color + - utf-8-validate + - zod + '@wagmi/connectors@5.1.10(@types/react@18.2.14)(@upstash/redis@1.22.1)(@wagmi/core@2.13.5(@tanstack/query-core@5.51.16)(@types/react@18.2.14)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(viem@2.21.4(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8)))(bufferutil@4.0.8)(encoding@0.1.13)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.24.4)(@babel/preset-env@7.24.4(@babel/core@7.24.4))(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@2.21.4(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8)': dependencies: '@coinbase/wallet-sdk': 4.0.4 @@ -34678,6 +35345,37 @@ snapshots: - utf-8-validate - zod + '@wagmi/core@1.4.13(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8)': + dependencies: + '@wagmi/connectors': 3.1.11(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) + abitype: 0.8.7(typescript@5.5.4)(zod@3.23.8) + eventemitter3: 4.0.7 + viem: 0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) + zustand: 4.4.1(@types/react@18.2.14)(immer@9.0.21)(react@18.2.0) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/kv' + - bufferutil + - encoding + - immer + - react + - supports-color + - utf-8-validate + - zod + '@wagmi/core@2.13.5(@tanstack/query-core@5.51.16)(@types/react@18.2.14)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(viem@2.21.4(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))': dependencies: eventemitter3: 5.0.1 @@ -34727,6 +35425,43 @@ snapshots: dependencies: '@wallet-standard/base': 1.0.1 + '@walletconnect/core@2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@walletconnect/heartbeat': 1.2.1 + '@walletconnect/jsonrpc-provider': 1.0.13 + '@walletconnect/jsonrpc-types': 1.0.3 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/jsonrpc-ws-connection': 1.0.14(bufferutil@4.0.8)(utf-8-validate@5.0.10) + '@walletconnect/keyvaluestorage': 1.1.1(@upstash/redis@1.22.1) + '@walletconnect/logger': 2.1.2(patch_hash=rvv5xppc7nrkuugnnppsvoyepa) + '@walletconnect/relay-api': 1.0.10 + '@walletconnect/relay-auth': 1.0.4 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.11.0 + '@walletconnect/utils': 2.11.0 + events: 3.3.0 + isomorphic-unfetch: 3.1.0(encoding@0.1.13) + lodash.isequal: 4.5.0 + uint8arrays: 3.1.1 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/kv' + - bufferutil + - encoding + - supports-color + - utf-8-validate + '@walletconnect/core@2.14.0(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/heartbeat': 1.2.2 @@ -34799,10 +35534,57 @@ snapshots: - supports-color - utf-8-validate + '@walletconnect/crypto@1.0.3': + dependencies: + '@walletconnect/encoding': 1.0.2 + '@walletconnect/environment': 1.0.1 + '@walletconnect/randombytes': 1.0.3 + aes-js: 3.1.2 + hash.js: 1.1.7 + tslib: 1.14.1 + + '@walletconnect/encoding@1.0.2': + dependencies: + is-typedarray: 1.0.0 + tslib: 1.14.1 + typedarray-to-buffer: 3.1.5 + '@walletconnect/environment@1.0.1': dependencies: tslib: 1.14.1 + '@walletconnect/ethereum-provider@2.11.0(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10)': + dependencies: + '@walletconnect/jsonrpc-http-connection': 1.0.8(encoding@0.1.13) + '@walletconnect/jsonrpc-provider': 1.0.14 + '@walletconnect/jsonrpc-types': 1.0.4 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/modal': 2.6.2(@types/react@18.2.14)(react@18.2.0) + '@walletconnect/sign-client': 2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@walletconnect/types': 2.11.0 + '@walletconnect/universal-provider': 2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@walletconnect/utils': 2.11.0 + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/kv' + - bufferutil + - encoding + - react + - supports-color + - utf-8-validate + '@walletconnect/ethereum-provider@2.14.0(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.8(encoding@0.1.13) @@ -34872,6 +35654,12 @@ snapshots: keyvaluestorage-interface: 1.0.0 tslib: 1.14.1 + '@walletconnect/heartbeat@1.2.1': + dependencies: + '@walletconnect/events': 1.0.1 + '@walletconnect/time': 1.0.2 + tslib: 1.14.1 + '@walletconnect/heartbeat@1.2.2': dependencies: '@walletconnect/events': 1.0.1 @@ -34887,12 +35675,23 @@ snapshots: transitivePeerDependencies: - encoding + '@walletconnect/jsonrpc-provider@1.0.13': + dependencies: + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/safe-json': 1.0.2 + tslib: 1.14.1 + '@walletconnect/jsonrpc-provider@1.0.14': dependencies: '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/safe-json': 1.0.2 events: 3.3.0 + '@walletconnect/jsonrpc-types@1.0.3': + dependencies: + keyvaluestorage-interface: 1.0.0 + tslib: 1.14.1 + '@walletconnect/jsonrpc-types@1.0.4': dependencies: events: 3.3.0 @@ -34933,6 +35732,53 @@ snapshots: - '@vercel/kv' - supports-color + '@walletconnect/legacy-client@2.0.0': + dependencies: + '@walletconnect/crypto': 1.0.3 + '@walletconnect/encoding': 1.0.2 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/legacy-types': 2.0.0 + '@walletconnect/legacy-utils': 2.0.0 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/window-getters': 1.0.1 + '@walletconnect/window-metadata': 1.0.1 + detect-browser: 5.3.0 + query-string: 6.14.1 + + '@walletconnect/legacy-modal@2.0.0': + dependencies: + '@walletconnect/legacy-types': 2.0.0 + '@walletconnect/legacy-utils': 2.0.0 + copy-to-clipboard: 3.3.3 + preact: 10.17.0 + qrcode: 1.5.3 + + '@walletconnect/legacy-provider@2.0.0(encoding@0.1.13)': + dependencies: + '@walletconnect/jsonrpc-http-connection': 1.0.8(encoding@0.1.13) + '@walletconnect/jsonrpc-provider': 1.0.14 + '@walletconnect/legacy-client': 2.0.0 + '@walletconnect/legacy-modal': 2.0.0 + '@walletconnect/legacy-types': 2.0.0 + '@walletconnect/legacy-utils': 2.0.0 + transitivePeerDependencies: + - encoding + + '@walletconnect/legacy-types@2.0.0': + dependencies: + '@walletconnect/jsonrpc-types': 1.0.4 + + '@walletconnect/legacy-utils@2.0.0': + dependencies: + '@walletconnect/encoding': 1.0.2 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/legacy-types': 2.0.0 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/window-getters': 1.0.1 + '@walletconnect/window-metadata': 1.0.1 + detect-browser: 5.3.0 + query-string: 6.14.1 + '@walletconnect/logger@2.1.2(patch_hash=rvv5xppc7nrkuugnnppsvoyepa)': dependencies: '@walletconnect/safe-json': 1.0.2 @@ -34963,6 +35809,13 @@ snapshots: - '@types/react' - react + '@walletconnect/randombytes@1.0.3': + dependencies: + '@walletconnect/encoding': 1.0.2 + '@walletconnect/environment': 1.0.1 + randombytes: 2.1.0 + tslib: 1.14.1 + '@walletconnect/relay-api@1.0.10': dependencies: '@walletconnect/jsonrpc-types': 1.0.4 @@ -34984,6 +35837,35 @@ snapshots: dependencies: tslib: 1.14.1 + '@walletconnect/sign-client@2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@walletconnect/core': 2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@walletconnect/events': 1.0.1 + '@walletconnect/heartbeat': 1.2.1 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/logger': 2.1.2(patch_hash=rvv5xppc7nrkuugnnppsvoyepa) + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.11.0 + '@walletconnect/utils': 2.11.0 + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/kv' + - bufferutil + - encoding + - supports-color + - utf-8-validate + '@walletconnect/sign-client@2.14.0(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/core': 2.14.0(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) @@ -35045,6 +35927,29 @@ snapshots: dependencies: tslib: 1.14.1 + '@walletconnect/types@2.11.0': + dependencies: + '@walletconnect/events': 1.0.1 + '@walletconnect/heartbeat': 1.2.1 + '@walletconnect/jsonrpc-types': 1.0.3 + '@walletconnect/keyvaluestorage': 1.1.1(@upstash/redis@1.22.1) + '@walletconnect/logger': 2.1.2(patch_hash=rvv5xppc7nrkuugnnppsvoyepa) + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/kv' + - supports-color + '@walletconnect/types@2.14.0(@upstash/redis@1.22.1)': dependencies: '@walletconnect/events': 1.0.1 @@ -35091,6 +35996,35 @@ snapshots: - '@vercel/kv' - supports-color + '@walletconnect/universal-provider@2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@walletconnect/jsonrpc-http-connection': 1.0.8(encoding@0.1.13) + '@walletconnect/jsonrpc-provider': 1.0.13 + '@walletconnect/jsonrpc-types': 1.0.4 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/logger': 2.1.2(patch_hash=rvv5xppc7nrkuugnnppsvoyepa) + '@walletconnect/sign-client': 2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@walletconnect/types': 2.11.0 + '@walletconnect/utils': 2.11.0 + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/kv' + - bufferutil + - encoding + - supports-color + - utf-8-validate + '@walletconnect/universal-provider@2.14.0(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.8(encoding@0.1.13) @@ -35149,6 +36083,37 @@ snapshots: - supports-color - utf-8-validate + '@walletconnect/utils@2.11.0': + dependencies: + '@stablelib/chacha20poly1305': 1.0.1 + '@stablelib/hkdf': 1.0.1 + '@stablelib/random': 1.0.2 + '@stablelib/sha256': 1.0.1 + '@stablelib/x25519': 1.0.3 + '@walletconnect/relay-api': 1.0.10 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.11.0 + '@walletconnect/window-getters': 1.0.1 + '@walletconnect/window-metadata': 1.0.1 + detect-browser: 5.3.0 + query-string: 7.1.3 + uint8arrays: 3.1.1 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/kv' + - supports-color + '@walletconnect/utils@2.14.0(@upstash/redis@1.22.1)': dependencies: '@stablelib/chacha20poly1305': 1.0.1 @@ -35357,6 +36322,12 @@ snapshots: abbrev@2.0.0: {} + abitype@0.8.7(typescript@5.5.4)(zod@3.23.8): + dependencies: + typescript: 5.5.4 + optionalDependencies: + zod: 3.23.8 + abitype@0.9.8(typescript@5.5.4)(zod@3.23.8): optionalDependencies: typescript: 5.5.4 @@ -35468,8 +36439,9 @@ snapshots: aes-js@3.0.0: {} - aes-js@3.1.2: - optional: true + aes-js@3.1.2: {} + + aes-js@4.0.0-beta.5: {} agent-base@5.1.1: {} @@ -36902,6 +37874,10 @@ snapshots: big.js@6.2.1: {} + bigint-buffer@1.1.5: + dependencies: + bindings: 1.5.0 + bigint-crypto-utils@3.3.0: {} bignumber.js@9.1.1: {} @@ -36984,6 +37960,12 @@ snapshots: boolbase@1.0.0: {} + borsh@0.7.0: + dependencies: + bn.js: 5.2.1 + bs58: 4.0.1 + text-encoding-utf-8: 1.0.2 + bottleneck@2.19.5: {} bowser@2.11.0: {} @@ -40693,6 +41675,19 @@ snapshots: - bufferutil - utf-8-validate + ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10): + dependencies: + '@adraffy/ens-normalize': 1.10.1 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@types/node': 18.15.13 + aes-js: 4.0.0-beta.5 + tslib: 2.4.0 + ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + ethjs-unit@0.1.6: dependencies: bn.js: 4.11.6 @@ -40709,6 +41704,8 @@ snapshots: eventemitter3@1.1.1: {} + eventemitter3@3.1.2: {} + eventemitter3@4.0.4: {} eventemitter3@4.0.7: {} @@ -40928,6 +41925,8 @@ snapshots: fast-safe-stringify@2.1.1: {} + fast-stable-stringify@1.0.0: {} + fast-url-parser@1.1.3: dependencies: punycode: 1.4.1 @@ -42505,6 +43504,8 @@ snapshots: ini@4.1.1: {} + injectpromise@1.0.0: {} + inquirer@6.5.2: dependencies: ansi-escapes: 3.2.0 @@ -42905,10 +43906,22 @@ snapshots: dependencies: ws: 5.2.3(bufferutil@4.0.8)(utf-8-validate@5.0.10) + isomorphic-ws@4.0.1(ws@7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10)): + dependencies: + ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) + isomorphic-ws@4.0.1(ws@7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10)): dependencies: ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) + isomorphic-ws@5.0.0(ws@8.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)): + dependencies: + ws: 8.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + + isows@1.0.3(ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)): + dependencies: + ws: 8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + isows@1.0.4(ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)): dependencies: ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -43011,6 +44024,24 @@ snapshots: - bufferutil - utf-8-validate + jayson@4.1.2(bufferutil@4.0.8)(utf-8-validate@5.0.10): + dependencies: + '@types/connect': 3.4.36 + '@types/node': 12.20.55 + '@types/ws': 7.4.7 + JSONStream: 1.3.5 + commander: 2.20.3 + delay: 5.0.0 + es6-promisify: 5.0.0 + eyes: 0.1.8 + isomorphic-ws: 4.0.1(ws@7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + json-stringify-safe: 5.0.1 + uuid: 8.3.2 + ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + jest-changed-files@27.5.1: dependencies: '@jest/types': 27.5.1 @@ -44964,7 +45995,7 @@ snapshots: metro-runtime@0.80.8: dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.25.4 metro-source-map@0.80.8: dependencies: @@ -45063,7 +46094,7 @@ snapshots: source-map: 0.5.7 strip-ansi: 6.0.1 throat: 5.0.0 - ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) yargs: 17.7.2 transitivePeerDependencies: - bufferutil @@ -47495,6 +48526,13 @@ snapshots: object-assign: 4.1.1 strict-uri-encode: 1.1.0 + query-string@6.14.1: + dependencies: + decode-uri-component: 0.2.2 + filter-obj: 1.1.0 + split-on-first: 1.1.0 + strict-uri-encode: 2.0.0 + query-string@7.1.3: dependencies: decode-uri-component: 0.2.2 @@ -47502,6 +48540,8 @@ snapshots: split-on-first: 1.1.0 strict-uri-encode: 2.0.0 + querystring-es3@0.2.1: {} + querystring@0.2.0: {} querystringify@2.2.0: {} @@ -47962,7 +49002,7 @@ snapshots: react-devtools-core@4.28.5(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: shell-quote: 1.8.1 - ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -48898,6 +49938,19 @@ snapshots: bufferutil: 4.0.8 utf-8-validate: 5.0.10 + rpc-websockets@9.0.2: + dependencies: + '@swc/helpers': 0.5.12 + '@types/uuid': 8.3.4 + '@types/ws': 8.5.5 + buffer: 6.0.3 + eventemitter3: 5.0.1 + uuid: 8.3.2 + ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) + optionalDependencies: + bufferutil: 4.0.8 + utf-8-validate: 5.0.10 + run-applescript@5.0.0: dependencies: execa: 5.1.1 @@ -48922,6 +49975,10 @@ snapshots: dependencies: tslib: 1.14.1 + rxjs@7.8.1: + dependencies: + tslib: 2.7.0 + sade@1.8.1: dependencies: mri: 1.2.0 @@ -50067,6 +51124,8 @@ snapshots: superstruct@1.0.3: {} + superstruct@2.0.2: {} + supports-color@2.0.0: {} supports-color@3.2.3: @@ -50483,6 +51542,8 @@ snapshots: testrpc@0.0.1: {} + text-encoding-utf-8@1.0.2: {} + text-table@0.2.0: {} then-request@6.0.2: @@ -50653,6 +51714,26 @@ snapshots: trim-right@1.0.1: {} + tronweb@5.3.2(bufferutil@4.0.8)(utf-8-validate@5.0.10): + dependencies: + '@babel/runtime': 7.24.5 + '@ethersproject/abi': 5.7.0 + '@tronweb3/google-protobuf': 3.21.2 + axios: 1.6.8 + bignumber.js: 9.1.1 + ethereum-cryptography: 2.1.2 + ethers: 6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) + eventemitter3: 3.1.2 + injectpromise: 1.0.0 + lodash: 4.17.21 + querystring-es3: 0.2.1 + semver: 5.7.2 + validator: 13.12.0 + transitivePeerDependencies: + - bufferutil + - debug + - utf-8-validate + trough@2.1.0: {} try-require@1.2.1: {} @@ -51571,6 +52652,8 @@ snapshots: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 + validator@13.12.0: {} + valtio@1.11.2(@types/react@18.2.14)(react@18.2.0): dependencies: proxy-compare: 2.5.1 @@ -51642,6 +52725,40 @@ snapshots: unist-util-stringify-position: 3.0.3 vfile-message: 3.1.4 + viem@0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8): + dependencies: + '@adraffy/ens-normalize': 1.9.0 + '@noble/curves': 1.0.0 + '@noble/hashes': 1.3.0 + '@scure/bip32': 1.3.0 + '@scure/bip39': 1.2.0 + '@wagmi/chains': 1.0.0(typescript@5.5.4) + abitype: 0.8.7(typescript@5.5.4)(zod@3.23.8) + isomorphic-ws: 5.0.0(ws@8.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + ws: 8.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - typescript + - utf-8-validate + - zod + + viem@1.21.4(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8): + dependencies: + '@adraffy/ens-normalize': 1.10.0 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@scure/bip32': 1.3.2 + '@scure/bip39': 1.2.1 + abitype: 0.9.8(typescript@5.5.4)(zod@3.23.8) + isows: 1.0.3(ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + ws: 8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + viem@2.21.4(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8): dependencies: '@adraffy/ens-normalize': 1.10.0 @@ -52921,6 +54038,11 @@ snapshots: bufferutil: 4.0.8 utf-8-validate: 5.0.10 + ws@7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10): + optionalDependencies: + bufferutil: 4.0.8 + utf-8-validate: 5.0.10 + ws@7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10): optionalDependencies: bufferutil: 4.0.8 @@ -52931,6 +54053,16 @@ snapshots: bufferutil: 4.0.8 utf-8-validate: 5.0.10 + ws@8.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): + optionalDependencies: + bufferutil: 4.0.8 + utf-8-validate: 5.0.10 + + ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): + optionalDependencies: + bufferutil: 4.0.8 + utf-8-validate: 5.0.10 + ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10): optionalDependencies: bufferutil: 4.0.8 From 034bfa18db91aa5cd7179cea2b05e68d4bca4d2e Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Wed, 28 Aug 2024 23:00:31 +0000 Subject: [PATCH 02/46] chore: tron path reorg --- apps/tron/package.json | 1 + .../app/_common/constants/abis/factory-abi.ts | 83 +++ .../app/_common/constants/abis/pair-abi.ts | 435 ++++++++++++++ .../app/_common/constants/abis/router-abi.ts | 345 +++++++++++ .../app/_common/constants/abis/trc20-abi.ts | 222 +++++++ .../_common/constants/abis/tron-multicall.ts | 111 ++++ .../_common/constants/abis/wrapped-trx-abi.ts | 162 ++++++ .../src/app/_common/constants/contracts.ts | 11 + .../src/app/_common/constants/icon-size.ts | 1 + .../src/app/_common/constants/is-testnet.ts | 1 + .../src/app/_common/constants/max-uint256.ts | 2 + .../app/_common/constants/pair-decimals.ts | 1 + .../src/app/_common/constants/token-list.tsx | 116 ++++ .../_common/lib/bitquery/bitquery-endpoint.ts | 1 + .../_common/lib/bitquery/bitquery-headers.ts | 13 + .../_common/lib/bitquery/bitquery-options.ts | 11 + .../lib/bitquery/queries/getAllPools.ts | 9 + .../lib/bitquery/queries/getReserves.ts | 17 + .../lib/bitquery/queries/getTokenInfo.ts | 9 + .../bitquery/queries/getTransfersToPairs.ts | 20 + .../lib/bitquery/queries/getTronInUSDT.ts | 9 + .../src/app/_common/lib/hooks/useAllowance.ts | 63 ++ .../app/_common/lib/hooks/useAmountsOut.ts | 47 ++ .../app/_common/lib/hooks/useCustomTokens.ts | 99 ++++ .../app/_common/lib/hooks/useIsContract.ts | 21 + .../app/_common/lib/hooks/useMyPositions.ts | 242 ++++++++ .../app/_common/lib/hooks/useNativeBalance.ts | 19 + .../app/_common/lib/hooks/usePairContract.ts | 48 ++ .../_common/lib/hooks/usePoolOwnership.tsx | 41 ++ .../src/app/_common/lib/hooks/usePools.ts | 174 ++++++ .../app/_common/lib/hooks/usePriceImpact.ts | 72 +++ .../src/app/_common/lib/hooks/useReserves.ts | 62 ++ .../src/app/_common/lib/hooks/useRoutes.ts | 122 ++++ .../_common/lib/hooks/useSortedTokenList.ts | 49 ++ .../app/_common/lib/hooks/useStablePrice.ts | 231 ++++++++ .../app/_common/lib/hooks/useTokenBalance.ts | 40 ++ .../src/app/_common/lib/hooks/useTokenInfo.ts | 50 ++ .../app/_common/lib/hooks/useTotalSupply.ts | 36 ++ .../src/app/_common/lib/hooks/useTronWeb.ts | 21 + .../_common/lib/hooks/useWalletAdapters.ts | 20 + .../src/app/_common/lib/utils/formatters.ts | 134 +++++ .../_common/lib/utils/getAllPairAddresses.ts | 35 ++ .../src/app/_common/lib/utils/getTokenData.ts | 28 + .../src/app/_common/lib/utils/getTronPrice.ts | 18 + .../tron/src/app/_common/lib/utils/helpers.ts | 541 ++++++++++++++++++ .../_common/lib/utils/token-search-helpers.ts | 96 ++++ .../app/_common/lib/utils/tronscan-helpers.ts | 17 + .../_common/lib}/utils/warning-severity.ts | 32 +- .../providers/edge-config-provider.tsx | 0 .../providers/query-client-provider.tsx | 0 .../src/app/_common/types/get-pools-type.ts | 70 +++ .../src/app/_common/types/pricing-types.ts | 23 + .../app/_common/types/router-selector-type.ts | 19 + apps/tron/src/app/_common/types/token-type.ts | 34 ++ apps/tron/src/app/_common/types/tronweb.d.ts | 1 + apps/tron/src/app/_common/ui/General/Icon.tsx | 38 ++ .../tron/src/app/_common/ui/General/Title.tsx | 16 + .../_common/ui/General/TokenListSelect.tsx | 215 +++++++ apps/tron/src/app/_common/ui/Input/Search.tsx | 261 +++++++++ .../src/app/_common/ui/Input/TokenInput.tsx | 102 ++++ .../app/_common/ui/Pools/Add/AddButton.tsx | 191 +++++++ .../_common/ui/Pools/Add/AmountInToken0.tsx | 78 +++ .../_common/ui/Pools/Add/AmountIntToken1.tsx | 71 +++ .../app/_common/ui/Pools/Add/DepositForm.tsx | 24 + .../src/app/_common/ui/Pools/Add/Plus.tsx | 12 + .../src/app/_common/ui/Pools/Add/Rate.tsx | 72 +++ .../_common/ui/Pools/Add/ReviewAddDialog.tsx | 115 ++++ .../ui/Pools/Add/ReviewAddDialogTrigger.tsx | 166 ++++++ .../_common/ui/Pools/Add/SelectTokensForm.tsx | 45 ++ .../_common/ui}/Pools/BackButton.tsx | 0 .../_common/ui/Pools/Manage/AddSection.tsx | 54 ++ .../app/_common/ui/Pools/Manage/Manage.tsx | 62 ++ .../_common/ui/Pools/Manage/RemoveSection.tsx | 44 ++ .../ui/Pools/PoolDetails/LiquidityItem.tsx | 38 ++ .../ui/Pools/PoolDetails/PoolHeader.tsx | 81 +++ .../ui/Pools/PoolDetails/PoolLiquidity.tsx | 87 +++ .../ui/Pools/PoolPosition/PoolPosition.tsx | 180 ++++++ .../ui/Pools/PoolRewards/PoolRewards.tsx | 46 ++ .../app/_common/ui/Pools/PoolSearchBar.tsx | 42 ++ .../ui/Pools/PoolsTable/PoolAprCell.tsx | 5 + .../ui/Pools/PoolsTable/PoolColumns.tsx | 55 ++ .../ui/Pools/PoolsTable/PoolNameCell.tsx | 51 ++ .../ui/Pools/PoolsTable/PoolReservesCell.tsx | 30 + .../ui/Pools/PoolsTable/PoolTvlCell.tsx | 52 ++ .../ui/Pools/PoolsTable/PoolsTable.tsx | 77 +++ .../src/app/_common/ui/Pools/PoolsView.tsx | 101 ++++ .../Pools/PositionsTable/PositionColumns.tsx | 56 ++ .../Pools/PositionsTable/PositionNameCell.tsx | 34 ++ .../Pools/PositionsTable/PositionSizeCell.tsx | 18 + .../Pools/PositionsTable/PositionTvlCell.tsx | 39 ++ .../Pools/PositionsTable/PositionsTable.tsx | 92 +++ .../ui/Pools/Remove/MinimumReceive.tsx | 131 +++++ .../_common/ui/Pools/Remove/RemoveButton.tsx | 235 ++++++++ .../_common/ui/Pools/Remove/RemoveInput.tsx | 52 ++ .../ui/Pools/Remove/RemoveLiquidity.tsx | 14 + .../app/_common/ui/Pools/ReserveHelper.tsx | 45 ++ .../app/_common/ui/Shared/ApproveToken.tsx | 165 ++++++ .../_common/ui/Shared/DollarAmountDisplay.tsx | 36 ++ .../_common/ui/Shared/TokenBalanceDisplay.tsx | 51 ++ .../tron/src/app/_common/ui/Swap/AmountIn.tsx | 52 ++ .../src/app/_common/ui/Swap/AmountOut.tsx | 17 + .../app/_common/ui/Swap/ReviewSwapDialog.tsx | 168 ++++++ .../ui/Swap/ReviewSwapDialogTrigger.tsx | 197 +++++++ .../src/app/_common/ui/Swap/SwapButton.tsx | 244 ++++++++ .../app/_common/ui/Swap/SwapRoutesDialog.tsx | 51 ++ .../src/app/_common/ui/Swap/SwapStats.tsx | 150 +++++ .../_common/ui/Swap/SwitchSwapDirection.tsx | 20 + .../app/_common/ui/Swap/SwitchSwapType.tsx | 11 + .../ui/WalletConnector/DefaultView.tsx | 111 ++++ .../ui/WalletConnector/SettingsView.tsx | 66 +++ .../ui/WalletConnector/WalletConnector.tsx | 80 +++ .../ui/WalletConnector/WalletListView.tsx | 39 ++ .../src/app/api/pools/get-reserves/route.ts | 52 +- .../src/app/api/pools/my-positions/route.ts | 66 ++- apps/tron/src/app/api/pools/route.ts | 50 +- apps/tron/src/app/api/pricing/route.ts | 37 +- apps/tron/src/app/api/token-info/route.ts | 50 +- apps/tron/src/app/header.tsx | 2 +- apps/tron/src/app/layout.tsx | 109 ++-- apps/tron/src/app/pool/[poolId]/layout.tsx | 8 +- apps/tron/src/app/pool/[poolId]/page.tsx | 146 ++--- .../src/app/pool/[poolId]/remove-provider.tsx | 230 ++++---- apps/tron/src/app/pool/add/layout.tsx | 65 ++- apps/tron/src/app/pool/add/page.tsx | 16 +- apps/tron/src/app/pool/layout.tsx | 14 +- apps/tron/src/app/pool/page.tsx | 131 +++-- apps/tron/src/app/pool/pool-provider.tsx | 290 +++++----- apps/tron/src/app/providers.tsx | 4 +- apps/tron/src/app/swap/layout.tsx | 14 +- apps/tron/src/app/swap/page.tsx | 59 +- apps/tron/src/app/swap/providers.tsx | 6 +- apps/tron/src/app/swap/swap-provider.tsx | 230 ++++---- apps/tron/src/bitquery/bitquery-endpoint.ts | 1 - apps/tron/src/bitquery/bitquery-headers.ts | 13 - apps/tron/src/bitquery/bitquery-options.ts | 11 - apps/tron/src/bitquery/queries/getAllPools.ts | 9 - apps/tron/src/bitquery/queries/getReserves.ts | 15 - .../tron/src/bitquery/queries/getTokenInfo.ts | 9 - .../bitquery/queries/getTransfersToPairs.ts | 15 - .../src/bitquery/queries/getTronInUSDT.ts | 9 - apps/tron/src/components/General/Icon.tsx | 29 - apps/tron/src/components/General/IconList.tsx | 32 -- apps/tron/src/components/General/Title.tsx | 12 - .../components/General/TokenListSelect.tsx | 187 ------ apps/tron/src/components/Input/Search.tsx | 220 ------- apps/tron/src/components/Input/TokenInput.tsx | 92 --- .../src/components/Pools/Add/AddButton.tsx | 162 ------ .../components/Pools/Add/AmountInToken0.tsx | 52 -- .../components/Pools/Add/AmountIntToken1.tsx | 52 -- .../src/components/Pools/Add/DepositForm.tsx | 21 - apps/tron/src/components/Pools/Add/Plus.tsx | 9 - apps/tron/src/components/Pools/Add/Rate.tsx | 54 -- .../components/Pools/Add/ReviewAddDialog.tsx | 98 ---- .../Pools/Add/ReviewAddDialogTrigger.tsx | 135 ----- .../components/Pools/Add/SelectTokensForm.tsx | 34 -- .../components/Pools/Manage/AddSection.tsx | 41 -- .../src/components/Pools/Manage/Manage.tsx | 54 -- .../components/Pools/Manage/RemoveSection.tsx | 31 - .../Pools/PoolDetails/LiquidityItem.tsx | 35 -- .../Pools/PoolDetails/PoolHeader.tsx | 71 --- .../Pools/PoolDetails/PoolLiquidity.tsx | 74 --- .../Pools/PoolPosition/PoolPosition.tsx | 145 ----- .../Pools/PoolRewards/PoolRewards.tsx | 38 -- .../src/components/Pools/PoolSearchBar.tsx | 38 -- .../Pools/PoolsTable/PoolAprCell.tsx | 5 - .../Pools/PoolsTable/PoolColumns.tsx | 55 -- .../Pools/PoolsTable/PoolNameCell.tsx | 38 -- .../Pools/PoolsTable/PoolReservesCell.tsx | 28 - .../Pools/PoolsTable/PoolTvlCell.tsx | 39 -- .../Pools/PoolsTable/PoolsTable.tsx | 75 --- apps/tron/src/components/Pools/PoolsView.tsx | 83 --- .../Pools/PositionsTable/PositionColumns.tsx | 56 -- .../Pools/PositionsTable/PositionNameCell.tsx | 29 - .../Pools/PositionsTable/PositionSizeCell.tsx | 18 - .../Pools/PositionsTable/PositionTvlCell.tsx | 32 -- .../Pools/PositionsTable/PositionsTable.tsx | 83 --- .../Pools/Remove/MinimumReceive.tsx | 99 ---- .../components/Pools/Remove/RemoveButton.tsx | 195 ------- .../components/Pools/Remove/RemoveInput.tsx | 48 -- .../Pools/Remove/RemoveLiquidity.tsx | 14 - .../src/components/Pools/ReserveHelper.tsx | 34 -- .../src/components/Shared/ApproveToken.tsx | 151 ----- .../components/Shared/DollarAmountDisplay.tsx | 28 - .../components/Shared/TokenBalanceDisplay.tsx | 51 -- apps/tron/src/components/Swap/AmountIn.tsx | 40 -- apps/tron/src/components/Swap/AmountOut.tsx | 17 - .../src/components/Swap/ReviewSwapDialog.tsx | 141 ----- .../Swap/ReviewSwapDialogTrigger.tsx | 174 ------ apps/tron/src/components/Swap/SwapButton.tsx | 210 ------- .../src/components/Swap/SwapRoutesDialog.tsx | 49 -- apps/tron/src/components/Swap/SwapStats.tsx | 116 ---- .../components/Swap/SwitchSwapDirection.tsx | 19 - .../src/components/Swap/SwitchSwapType.tsx | 11 - .../WalletConnector/DefaultView.tsx | 90 --- .../WalletConnector/SettingsView.tsx | 65 --- .../WalletConnector/WalletConnector.tsx | 66 --- .../WalletConnector/WalletListView.tsx | 32 -- apps/tron/src/constants/abis/factory-abi.ts | 83 --- apps/tron/src/constants/abis/pair-abi.ts | 345 ----------- apps/tron/src/constants/abis/router-abi.ts | 335 ----------- apps/tron/src/constants/abis/trc20-abi.ts | 222 ------- .../tron/src/constants/abis/tron-multicall.ts | 109 ---- .../src/constants/abis/wrapped-trx-abi.ts | 162 ------ apps/tron/src/constants/contracts.ts | 5 - apps/tron/src/constants/icon-size.ts | 1 - apps/tron/src/constants/is-testnet.ts | 1 - apps/tron/src/constants/max-uint256.ts | 1 - apps/tron/src/constants/pair-decimals.ts | 1 - apps/tron/src/constants/token-list.tsx | 110 ---- apps/tron/src/hooks/useAllowance.ts | 61 -- apps/tron/src/hooks/useAmountsOut.ts | 37 -- apps/tron/src/hooks/useCustomTokens.ts | 86 --- apps/tron/src/hooks/useIsContract.ts | 19 - apps/tron/src/hooks/useMyPositions.ts | 206 ------- apps/tron/src/hooks/useNativeBalance.ts | 19 - apps/tron/src/hooks/usePairContract.ts | 37 -- apps/tron/src/hooks/usePoolOwnership.tsx | 28 - apps/tron/src/hooks/usePools.ts | 153 ----- apps/tron/src/hooks/usePriceImpact.ts | 65 --- apps/tron/src/hooks/useReserves.ts | 50 -- apps/tron/src/hooks/useRoutes.ts | 91 --- apps/tron/src/hooks/useSortedTokenList.ts | 28 - apps/tron/src/hooks/useStablePrice.ts | 191 ------- apps/tron/src/hooks/useTokenBalance.ts | 40 -- apps/tron/src/hooks/useTokenInfo.ts | 39 -- apps/tron/src/hooks/useTotalSupply.ts | 34 -- apps/tron/src/hooks/useTronWeb.ts | 19 - apps/tron/src/hooks/useWalletAdapters.ts | 17 - apps/tron/src/lib/getAllPairAddresses.ts | 30 - apps/tron/src/lib/getTokenData.ts | 21 - apps/tron/src/lib/getTronPrice.ts | 18 - apps/tron/src/tronweb.d.ts | 1 - apps/tron/src/types/get-pools-type.ts | 70 --- apps/tron/src/types/pricing-types.ts | 23 - apps/tron/src/types/router-selector-type.ts | 19 - apps/tron/src/types/token-type.ts | 34 -- apps/tron/src/utils/formatters.ts | 106 ---- apps/tron/src/utils/helpers.ts | 512 ----------------- apps/tron/src/utils/token-search-helpers.ts | 84 --- apps/tron/src/utils/tronscan-helpers.ts | 17 - apps/tron/tsconfig.json | 3 + apps/web/tsconfig.json | 3 +- pnpm-lock.yaml | 3 + 243 files changed, 9514 insertions(+), 8263 deletions(-) create mode 100644 apps/tron/src/app/_common/constants/abis/factory-abi.ts create mode 100644 apps/tron/src/app/_common/constants/abis/pair-abi.ts create mode 100644 apps/tron/src/app/_common/constants/abis/router-abi.ts create mode 100644 apps/tron/src/app/_common/constants/abis/trc20-abi.ts create mode 100644 apps/tron/src/app/_common/constants/abis/tron-multicall.ts create mode 100644 apps/tron/src/app/_common/constants/abis/wrapped-trx-abi.ts create mode 100644 apps/tron/src/app/_common/constants/contracts.ts create mode 100644 apps/tron/src/app/_common/constants/icon-size.ts create mode 100644 apps/tron/src/app/_common/constants/is-testnet.ts create mode 100644 apps/tron/src/app/_common/constants/max-uint256.ts create mode 100644 apps/tron/src/app/_common/constants/pair-decimals.ts create mode 100644 apps/tron/src/app/_common/constants/token-list.tsx create mode 100644 apps/tron/src/app/_common/lib/bitquery/bitquery-endpoint.ts create mode 100644 apps/tron/src/app/_common/lib/bitquery/bitquery-headers.ts create mode 100644 apps/tron/src/app/_common/lib/bitquery/bitquery-options.ts create mode 100644 apps/tron/src/app/_common/lib/bitquery/queries/getAllPools.ts create mode 100644 apps/tron/src/app/_common/lib/bitquery/queries/getReserves.ts create mode 100644 apps/tron/src/app/_common/lib/bitquery/queries/getTokenInfo.ts create mode 100644 apps/tron/src/app/_common/lib/bitquery/queries/getTransfersToPairs.ts create mode 100644 apps/tron/src/app/_common/lib/bitquery/queries/getTronInUSDT.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useAllowance.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useAmountsOut.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useCustomTokens.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useIsContract.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useMyPositions.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useNativeBalance.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/usePairContract.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/usePoolOwnership.tsx create mode 100644 apps/tron/src/app/_common/lib/hooks/usePools.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/usePriceImpact.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useReserves.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useRoutes.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useSortedTokenList.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useStablePrice.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useTokenBalance.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useTokenInfo.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useTotalSupply.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useTronWeb.ts create mode 100644 apps/tron/src/app/_common/lib/hooks/useWalletAdapters.ts create mode 100644 apps/tron/src/app/_common/lib/utils/formatters.ts create mode 100644 apps/tron/src/app/_common/lib/utils/getAllPairAddresses.ts create mode 100644 apps/tron/src/app/_common/lib/utils/getTokenData.ts create mode 100644 apps/tron/src/app/_common/lib/utils/getTronPrice.ts create mode 100644 apps/tron/src/app/_common/lib/utils/helpers.ts create mode 100644 apps/tron/src/app/_common/lib/utils/token-search-helpers.ts create mode 100644 apps/tron/src/app/_common/lib/utils/tronscan-helpers.ts rename apps/tron/src/{ => app/_common/lib}/utils/warning-severity.ts (50%) rename apps/tron/src/{ => app/_common}/providers/edge-config-provider.tsx (100%) rename apps/tron/src/{ => app/_common}/providers/query-client-provider.tsx (100%) create mode 100644 apps/tron/src/app/_common/types/get-pools-type.ts create mode 100644 apps/tron/src/app/_common/types/pricing-types.ts create mode 100644 apps/tron/src/app/_common/types/router-selector-type.ts create mode 100644 apps/tron/src/app/_common/types/token-type.ts create mode 100644 apps/tron/src/app/_common/types/tronweb.d.ts create mode 100644 apps/tron/src/app/_common/ui/General/Icon.tsx create mode 100644 apps/tron/src/app/_common/ui/General/Title.tsx create mode 100644 apps/tron/src/app/_common/ui/General/TokenListSelect.tsx create mode 100644 apps/tron/src/app/_common/ui/Input/Search.tsx create mode 100644 apps/tron/src/app/_common/ui/Input/TokenInput.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Add/AddButton.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Add/AmountInToken0.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Add/AmountIntToken1.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Add/DepositForm.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Add/Plus.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Add/Rate.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Add/ReviewAddDialog.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Add/SelectTokensForm.tsx rename apps/tron/src/{components => app/_common/ui}/Pools/BackButton.tsx (100%) create mode 100644 apps/tron/src/app/_common/ui/Pools/Manage/AddSection.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Manage/Manage.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Manage/RemoveSection.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PoolDetails/LiquidityItem.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PoolDetails/PoolHeader.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PoolPosition/PoolPosition.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PoolRewards/PoolRewards.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PoolSearchBar.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolAprCell.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolColumns.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolNameCell.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolReservesCell.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolTvlCell.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolsTable.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PoolsView.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionColumns.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionNameCell.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionSizeCell.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionTvlCell.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionsTable.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Remove/MinimumReceive.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Remove/RemoveButton.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Remove/RemoveInput.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/Remove/RemoveLiquidity.tsx create mode 100644 apps/tron/src/app/_common/ui/Pools/ReserveHelper.tsx create mode 100644 apps/tron/src/app/_common/ui/Shared/ApproveToken.tsx create mode 100644 apps/tron/src/app/_common/ui/Shared/DollarAmountDisplay.tsx create mode 100644 apps/tron/src/app/_common/ui/Shared/TokenBalanceDisplay.tsx create mode 100644 apps/tron/src/app/_common/ui/Swap/AmountIn.tsx create mode 100644 apps/tron/src/app/_common/ui/Swap/AmountOut.tsx create mode 100644 apps/tron/src/app/_common/ui/Swap/ReviewSwapDialog.tsx create mode 100644 apps/tron/src/app/_common/ui/Swap/ReviewSwapDialogTrigger.tsx create mode 100644 apps/tron/src/app/_common/ui/Swap/SwapButton.tsx create mode 100644 apps/tron/src/app/_common/ui/Swap/SwapRoutesDialog.tsx create mode 100644 apps/tron/src/app/_common/ui/Swap/SwapStats.tsx create mode 100644 apps/tron/src/app/_common/ui/Swap/SwitchSwapDirection.tsx create mode 100644 apps/tron/src/app/_common/ui/Swap/SwitchSwapType.tsx create mode 100644 apps/tron/src/app/_common/ui/WalletConnector/DefaultView.tsx create mode 100644 apps/tron/src/app/_common/ui/WalletConnector/SettingsView.tsx create mode 100644 apps/tron/src/app/_common/ui/WalletConnector/WalletConnector.tsx create mode 100644 apps/tron/src/app/_common/ui/WalletConnector/WalletListView.tsx delete mode 100644 apps/tron/src/bitquery/bitquery-endpoint.ts delete mode 100644 apps/tron/src/bitquery/bitquery-headers.ts delete mode 100644 apps/tron/src/bitquery/bitquery-options.ts delete mode 100644 apps/tron/src/bitquery/queries/getAllPools.ts delete mode 100644 apps/tron/src/bitquery/queries/getReserves.ts delete mode 100644 apps/tron/src/bitquery/queries/getTokenInfo.ts delete mode 100644 apps/tron/src/bitquery/queries/getTransfersToPairs.ts delete mode 100644 apps/tron/src/bitquery/queries/getTronInUSDT.ts delete mode 100644 apps/tron/src/components/General/Icon.tsx delete mode 100644 apps/tron/src/components/General/IconList.tsx delete mode 100644 apps/tron/src/components/General/Title.tsx delete mode 100644 apps/tron/src/components/General/TokenListSelect.tsx delete mode 100644 apps/tron/src/components/Input/Search.tsx delete mode 100644 apps/tron/src/components/Input/TokenInput.tsx delete mode 100644 apps/tron/src/components/Pools/Add/AddButton.tsx delete mode 100644 apps/tron/src/components/Pools/Add/AmountInToken0.tsx delete mode 100644 apps/tron/src/components/Pools/Add/AmountIntToken1.tsx delete mode 100644 apps/tron/src/components/Pools/Add/DepositForm.tsx delete mode 100644 apps/tron/src/components/Pools/Add/Plus.tsx delete mode 100644 apps/tron/src/components/Pools/Add/Rate.tsx delete mode 100644 apps/tron/src/components/Pools/Add/ReviewAddDialog.tsx delete mode 100644 apps/tron/src/components/Pools/Add/ReviewAddDialogTrigger.tsx delete mode 100644 apps/tron/src/components/Pools/Add/SelectTokensForm.tsx delete mode 100644 apps/tron/src/components/Pools/Manage/AddSection.tsx delete mode 100644 apps/tron/src/components/Pools/Manage/Manage.tsx delete mode 100644 apps/tron/src/components/Pools/Manage/RemoveSection.tsx delete mode 100644 apps/tron/src/components/Pools/PoolDetails/LiquidityItem.tsx delete mode 100644 apps/tron/src/components/Pools/PoolDetails/PoolHeader.tsx delete mode 100644 apps/tron/src/components/Pools/PoolDetails/PoolLiquidity.tsx delete mode 100644 apps/tron/src/components/Pools/PoolPosition/PoolPosition.tsx delete mode 100644 apps/tron/src/components/Pools/PoolRewards/PoolRewards.tsx delete mode 100644 apps/tron/src/components/Pools/PoolSearchBar.tsx delete mode 100644 apps/tron/src/components/Pools/PoolsTable/PoolAprCell.tsx delete mode 100644 apps/tron/src/components/Pools/PoolsTable/PoolColumns.tsx delete mode 100644 apps/tron/src/components/Pools/PoolsTable/PoolNameCell.tsx delete mode 100644 apps/tron/src/components/Pools/PoolsTable/PoolReservesCell.tsx delete mode 100644 apps/tron/src/components/Pools/PoolsTable/PoolTvlCell.tsx delete mode 100644 apps/tron/src/components/Pools/PoolsTable/PoolsTable.tsx delete mode 100644 apps/tron/src/components/Pools/PoolsView.tsx delete mode 100644 apps/tron/src/components/Pools/PositionsTable/PositionColumns.tsx delete mode 100644 apps/tron/src/components/Pools/PositionsTable/PositionNameCell.tsx delete mode 100644 apps/tron/src/components/Pools/PositionsTable/PositionSizeCell.tsx delete mode 100644 apps/tron/src/components/Pools/PositionsTable/PositionTvlCell.tsx delete mode 100644 apps/tron/src/components/Pools/PositionsTable/PositionsTable.tsx delete mode 100644 apps/tron/src/components/Pools/Remove/MinimumReceive.tsx delete mode 100644 apps/tron/src/components/Pools/Remove/RemoveButton.tsx delete mode 100644 apps/tron/src/components/Pools/Remove/RemoveInput.tsx delete mode 100644 apps/tron/src/components/Pools/Remove/RemoveLiquidity.tsx delete mode 100644 apps/tron/src/components/Pools/ReserveHelper.tsx delete mode 100644 apps/tron/src/components/Shared/ApproveToken.tsx delete mode 100644 apps/tron/src/components/Shared/DollarAmountDisplay.tsx delete mode 100644 apps/tron/src/components/Shared/TokenBalanceDisplay.tsx delete mode 100644 apps/tron/src/components/Swap/AmountIn.tsx delete mode 100644 apps/tron/src/components/Swap/AmountOut.tsx delete mode 100644 apps/tron/src/components/Swap/ReviewSwapDialog.tsx delete mode 100644 apps/tron/src/components/Swap/ReviewSwapDialogTrigger.tsx delete mode 100644 apps/tron/src/components/Swap/SwapButton.tsx delete mode 100644 apps/tron/src/components/Swap/SwapRoutesDialog.tsx delete mode 100644 apps/tron/src/components/Swap/SwapStats.tsx delete mode 100644 apps/tron/src/components/Swap/SwitchSwapDirection.tsx delete mode 100644 apps/tron/src/components/Swap/SwitchSwapType.tsx delete mode 100644 apps/tron/src/components/WalletConnector/DefaultView.tsx delete mode 100644 apps/tron/src/components/WalletConnector/SettingsView.tsx delete mode 100644 apps/tron/src/components/WalletConnector/WalletConnector.tsx delete mode 100644 apps/tron/src/components/WalletConnector/WalletListView.tsx delete mode 100644 apps/tron/src/constants/abis/factory-abi.ts delete mode 100644 apps/tron/src/constants/abis/pair-abi.ts delete mode 100644 apps/tron/src/constants/abis/router-abi.ts delete mode 100644 apps/tron/src/constants/abis/trc20-abi.ts delete mode 100644 apps/tron/src/constants/abis/tron-multicall.ts delete mode 100644 apps/tron/src/constants/abis/wrapped-trx-abi.ts delete mode 100644 apps/tron/src/constants/contracts.ts delete mode 100644 apps/tron/src/constants/icon-size.ts delete mode 100644 apps/tron/src/constants/is-testnet.ts delete mode 100644 apps/tron/src/constants/max-uint256.ts delete mode 100644 apps/tron/src/constants/pair-decimals.ts delete mode 100644 apps/tron/src/constants/token-list.tsx delete mode 100644 apps/tron/src/hooks/useAllowance.ts delete mode 100644 apps/tron/src/hooks/useAmountsOut.ts delete mode 100644 apps/tron/src/hooks/useCustomTokens.ts delete mode 100644 apps/tron/src/hooks/useIsContract.ts delete mode 100644 apps/tron/src/hooks/useMyPositions.ts delete mode 100644 apps/tron/src/hooks/useNativeBalance.ts delete mode 100644 apps/tron/src/hooks/usePairContract.ts delete mode 100644 apps/tron/src/hooks/usePoolOwnership.tsx delete mode 100644 apps/tron/src/hooks/usePools.ts delete mode 100644 apps/tron/src/hooks/usePriceImpact.ts delete mode 100644 apps/tron/src/hooks/useReserves.ts delete mode 100644 apps/tron/src/hooks/useRoutes.ts delete mode 100644 apps/tron/src/hooks/useSortedTokenList.ts delete mode 100644 apps/tron/src/hooks/useStablePrice.ts delete mode 100644 apps/tron/src/hooks/useTokenBalance.ts delete mode 100644 apps/tron/src/hooks/useTokenInfo.ts delete mode 100644 apps/tron/src/hooks/useTotalSupply.ts delete mode 100644 apps/tron/src/hooks/useTronWeb.ts delete mode 100644 apps/tron/src/hooks/useWalletAdapters.ts delete mode 100644 apps/tron/src/lib/getAllPairAddresses.ts delete mode 100644 apps/tron/src/lib/getTokenData.ts delete mode 100644 apps/tron/src/lib/getTronPrice.ts delete mode 100644 apps/tron/src/tronweb.d.ts delete mode 100644 apps/tron/src/types/get-pools-type.ts delete mode 100644 apps/tron/src/types/pricing-types.ts delete mode 100644 apps/tron/src/types/router-selector-type.ts delete mode 100644 apps/tron/src/types/token-type.ts delete mode 100644 apps/tron/src/utils/formatters.ts delete mode 100644 apps/tron/src/utils/helpers.ts delete mode 100644 apps/tron/src/utils/token-search-helpers.ts delete mode 100644 apps/tron/src/utils/tronscan-helpers.ts diff --git a/apps/tron/package.json b/apps/tron/package.json index 83be8a4f9b..a738b49cfc 100644 --- a/apps/tron/package.json +++ b/apps/tron/package.json @@ -21,6 +21,7 @@ "@sushiswap/react-query": "workspace:*", "@sushiswap/tailwindcss-config": "workspace:*", "@sushiswap/ui": "workspace:*", + "@sushiswap/notifications": "workspace:*", "@tanstack/react-query": "5.51.16", "@tanstack/react-query-devtools": "4.28.0", "@tanstack/react-query-persist-client": "4.28.0", diff --git a/apps/tron/src/app/_common/constants/abis/factory-abi.ts b/apps/tron/src/app/_common/constants/abis/factory-abi.ts new file mode 100644 index 0000000000..4e151d0aed --- /dev/null +++ b/apps/tron/src/app/_common/constants/abis/factory-abi.ts @@ -0,0 +1,83 @@ +export const FACTORY_ABI = [ + { + outputs: [{ type: 'address' }], + constant: true, + name: 'feeTo', + stateMutability: 'view', + type: 'function', + }, + { + outputs: [{ type: 'address' }], + constant: true, + name: 'feeToSetter', + stateMutability: 'view', + type: 'function', + }, + { + outputs: [{ type: 'address' }], + constant: true, + inputs: [{ type: 'uint256' }], + name: 'allPairs', + stateMutability: 'view', + type: 'function', + }, + { + outputs: [{ type: 'uint256' }], + constant: true, + name: 'allPairsLength', + stateMutability: 'view', + type: 'function', + }, + { + outputs: [{ type: 'bytes32' }], + constant: true, + name: 'getPairHash', + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ name: '_feeToSetter', type: 'address' }], + name: 'setFeeToSetter', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + outputs: [{ name: 'pair', type: 'address' }], + inputs: [ + { name: 'tokenA', type: 'address' }, + { name: 'tokenB', type: 'address' }, + ], + name: 'createPair', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + outputs: [{ type: 'address' }], + constant: true, + inputs: [{ type: 'address' }, { type: 'address' }], + name: 'getPair', + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ name: '_feeTo', type: 'address' }], + name: 'setFeeTo', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + inputs: [{ name: '_feeToSetter', type: 'address' }], + stateMutability: 'Nonpayable', + type: 'Constructor', + }, + { + inputs: [ + { indexed: true, name: 'token0', type: 'address' }, + { indexed: true, name: 'token1', type: 'address' }, + { name: 'pair', type: 'address' }, + { type: 'uint256' }, + ], + name: 'PairCreated', + type: 'Event', + }, +] diff --git a/apps/tron/src/app/_common/constants/abis/pair-abi.ts b/apps/tron/src/app/_common/constants/abis/pair-abi.ts new file mode 100644 index 0000000000..c0469a268f --- /dev/null +++ b/apps/tron/src/app/_common/constants/abis/pair-abi.ts @@ -0,0 +1,435 @@ +export const PAIR_ABI = [ + { + inputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1', + type: 'uint256', + }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + ], + name: 'Burn', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1', + type: 'uint256', + }, + ], + name: 'Mint', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0In', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1In', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0Out', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1Out', + type: 'uint256', + }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + ], + name: 'Swap', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint112', + name: 'reserve0', + type: 'uint112', + }, + { + indexed: false, + internalType: 'uint112', + name: 'reserve1', + type: 'uint112', + }, + ], + name: 'Sync', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'from', type: 'address' }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + constant: true, + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'MINIMUM_LIQUIDITY', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'PERMIT_TYPEHASH', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { internalType: 'address', name: '', type: 'address' }, + { internalType: 'address', name: '', type: 'address' }, + ], + name: 'allowance', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + ], + name: 'approve', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'balanceOf', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [{ internalType: 'address', name: 'to', type: 'address' }], + name: 'burn', + outputs: [ + { internalType: 'uint256', name: 'amount0', type: 'uint256' }, + { internalType: 'uint256', name: 'amount1', type: 'uint256' }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'decimals', + outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'factory', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'getReserves', + outputs: [ + { internalType: 'uint112', name: '_reserve0', type: 'uint112' }, + { internalType: 'uint112', name: '_reserve1', type: 'uint112' }, + { internalType: 'uint32', name: '_blockTimestampLast', type: 'uint32' }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { internalType: 'address', name: '_token0', type: 'address' }, + { internalType: 'address', name: '_token1', type: 'address' }, + ], + name: 'initialize', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'kLast', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [{ internalType: 'address', name: 'to', type: 'address' }], + name: 'mint', + outputs: [{ internalType: 'uint256', name: 'liquidity', type: 'uint256' }], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'name', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'nonces', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { internalType: 'address', name: 'owner', type: 'address' }, + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + { internalType: 'uint256', name: 'deadline', type: 'uint256' }, + { internalType: 'uint8', name: 'v', type: 'uint8' }, + { internalType: 'bytes32', name: 'r', type: 'bytes32' }, + { internalType: 'bytes32', name: 's', type: 'bytes32' }, + ], + name: 'permit', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'price0CumulativeLast', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'price1CumulativeLast', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [{ internalType: 'address', name: 'to', type: 'address' }], + name: 'skim', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { internalType: 'uint256', name: 'amount0Out', type: 'uint256' }, + { internalType: 'uint256', name: 'amount1Out', type: 'uint256' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'bytes', name: 'data', type: 'bytes' }, + ], + name: 'swap', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'symbol', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'sync', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'token0', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'token1', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'totalSupply', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + ], + name: 'transfer', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { internalType: 'address', name: 'from', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + ], + name: 'transferFrom', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, +] diff --git a/apps/tron/src/app/_common/constants/abis/router-abi.ts b/apps/tron/src/app/_common/constants/abis/router-abi.ts new file mode 100644 index 0000000000..437f0abf56 --- /dev/null +++ b/apps/tron/src/app/_common/constants/abis/router-abi.ts @@ -0,0 +1,345 @@ +export const ROUTER_ABI = [ + { + inputs: [ + { name: '_factory', type: 'address' }, + { name: '_WETH', type: 'address' }, + ], + stateMutability: 'Nonpayable', + type: 'Constructor', + }, + { + outputs: [{ type: 'address' }], + name: 'WETH', + stateMutability: 'View', + type: 'Function', + }, + { + outputs: [ + { name: 'amountA', type: 'uint256' }, + { name: 'amountB', type: 'uint256' }, + { name: 'liquidity', type: 'uint256' }, + ], + inputs: [ + { name: 'tokenA', type: 'address' }, + { name: 'tokenB', type: 'address' }, + { name: 'amountADesired', type: 'uint256' }, + { name: 'amountBDesired', type: 'uint256' }, + { name: 'amountAMin', type: 'uint256' }, + { name: 'amountBMin', type: 'uint256' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'addLiquidity', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + outputs: [ + { name: 'amountToken', type: 'uint256' }, + { name: 'amountETH', type: 'uint256' }, + { name: 'liquidity', type: 'uint256' }, + ], + inputs: [ + { name: 'token', type: 'address' }, + { name: 'amountTokenDesired', type: 'uint256' }, + { name: 'amountTokenMin', type: 'uint256' }, + { name: 'amountETHMin', type: 'uint256' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'addLiquidityETH', + stateMutability: 'Payable', + type: 'Function', + }, + { + outputs: [{ type: 'address' }], + name: 'factory', + stateMutability: 'View', + type: 'Function', + }, + { + outputs: [{ name: 'amountIn', type: 'uint256' }], + inputs: [ + { name: 'amountOut', type: 'uint256' }, + { name: 'reserveIn', type: 'uint256' }, + { name: 'reserveOut', type: 'uint256' }, + ], + name: 'getAmountIn', + stateMutability: 'Pure', + type: 'Function', + }, + { + outputs: [{ name: 'amountOut', type: 'uint256' }], + inputs: [ + { name: 'amountIn', type: 'uint256' }, + { name: 'reserveIn', type: 'uint256' }, + { name: 'reserveOut', type: 'uint256' }, + ], + name: 'getAmountOut', + stateMutability: 'Pure', + type: 'Function', + }, + { + outputs: [{ name: 'amounts', type: 'uint256[]' }], + inputs: [ + { name: 'amountOut', type: 'uint256' }, + { name: 'path', type: 'address[]' }, + ], + name: 'getAmountsIn', + stateMutability: 'View', + type: 'Function', + }, + { + outputs: [{ name: 'amounts', type: 'uint256[]' }], + inputs: [ + { name: 'amountIn', type: 'uint256' }, + { name: 'path', type: 'address[]' }, + ], + name: 'getAmountsOut', + stateMutability: 'View', + type: 'Function', + }, + { + outputs: [{ name: 'pair', type: 'address' }], + inputs: [ + { name: 'tokenA', type: 'address' }, + { name: 'tokenB', type: 'address' }, + ], + name: 'getPairOffChain', + stateMutability: 'View', + type: 'Function', + }, + { + outputs: [{ name: 'amountB', type: 'uint256' }], + inputs: [ + { name: 'amountA', type: 'uint256' }, + { name: 'reserveA', type: 'uint256' }, + { name: 'reserveB', type: 'uint256' }, + ], + name: 'quote', + stateMutability: 'Pure', + type: 'Function', + }, + { + outputs: [ + { name: 'amountA', type: 'uint256' }, + { name: 'amountB', type: 'uint256' }, + ], + inputs: [ + { name: 'tokenA', type: 'address' }, + { name: 'tokenB', type: 'address' }, + { name: 'liquidity', type: 'uint256' }, + { name: 'amountAMin', type: 'uint256' }, + { name: 'amountBMin', type: 'uint256' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'removeLiquidity', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + outputs: [ + { name: 'amountToken', type: 'uint256' }, + { name: 'amountETH', type: 'uint256' }, + ], + inputs: [ + { name: 'token', type: 'address' }, + { name: 'liquidity', type: 'uint256' }, + { name: 'amountTokenMin', type: 'uint256' }, + { name: 'amountETHMin', type: 'uint256' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'removeLiquidityETH', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + outputs: [{ name: 'amountETH', type: 'uint256' }], + inputs: [ + { name: 'token', type: 'address' }, + { name: 'liquidity', type: 'uint256' }, + { name: 'amountTokenMin', type: 'uint256' }, + { name: 'amountETHMin', type: 'uint256' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'removeLiquidityETHSupportingFeeOnTransferTokens', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + outputs: [ + { name: 'amountToken', type: 'uint256' }, + { name: 'amountETH', type: 'uint256' }, + ], + inputs: [ + { name: 'token', type: 'address' }, + { name: 'liquidity', type: 'uint256' }, + { name: 'amountTokenMin', type: 'uint256' }, + { name: 'amountETHMin', type: 'uint256' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + { name: 'approveMax', type: 'bool' }, + { name: 'v', type: 'uint8' }, + { name: 'r', type: 'bytes32' }, + { name: 's', type: 'bytes32' }, + ], + name: 'removeLiquidityETHWithPermit', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + outputs: [{ name: 'amountETH', type: 'uint256' }], + inputs: [ + { name: 'token', type: 'address' }, + { name: 'liquidity', type: 'uint256' }, + { name: 'amountTokenMin', type: 'uint256' }, + { name: 'amountETHMin', type: 'uint256' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + { name: 'approveMax', type: 'bool' }, + { name: 'v', type: 'uint8' }, + { name: 'r', type: 'bytes32' }, + { name: 's', type: 'bytes32' }, + ], + name: 'removeLiquidityETHWithPermitSupportingFeeOnTransferTokens', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + outputs: [ + { name: 'amountA', type: 'uint256' }, + { name: 'amountB', type: 'uint256' }, + ], + inputs: [ + { name: 'tokenA', type: 'address' }, + { name: 'tokenB', type: 'address' }, + { name: 'liquidity', type: 'uint256' }, + { name: 'amountAMin', type: 'uint256' }, + { name: 'amountBMin', type: 'uint256' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + { name: 'approveMax', type: 'bool' }, + { name: 'v', type: 'uint8' }, + { name: 'r', type: 'bytes32' }, + { name: 's', type: 'bytes32' }, + ], + name: 'removeLiquidityWithPermit', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + outputs: [{ name: 'amounts', type: 'uint256[]' }], + inputs: [ + { name: 'amountOut', type: 'uint256' }, + { name: 'path', type: 'address[]' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'swapETHForExactTokens', + stateMutability: 'Payable', + type: 'Function', + }, + { + outputs: [{ name: 'amounts', type: 'uint256[]' }], + inputs: [ + { name: 'amountOutMin', type: 'uint256' }, + { name: 'path', type: 'address[]' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'swapExactETHForTokens', + stateMutability: 'Payable', + type: 'Function', + }, + { + inputs: [ + { name: 'amountOutMin', type: 'uint256' }, + { name: 'path', type: 'address[]' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'swapExactETHForTokensSupportingFeeOnTransferTokens', + stateMutability: 'Payable', + type: 'Function', + }, + { + outputs: [{ name: 'amounts', type: 'uint256[]' }], + inputs: [ + { name: 'amountIn', type: 'uint256' }, + { name: 'amountOutMin', type: 'uint256' }, + { name: 'path', type: 'address[]' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'swapExactTokensForETH', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + inputs: [ + { name: 'amountIn', type: 'uint256' }, + { name: 'amountOutMin', type: 'uint256' }, + { name: 'path', type: 'address[]' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'swapExactTokensForETHSupportingFeeOnTransferTokens', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + outputs: [{ name: 'amounts', type: 'uint256[]' }], + inputs: [ + { name: 'amountIn', type: 'uint256' }, + { name: 'amountOutMin', type: 'uint256' }, + { name: 'path', type: 'address[]' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'swapExactTokensForTokens', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + inputs: [ + { name: 'amountIn', type: 'uint256' }, + { name: 'amountOutMin', type: 'uint256' }, + { name: 'path', type: 'address[]' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'swapExactTokensForTokensSupportingFeeOnTransferTokens', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + outputs: [{ name: 'amounts', type: 'uint256[]' }], + inputs: [ + { name: 'amountOut', type: 'uint256' }, + { name: 'amountInMax', type: 'uint256' }, + { name: 'path', type: 'address[]' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'swapTokensForExactETH', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { + outputs: [{ name: 'amounts', type: 'uint256[]' }], + inputs: [ + { name: 'amountOut', type: 'uint256' }, + { name: 'amountInMax', type: 'uint256' }, + { name: 'path', type: 'address[]' }, + { name: 'to', type: 'address' }, + { name: 'deadline', type: 'uint256' }, + ], + name: 'swapTokensForExactTokens', + stateMutability: 'Nonpayable', + type: 'Function', + }, + { stateMutability: 'Payable', type: 'Receive' }, +] diff --git a/apps/tron/src/app/_common/constants/abis/trc20-abi.ts b/apps/tron/src/app/_common/constants/abis/trc20-abi.ts new file mode 100644 index 0000000000..34fb5ce624 --- /dev/null +++ b/apps/tron/src/app/_common/constants/abis/trc20-abi.ts @@ -0,0 +1,222 @@ +export const TRC_20_ABI = [ + { + constant: true, + inputs: [], + name: 'name', + outputs: [ + { + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + name: '_spender', + type: 'address', + }, + { + name: '_value', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'totalSupply', + outputs: [ + { + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + name: '_from', + type: 'address', + }, + { + name: '_to', + type: 'address', + }, + { + name: '_value', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'decimals', + outputs: [ + { + name: '', + type: 'uint8', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + name: '_owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + name: 'balance', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'symbol', + outputs: [ + { + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + name: '_to', + type: 'address', + }, + { + name: '_value', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + name: '_owner', + type: 'address', + }, + { + name: '_spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + payable: true, + stateMutability: 'payable', + type: 'fallback', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: 'owner', + type: 'address', + }, + { + indexed: true, + name: 'spender', + type: 'address', + }, + { + indexed: false, + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: 'from', + type: 'address', + }, + { + indexed: true, + name: 'to', + type: 'address', + }, + { + indexed: false, + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, +] diff --git a/apps/tron/src/app/_common/constants/abis/tron-multicall.ts b/apps/tron/src/app/_common/constants/abis/tron-multicall.ts new file mode 100644 index 0000000000..0254fb411e --- /dev/null +++ b/apps/tron/src/app/_common/constants/abis/tron-multicall.ts @@ -0,0 +1,111 @@ +export const TRON_MULTICALL_ABI = [ + { + inputs: [ + { + components: [ + { internalType: 'address', name: 'target', type: 'address' }, + { internalType: 'bytes', name: 'callData', type: 'bytes' }, + ], + internalType: 'struct TronMulticall.Call[]', + name: 'calls', + type: 'tuple[]', + }, + ], + name: 'aggregate', + outputs: [ + { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, + { internalType: 'bytes[]', name: 'returnData', type: 'bytes[]' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getBasefee', + outputs: [{ internalType: 'uint256', name: 'basefee', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' }], + name: 'getBlockHash', + outputs: [{ internalType: 'bytes32', name: 'blockHash', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getBlockNumber', + outputs: [ + { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getChainId', + outputs: [{ internalType: 'uint256', name: 'chainid', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getCurrentBlockCoinbase', + outputs: [{ internalType: 'address', name: 'coinbase', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getCurrentBlockDifficulty', + outputs: [{ internalType: 'uint256', name: 'difficulty', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getCurrentBlockTimestamp', + outputs: [{ internalType: 'uint256', name: 'timestamp', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'addr', type: 'address' }], + name: 'getEthBalance', + outputs: [{ internalType: 'uint256', name: 'balance', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getLastBlockHash', + outputs: [{ internalType: 'bytes32', name: 'blockHash', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'accountAddress', type: 'address' }, + { internalType: 'trcToken', name: 'id', type: 'trcToken' }, + ], + name: 'getTokenBalance', + outputs: [{ internalType: 'uint256', name: 'balance', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'addr', type: 'address' }], + name: 'isContract', + outputs: [{ internalType: 'bool', name: 'result', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes[]', name: 'data', type: 'bytes[]' }], + name: 'multicall', + outputs: [{ internalType: 'bytes[]', name: 'results', type: 'bytes[]' }], + stateMutability: 'view', + type: 'function', + }, +] diff --git a/apps/tron/src/app/_common/constants/abis/wrapped-trx-abi.ts b/apps/tron/src/app/_common/constants/abis/wrapped-trx-abi.ts new file mode 100644 index 0000000000..34c3de242b --- /dev/null +++ b/apps/tron/src/app/_common/constants/abis/wrapped-trx-abi.ts @@ -0,0 +1,162 @@ +export const WRAPPED_TRX_ABI = [ + { + constant: true, + inputs: [], + name: 'name', + outputs: [{ name: '', type: 'string' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { name: 'guy', type: 'address' }, + { name: 'sad', type: 'uint256' }, + ], + name: 'approve', + outputs: [{ name: '', type: 'bool' }], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'totalSupply', + outputs: [{ name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { name: '~tron/_common', type: 'address' }, + { name: 'dst', type: 'address' }, + { name: 'sad', type: 'uint256' }, + ], + name: 'transferFrom', + outputs: [{ name: '', type: 'bool' }], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [{ name: 'sad', type: 'uint256' }], + name: 'withdraw', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'decimals', + outputs: [{ name: '', type: 'uint8' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [{ name: 'guy', type: 'address' }], + name: 'balanceOf', + outputs: [{ name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'symbol', + outputs: [{ name: '', type: 'string' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { name: 'dst', type: 'address' }, + { name: 'sad', type: 'uint256' }, + ], + name: 'transfer', + outputs: [{ name: '', type: 'bool' }], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'deposit', + outputs: [], + payable: true, + stateMutability: 'payable', + type: 'function', + }, + { + constant: false, + inputs: [{ name: 'guy', type: 'address' }], + name: 'approve', + outputs: [{ name: '', type: 'bool' }], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { name: '~tron/_common', type: 'address' }, + { name: 'guy', type: 'address' }, + ], + name: 'allowance', + outputs: [{ name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { payable: true, stateMutability: 'payable', type: 'fallback' }, + { + anonymous: false, + inputs: [ + { indexed: true, name: '~tron/_common', type: 'address' }, + { indexed: true, name: 'guy', type: 'address' }, + { indexed: false, name: 'sad', type: 'uint256' }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, name: '~tron/_common', type: 'address' }, + { indexed: true, name: 'dst', type: 'address' }, + { indexed: false, name: 'sad', type: 'uint256' }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, name: 'dst', type: 'address' }, + { indexed: false, name: 'sad', type: 'uint256' }, + ], + name: 'Deposit', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, name: '~tron/_common', type: 'address' }, + { indexed: false, name: 'sad', type: 'uint256' }, + ], + name: 'Withdrawal', + type: 'event', + }, +] diff --git a/apps/tron/src/app/_common/constants/contracts.ts b/apps/tron/src/app/_common/constants/contracts.ts new file mode 100644 index 0000000000..f5218bd3aa --- /dev/null +++ b/apps/tron/src/app/_common/constants/contracts.ts @@ -0,0 +1,11 @@ +import { IS_TESTNET } from './is-testnet' + +export const FACTORY_CONTRACT = IS_TESTNET + ? '' + : 'TKWJdrQkqHisa1X8HUdHEfREvTzw4pMAaY' //sun.io factory contract address +export const ROUTER_CONTRACT = IS_TESTNET + ? '' + : 'TKzxdSv2FZKQrEqkKVgp5DcwEXBEKMg2Ax' //sun.io router contract address +export const MULTICALL_CONTRACT = IS_TESTNET + ? '' + : 'TGXuuKAb4bnrn137u39EKbYzKNXvdCes98' diff --git a/apps/tron/src/app/_common/constants/icon-size.ts b/apps/tron/src/app/_common/constants/icon-size.ts new file mode 100644 index 0000000000..80c317d38a --- /dev/null +++ b/apps/tron/src/app/_common/constants/icon-size.ts @@ -0,0 +1 @@ +export const ICON_SIZE = 26 diff --git a/apps/tron/src/app/_common/constants/is-testnet.ts b/apps/tron/src/app/_common/constants/is-testnet.ts new file mode 100644 index 0000000000..3fb75bb139 --- /dev/null +++ b/apps/tron/src/app/_common/constants/is-testnet.ts @@ -0,0 +1 @@ +export const IS_TESTNET: boolean = false diff --git a/apps/tron/src/app/_common/constants/max-uint256.ts b/apps/tron/src/app/_common/constants/max-uint256.ts new file mode 100644 index 0000000000..0665fed5dc --- /dev/null +++ b/apps/tron/src/app/_common/constants/max-uint256.ts @@ -0,0 +1,2 @@ +export const MAX_UINT256 = + '0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' diff --git a/apps/tron/src/app/_common/constants/pair-decimals.ts b/apps/tron/src/app/_common/constants/pair-decimals.ts new file mode 100644 index 0000000000..f446a124f7 --- /dev/null +++ b/apps/tron/src/app/_common/constants/pair-decimals.ts @@ -0,0 +1 @@ +export const PAIR_DECIMALS = 18 diff --git a/apps/tron/src/app/_common/constants/token-list.tsx b/apps/tron/src/app/_common/constants/token-list.tsx new file mode 100644 index 0000000000..1d5b238097 --- /dev/null +++ b/apps/tron/src/app/_common/constants/token-list.tsx @@ -0,0 +1,116 @@ +import { IToken } from '~tron/_common/types/token-type' +import { IS_TESTNET } from './is-testnet' + +export const TRON: IToken = { + address: 'TRON', + decimals: 6, + logoURI: + 'https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415', + name: 'TRX (TRON)', + symbol: 'TRX', +} + +export const WTRX: IToken = { + address: 'TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR', + decimals: 6, + logoURI: + 'https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415', + name: 'Wrapped TRX', + symbol: 'WTRX', +} + +export const INTERMEDIATE_TOKEN = WTRX + +const MAINNET_TOKENS: IToken[] = [ + { + address: 'TRON', + decimals: 6, + logoURI: + 'https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415', + name: 'TRX (TRON)', + symbol: 'TRX', + }, + { + address: 'TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR', + decimals: 6, + logoURI: + 'https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415', + name: 'Wrapped TRX', + symbol: 'WTRX', + }, + { + address: 'TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4', + decimals: 18, + logoURI: + 'https://static.tronscan.org/production/logo/TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4.png', + name: 'TrueUSD', + symbol: 'TUSD', + }, + { + address: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t', + decimals: 6, + logoURI: 'https://static.tronscan.org/production/logo/usdtlogo.png', + name: 'Tether USD', + symbol: 'USDT', + }, + { + address: 'TPYmHEhy5n8TCEfYGqW2rPxsghSfzghPDn', + decimals: 18, + logoURI: + 'https://static.tronscan.org/production/upload/logo/TPYmHEhy5n8TCEfYGqW2rPxsghSfzghPDn.png', + name: 'Decentralized USD', + symbol: 'USDD', + }, +] + +const TESTNET_TOKENS: IToken[] = [ + { + address: 'TRON', + decimals: 6, + logoURI: + 'https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415', + name: 'TRX (TRON)', + symbol: 'TRX', + }, + { + address: 'TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR', //mainnet address currently + decimals: 6, + logoURI: + 'https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415', + name: 'Wrapped TRX', + symbol: 'WTRX', + }, + { + address: 'TSdZwNqpHofzP6BsBKGQUWdBeJphLmF6id', + decimals: 6, + logoURI: + 'https://static.tronscan.org/production/upload/logo/TEkxiTehnzSmSe2XqrBj4w32RUN966rdz81.png', + name: 'USDC Coin', + symbol: 'USDC', + }, +] + +export const DEFAULT_TOKEN_LIST = IS_TESTNET ? TESTNET_TOKENS : MAINNET_TOKENS + +export const DEFAULT_TOKEN_LIST_WITH_KEY = () => { + return DEFAULT_TOKEN_LIST.reduce>( + (acc, { address, decimals, name, symbol, logoURI }) => { + acc[address] = { + name, + decimals, + symbol, + address, + logoURI, + } + return acc + }, + {}, + ) +} + +export const STABLE_TOKENS = DEFAULT_TOKEN_LIST.filter( + (token) => + token.symbol === 'USDT' || + token.symbol === 'TUSD' || + token.symbol === 'USDD', +) diff --git a/apps/tron/src/app/_common/lib/bitquery/bitquery-endpoint.ts b/apps/tron/src/app/_common/lib/bitquery/bitquery-endpoint.ts new file mode 100644 index 0000000000..46a3aa055c --- /dev/null +++ b/apps/tron/src/app/_common/lib/bitquery/bitquery-endpoint.ts @@ -0,0 +1 @@ +export const BITQUERY_ENDPOINT = 'https://graphql.bitquery.io' diff --git a/apps/tron/src/app/_common/lib/bitquery/bitquery-headers.ts b/apps/tron/src/app/_common/lib/bitquery/bitquery-headers.ts new file mode 100644 index 0000000000..596a7b8fa4 --- /dev/null +++ b/apps/tron/src/app/_common/lib/bitquery/bitquery-headers.ts @@ -0,0 +1,13 @@ +export const getBitqueryHeaders = () => { + if (!process.env.BITQUERY_API_KEY) { + throw new Error('BITQUERY_API_KEY is not set') + } + if (!process.env.BITQUERY_BEARER_TOKEN) { + throw new Error('BITQUERY_BEARER_TOKEN is not set') + } + const headers = new Headers() + headers.append('Content-Type', 'application/json') + headers.append('X-API-KEY', process.env.BITQUERY_API_KEY) + headers.append('Authorization', `Bearer ${process.env.BITQUERY_BEARER_TOKEN}`) + return headers +} diff --git a/apps/tron/src/app/_common/lib/bitquery/bitquery-options.ts b/apps/tron/src/app/_common/lib/bitquery/bitquery-options.ts new file mode 100644 index 0000000000..f8234f96c5 --- /dev/null +++ b/apps/tron/src/app/_common/lib/bitquery/bitquery-options.ts @@ -0,0 +1,11 @@ +import { getBitqueryHeaders } from './bitquery-headers' + +export const getOptions = (query: string) => { + const headers = getBitqueryHeaders() + return { + method: 'POST', + headers, + body: query, + redirect: 'follow' as RequestRedirect, + } +} diff --git a/apps/tron/src/app/_common/lib/bitquery/queries/getAllPools.ts b/apps/tron/src/app/_common/lib/bitquery/queries/getAllPools.ts new file mode 100644 index 0000000000..1628185c0b --- /dev/null +++ b/apps/tron/src/app/_common/lib/bitquery/queries/getAllPools.ts @@ -0,0 +1,9 @@ +export const getAllPools = (factoryContract: string) => { + const query = JSON.stringify({ + query: + 'query ($factoryContract: String!) {\n tron {\n smartContractEvents(\n smartContractEvent: {is: "PairCreated"}\n smartContractAddress: {is: $factoryContract}\n options: {desc: "block.height"}\n ) {\n arguments {\n argument\n value\n }\n block {\n height\n }\n }\n }\n}\n', + variables: `{\n \"factoryContract\": \"${factoryContract}\"\n}`, + }) + + return query +} diff --git a/apps/tron/src/app/_common/lib/bitquery/queries/getReserves.ts b/apps/tron/src/app/_common/lib/bitquery/queries/getReserves.ts new file mode 100644 index 0000000000..4205ce2622 --- /dev/null +++ b/apps/tron/src/app/_common/lib/bitquery/queries/getReserves.ts @@ -0,0 +1,17 @@ +export const getReserves = (pairAddresses: string[]) => { + if (pairAddresses.length === 0 || pairAddresses.length > 100) { + throw new Error('Invalid pairAddresses length. Must be between 1 and 100.') + } + + const pairAddressesString = pairAddresses + .map((address) => `"${address}"`) + .join(', ') + + const query = JSON.stringify({ + query: + 'query ($pairAddresses: [String!]) {\n tron {\n smartContractEvents(\n smartContractEvent: {is: "Sync"}\n smartContractAddress: {in: $pairAddresses}\n options: {desc: "block.height", limitBy: {limit: 1, each: "smartContract.address.address"}}\n ) {\n arguments {\n argument\n value\n }\n block {\n height\n }\n smartContract {\n address {\n address\n }\n }\n }\n }\n}\n', + variables: `{\n \"pairAddresses\": [\n ${pairAddressesString}\n ]\n}`, + }) + + return query +} diff --git a/apps/tron/src/app/_common/lib/bitquery/queries/getTokenInfo.ts b/apps/tron/src/app/_common/lib/bitquery/queries/getTokenInfo.ts new file mode 100644 index 0000000000..40c5b0dce9 --- /dev/null +++ b/apps/tron/src/app/_common/lib/bitquery/queries/getTokenInfo.ts @@ -0,0 +1,9 @@ +export const getTokenInfo = (contractAddress: string) => { + const query = JSON.stringify({ + query: + 'query ($contractAddress: String!) {\n tron {\n address(address: {is: $contractAddress}) {\n smartContract {\n currency {\n decimals\n name\n symbol\n }\n }\n }\n }\n}', + variables: `{\n \"contractAddress\": \"${contractAddress}\"\n}`, + }) + + return query +} diff --git a/apps/tron/src/app/_common/lib/bitquery/queries/getTransfersToPairs.ts b/apps/tron/src/app/_common/lib/bitquery/queries/getTransfersToPairs.ts new file mode 100644 index 0000000000..03d250c808 --- /dev/null +++ b/apps/tron/src/app/_common/lib/bitquery/queries/getTransfersToPairs.ts @@ -0,0 +1,20 @@ +export const getTransfersToPairs = ( + pairAddresses: string[], + walletAddress: string, +) => { + if (pairAddresses.length === 0 || pairAddresses.length > 100) { + throw new Error('Invalid pairAddresses length. Must be between 1 and 100.') + } + + const pairAddressesString = pairAddresses + .map((address) => `"${address}"`) + .join(', ') + + const query = JSON.stringify({ + query: + 'query ($pairAddresses: [String!], $walletAddress: String!) {\n tron {\n transfers(\n sender: {is: $walletAddress}\n receiver: {in: $pairAddresses}\n ) {\n currency {\n address\n decimals\n name\n symbol\n }\n txHash\n receiver {\n address\n }\n }\n }\n}\n', + variables: `{\n \"walletAddress\": \"${walletAddress}\",\n \"pairAddresses\": [\n ${pairAddressesString}\n ]\n}`, + }) + + return query +} diff --git a/apps/tron/src/app/_common/lib/bitquery/queries/getTronInUSDT.ts b/apps/tron/src/app/_common/lib/bitquery/queries/getTronInUSDT.ts new file mode 100644 index 0000000000..eacaa7a4b9 --- /dev/null +++ b/apps/tron/src/app/_common/lib/bitquery/queries/getTronInUSDT.ts @@ -0,0 +1,9 @@ +export const getTronInUSDT = () => { + const query = JSON.stringify({ + query: + 'query GetTronInUSDT {\n tron {\n dexTrades(\n baseCurrency: {is: "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR"}\n quoteCurrency: {is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"}\n options: {limit: 1, desc: "block.timestamp.time"}\n ) {\n block {\n timestamp {\n time(format: "%Y-%m-%d %H:%M:%S")\n }\n }\n baseCurrency {\n address\n }\n quoteCurrency {\n address\n }\n quotePrice\n }\n }\n}\n', + variables: '{}', + }) + + return query +} diff --git a/apps/tron/src/app/_common/lib/hooks/useAllowance.ts b/apps/tron/src/app/_common/lib/hooks/useAllowance.ts new file mode 100644 index 0000000000..c10eec74d2 --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useAllowance.ts @@ -0,0 +1,63 @@ +import { useQuery } from '@tanstack/react-query' +import { MAX_UINT256 } from '~tron/_common/constants/max-uint256' +import { isAddress } from '~tron/_common/lib/utils/helpers' +import { useTronWeb } from './useTronWeb' + +const abi = [ + { + constant: true, + inputs: [ + { + name: '_owner', + type: 'address', + }, + { + name: '_spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] + +export const useAllowance = ({ + tokenAddress, + ownerAddress, + spenderAddress, +}: { + tokenAddress: string + ownerAddress: string + spenderAddress: string +}) => { + const { tronWeb } = useTronWeb() + + return useQuery({ + queryKey: ['useAllowance', { tokenAddress, ownerAddress, spenderAddress }], + queryFn: async () => { + if (tokenAddress === 'TRON') { + return MAX_UINT256 + } + tronWeb.setAddress(tokenAddress) + const tokenContract = await tronWeb.contract(abi, tokenAddress) + const allowance = await tokenContract + .allowance(ownerAddress, spenderAddress) + .call() + + return allowance?.toString() as string + }, + enabled: + (isAddress(tokenAddress) || tokenAddress === 'TRON') && + isAddress(ownerAddress) && + isAddress(spenderAddress) && + !!tronWeb, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/useAmountsOut.ts b/apps/tron/src/app/_common/lib/hooks/useAmountsOut.ts new file mode 100644 index 0000000000..d1a40fd4ba --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useAmountsOut.ts @@ -0,0 +1,47 @@ +import { useQuery } from '@tanstack/react-query' +import TronWeb from 'tronweb' +import { ROUTER_ABI } from '~tron/_common/constants/abis/router-abi' +import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' +import { + getIfWrapOrUnwrap, + getValidTokenAddress, +} from '~tron/_common/lib/utils/helpers' +import { useSwapState } from '~tron/swap/swap-provider' +import { useTronWeb } from './useTronWeb' + +export const useAmountsOut = ({ amountIn }: { amountIn: string }) => { + const { tronWeb } = useTronWeb() + const { route, token0, token1 } = useSwapState() + + return useQuery({ + queryKey: ['useAmountsOut', { route, amountIn }], + queryFn: async () => { + const swapType = getIfWrapOrUnwrap(token0, token1) + if (swapType === 'wrap' || swapType === 'unwrap') { + return [amountIn, amountIn] + } + if (!route) return [] + + const cleanedAddressRoute = route?.map((i) => getValidTokenAddress(i)) + if (!amountIn || isNaN(Number(amountIn))) return [] + try { + tronWeb.setAddress(ROUTER_CONTRACT) + const routerContract = await tronWeb.contract( + ROUTER_ABI, + ROUTER_CONTRACT, + ) + const amountsOuts = await routerContract + .getAmountsOut(amountIn, cleanedAddressRoute) + .call() + + return amountsOuts?.amounts?.map((i: typeof TronWeb.BigNumber) => + i.toString(), + ) as string[] + } catch (error) { + console.log('useAmountsOut error', error) + return [amountIn, ''] + } + }, + enabled: !!amountIn && !!tronWeb, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/useCustomTokens.ts b/apps/tron/src/app/_common/lib/hooks/useCustomTokens.ts new file mode 100644 index 0000000000..c2d9234b9d --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useCustomTokens.ts @@ -0,0 +1,99 @@ +import { useLocalStorage } from '@sushiswap/hooks' +import { useCallback, useMemo } from 'react' +import { IS_TESTNET } from '~tron/_common/constants/is-testnet' +import { isAddress } from '~tron/_common/lib/utils/helpers' +import { IToken } from '~tron/_common/types/token-type' + +const localStorageKey = IS_TESTNET + ? 'sushi.customTokens.shasta' + : 'sushi.customTokens.tron' + +export const useCustomTokens = () => { + const [value, setValue] = useLocalStorage>( + localStorageKey, + {}, + ) + + const hydrate = useCallback((data: Record) => { + return Object.entries(data).reduce>( + (acc, [k, { address, decimals, name, symbol }]) => { + acc[k] = { + address, + decimals, + name: String(name), + symbol: String(symbol), + } + return acc + }, + {}, + ) + }, []) + + const addCustomToken = useCallback( + (currencies: IToken[]) => { + const data: IToken[] = currencies.map((currency) => ({ + address: currency.address, + name: currency.name, + symbol: currency.symbol, + decimals: currency.decimals, + })) + + setValue((prev) => { + return data.reduce( + (acc, cur) => { + acc[`${cur.address}`] = cur + return acc + }, + { ...prev }, + ) + }) + }, + [setValue], + ) + + const removeCustomToken = useCallback( + (currency: IToken) => { + setValue((prev) => { + return Object.entries(prev).reduce>( + (acc, cur) => { + if (cur[0] === `${currency.address}`) { + return acc // filter + } + acc[cur[0]] = cur[1] // add + return acc + }, + {}, + ) + }) + }, + [setValue], + ) + + const hasToken = useCallback( + (currency: IToken): boolean => { + if (currency.address === 'TRON') return false + if (!isAddress(currency.address)) { + throw new Error('Invalid address') + } + + return !!value[currency.address] + }, + [value], + ) + + const addOrRemoveToken = useCallback( + (type: 'add' | 'remove', currency: IToken[]) => { + if (type === 'add') addCustomToken(currency) + if (type === 'remove') removeCustomToken(currency[0]) + }, + [addCustomToken, removeCustomToken], + ) + + return useMemo(() => { + return { + customTokens: hydrate(value), + addOrRemoveToken, + hasToken, + } + }, [hydrate, addOrRemoveToken, hasToken, value]) +} diff --git a/apps/tron/src/app/_common/lib/hooks/useIsContract.ts b/apps/tron/src/app/_common/lib/hooks/useIsContract.ts new file mode 100644 index 0000000000..c283dea0d8 --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useIsContract.ts @@ -0,0 +1,21 @@ +import { useQuery } from '@tanstack/react-query' +import { isContract } from '~tron/_common/lib/utils/helpers' +import { useTronWeb } from './useTronWeb' + +export const useIsContract = ({ + address, +}: { address: string | null | undefined }) => { + const { tronWeb } = useTronWeb() + + return useQuery({ + queryKey: ['useIsContract', { address }], + queryFn: async () => { + if (!address) return false + return await isContract(tronWeb, address) + }, + enabled: !!address && !!tronWeb, + refetchOnMount: false, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/useMyPositions.ts b/apps/tron/src/app/_common/lib/hooks/useMyPositions.ts new file mode 100644 index 0000000000..a4bdf81d2e --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useMyPositions.ts @@ -0,0 +1,242 @@ +import { useQuery } from '@tanstack/react-query' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { DEFAULT_TOKEN_LIST, TRON } from '~tron/_common/constants/token-list' +import { sortTokenAddresses } from '~tron/_common/lib/utils/formatters' +import { getAllPairAddresses } from '~tron/_common/lib/utils/getAllPairAddresses' +import { + chunk, + flatten, + getValidTokenAddress, + isAddress, +} from '~tron/_common/lib/utils/helpers' +import { IReserveDataResponse } from '~tron/_common/types/get-pools-type' +import { IToken } from '~tron/_common/types/token-type' + +type IPairDataResponse = { + data: { + tron: { + transfers: { + currency: { + address: string + decimals: number + name: string + symbol: string + } + txHash: string + receiver: { + address: string + } + }[] + } + } +} + +type _IPools = { + token0: IToken + token1: IToken + pairAddress: string + reserve0: string + reserve1: string +}[] + +const getPairContributions = async ({ + pairAddresses, + walletAddress, +}: { + pairAddresses: string[] + walletAddress: string +}) => { + try { + const res = await fetch( + `/api/pools/my-positions?pairAddresses=${pairAddresses}&walletAddress=${walletAddress}`, + { method: 'GET' }, + ) + if (!res.ok) { + throw new Error('Failed to fetch data from my-positions API') + } + const data: IPairDataResponse | undefined = await res.json() + + if (!data?.data?.tron.transfers) return [] + const groupedData = data?.data?.tron.transfers.reduce( + (acc, curr) => { + if (!acc[curr.txHash]) { + acc[curr.txHash] = [] + } + + acc[curr.txHash].push({ + currency: curr.currency, + receiver: curr.receiver.address, + }) + return acc + }, + {} as Record< + string, + { + currency: { + address: string + decimals: number + name: string + symbol: string + } + receiver: string + }[] + >, + ) + if (!groupedData) return [] + + const groupedDataArray = Object.entries(groupedData).map( + ([txHash, data]) => { + const [token0, token1] = sortTokenAddresses( + data?.[0]?.currency?.address ?? getValidTokenAddress(TRON.address), + data?.[1]?.currency?.address ?? getValidTokenAddress(TRON.address), + ) + const pairAddress = data?.[0]?.receiver as string + + //if token0 or token1 is equal to pairAddress, skip this pair + if (token0 === pairAddress || token1 === pairAddress) { + return + } + + const _token0: IToken = { + address: token0, + decimals: + data.find((i) => i?.currency?.address === token0)?.currency + ?.decimals ?? TRON.decimals, + name: + data.find((i) => i.currency.address === token0)?.currency.name ?? + TRON.name, + symbol: + data.find((i) => i.currency.address === token0)?.currency.symbol ?? + TRON.symbol, + logoURI: + DEFAULT_TOKEN_LIST.find( + (i) => + getValidTokenAddress(i.address) === + getValidTokenAddress(token0), + )?.logoURI ?? undefined, + } + const _token1: IToken = { + address: token1, + decimals: + data.find((i) => i.currency.address === token1)?.currency + .decimals ?? TRON.decimals, + name: + data.find((i) => i.currency.address === token1)?.currency.name ?? + TRON.name, + symbol: + data.find((i) => i.currency.address === token1)?.currency.symbol ?? + TRON.symbol, + logoURI: + DEFAULT_TOKEN_LIST.find( + (i) => + getValidTokenAddress(i.address) === + getValidTokenAddress(token1), + )?.logoURI ?? undefined, + } + return { + token0: _token0, + token1: _token1, + pairAddress: pairAddress, + reserve0: '0', + reserve1: '0', + } + }, + ) + // //filter out all objects that have duplicate pair addresses or are undefined + const filteredDataArray = groupedDataArray.filter( + (v, i, a) => + v && a.findIndex((t) => t?.pairAddress === v.pairAddress) === i, + ) + + return filteredDataArray + } catch (error) { + console.log(error) + return [] + } +} + +const injectReserves = async (pools: _IPools) => { + try { + const chunkedPools = chunk(pools, 100) + const poolsCopy = [...pools] + + for (const chunk of chunkedPools) { + const pairAddresses = chunk.map((pool) => pool.pairAddress) + const res = await fetch( + `/api/pools/get-reserves?pairAddresses=${pairAddresses}`, + { method: 'GET' }, + ) + if (!res.ok) { + throw new Error('Failed to fetch data from Tron API') + } + const data: IReserveDataResponse | undefined = await res.json() + if (!data) return [] + // find the reserves in the data and inject them into the pool object by pairAddress + + for (const pool of chunk) { + const reserveData = data?.data?.tron.smartContractEvents.find( + (event) => + event?.smartContract?.address?.address?.toLowerCase() === + pool?.pairAddress?.toLowerCase(), + ) + + if (reserveData) { + const reserve0 = + reserveData.arguments.find((arg) => arg.argument === 'reserve0') + ?.value ?? '0' + const reserve1 = + reserveData.arguments.find((arg) => arg.argument === 'reserve1') + ?.value ?? '0' + + const _pool = poolsCopy.find( + (p) => p.pairAddress === pool.pairAddress, + ) + if (_pool) { + _pool.reserve0 = reserve0 + _pool.reserve1 = reserve1 + } + } + } + } + return poolsCopy + } catch (error) { + console.log(error) + return [] + } +} + +export const useMyPositions = () => { + const { address } = useWallet() + return useQuery({ + queryKey: ['useMyPositions', { address: address }], + queryFn: async (data) => { + if (!address) return [] + if (!isAddress(address)) return [] + const allPairs = await getAllPairAddresses() + //split allPairs into chunks of 100 + const chunkedPairs = chunk(allPairs, 100) + //get pair contributions for each chunk + const _result = [] + for (const chunk of chunkedPairs) { + const _data = await getPairContributions({ + pairAddresses: chunk.map((pair) => pair.pairAddress), + walletAddress: address, + }) + _result.push(_data) + } + const pools = flatten(_result) + if (!pools || pools?.length === 0) { + return [] + } + console.log({ pools }) + const poolsWithReserves = await injectReserves(pools as _IPools) + + return poolsWithReserves + }, + + enabled: !!address, + refetchOnMount: false, + refetchOnWindowFocus: false, + refetchOnReconnect: false, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/useNativeBalance.ts b/apps/tron/src/app/_common/lib/hooks/useNativeBalance.ts new file mode 100644 index 0000000000..d2c2b5c720 --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useNativeBalance.ts @@ -0,0 +1,19 @@ +import { useQuery } from '@tanstack/react-query' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { useTronWeb } from './useTronWeb' + +export const useNativeBalance = () => { + const { address } = useWallet() + const { tronWeb } = useTronWeb() + return useQuery({ + queryKey: ['useNativeBalance'], + queryFn: async () => { + const balance = await tronWeb.trx.getUnconfirmedBalance(address) + const formattedBalance = tronWeb.fromSun(balance) + return { balance, formattedBalance } + }, + refetchOnMount: true, + refetchOnWindowFocus: true, + enabled: !!address && !!tronWeb, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/usePairContract.ts b/apps/tron/src/app/_common/lib/hooks/usePairContract.ts new file mode 100644 index 0000000000..ac2896c2e3 --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/usePairContract.ts @@ -0,0 +1,48 @@ +import { useQuery } from '@tanstack/react-query' +import { useMemo } from 'react' +import { FACTORY_ABI } from '~tron/_common/constants/abis/factory-abi' +import { FACTORY_CONTRACT } from '~tron/_common/constants/contracts' +import { sortTokenAddresses } from '~tron/_common/lib/utils/formatters' +import { + getBase58Address, + getValidTokenAddress, +} from '~tron/_common/lib/utils/helpers' +import { useTronWeb } from './useTronWeb' + +export const usePairContract = ({ + token0Address, + token1Address, +}: { + token0Address: string | undefined + token1Address: string | undefined +}) => { + const { tronWeb } = useTronWeb() + const [token0, token1] = useMemo(() => { + if (!token0Address || !token1Address) return [undefined, undefined] + return sortTokenAddresses( + getValidTokenAddress(token0Address), + getValidTokenAddress(token1Address), + ) + }, [token0Address, token1Address]) + return useQuery({ + queryKey: ['usePairContract', { token0Address, token1Address }], + queryFn: async () => { + if (!token0 || !token1 || !tronWeb) return null + if (token0 === token1) return null + tronWeb.setAddress(FACTORY_CONTRACT) + const factoryContract = await tronWeb.contract( + FACTORY_ABI, + FACTORY_CONTRACT, + ) + const pairAddress: string | undefined = await factoryContract + .getPair(token0, token1) + .call() + if (!pairAddress) return null + return getBase58Address(pairAddress) + }, + enabled: !!token0 && !!token1 && !!tronWeb, + refetchOnMount: false, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/usePoolOwnership.tsx b/apps/tron/src/app/_common/lib/hooks/usePoolOwnership.tsx new file mode 100644 index 0000000000..f9a14238e0 --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/usePoolOwnership.tsx @@ -0,0 +1,41 @@ +import { useQuery } from '@tanstack/react-query' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { PAIR_ABI } from '~tron/_common/constants/abis/pair-abi' +import { isAddress } from '../utils/helpers' +import { useTronWeb } from './useTronWeb' + +export const usePoolOwnership = ({ + pairAddress, +}: { pairAddress: string | undefined | null }) => { + const { tronWeb } = useTronWeb() + const { address } = useWallet() + + return useQuery({ + queryKey: ['usePoolOwnership', { pairAddress }], + queryFn: async () => { + if ( + !pairAddress || + !tronWeb || + !isAddress(pairAddress) || + !address || + !isAddress(address) + ) { + return { ownership: '0', ownedSupply: '0' } + } + tronWeb.setAddress(pairAddress) + const pairInstance = await tronWeb.contract(PAIR_ABI, pairAddress) + const totalSupply = await pairInstance.totalSupply().call() + const ownedSupply = await pairInstance.balanceOf(address).call() + + const ownership = (ownedSupply / totalSupply).toString() + + return { ownership, ownedSupply: ownedSupply.toString() } + }, + enabled: + !!address && + isAddress(address) && + !!pairAddress && + isAddress(pairAddress) && + !!tronWeb, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/usePools.ts b/apps/tron/src/app/_common/lib/hooks/usePools.ts new file mode 100644 index 0000000000..dafe846fdb --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/usePools.ts @@ -0,0 +1,174 @@ +import { keepPreviousData, useQuery } from '@tanstack/react-query' +import { FACTORY_CONTRACT } from '~tron/_common/constants/contracts' +import { chunk } from '~tron/_common/lib/utils/helpers' +import { + IPoolDataResponse, + IReserveDataResponse, +} from '~tron/_common/types/get-pools-type' +import { useTronWeb } from './useTronWeb' + +type _IPools = { + token0Address: string + token1Address: string + pairAddress: string + reserve0: string + reserve1: string +}[] + +const getPoolsByEvent = async ({ + factoryAddress, +}: { factoryAddress: string }): Promise<_IPools> => { + try { + const res = await fetch(`/api/pools?factoryAddress=${factoryAddress}`, { + method: 'GET', + }) + if (!res.ok) { + throw new Error('Failed to fetch data from Tron API') + } + const data: IPoolDataResponse | undefined = await res.json() + if (!data) return [] + + const cleanedData = data?.data?.tron.smartContractEvents.map((event) => { + const pairAddress = + event.arguments.find((arg) => arg.argument === 'pair')?.value ?? '' + const token0Address = + event.arguments.find((arg) => arg.argument === 'token0')?.value ?? '' + const token1Address = + event.arguments.find((arg) => arg.argument === 'token1')?.value ?? '' + + return { + pairAddress, + token0Address, + token1Address, + reserve0: '0', + reserve1: '0', + } + }) + + return cleanedData + } catch (error) { + console.log(error) + return [] + } +} + +const injectReserves = async (pools: _IPools) => { + try { + const chunkedPools = chunk(pools, 100) + const poolsCopy = [...pools] + + for (const chunk of chunkedPools) { + const pairAddresses = chunk.map((pool) => pool.pairAddress) + const res = await fetch( + `/api/pools/get-reserves?pairAddresses=${pairAddresses}`, + { method: 'GET' }, + ) + if (!res.ok) { + throw new Error('Failed to fetch data from Tron API') + } + const data: IReserveDataResponse | undefined = await res.json() + if (!data) return [] + // find the reserves in the data and inject them into the pool object by pairAddress + + for (const pool of chunk) { + const reserveData = data?.data?.tron.smartContractEvents.find( + (event) => + event.smartContract.address.address.toLowerCase() === + pool.pairAddress.toLowerCase(), + ) + + if (reserveData) { + const reserve0 = + reserveData.arguments.find((arg) => arg.argument === 'reserve0') + ?.value ?? '0' + const reserve1 = + reserveData.arguments.find((arg) => arg.argument === 'reserve1') + ?.value ?? '0' + + // Find the corresponding pool in the original array and update its reserve0 and reserve1 properties + const originalPool = poolsCopy.find( + (p) => p.pairAddress === pool.pairAddress, + ) + if (originalPool) { + originalPool.reserve0 = reserve0 + originalPool.reserve1 = reserve1 + } + } + } + } + + return poolsCopy + } catch (error) { + console.log(error) + return pools + } +} +export const usePools = () => { + const { tronWeb } = useTronWeb() + return useQuery({ + queryKey: ['usePools'], + staleTime: Infinity, //TODO: remove after testing + queryFn: async () => { + if (!tronWeb) return [] + const pools = await getPoolsByEvent({ factoryAddress: FACTORY_CONTRACT }) + const _pools = await injectReserves(pools) + + return _pools + }, + placeholderData: keepPreviousData, + enabled: !!tronWeb, + refetchOnMount: false, + refetchOnWindowFocus: false, + refetchOnReconnect: false, + }) +} + +// const multicallAddress = "TGXuuKAb4bnrn137u39EKbYzKNXvdCes98"; +// tronWeb.setAddress(multicallAddress); +// const multicall = await tronWeb.contract(TRON_MULTICALL_ABI, multicallAddress); + +// //loop through all the pools and get the reserves in chunks so the tron vm doesn't timeout +// //TODO: find way to optimize this so the user isnt waiting so long + +// const chunkSize = 20; +// const chunkedPools = chunk(_pools, chunkSize); + +// let chunkIndex = 0; + +// while (chunkIndex < chunkedPools.length) { +// try { +// const pools = chunkedPools[chunkIndex]; +// const calls = pools.map((pool) => { +// return [ +// pool.pairAddress, +// "0x0902f1ac", //getReserves encoded +// ]; +// }); + +// const _multicallReturn = await multicall.aggregate(calls).call(); +// const { returnData } = _multicallReturn; + +// for (let i = 0; i < returnData.length; i++) { +// const decoded = ethers.utils.defaultAbiCoder.decode( +// ["uint112", "uint112", "uint32"], +// returnData[i] +// ); +// const _reserve0 = decoded[0].toString(); +// const _reserve1 = decoded[1].toString(); + +// //add the reserves to the pool object with the pair address as the key +// const pool = _pools.find( +// (pool) => getBase58Address(pool.pairAddress) === getBase58Address(calls[i][0]) +// ); +// if (pool) { +// pool.reserve0 = _reserve0; +// pool.reserve1 = _reserve1; +// } +// } + +// chunkIndex++; // Move to the next chunk only if the current chunk was processed successfully +// } catch (error) { +// console.error(`Error processing chunk ${chunkIndex}: ${error}`); +// // If a CPU timeout error occurred, the while loop will retry processing the current chunk +// } +// } diff --git a/apps/tron/src/app/_common/lib/hooks/usePriceImpact.ts b/apps/tron/src/app/_common/lib/hooks/usePriceImpact.ts new file mode 100644 index 0000000000..27e5f14b56 --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/usePriceImpact.ts @@ -0,0 +1,72 @@ +import { useQuery } from '@tanstack/react-query' +import { parseUnits, toBigNumber } from '~tron/_common/lib/utils/formatters' +import { + getValidTokenAddress, + isAddress, +} from '~tron/_common/lib/utils/helpers' +import { IReserves, IToken } from '~tron/_common/types/token-type' +import { useTronWeb } from './useTronWeb' + +const calculatePriceImpact = ({ + initialReserve0, + initialReserve1, + tokenAmount0, +}: { + initialReserve0: any + initialReserve1: any + tokenAmount0: any +}): number => { + const k = initialReserve0.times(initialReserve1) // Constant product + const newReserveX = initialReserve0.plus(tokenAmount0) // Updated reserve of token X + const newReserveY = k.div(newReserveX) // Updated reserve of token Y using constant product formula + const receivedTokenY = initialReserve1.minus(newReserveY) // Amount of token Y received + const priceImpact = receivedTokenY.div(newReserveY).times(toBigNumber(100)) // Price impact percentage + return Number(priceImpact) +} +export const usePriceImpact = ({ + amount, + token, + reserves, +}: { + amount: string + token: IToken + reserves: IReserves[] | undefined +}) => { + const { tronWeb } = useTronWeb() + + return useQuery({ + queryKey: ['usePriceImpact', { reserves, token, amount }], + queryFn: async () => { + if (!reserves || !token || !amount) return 0 + + const reserve0 = reserves?.find( + (reserve) => + getValidTokenAddress(reserve.address as string) === + getValidTokenAddress(token.address), + ) + const reserve1 = reserves?.find( + (reserve) => + getValidTokenAddress(reserve.address as string) !== + getValidTokenAddress(token.address), + ) + if (!reserve0 || !reserve1) return 0 + + const priceImpactPercentage = calculatePriceImpact({ + initialReserve0: toBigNumber(reserve0.reserve ?? ''), + initialReserve1: toBigNumber(reserve1.reserve ?? ''), + tokenAmount0: toBigNumber(Number(parseUnits(amount, token.decimals))), + }) + + return priceImpactPercentage + }, + enabled: + !!amount && + !!token && + !!reserves?.[0]?.address && + !!reserves?.[1]?.address && + isAddress(getValidTokenAddress(token?.address)) && + isAddress(getValidTokenAddress(reserves?.[0]?.address)) && + isAddress(getValidTokenAddress(reserves?.[1]?.address)) && + !!tronWeb, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/useReserves.ts b/apps/tron/src/app/_common/lib/hooks/useReserves.ts new file mode 100644 index 0000000000..e13ab4c12a --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useReserves.ts @@ -0,0 +1,62 @@ +import { useQuery } from '@tanstack/react-query' +import { useMemo } from 'react' +import { PAIR_ABI } from '~tron/_common/constants/abis/pair-abi' +import { sortTokens } from '~tron/_common/lib/utils/formatters' +import { isAddress } from '~tron/_common/lib/utils/helpers' +import { IToken } from '~tron/_common/types/token-type' +import { useTronWeb } from './useTronWeb' + +export const useReserves = ({ + pairAddress, + token0, + token1, + refetchInterval = false, +}: { + pairAddress: string | undefined | null + token0: IToken | undefined + token1: IToken | undefined + refetchInterval?: number | false +}) => { + const { tronWeb } = useTronWeb() + const [_token0, _token1] = useMemo(() => { + if (!token0 || !token1) return [] + return sortTokens(token0, token1) + }, [token0, token1]) + + return useQuery({ + queryKey: ['useReserves', { pairAddress, token0, token1 }], + queryFn: async () => { + if ( + !pairAddress || + !tronWeb || + !isAddress(pairAddress) || + !token0 || + !token1 + ) + return [] + tronWeb.setAddress(pairAddress) + try { + const pairInstance = await tronWeb.contract(PAIR_ABI, pairAddress) + const [reserve0, reserve1] = await pairInstance.getReserves().call() + //@DEV reserves are returned in order of token0, token1 in the pair contract + return [ + { + ..._token0, + reserve: reserve0.toString() as string, + }, + { ..._token1, reserve: reserve1.toString() as string }, + ] + } catch (error) { + console.error('useReserves error', error) + return [] + } + }, + enabled: + !!pairAddress && + isAddress(pairAddress) && + !!tronWeb && + !!token0 && + !!token1, + refetchInterval, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/useRoutes.ts b/apps/tron/src/app/_common/lib/hooks/useRoutes.ts new file mode 100644 index 0000000000..1758aa4189 --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useRoutes.ts @@ -0,0 +1,122 @@ +import { useQuery } from '@tanstack/react-query' +import { ethers } from 'ethers' +import { TRON_MULTICALL_ABI } from '~tron/_common/constants/abis/tron-multicall' +import { + FACTORY_CONTRACT, + MULTICALL_CONTRACT, +} from '~tron/_common/constants/contracts' +import { INTERMEDIATE_TOKEN } from '~tron/_common/constants/token-list' +import { + getBase58Address, + getIfWrapOrUnwrap, + getValidTokenAddress, + isContract, +} from '~tron/_common/lib/utils/helpers' +import { IToken } from '~tron/_common/types/token-type' +import { useTronWeb } from './useTronWeb' + +const abi = { + outputs: [{ type: 'address' }], + constant: true, + inputs: [{ type: 'address' }, { type: 'address' }], + name: 'getPair', + stateMutability: 'View', + type: 'Function', +} + +const functionSignature = 'getPair(address,address)' + +const getPairsToCall = ( + token0Address: string, + token1Address: string, + intermediateTokenAddress: string, +) => { + return [ + { token0Address, token1Address }, + { token0Address, token1Address: intermediateTokenAddress }, + { token0Address: intermediateTokenAddress, token1Address }, + ] +} + +export const useRoutes = ({ + token0, + token1, +}: { token0: IToken; token1: IToken }) => { + const { tronWeb } = useTronWeb() + return useQuery({ + queryKey: ['useRoutes', { token0, token1 }], + queryFn: async () => { + const swapType = getIfWrapOrUnwrap(token0, token1) + if (swapType === 'wrap' || swapType === 'unwrap') { + return { + pairs: [], + route: [], + } + } + + const functionSelector = tronWeb.sha3(functionSignature).slice(0, 10) // first 4 bytes + const token0Address = getValidTokenAddress(token0.address) + const token1Address = getValidTokenAddress(token1.address) + const intermediateTokenAddress = INTERMEDIATE_TOKEN.address + + const pairsToCall = getPairsToCall( + token0Address, + token1Address, + intermediateTokenAddress, + ) + + const calls = pairsToCall.map(({ token0Address, token1Address }) => { + const parameters = tronWeb.utils.abi.encodeParamsV2ByABI(abi, [ + token0Address, + token1Address, + ]) + const callData = functionSelector + parameters.replace(/^0x/, '') + + return [FACTORY_CONTRACT, callData] + }) + + tronWeb.setAddress(MULTICALL_CONTRACT) + const multicallInstance = await tronWeb.contract( + TRON_MULTICALL_ABI, + MULTICALL_CONTRACT, + ) + + const _multicallReturn = await multicallInstance.aggregate(calls).call() + const { returnData } = _multicallReturn + + const _pairs: string[] = [] + for (let i = 0; i < returnData.length; i++) { + const pairAddress = ethers.utils.defaultAbiCoder.decode( + ['address'], + returnData[i], + ) + _pairs.push(getBase58Address(pairAddress?.[0] as string)) + } + + //using multicall, check if there is a direct pair (index 0), if not check if there is a pair with intermediate token (index 1 or 2) + if (await isContract(tronWeb, _pairs?.[0])) { + return { + pairs: [_pairs?.[0]], + route: [token0.address, token1.address], + } + } + if ( + (await isContract(tronWeb, _pairs?.[1])) && + (await isContract(tronWeb, _pairs?.[2])) + ) { + return { + pairs: [_pairs?.[1], _pairs?.[2]], + route: [token0.address, INTERMEDIATE_TOKEN.address, token1.address], + } + } + return { + pairs: [], + route: [], + } + }, + enabled: !!token0 && !!token1 && !!tronWeb, + refetchOnMount: false, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/useSortedTokenList.ts b/apps/tron/src/app/_common/lib/hooks/useSortedTokenList.ts new file mode 100644 index 0000000000..f16e09622f --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useSortedTokenList.ts @@ -0,0 +1,49 @@ +import { useDebounce } from '@sushiswap/hooks' +import { useQuery } from '@tanstack/react-query' +import { + filterTokens, + getSortedTokensByQuery, + tokenComparator, +} from '~tron/_common/lib/utils/token-search-helpers' +import { IToken } from '~tron/_common/types/token-type' + +type TokenListParams = { + query: string + tokenMap: Record | undefined + customTokenMap: Record | undefined +} + +export const useSortedTokenList = ({ + query, + tokenMap, + customTokenMap, +}: TokenListParams) => { + const debouncedQuery = useDebounce(query, 250) + return useQuery({ + queryKey: ['sortedTokenList', { debouncedQuery, tokenMap, customTokenMap }], + queryFn: async () => { + const tokenMapValues = tokenMap ? Object.values(tokenMap) : [] + const customTokenMapValues = customTokenMap + ? Object.values(customTokenMap) + : [] + const filteredTokens: IToken[] = filterTokens( + tokenMapValues, + debouncedQuery, + ) + const filteredCustomTokens: IToken[] = filterTokens( + customTokenMapValues, + debouncedQuery, + ) + // const sortedTokens + const sortedTokens: IToken[] = [ + ...filteredTokens, + ...filteredCustomTokens, + ].sort(tokenComparator()) + const filteredSortedTokens = getSortedTokensByQuery( + sortedTokens, + debouncedQuery, + ) + return filteredSortedTokens + }, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/useStablePrice.ts b/apps/tron/src/app/_common/lib/hooks/useStablePrice.ts new file mode 100644 index 0000000000..968c86aa17 --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useStablePrice.ts @@ -0,0 +1,231 @@ +import { keepPreviousData, useQuery } from '@tanstack/react-query' +import { STABLE_TOKENS, WTRX } from '~tron/_common/constants/token-list' +import { getAllPairAddresses } from '~tron/_common/lib/utils/getAllPairAddresses' +import { getTronPrice } from '~tron/_common/lib/utils/getTronPrice' +import { + getToken0Price, + getToken1Price, + getValidTokenAddress, +} from '~tron/_common/lib/utils/helpers' +import { IReserveDataResponse } from '~tron/_common/types/get-pools-type' +import { IToken } from '~tron/_common/types/token-type' + +type Pair = { + token0Address: string + token1Address: string + pairAddress: string +}[] + +//USDT +const BEST_STABLE = STABLE_TOKENS.find((token) => token.symbol === 'USDT') + +const getBestStable = (stablePairs: Pair) => { + const bestStable = stablePairs.find( + (pair) => + pair.token0Address === BEST_STABLE?.address || + pair.token1Address === BEST_STABLE?.address, + ) + if (bestStable) { + return bestStable + } else { + return stablePairs[0] + } +} + +const getTokenPrice = async (token: IToken | undefined) => { + //if token is undefined return 0 + if (!token) return '0' + + //if token in STABLE_TOKENS return 1 + if ( + STABLE_TOKENS.find( + (stableToken) => + getValidTokenAddress(stableToken.address).toLowerCase() === + getValidTokenAddress(token.address).toLowerCase(), + ) + ) { + return '1' + } + //if native coin or WTRX, return native usd price + const isNativeOrWrappedTrx = + getValidTokenAddress(token.address).toLowerCase() === + WTRX.address.toLowerCase() + + if (isNativeOrWrappedTrx) { + const tronInUSDT = await getTronPrice() + return tronInUSDT.toString() + } + + const { stablePairs, wtrxPairs } = await getPairsIfItExists(token) + + //if pairs dont exist, return 0 + if (!stablePairs && !wtrxPairs) { + return '0' + } + + if (stablePairs?.length > 0) { + const pair = getBestStable(stablePairs) + const { reserve0, reserve1 } = await getReserves(pair.pairAddress) + if (token.address === pair.token0Address) { + const token1Data = STABLE_TOKENS.find( + (stableToken) => + getValidTokenAddress(stableToken.address).toLowerCase() === + getValidTokenAddress(pair.token1Address).toLowerCase(), + ) + if (!token1Data) return '0' + + return getToken0Price( + reserve0, + reserve1, + token.decimals, + token1Data?.decimals, + ) + } else if (token.address === pair.token1Address) { + const token0Data = STABLE_TOKENS.find( + (stableToken) => + getValidTokenAddress(stableToken.address).toLowerCase() === + getValidTokenAddress(pair.token0Address).toLowerCase(), + ) + if (!token0Data) return '0' + + return getToken1Price( + reserve0, + reserve1, + token0Data?.decimals, + token.decimals, + ) + } + } + + // if token0Address or token1Address is WRTX in pair, then use getTronPrice to calculate the price of the other token + if (wtrxPairs?.length > 0) { + const pair = wtrxPairs[0] + const { reserve0, reserve1 } = await getReserves(pair.pairAddress) + const tronInUSDT = await getTronPrice() + if ( + getValidTokenAddress(pair.token0Address).toLowerCase() === + WTRX.address.toLowerCase() + ) { + // token0 is WRTX, so token1 is the other token + const decimals0 = WTRX.decimals + const decimals1 = token.decimals + return ( + Number(getToken1Price(reserve0, reserve1, decimals0, decimals1)) * + tronInUSDT + ).toString(10) + } else if ( + getValidTokenAddress(pair.token1Address).toLowerCase() === + WTRX.address.toLowerCase() + ) { + // token1 is WRTX, so token0 is the other token + const decimals0 = token.decimals + const decimals1 = WTRX.decimals + return ( + Number(getToken0Price(reserve0, reserve1, decimals0, decimals1)) * + tronInUSDT + ).toString(10) + } + } + + //if exotic pair, a usd price is not available + return '0' +} + +const getPairsIfItExists = async (token: IToken) => { + try { + const allPairs = await getAllPairAddresses() + if (!allPairs) { + return { + stablePairs: undefined, + wtrxPairs: undefined, + } + } + //find all stable and WRTX pairs that include the token + const stablePairsThatIncludeToken = allPairs.filter( + (pair) => + STABLE_TOKENS.find( + (stableToken) => + getValidTokenAddress(stableToken.address).toLowerCase() === + getValidTokenAddress(pair.token0Address).toLowerCase() || + getValidTokenAddress(stableToken.address).toLowerCase() === + getValidTokenAddress(pair.token1Address).toLowerCase(), + ) && + (getValidTokenAddress(pair.token0Address).toLowerCase() === + token.address.toLowerCase() || + getValidTokenAddress(pair.token1Address).toLowerCase() === + token.address.toLowerCase()), + ) + const wtrxPairsThatIncludeToken = allPairs.filter( + (pair) => + (getValidTokenAddress(pair.token0Address).toLowerCase() === + WTRX.address.toLowerCase() || + getValidTokenAddress(pair.token1Address).toLowerCase() === + WTRX.address.toLowerCase()) && + (getValidTokenAddress(pair.token0Address).toLowerCase() === + token.address.toLowerCase() || + getValidTokenAddress(pair.token1Address).toLowerCase() === + token.address.toLowerCase()), + ) + return { + stablePairs: stablePairsThatIncludeToken, + wtrxPairs: wtrxPairsThatIncludeToken, + } + } catch (error) { + console.log('getPairIfItExists Error: ', error) + return { + stablePairs: undefined, + wtrxPairs: undefined, + } + } +} + +const getReserves = async (pairAddress: string) => { + try { + const res = await fetch( + `/api/pools/get-reserves?pairAddresses=${[pairAddress]}`, + { method: 'GET' }, + ) + if (!res.ok) { + throw new Error('Failed to fetch data from Tron API') + } + const data: IReserveDataResponse | undefined = await res.json() + if (!data) { + return { + reserve0: '0', + reserve1: '0', + } + } + return { + reserve0: + data?.data?.tron.smartContractEvents[0].arguments.find( + (arg) => arg.argument === 'reserve0', + )?.value ?? '', + reserve1: + data?.data?.tron.smartContractEvents[0].arguments.find( + (arg) => arg.argument === 'reserve1', + )?.value ?? '', + } + } catch (error) { + console.log('getReserves Error: ', error) + return { + reserve0: '0', + reserve1: '0', + } + } +} + +export const useStablePrice = ({ token }: { token: IToken | undefined }) => { + return useQuery({ + queryKey: ['useStablePrice', { token: token?.address }], + queryFn: async () => { + const tokenPrice = await getTokenPrice(token) + + return tokenPrice + }, + placeholderData: keepPreviousData, + enabled: !!token, + refetchOnMount: false, + refetchOnWindowFocus: false, + refetchOnReconnect: false, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/useTokenBalance.ts b/apps/tron/src/app/_common/lib/hooks/useTokenBalance.ts new file mode 100644 index 0000000000..2e80d35080 --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useTokenBalance.ts @@ -0,0 +1,40 @@ +import { useTronWeb } from './useTronWeb' +import { useQuery } from '@tanstack/react-query' + +const abi = [ + { + constant: true, + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'balanceOf', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] + +export const useTokenBalance = ({ + accountAddress, + tokenAddress, +}: { + accountAddress: string | null + tokenAddress: string | undefined | null +}) => { + const { tronWeb } = useTronWeb() + + return useQuery({ + queryKey: ['useTokenBalance', { accountAddress, tokenAddress }], + queryFn: async () => { + if (!accountAddress || !tokenAddress) return '0' + if (tokenAddress === 'TRON') { + const balance = await tronWeb.trx.getUnconfirmedBalance(accountAddress) + return balance?.toString() as string + } + tronWeb.setAddress(tokenAddress) + const contractInstance = await tronWeb.contract(abi, tokenAddress) + const balanceOf = await contractInstance.balanceOf(accountAddress).call() + return balanceOf?.toString() as string + }, + enabled: !!accountAddress && !!tokenAddress && !!tronWeb, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/useTokenInfo.ts b/apps/tron/src/app/_common/lib/hooks/useTokenInfo.ts new file mode 100644 index 0000000000..2df2a2c247 --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useTokenInfo.ts @@ -0,0 +1,50 @@ +import { useQuery } from '@tanstack/react-query' +import { + DEFAULT_TOKEN_LIST, + TRON, + WTRX, +} from '~tron/_common/constants/token-list' +import { getTokenData } from '~tron/_common/lib/utils/getTokenData' +import { + getValidTokenAddress, + isAddress, +} from '~tron/_common/lib/utils/helpers' + +export const useTokenInfo = ({ tokenAddress }: { tokenAddress: string }) => { + return useQuery({ + queryKey: ['useTokenInfo2', { tokenAddress }], + staleTime: Infinity, + queryFn: async () => { + if (tokenAddress === 'TRON') { + return TRON + } + if (tokenAddress.toLowerCase() === WTRX.address.toLowerCase()) { + return WTRX + } + + if (!isAddress(tokenAddress)) return undefined + const foundInTokenList = DEFAULT_TOKEN_LIST.find( + (i) => + getValidTokenAddress(i.address) === + getValidTokenAddress(tokenAddress), + ) + if (foundInTokenList) return foundInTokenList + + const tokenData = await getTokenData({ contractAddress: tokenAddress }) + + return { + address: tokenAddress, + decimals: Number(tokenData?.decimals ?? 0), + name: tokenData?.name ?? 'N/A', + symbol: tokenData?.symbol ?? 'N/A', + logoURI: + DEFAULT_TOKEN_LIST.find( + (i) => + getValidTokenAddress(i.address) === + getValidTokenAddress(tokenAddress), + )?.logoURI ?? undefined, + } + }, + enabled: !!tokenAddress, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/useTotalSupply.ts b/apps/tron/src/app/_common/lib/hooks/useTotalSupply.ts new file mode 100644 index 0000000000..1cbc04060e --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useTotalSupply.ts @@ -0,0 +1,36 @@ +import { useTronWeb } from './useTronWeb' +import { useQuery } from '@tanstack/react-query' + +const abi = [ + { + constant: true, + inputs: [], + name: 'totalSupply', + outputs: [ + { + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] + +export const useTotalSupply = ({ + tokenAddress, +}: { tokenAddress: string | undefined | null }) => { + const { tronWeb } = useTronWeb() + + return useQuery({ + queryKey: ['useTotalSupply', { tokenAddress }], + queryFn: async () => { + tronWeb.setAddress(tokenAddress) + const contractInstance = await tronWeb.contract(abi, tokenAddress) + const totalSupply = await contractInstance.totalSupply().call() + return totalSupply?.toString() as string + }, + enabled: !!tokenAddress && !!tronWeb, + }) +} diff --git a/apps/tron/src/app/_common/lib/hooks/useTronWeb.ts b/apps/tron/src/app/_common/lib/hooks/useTronWeb.ts new file mode 100644 index 0000000000..ecf8f5af3e --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useTronWeb.ts @@ -0,0 +1,21 @@ +import { useMemo } from 'react' +import TronWeb from 'tronweb' +import { IS_TESTNET } from '~tron/_common/constants/is-testnet' + +if (!process.env.NEXT_PUBLIC_TRON_PRO_API_KEY) { + throw new Error('NEXT_PUBLIC_TRON_PRO_API_KEY is not set') +} + +export const useTronWeb = () => { + const tronWeb = useMemo(() => { + const host = IS_TESTNET + ? 'https://api.shasta.trongrid.io/' + : 'https://api.trongrid.io/' + return new TronWeb({ + fullHost: host, + + headers: { 'TRON-PRO-API-KEY': process.env.NEXT_PUBLIC_TRON_PRO_API_KEY }, + }) + }, []) + return { tronWeb } +} diff --git a/apps/tron/src/app/_common/lib/hooks/useWalletAdapters.ts b/apps/tron/src/app/_common/lib/hooks/useWalletAdapters.ts new file mode 100644 index 0000000000..0e1c5545c3 --- /dev/null +++ b/apps/tron/src/app/_common/lib/hooks/useWalletAdapters.ts @@ -0,0 +1,20 @@ +import { + TronLinkAdapter, + WalletConnectAdapter, +} from '@tronweb3/tronwallet-adapters' +import { useMemo } from 'react' +import { IS_TESTNET } from '~tron/_common/constants/is-testnet' + +export const useWalletAdapters = () => { + const adapters = useMemo(() => { + return [ + new TronLinkAdapter({ dappName: 'SushiSwap on Tron' }), + new WalletConnectAdapter({ + network: IS_TESTNET ? 'Shasta' : 'Mainnet', + //TODO: Get real prjoect ID from sushi team + options: { projectId: '74b1794741f5f9376c04ca8af64705d8' }, + }), + ] + }, []) + return { adapters } +} diff --git a/apps/tron/src/app/_common/lib/utils/formatters.ts b/apps/tron/src/app/_common/lib/utils/formatters.ts new file mode 100644 index 0000000000..02ecf2e9b3 --- /dev/null +++ b/apps/tron/src/app/_common/lib/utils/formatters.ts @@ -0,0 +1,134 @@ +import TronWeb from 'tronweb' +import { IToken } from '~tron/_common/types/token-type' +import { getValidTokenAddress } from './helpers' + +export const truncateText = (str: string | `0x${string}`, n = 5): string => { + if (str) { + if (str.length <= n) { + return str + } + return `${str.slice(0, n)}...${str.slice(str.length - n)}` + } + return '' +} + +export const hashStringToColor = (str: string) => { + const hash = _djb2(str) + const r = (hash & 0xff0000) >> 16 + const g = (hash & 0x00ff00) >> 8 + const b = hash & 0x0000ff + return ( + '#' + + ('0' + r.toString(16)).substr(-2) + + ('0' + g.toString(16)).substr(-2) + + ('0' + b.toString(16)).substr(-2) + ) +} + +const _djb2 = (str: string) => { + let hash = 5381 + for (let i = 0; i < str.length; i++) { + hash = (hash << 5) + hash + str.charCodeAt(i) /* hash * 33 + c */ + } + return hash +} + +export const sortTokenAddresses = ( + token0: string, + token1: string, +): [string, string] => { + return token0.toLowerCase() < token1.toLowerCase() + ? [token0, token1] + : [token1, token0] +} + +export const sortTokens = ( + token0: IToken, + token1: IToken, +): [IToken, IToken] => { + return getValidTokenAddress(token0.address).toLowerCase() < + getValidTokenAddress(token1.address).toLowerCase() + ? [token0, token1] + : [token1, token0] +} + +export const formatUnits = ( + amount: string | number, + decimals: number, + maxDecimals?: number, +): string => { + if (isNaN(Number(amount))) { + return '0' + } + const val = TronWeb.toBigNumber(amount).div(10 ** decimals) + if (Number(val) < 0.0001) { + return '<0.0001' + } + if (maxDecimals) { + return toBigNumber( + parseFloat(val.toFixed(maxDecimals)).toString(), + ).toString(10) + } + return toBigNumber(parseFloat(val.toFixed(decimals)).toString()).toString(10) +} + +export const formatUnitsForInput = ( + amount: string | number, + decimals: number, +): string => { + if (isNaN(Number(amount))) { + return '0' + } + + const _decimals = toBigNumber(10).pow(decimals) + + const val = TronWeb.toBigNumber(amount).div(_decimals) + if (isNaN(val)) { + return '0' + } + + return toBigNumber(parseFloat(val.toFixed(decimals)).toString()).toString(10) +} + +export const parseUnits = ( + amount: string | number, + decimals: number, +): string => { + if (isNaN(Number(amount))) { + return '0' + } + + const val = TronWeb.toBigNumber(amount) + .times(10 ** decimals) + .toString(10) + + if (!toBigNumber(val).isInteger()) { + return toBigNumber(val) + .toFormat(0, { + groupSeparator: '', + decimalSeparator: '.', + padFractionalPart: false, + }) + .toString(10) + } + + return val +} + +export const toBigNumber = (amount: string | number) => { + return TronWeb.toBigNumber(amount) +} + +export const removeDecimals = (amount: string | number): string => { + const val = TronWeb.toBigNumber(amount) + if (!toBigNumber(val).isInteger()) { + return toBigNumber(val) + .toFormat(0, { + groupSeparator: '', + decimalSeparator: '.', + padFractionalPart: false, + }) + .toString(10) + } + return val.toString(10) +} diff --git a/apps/tron/src/app/_common/lib/utils/getAllPairAddresses.ts b/apps/tron/src/app/_common/lib/utils/getAllPairAddresses.ts new file mode 100644 index 0000000000..a10a8f94a9 --- /dev/null +++ b/apps/tron/src/app/_common/lib/utils/getAllPairAddresses.ts @@ -0,0 +1,35 @@ +import { FACTORY_CONTRACT } from '~tron/_common/constants/contracts' +import { IPoolDataResponse } from '~tron/_common/types/get-pools-type' + +export const getAllPairAddresses = async () => { + try { + const res = await fetch(`/api/pools?factoryAddress=${FACTORY_CONTRACT}`, { + method: 'GET', + }) + if (!res.ok) { + throw new Error('Failed to fetch data from Tron API') + } + const data: IPoolDataResponse | undefined = await res.json() + + const cleanedData = data?.data?.tron.smartContractEvents.map((event) => { + const pairAddress = + event.arguments.find((arg) => arg.argument === 'pair')?.value ?? '' + const token0Address = + event.arguments.find((arg) => arg.argument === 'token0')?.value ?? '' + const token1Address = + event.arguments.find((arg) => arg.argument === 'token1')?.value ?? '' + + return { + token0Address, + token1Address, + pairAddress, + } + }) + if (!cleanedData) return [] + + return cleanedData + } catch (error) { + console.log(error) + return [] + } +} diff --git a/apps/tron/src/app/_common/lib/utils/getTokenData.ts b/apps/tron/src/app/_common/lib/utils/getTokenData.ts new file mode 100644 index 0000000000..c211cfe653 --- /dev/null +++ b/apps/tron/src/app/_common/lib/utils/getTokenData.ts @@ -0,0 +1,28 @@ +import { ITokenDataResponse } from '~tron/_common/types/token-type' + +export const getTokenData = async ({ + contractAddress, +}: { contractAddress: string }) => { + try { + const res = await fetch( + `/api/token-info?contractAddress=${contractAddress}`, + { method: 'GET' }, + ) + if (!res.ok) { + throw new Error('Failed to fetch data from Tron API') + } + const data: ITokenDataResponse | undefined = await res.json() + + const cleanedData = { + decimals: + data?.data?.tron.address[0].smartContract.currency.decimals ?? 0, + name: data?.data?.tron.address[0].smartContract.currency.name ?? 'N/A', + symbol: + data?.data?.tron.address[0].smartContract.currency.symbol ?? 'N/A', + } + return cleanedData + } catch (error) { + console.log(error) + return undefined + } +} diff --git a/apps/tron/src/app/_common/lib/utils/getTronPrice.ts b/apps/tron/src/app/_common/lib/utils/getTronPrice.ts new file mode 100644 index 0000000000..77e1a8a862 --- /dev/null +++ b/apps/tron/src/app/_common/lib/utils/getTronPrice.ts @@ -0,0 +1,18 @@ +import { ITronInUSDTResponse } from '~tron/_common/types/pricing-types' + +export const getTronPrice = async () => { + try { + const res = await fetch(`/api/pricing`, { method: 'GET' }) + if (!res.ok) { + throw new Error('Failed to fetch data from Tron API') + } + const data: ITronInUSDTResponse | undefined = await res.json() + if (!data) return 0 + + const cleanedQuotePrice = data?.data?.tron.dexTrades[0]?.quotePrice ?? 0 + return cleanedQuotePrice + } catch (error) { + console.log('getTronPrice Error: ', error) + return 0 + } +} diff --git a/apps/tron/src/app/_common/lib/utils/helpers.ts b/apps/tron/src/app/_common/lib/utils/helpers.ts new file mode 100644 index 0000000000..26a603f166 --- /dev/null +++ b/apps/tron/src/app/_common/lib/utils/helpers.ts @@ -0,0 +1,541 @@ +import TronWeb from 'tronweb' +import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' +import { DEFAULT_TOKEN_LIST } from '~tron/_common/constants/token-list' +import { + IRouterFunctionSelector, + IRouterLiquidityFunctionSelector, + IRouterRemoveLiquidityFunctionSelector, +} from '~tron/_common/types/router-selector-type' +import { IToken } from '~tron/_common/types/token-type' + +export const isAddress = (address: string): boolean => { + if (!address) return false + return TronWeb.isAddress(address) +} + +export const getValidTokenAddress = (address: string): string => { + let _tokenAddress = address + if (address === 'TRON') { + _tokenAddress = DEFAULT_TOKEN_LIST.find((token) => token.symbol === 'WTRX') + ?.address as string + } + return _tokenAddress +} + +export const getBase58Address = (address: string): string => { + return TronWeb.address.fromHex(address) +} + +export const getHexAddress = (address: string): string => { + return TronWeb.address.toHex(address) +} + +export const chunk = (arr: T[], chunkSize: number): T[][] => { + return Array.from({ length: Math.ceil(arr.length / chunkSize) }, (_, i) => + arr.slice(i * chunkSize, i * chunkSize + chunkSize), + ) +} + +export const flatten = (arr: T[][]): T[] => { + return arr.flat() +} + +export const chunkAndFlatten = (arr: T[], chunkSize: number): T[] => { + const chunked = chunk(arr, chunkSize) + return flatten(chunked) +} + +export const timer = (ms: number) => new Promise((res) => setTimeout(res, ms)) + +export const getToken0Price = ( + reserve0Amount: string, + reserve1Amount: string, + reserve0Decimals: number, + reserve1Decimals: number, +): string => { + const reserve0 = TronWeb.toBigNumber(reserve0Amount).div( + 10 ** reserve0Decimals, + ) + const reserve1 = TronWeb.toBigNumber(reserve1Amount).div( + 10 ** reserve1Decimals, + ) + return reserve1.div(reserve0).toString(10) +} + +export const getToken1Price = ( + reserve0Amount: string, + reserve1Amount: string, + reserve0Decimals: number, + reserve1Decimals: number, +): string => { + const reserve0 = TronWeb.toBigNumber(reserve0Amount).div( + 10 ** reserve0Decimals, + ) + const reserve1 = TronWeb.toBigNumber(reserve1Amount).div( + 10 ** reserve1Decimals, + ) + return reserve0.div(reserve1).toString(10) +} + +export const getToken0AmountForLiquidity = ( + token1Amount: string, + reserve0: string, + reserv1: string, +): string => { + //@DEV parseUnits for token1Amount + const token1 = TronWeb.toBigNumber(token1Amount) + const reserve0BN = TronWeb.toBigNumber(reserve0) + const reserve1BN = TronWeb.toBigNumber(reserv1) + return token1.times(reserve0BN).div(reserve1BN).toString(10) +} + +export const getToken1AmountForLiquidity = ( + token0Amount: string, + reserve0: string, + reserv1: string, +): string => { + //@DEV parseUnits for token0Amount + const token0 = TronWeb.toBigNumber(token0Amount) + const reserve0BN = TronWeb.toBigNumber(reserve0) + const reserve1BN = TronWeb.toBigNumber(reserv1) + return token0.times(reserve1BN).div(reserve0BN).toString(10) +} + +export const getIfWrapOrUnwrap = ( + token0: IToken, + token1: IToken, +): 'wrap' | 'unwrap' | 'swap' => { + if (token0.symbol === 'WTRX' && token1.symbol === 'TRX') { + return 'unwrap' + } + if (token0.symbol === 'TRX' && token1.symbol === 'WTRX') { + return 'wrap' + } + return 'swap' +} + +export const isContract = async (tronWebInstace: any, address: string) => { + const code = await tronWebInstace.trx.getContract(address) + // will be empty object if not a contract + return 'contract_address' in code +} + +export const parseTxnError = (error: string): string => { + console.log('parseTxnError: ', error) + switch (error) { + case 'CONTRACT_VALIDATE_ERROR': + return 'Insufficient TRX balance' + + default: + return 'An error occurred while processing the transaction.' + } +} + +//TODO: Add type for transactionInfo +export const getTransactionInfo = async ( + tronWebInstance: any, + txId: string, + waitIntervalMs = 6000, + maxTries = 15, +) => { + //avg txn is 1min till confirmed + let transactionInfo + for (let i = 0; i < maxTries; i++) { + transactionInfo = + await tronWebInstance.trx.getUnconfirmedTransactionInfo(txId) + console.log({ transactionInfo }) + if (transactionInfo && transactionInfo.receipt) { + return transactionInfo + } + await timer(waitIntervalMs) + } + throw new Error('Transaction not found or timeout reached') +} + +//TODO: Add type for result +export const estimateEnergy = async ( + tronWebInstance: any, + contractAddress: string, + functionSelector: string, + option: Record, + paramater: { type: string; value: string }[], + issuerAddress: string, +) => { + // console.log("estimateEnergy", contractAddress, functionSelector, option, paramater, issuerAddress); + const data = await tronWebInstance.transactionBuilder.triggerConstantContract( + contractAddress, //contract address + functionSelector, //function name + option, // options + paramater, //parameters + issuerAddress, //issuerAddress + ) + + return data +} + +//TODO: Add type for result +export const safeGasEstimates = async ( + tronWebInstance: any, + args: any[][], +): Promise => { + const safeGasEstimates = await Promise.all( + args.map((i: any) => + //@ts-expect-error + estimateEnergy(tronWebInstance, ...i) + .then((c) => { + return c + }) + .catch((error) => { + console.error(`estimateEnergy failed`, error) + return undefined + }), + ), + ) + return safeGasEstimates.sort((a, b) => a?.energy_used - b?.energy_used) +} + +export const getDeadline = (deadlineInMinutes = 20): number => { + const currentTimestamp = Math.floor(Date.now() / 1000) + const bufferTime = deadlineInMinutes * 60 + return Math.floor(currentTimestamp + bufferTime) +} + +export const getRouterFunctionSelectors = ( + route: string[], +): IRouterFunctionSelector[] => { + const routeHasTron = route.some((address) => address === 'TRON') + if (routeHasTron) { + const token0IsTron = route[0] === 'TRON' + + if (token0IsTron) { + return [ + 'swapExactETHForTokens(uint256,address[],address,uint256)', + 'swapETHForExactTokens(uint256,address[],address,uint256)', + 'swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)', + ] + } else { + return [ + 'swapExactTokensForETH(uint256,uint256,address[],address,uint256)', + 'swapTokensForExactETH(uint256,uint256,address[],address,uint256)', + 'swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)', + ] + } + } else { + return [ + 'swapExactTokensForTokens(uint256,uint256,address[],address,uint256)', + 'swapTokensForExactTokens(uint256,uint256,address[],address,uint256)', + 'swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)', + ] + } +} + +//TODO: clean this up!! +export const getArgsForSwap = ( + functionSelector: IRouterFunctionSelector, + amountIn: string, + amountOut: string, + amountInMax: string, + amountOutMin: string, + route: string[], + to: string, + deadline: number, + issuerAddress: string, +) => { + const cleanedRoute = route.map((address) => getValidTokenAddress(address)) + + switch (functionSelector) { + case 'swapETHForExactTokens(uint256,address[],address,uint256)': + return [ + ROUTER_CONTRACT, + functionSelector, + { callValue: amountIn }, + [ + { type: 'uint256', value: amountOut }, + { type: 'address[]', value: cleanedRoute }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + issuerAddress, + ] + case 'swapExactETHForTokens(uint256,address[],address,uint256)': + return [ + ROUTER_CONTRACT, + functionSelector, + { callValue: amountIn }, + [ + { type: 'uint256', value: amountOutMin }, + { type: 'address[]', value: cleanedRoute }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + issuerAddress, + ] + case 'swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)': + return [ + ROUTER_CONTRACT, + functionSelector, + { callValue: amountIn }, + [ + { type: 'uint256', value: amountOutMin }, + { type: 'address[]', value: cleanedRoute }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + issuerAddress, + ] + case 'swapExactTokensForETH(uint256,uint256,address[],address,uint256)': + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: 'uint256', value: amountIn }, + { type: 'uint256', value: amountOutMin }, + { type: 'address[]', value: cleanedRoute }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + issuerAddress, + ] + case 'swapTokensForExactETH(uint256,uint256,address[],address,uint256)': + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: 'uint256', value: amountOut }, + { type: 'uint256', value: amountInMax }, + { type: 'address[]', value: cleanedRoute }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + issuerAddress, + ] + case 'swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)': + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: 'uint256', value: amountIn }, + { type: 'uint256', value: amountOutMin }, + { type: 'address[]', value: cleanedRoute }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + issuerAddress, + ] + case 'swapExactTokensForTokens(uint256,uint256,address[],address,uint256)': + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: 'uint256', value: amountIn }, + { type: 'uint256', value: amountOutMin }, + { type: 'address[]', value: cleanedRoute }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + issuerAddress, + ] + case 'swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)': + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: 'uint256', value: amountIn }, + { type: 'uint256', value: amountOutMin }, + { type: 'address[]', value: cleanedRoute }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + issuerAddress, + ] + case 'swapTokensForExactTokens(uint256,uint256,address[],address,uint256)': + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: 'uint256', value: amountOut }, + { type: 'uint256', value: amountInMax }, + { type: 'address[]', value: cleanedRoute }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + issuerAddress, + ] + + default: + throw new Error('Invalid function selector') + } +} + +export const getLiquidityFunctionSelector = ( + token0: IToken, + token1: IToken, +): IRouterLiquidityFunctionSelector => { + if (token0.symbol === 'TRX' || token1.symbol === 'TRX') { + return 'addLiquidityETH(address,uint256,uint256,uint256,address,uint256)' + } + return 'addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)' +} + +export const getArgsForAddLiquidity = ( + functionSelector: IRouterLiquidityFunctionSelector, + token0Address: string, + token1Address: string, + amount0Desired: string, + amount1Desired: string, + amount0Min: string, + amount1Min: string, + to: string, //same as issuerAddress + deadline: number, +): any[] => { + switch (functionSelector) { + case 'addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)': + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: 'address', value: token0Address }, + { type: 'address', value: token1Address }, + { type: 'uint256', value: amount0Desired }, + { type: 'uint256', value: amount1Desired }, + { type: 'uint256', value: amount0Min }, + { type: 'uint256', value: amount1Min }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + to, + ] + case 'addLiquidityETH(address,uint256,uint256,uint256,address,uint256)': + const tokenAddress = + token0Address === 'TRON' ? token1Address : token0Address + const tokenAmount = + token0Address === 'TRON' ? amount1Desired : amount0Desired + const tokenMinAmount = token0Address === 'TRON' ? amount1Min : amount0Min + const ethAmount = + token0Address === 'TRON' ? amount0Desired : amount1Desired + const ethMinAmount = token0Address === 'TRON' ? amount0Min : amount1Min + return [ + ROUTER_CONTRACT, + functionSelector, + { callValue: ethAmount }, + [ + { type: 'address', value: tokenAddress }, + { type: 'uint256', value: tokenAmount }, + { type: 'uint256', value: tokenMinAmount }, + { type: 'uint256', value: ethMinAmount }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + to, + ] + + default: + throw new Error('Invalid function selector') + } +} + +export const getRemoveLiquidityFunctionSelector = ( + token0: IToken, + token1: IToken, +): IRouterRemoveLiquidityFunctionSelector[] => { + if (token0.symbol === 'TRX' || token1.symbol === 'TRX') { + return [ + 'removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)', + 'removeLiquidityETHSupportingFeeOnTransferTokens(address,uint256,uint256,uint256,address,uint256)', + ] + } + return [ + 'removeLiquidity(address,address,uint256,uint256,uint256,address,uint256)', + ] +} + +export const getArgsForRemoveLiquidity = ( + functionSelector: IRouterRemoveLiquidityFunctionSelector, + token0Address: string, + token1Address: string, + lpToRemove: string, + amountToken0Min: string, + amountToken1Min: string, + to: string, //same as issuerAddress + deadline: number, +) => { + switch (functionSelector) { + case 'removeLiquidity(address,address,uint256,uint256,uint256,address,uint256)': + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: 'address', value: token0Address }, + { type: 'address', value: token1Address }, + { type: 'uint256', value: lpToRemove }, + { type: 'uint256', value: amountToken0Min }, + { type: 'uint256', value: amountToken1Min }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + to, + ] + case 'removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)': + const tokenAddress = + token0Address === 'TRON' ? token1Address : token0Address + const tokenMinAmount = + token0Address === 'TRON' ? amountToken1Min : amountToken0Min + const ethMinAmount = + token0Address === 'TRON' ? amountToken0Min : amountToken1Min + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: 'address', value: tokenAddress }, + { type: 'uint256', value: lpToRemove }, + { type: 'uint256', value: tokenMinAmount }, + { type: 'uint256', value: ethMinAmount }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + to, + ] + case 'removeLiquidityETHSupportingFeeOnTransferTokens(address,uint256,uint256,uint256,address,uint256)': + const _tokenAddress = + token0Address === 'TRON' ? token1Address : token0Address + const _tokenMinAmount = + token0Address === 'TRON' ? amountToken1Min : amountToken0Min + const _ethMinAmount = + token0Address === 'TRON' ? amountToken0Min : amountToken1Min + return [ + ROUTER_CONTRACT, + functionSelector, + {}, + [ + { type: 'address', value: _tokenAddress }, + { type: 'uint256', value: lpToRemove }, + { type: 'uint256', value: _tokenMinAmount }, + { type: 'uint256', value: _ethMinAmount }, + { type: 'address', value: to }, + { type: 'uint256', value: deadline }, + ], + to, + ] + } +} + +export const cleanArgs = (args: any[], feeLimit?: string | number) => { + const _args = args + if (_args?.[2] && _args?.[2]?._isConstant === true) { + delete _args[2]._isConstant + } + if (feeLimit) { + _args[2].feeLimit = feeLimit + } + + return _args +} diff --git a/apps/tron/src/app/_common/lib/utils/token-search-helpers.ts b/apps/tron/src/app/_common/lib/utils/token-search-helpers.ts new file mode 100644 index 0000000000..e24c4b7210 --- /dev/null +++ b/apps/tron/src/app/_common/lib/utils/token-search-helpers.ts @@ -0,0 +1,96 @@ +import { IToken } from '~tron/_common/types/token-type' + +const alwaysTrue = () => true + +export function createTokenFilterFunction( + search: string, +): (tokens: T) => boolean { + // const isValidAddress = isAddress(search) + + // if (isValidAddress) { + // } + // if ((search.startsWith("0x") && search.length > 65) || search == "0x1::aptos_coin::AptosCoin") { + // return (t: T) => search.toLowerCase() === t.address.toLowerCase(); + // } + + const lowerSearchParts = search + .toLowerCase() + .split(/\s+/) + .filter((s) => s.length > 0) + + if (lowerSearchParts.length === 0) return alwaysTrue + + const matchesSearch = (s: string): boolean => { + const sParts = s + .toLowerCase() + .split(/\s+/) + .filter((s) => s.length > 0) + + return lowerSearchParts.every( + (p) => + p.length === 0 || + sParts.some((sp) => sp.startsWith(p) || sp.endsWith(p)), + ) + } + + return ({ name, symbol }: T): boolean => + Boolean((symbol && matchesSearch(symbol)) || (name && matchesSearch(name))) +} + +export function filterTokens( + tokens: T[], + search: string, +): T[] { + return tokens.filter(createTokenFilterFunction(search)) +} + +export const tokenComparator = () => { + return (tokenA: IToken, tokenB: IToken): number => { + if (tokenA.symbol && tokenB.symbol) { + return tokenA.symbol.toLowerCase() < tokenB.symbol.toLowerCase() ? -1 : 1 + } else { + return tokenA.symbol ? -1 : tokenB.symbol ? -1 : 0 + } + } +} + +export function getSortedTokensByQuery( + tokens: IToken[] | undefined, + searchQuery: string, +): IToken[] { + if (!tokens) { + return [] + } + + if (searchQuery === '') { + return tokens + } + + const symbolMatch = searchQuery + .toLowerCase() + .split(/\s+/) + .filter((s) => s.length > 0) + + if (symbolMatch.length > 1) { + return tokens + } + + const exactMatches: IToken[] = [] + const symbolSubstrings: IToken[] = [] + const rest: IToken[] = [] + + // sort tokens by exact match -> subtring on symbol match -> rest + tokens.map((token) => { + if (token.symbol?.toLowerCase() === symbolMatch[0]) { + return exactMatches.push(token) + } else if ( + token.symbol?.toLowerCase().startsWith(searchQuery.toLowerCase().trim()) + ) { + return symbolSubstrings.push(token) + } else { + return rest.push(token) + } + }) + + return [...exactMatches, ...symbolSubstrings, ...rest] +} diff --git a/apps/tron/src/app/_common/lib/utils/tronscan-helpers.ts b/apps/tron/src/app/_common/lib/utils/tronscan-helpers.ts new file mode 100644 index 0000000000..dc02422274 --- /dev/null +++ b/apps/tron/src/app/_common/lib/utils/tronscan-helpers.ts @@ -0,0 +1,17 @@ +import { IS_TESTNET } from '~tron/_common/constants/is-testnet' + +export const getTronscanAddressLink = (address: string) => { + if (IS_TESTNET) { + return `https://shasta.tronscan.org/#/address/${address}` + } else { + return `https://tronscan.org/#/address/${address}` + } +} + +export const getTronscanTxnLink = (txnHash: string) => { + if (IS_TESTNET) { + return `https://shasta.tronscan.org/#/transaction/${txnHash}` + } else { + return `https://tronscan.org/#/transaction/${txnHash}` + } +} diff --git a/apps/tron/src/utils/warning-severity.ts b/apps/tron/src/app/_common/lib/utils/warning-severity.ts similarity index 50% rename from apps/tron/src/utils/warning-severity.ts rename to apps/tron/src/app/_common/lib/utils/warning-severity.ts index e789d7f92a..3507af9a44 100644 --- a/apps/tron/src/utils/warning-severity.ts +++ b/apps/tron/src/app/_common/lib/utils/warning-severity.ts @@ -1,4 +1,4 @@ -import sharedConfig from "@sushiswap/tailwindcss-config"; +import sharedConfig from '@sushiswap/tailwindcss-config' // one basis JSBI.BigInt // const BIPS_BASE = BigInt(10000); @@ -16,20 +16,22 @@ import sharedConfig from "@sushiswap/tailwindcss-config"; // ALLOWED_PRICE_IMPACT_LOW, // ]; -type WarningSeverity = 0 | 1 | 2 | 3 | 4; -export function warningSeverity(priceImpactPercentage: number | undefined): WarningSeverity { - if (!priceImpactPercentage) return 0; - if (priceImpactPercentage < 1) return 0; - if (priceImpactPercentage < 3) return 1; - if (priceImpactPercentage < 5) return 2; - if (priceImpactPercentage < 15) return 3; - return 4; +type WarningSeverity = 0 | 1 | 2 | 3 | 4 +export function warningSeverity( + priceImpactPercentage: number | undefined, +): WarningSeverity { + if (!priceImpactPercentage) return 0 + if (priceImpactPercentage < 1) return 0 + if (priceImpactPercentage < 3) return 1 + if (priceImpactPercentage < 5) return 2 + if (priceImpactPercentage < 15) return 3 + return 4 } export const warningSeverityClassName = (severity: WarningSeverity): string => { - if (severity === 0) return ""; - if (severity <= 1) return sharedConfig.theme.extend.colors.green.DEFAULT; - if (severity <= 2) return "rgb(250 204 21)"; //text-yellow-400 - if (severity <= 3) return sharedConfig.theme.extend.colors.yellow.DEFAULT; - return sharedConfig.theme.extend.colors.red.DEFAULT; -}; + if (severity === 0) return '' + if (severity <= 1) return sharedConfig.theme.extend.colors.green.DEFAULT + if (severity <= 2) return 'rgb(250 204 21)' //text-yellow-400 + if (severity <= 3) return sharedConfig.theme.extend.colors.yellow.DEFAULT + return sharedConfig.theme.extend.colors.red.DEFAULT +} diff --git a/apps/tron/src/providers/edge-config-provider.tsx b/apps/tron/src/app/_common/providers/edge-config-provider.tsx similarity index 100% rename from apps/tron/src/providers/edge-config-provider.tsx rename to apps/tron/src/app/_common/providers/edge-config-provider.tsx diff --git a/apps/tron/src/providers/query-client-provider.tsx b/apps/tron/src/app/_common/providers/query-client-provider.tsx similarity index 100% rename from apps/tron/src/providers/query-client-provider.tsx rename to apps/tron/src/app/_common/providers/query-client-provider.tsx diff --git a/apps/tron/src/app/_common/types/get-pools-type.ts b/apps/tron/src/app/_common/types/get-pools-type.ts new file mode 100644 index 0000000000..19e690d352 --- /dev/null +++ b/apps/tron/src/app/_common/types/get-pools-type.ts @@ -0,0 +1,70 @@ +import { IToken } from './token-type' + +export type IPoolData = { + token0Address: string + token1Address: string + pairAddress: string +}[] + +export type IPoolDataResponse = { + data: { + tron: { + smartContractEvents: { + arguments: [ + { + argument: 'token0' + value: string + }, + { + argument: 'token1' + value: string + }, + { + argument: 'pair' + value: string + }, + { + argument: '' + value: string + }, + ] + block: { + height: number + } + }[] + } + } +} + +export type IMyPositionData = { + token0: IToken | undefined + token1: IToken | undefined + pairAddress: string | undefined +} + +export type IReserveDataResponse = { + data: { + tron: { + smartContractEvents: { + arguments: [ + { + argument: 'reserve0' + value: string + }, + { + argument: 'reserve1' + value: string + }, + ] + block: { + height: number + } + smartContract: { + address: { + address: string + } + } + }[] + } + } +} diff --git a/apps/tron/src/app/_common/types/pricing-types.ts b/apps/tron/src/app/_common/types/pricing-types.ts new file mode 100644 index 0000000000..20886a9a5a --- /dev/null +++ b/apps/tron/src/app/_common/types/pricing-types.ts @@ -0,0 +1,23 @@ +export type ITronInUSDTResponse = { + data: { + tron: { + dexTrades: [ + { + block: { + timestamp: { + time: string + // 2024-05-31 15:52:36 in this format + } + } + baseCurrency: { + address: 'TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR' + } + quoteCurrency: { + address: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t' + } + quotePrice: number + }, + ] + } + } +} diff --git a/apps/tron/src/app/_common/types/router-selector-type.ts b/apps/tron/src/app/_common/types/router-selector-type.ts new file mode 100644 index 0000000000..30269102af --- /dev/null +++ b/apps/tron/src/app/_common/types/router-selector-type.ts @@ -0,0 +1,19 @@ +export type IRouterFunctionSelector = + | 'swapExactETHForTokens(uint256,address[],address,uint256)' + | 'swapETHForExactTokens(uint256,address[],address,uint256)' + | 'swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)' + | 'swapExactTokensForETH(uint256,uint256,address[],address,uint256)' + | 'swapTokensForExactETH(uint256,uint256,address[],address,uint256)' + | 'swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)' + | 'swapExactTokensForTokens(uint256,uint256,address[],address,uint256)' + | 'swapTokensForExactTokens(uint256,uint256,address[],address,uint256)' + | 'swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)' + +export type IRouterLiquidityFunctionSelector = + | 'addLiquidityETH(address,uint256,uint256,uint256,address,uint256)' + | 'addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)' + +export type IRouterRemoveLiquidityFunctionSelector = + | 'removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)' + | 'removeLiquidityETHSupportingFeeOnTransferTokens(address,uint256,uint256,uint256,address,uint256)' + | 'removeLiquidity(address,address,uint256,uint256,uint256,address,uint256)' diff --git a/apps/tron/src/app/_common/types/token-type.ts b/apps/tron/src/app/_common/types/token-type.ts new file mode 100644 index 0000000000..9f6418907d --- /dev/null +++ b/apps/tron/src/app/_common/types/token-type.ts @@ -0,0 +1,34 @@ +export type IToken = { + address: string + decimals: number + logoURI?: string + name: string + symbol: string +} + +export type IReserves = { + reserve: string + address?: string | undefined + decimals?: number | undefined + logoURI?: string | undefined + name?: string | undefined + symbol?: string | undefined +} + +export type ITokenDataResponse = { + data: { + tron: { + address: [ + { + smartContract: { + currency: { + decimals: number + name: string + symbol: string + } + } + }, + ] + } + } +} diff --git a/apps/tron/src/app/_common/types/tronweb.d.ts b/apps/tron/src/app/_common/types/tronweb.d.ts new file mode 100644 index 0000000000..43e86f3826 --- /dev/null +++ b/apps/tron/src/app/_common/types/tronweb.d.ts @@ -0,0 +1 @@ +declare module 'tronweb' diff --git a/apps/tron/src/app/_common/ui/General/Icon.tsx b/apps/tron/src/app/_common/ui/General/Icon.tsx new file mode 100644 index 0000000000..7b7bfbbc82 --- /dev/null +++ b/apps/tron/src/app/_common/ui/General/Icon.tsx @@ -0,0 +1,38 @@ +import Image from 'next/image' +import { hashStringToColor } from '~tron/_common/lib/utils/formatters' +import { IToken } from '~tron/_common/types/token-type' + +type IconProps = { + currency: IToken | undefined + height?: number + width?: number +} + +export const Icon = ({ currency, height = 40, width = 40 }: IconProps) => { + return ( + <> + {currency?.logoURI ? ( + + ) : ( +
    + {currency?.symbol?.substring(0, 2) ?? '??'} +
    + )} + + ) +} diff --git a/apps/tron/src/app/_common/ui/General/Title.tsx b/apps/tron/src/app/_common/ui/General/Title.tsx new file mode 100644 index 0000000000..a0b7bc9d2b --- /dev/null +++ b/apps/tron/src/app/_common/ui/General/Title.tsx @@ -0,0 +1,16 @@ +import { ReactNode } from 'react' + +export const Title = ({ + children, + className, +}: { children: ReactNode; className?: string }) => { + return ( +

    + {children} +

    + ) +} diff --git a/apps/tron/src/app/_common/ui/General/TokenListSelect.tsx b/apps/tron/src/app/_common/ui/General/TokenListSelect.tsx new file mode 100644 index 0000000000..7b15899b2b --- /dev/null +++ b/apps/tron/src/app/_common/ui/General/TokenListSelect.tsx @@ -0,0 +1,215 @@ +import { CheckCircleIcon } from '@heroicons/react/20/solid' +import { useDebounce } from '@sushiswap/hooks' +import { + Badge, + Button, + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, + List, + SelectIcon, +} from '@sushiswap/ui' +import { useMemo, useRef, useState } from 'react' +import { + DEFAULT_TOKEN_LIST, + DEFAULT_TOKEN_LIST_WITH_KEY, +} from '~tron/_common/constants/token-list' +import { useCustomTokens } from '~tron/_common/lib/hooks/useCustomTokens' +import { useSortedTokenList } from '~tron/_common/lib/hooks/useSortedTokenList' +import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' +import { IToken } from '~tron/_common/types/token-type' +import { Search } from '../Input/Search' +import { Icon } from './Icon' + +export const TokenListSelect = ({ + token, + setToken, + className, +}: { + token: IToken | undefined + setToken: (token: IToken) => void + className?: string +}) => { + const [query, setQuery] = useState('') + const debouncedQuery = useDebounce(query, 500) + const closeBtnRef = useRef(null) + const { data: newToken } = useTokenInfo({ tokenAddress: debouncedQuery }) + const { customTokens, addOrRemoveToken, hasToken } = useCustomTokens() + const { data: sortedTokenList } = useSortedTokenList({ + query: debouncedQuery, + tokenMap: DEFAULT_TOKEN_LIST_WITH_KEY(), + customTokenMap: customTokens, + }) + + const closeModal = () => { + closeBtnRef?.current?.click() + setQuery('') + } + + const selectToken = (token: IToken) => { + setToken(token) + closeModal() + } + + return ( + + + + + + + + Select a token + + Select a token from our default list or search for a token by symbol + or address. + + +
    + +
    + +
    + + + {newToken ? ( + [newToken].map((_token) => ( + + )) + ) : sortedTokenList?.length === 0 ? ( +

    + No tokens found +

    + ) : ( + sortedTokenList?.map((_token) => ( + + )) + )} +
    +
    +
    +
    +
    + ) +} + +const TokenButton = ({ + token, + selectToken, + hasToken, + addOrRemoveToken, + isSelected, +}: { + token: IToken + selectToken: (_token: IToken) => void + hasToken?: (currency: IToken) => boolean + isSelected: boolean + addOrRemoveToken?: (type: 'add' | 'remove', currency: IToken[]) => void +}) => { + const isOnDefaultList = useMemo( + () => DEFAULT_TOKEN_LIST.some((t) => t.address === token.address), + [token], + ) + const isNew = hasToken && !hasToken(token) + const isCustomAdded = hasToken && hasToken(token) + + return ( +
    +
    + + {isNew && !isOnDefaultList ? ( + + ) : null} + {isCustomAdded && !isOnDefaultList ? ( + + ) : null} +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Input/Search.tsx b/apps/tron/src/app/_common/ui/Input/Search.tsx new file mode 100644 index 0000000000..12a5f6c48b --- /dev/null +++ b/apps/tron/src/app/_common/ui/Input/Search.tsx @@ -0,0 +1,261 @@ +import { classNames } from '@sushiswap/ui' +import React, { + FC, + KeyboardEvent, + ReactElement, + forwardRef, + useCallback, + useEffect, + useState, +} from 'react' +import { MagnifyingGlassIcon, XMarkIcon } from '@heroicons/react/24/outline' +import { Loader } from '@sushiswap/ui' + +interface Search { + className?: string + id: string + input?(props: any): ReactElement | null + value: string + loading: boolean + onChange(val: string): void + size?: 'sm' | 'default' + delimiter?: string + placeholder?: string +} + +export const Search: FC = forwardRef( + function Search( + { + className, + id, + loading, + input: Input, + value, + onChange, + size = 'default', + delimiter, + placeholder, + }, + ref, + ) { + const [values, setValues] = useState({ + all: value.split(delimiter || ' '), + typed: '', + }) + const _onChange = useCallback( + (val: string) => { + if (val.slice(-1) === (delimiter || ' ')) { + setValues((prev) => ({ + typed: '', + all: [...prev.all, prev.typed], + })) + } else { + setValues((prev) => ({ + typed: val, + all: prev.all, + })) + } + }, + [delimiter], + ) + + const remove = useCallback((val: string) => { + setValues((prev) => ({ + typed: prev.typed, + all: prev.all.filter((_val) => _val !== val), + })) + }, []) + + const handleKeyDown = useCallback( + (event: KeyboardEvent) => { + if (event.key === 'Backspace') { + setValues((prev) => ({ + typed: prev.typed, + all: prev.all.slice(0, -1), + })) + } + if (event.key === 'Enter') { + setValues((prev) => ({ + typed: '', + all: [...prev.all, prev.typed], + })) + } + }, + [], + ) + + useEffect(() => { + if (delimiter) { + onChange( + `${values.typed} ${values.all + .filter((el) => el !== ' ' && el !== '') + .join(' ')}`, + ) + } + }, [delimiter, onChange, values]) + + if (delimiter) { + return ( +
    +
    + +
    + +
    + {values.all + .filter((el) => el !== ' ' && el !== '') + .map((el, i) => ( +
    remove(el)} + key={i} + className="font-semibold text-gray-600 dark:text-slate-300 flex items-center text-sm rounded-full p-1 pl-2.5 bg-black/[0.08] dark:bg-white/[0.16] gap-1" + > + {el} +
    + +
    +
    + ))} +
    + _onChange(e.target.value)} + onKeyDown={handleKeyDown} + className={classNames( + 'truncate outline-none font-semibold w-full bg-transparent !p-0 placeholder:font-medium placeholder:text-gray-400 placeholder:dark:text-slate-500 text-gray-900 dark:text-slate-200', + )} + autoCorrect="off" + autoCapitalize="off" + spellCheck="false" + autoComplete="off" + /> + {(loading || value) && ( +
    + {loading ? ( +
    + +
    + ) : value ? ( +
    + setValues({ + all: [], + typed: '', + }) + } + > + +
    + ) : ( + <> + )} +
    + )} +
    + ) + } + return ( +
    + + {Input ? ( + + ) : ( + onChange(e.target.value)} + className={classNames( + 'truncate font-semibold w-full bg-transparent !p-0 placeholder:font-medium placeholder:text-gray-400 placeholder:dark:text-slate-500 text-gray-900 dark:text-slate-200', + )} + autoCorrect="off" + autoCapitalize="off" + spellCheck="false" + autoComplete="off" + /> + )} + {(loading || value) && ( +
    + {loading ? ( +
    + +
    + ) : value ? ( +
    onChange('')}> + +
    + ) : ( + <> + )} +
    + )} +
    + ) + }, +) diff --git a/apps/tron/src/app/_common/ui/Input/TokenInput.tsx b/apps/tron/src/app/_common/ui/Input/TokenInput.tsx new file mode 100644 index 0000000000..df91caede5 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Input/TokenInput.tsx @@ -0,0 +1,102 @@ +import { Button, TextField } from '@sushiswap/ui' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' +import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' +import { formatUnitsForInput } from '~tron/_common/lib/utils/formatters' +import { IToken } from '~tron/_common/types/token-type' +import { Icon } from '../General/Icon' +import { TokenListSelect } from '../General/TokenListSelect' +import { DollarAmountDisplay } from '../Shared/DollarAmountDisplay' +import { TokenBalanceDisplay } from '../Shared/TokenBalanceDisplay' + +type TokenInputProps = { + type: 'input' | 'output' + token: IToken | undefined + setToken: (token: IToken) => void + amount: string + setAmount: (amount: string) => void + hasTokenListSelect?: boolean +} + +export const TokenInput = ({ + type, + token, + setToken, + amount, + setAmount, + hasTokenListSelect = true, +}: TokenInputProps) => { + const { address } = useWallet() + const { data: tokenBalance, isInitialLoading: isInitialLoadingTokenBalance } = + useTokenBalance({ + accountAddress: address, + tokenAddress: token?.address, + }) + const { data: usdValue, isLoading: isUSDValueLoading } = useStablePrice({ + token: token, + }) + + const usdAmount = amount + ? (Number(amount) * (usdValue ? Number(usdValue) : 0)).toString(10) + : '0.00' + + return ( +
    +
    + { + if (type === 'output') return + const value = e.target.value + + setAmount(value) + }} + // isError={true} + /> + {hasTokenListSelect ? ( + + ) : ( + + )} +
    +
    + + { + if (type === 'output') return + if (tokenBalance === '0') { + setAmount('') + return + } + setAmount( + formatUnitsForInput(tokenBalance ?? '0', token?.decimals ?? 0), + ) + }} + /> +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Add/AddButton.tsx b/apps/tron/src/app/_common/ui/Pools/Add/AddButton.tsx new file mode 100644 index 0000000000..796854ce1f --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Add/AddButton.tsx @@ -0,0 +1,191 @@ +import { + SlippageToleranceStorageKey, + useSlippageTolerance, +} from '@sushiswap/hooks' +import { + createFailedToast, + createInfoToast, + createSuccessToast, +} from '@sushiswap/notifications' +import { Button } from '@sushiswap/ui' +import { useQueryClient } from '@tanstack/react-query' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { useMemo } from 'react' +import { useTronWeb } from '~tron/_common/lib/hooks/useTronWeb' +import { parseUnits } from '~tron/_common/lib/utils/formatters' +import { + cleanArgs, + getArgsForAddLiquidity, + getDeadline, + getLiquidityFunctionSelector, + getTransactionInfo, + parseTxnError, + safeGasEstimates, +} from '~tron/_common/lib/utils/helpers' +import { getTronscanTxnLink } from '~tron/_common/lib/utils/tronscan-helpers' +import { usePoolDispatch, usePoolState } from '~tron/pool/pool-provider' + +export const AddButton = ({ closeModal }: { closeModal: () => void }) => { + const queryClient = useQueryClient() + + const { + token0, + token1, + isTxnPending, + amountInToken0, + amountInToken1, + pairAddress, + } = usePoolState() + const { setIsTxnPending, setAmountInToken0, setAmountInToken1 } = + usePoolDispatch() + const { address, signTransaction } = useWallet() + const { tronWeb } = useTronWeb() + const [slippageTolerance] = useSlippageTolerance( + SlippageToleranceStorageKey.AddLiquidity, + ) + const slippage = + slippageTolerance === 'AUTO' ? 0.005 : Number(slippageTolerance) / 100 + + const pairExists = !!pairAddress + + const minAmountToken0 = useMemo(() => { + if (!amountInToken0) return '' + const output = Number(amountInToken0) * (1 - slippage) + return output.toString() + }, [slippage, amountInToken0]) + + const minAmountToken1 = useMemo(() => { + if (!amountInToken1) return '' + const output = Number(amountInToken1) * (1 - slippage) + return output.toString() + }, [slippage, amountInToken1]) + + const addLiquidity = async () => { + if (!token0 || !token1 || !amountInToken0 || !amountInToken1 || !address) + return + try { + setIsTxnPending(true) + const methodName = getLiquidityFunctionSelector(token0, token1) + const deadline = getDeadline() + const parsedAmount0 = parseUnits(amountInToken0, token0.decimals) + const parsedAmount1 = parseUnits(amountInToken1, token1.decimals) + const parsedMinAmount0 = parseUnits(minAmountToken0, token0.decimals) + const parsedMinAmount1 = parseUnits(minAmountToken1, token1.decimals) + + const args = getArgsForAddLiquidity( + methodName, + token0.address, + token1.address, + parsedAmount0, + parsedAmount1, + parsedMinAmount0, + parsedMinAmount1, + address, + deadline, + ) + console.log('args', args) + const estimates = await safeGasEstimates(tronWeb, [args]) + console.log(estimates) + const safeGasEstimate = estimates.findIndex( + (predicate) => predicate !== undefined, + ) + console.log('safeGasEstimate', safeGasEstimate) + + if (safeGasEstimate === -1) { + throw new Error('Failed to estimate energy. Transaction will fail.') + } + const feeLimit = pairExists ? undefined : 3000000000 //3000 trx since contract will need to be deployed + const cleanedArgs = cleanArgs(args, feeLimit) + console.log('cleanedArgs', cleanedArgs) + const { transaction } = + await tronWeb.transactionBuilder.triggerSmartContract(...cleanedArgs) + const signedTransation = await signTransaction(transaction) + + const result = await tronWeb.trx.sendRawTransaction(signedTransation) + + if (!result.result && 'code' in result) { + throw new Error(parseTxnError(result.code)) + } + const txId = result?.txid + + createInfoToast({ + summary: 'Add liquidity initiated...', + type: 'swap', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + txHash: txId, + href: getTronscanTxnLink(txId), + }) + + const transactionInfo = await getTransactionInfo(tronWeb, txId) + if (transactionInfo?.receipt?.result !== 'SUCCESS') { + throw new Error('Transaction failed') + } + + //create success toast + createSuccessToast({ + summary: 'Add liquidity successful', + txHash: txId, + type: 'swap', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + href: getTronscanTxnLink(txId), + }) + + onSuccess() + } catch (error) { + const errorMessage = + typeof error === 'string' + ? error + : (error as Error)?.message ?? + 'An error occurred while trying to add liquidity' + //create error toast + createFailedToast({ + summary: errorMessage, + type: 'swap', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + }) + console.log(error) + setIsTxnPending(false) + } + } + + const onSuccess = () => { + setIsTxnPending(false) + setAmountInToken0('') + setAmountInToken1('') + closeModal() + queryClient.invalidateQueries({ + queryKey: [ + 'useTokenBalance', + { accountAddress: address, tokenAddress: token0?.address }, + ], + }) + queryClient.invalidateQueries({ + queryKey: [ + 'useTokenBalance', + { accountAddress: address, tokenAddress: token1?.address }, + ], + }) + } + + return ( + + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Add/AmountInToken0.tsx b/apps/tron/src/app/_common/ui/Pools/Add/AmountInToken0.tsx new file mode 100644 index 0000000000..69623cf352 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Add/AmountInToken0.tsx @@ -0,0 +1,78 @@ +import { useEffect, useMemo } from 'react' +import { + formatUnitsForInput, + parseUnits, +} from '~tron/_common/lib/utils/formatters' +import { getToken1AmountForLiquidity } from '~tron/_common/lib/utils/helpers' +import { TokenInput } from '~tron/_common/ui/Input/TokenInput' +import { usePoolDispatch, usePoolState } from '~tron/pool/pool-provider' + +export const AmountInToken0 = () => { + const { + token0, + token1, + amountInToken0, + reserve0, + reserve1, + pairAddress, + inputField, + } = usePoolState() + const { setToken0, setAmountInToken0, setAmountInToken1, setInputField } = + usePoolDispatch() + + const pairExists = !!pairAddress + + const rateOfToken1 = useMemo(() => { + if (!reserve0 || !reserve1) return + if (!token0 || !token1) return + return getToken1AmountForLiquidity( + parseUnits(amountInToken0 ?? 0, token0?.decimals), + reserve0, + reserve1, + ) + }, [token0, token1, reserve0, reserve1, amountInToken0]) + + useEffect(() => { + if (inputField === 'token1') { + return + } + if (pairExists && amountInToken0 === '') { + setAmountInToken1('') + return + } + if (pairExists && rateOfToken1 && rateOfToken1 !== 'NaN' && token1) { + const amountFormatted = formatUnitsForInput( + rateOfToken1, + token1?.decimals, + ) + if (amountFormatted) { + setAmountInToken1(amountFormatted) + } else { + setAmountInToken1('') + } + } + }, [ + amountInToken0, + pairExists, + rateOfToken1, + rateOfToken1, + token1, + inputField, + ]) + + const setAmount = (amount: string) => { + setInputField('token0') + setAmountInToken0(amount) + } + + return ( + + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Add/AmountIntToken1.tsx b/apps/tron/src/app/_common/ui/Pools/Add/AmountIntToken1.tsx new file mode 100644 index 0000000000..0701ab4604 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Add/AmountIntToken1.tsx @@ -0,0 +1,71 @@ +import { useEffect, useMemo } from 'react' +import { + formatUnitsForInput, + parseUnits, +} from '~tron/_common/lib/utils/formatters' +import { getToken0AmountForLiquidity } from '~tron/_common/lib/utils/helpers' +import { TokenInput } from '~tron/_common/ui/Input/TokenInput' +import { usePoolDispatch, usePoolState } from '~tron/pool/pool-provider' + +export const AmountInToken1 = () => { + const { + token0, + token1, + amountInToken1, + pairAddress, + reserve0, + reserve1, + inputField, + } = usePoolState() + const { setToken1, setAmountInToken1, setAmountInToken0, setInputField } = + usePoolDispatch() + + const pairExists = !!pairAddress + + const rateOfToken0 = useMemo(() => { + if (!reserve0 || !reserve1) return + if (!token0 || !token1) return + return getToken0AmountForLiquidity( + parseUnits(amountInToken1 ?? 0, token1?.decimals), + reserve0, + reserve1, + ) + }, [token0, token1, reserve0, reserve1, amountInToken1]) + + useEffect(() => { + if (inputField === 'token0') { + return + } + if (pairExists && amountInToken1 === '') { + setAmountInToken0('') + return + } + if (pairExists && rateOfToken0 && rateOfToken0 !== 'NaN' && token0) { + const amountFormatted = formatUnitsForInput( + rateOfToken0, + token0?.decimals, + ) + if (amountFormatted) { + setAmountInToken0(amountFormatted) + } else { + setAmountInToken0('') + } + } + }, [amountInToken1, pairExists, rateOfToken0, token0, inputField]) + + const setAmount = (amount: string) => { + setInputField('token1') + setAmountInToken1(amount) + } + + return ( + + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Add/DepositForm.tsx b/apps/tron/src/app/_common/ui/Pools/Add/DepositForm.tsx new file mode 100644 index 0000000000..6142fe8f3e --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Add/DepositForm.tsx @@ -0,0 +1,24 @@ +'use client' +import { FormSection } from '@sushiswap/ui' +import { AmountInToken0 } from './AmountInToken0' +import { Plus } from './Plus' +import { AmountInToken1 } from './AmountIntToken1' +import { ReviewAddDialog } from './ReviewAddDialog' + +export const DepositForm = () => { + return ( + +
    + + + +
    +
    + +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Add/Plus.tsx b/apps/tron/src/app/_common/ui/Pools/Add/Plus.tsx new file mode 100644 index 0000000000..ff64319062 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Add/Plus.tsx @@ -0,0 +1,12 @@ +import { PlusIcon } from '@heroicons/react/20/solid' + +export const Plus = () => { + return ( +
    + +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Add/Rate.tsx b/apps/tron/src/app/_common/ui/Pools/Add/Rate.tsx new file mode 100644 index 0000000000..91cb284f65 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Add/Rate.tsx @@ -0,0 +1,72 @@ +import { Button, SkeletonBox } from '@sushiswap/ui' +import { useMemo, useState } from 'react' +import { formatUSD } from 'sushi/format' +import { formatUnits, parseUnits } from '~tron/_common/lib/utils/formatters' +import { + getToken0AmountForLiquidity, + getToken1AmountForLiquidity, +} from '~tron/_common/lib/utils/helpers' +import { usePoolState } from '~tron/pool/pool-provider' + +export const Rate = ({ + token0Price, + token1Price, + isLoading, +}: { + token0Price: string | undefined + token1Price: string | undefined + isLoading: boolean +}) => { + const [showToken0First, setShowToken0First] = useState(false) + const { token0, token1, reserve0, reserve1 } = usePoolState() + + const handleToggleRate = () => { + setShowToken0First(!showToken0First) + } + + const rateOfToken0 = useMemo(() => { + if (!reserve0 || !reserve1) return + if (!token0 || !token1) return + return getToken0AmountForLiquidity( + parseUnits('1', token1?.decimals), + reserve0, + reserve1, + ) + }, [token0, token1, reserve0, reserve1]) + + const rateOfToken1 = useMemo(() => { + if (!reserve0 || !reserve1) return + if (!token0 || !token1) return + return getToken1AmountForLiquidity( + parseUnits('1', token0?.decimals), + reserve0, + reserve1, + ) + }, [token0, token1, reserve0, reserve1]) + + return ( +
    + + {isLoading ? ( + + ) : ( +
    + {showToken0First + ? formatUSD(token0Price ?? '') + : formatUSD(token1Price ?? '')} +
    + )} +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Add/ReviewAddDialog.tsx b/apps/tron/src/app/_common/ui/Pools/Add/ReviewAddDialog.tsx new file mode 100644 index 0000000000..4c7e93d4c6 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Add/ReviewAddDialog.tsx @@ -0,0 +1,115 @@ +import { List, SkeletonBox } from '@sushiswap/ui' +import { + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, +} from '@sushiswap/ui' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { useRef } from 'react' +import { formatUSD } from 'sushi/format' +import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' +import { formatUnits } from '~tron/_common/lib/utils/formatters' +import { usePoolState } from '~tron/pool/pool-provider' +import { Icon } from '../../General/Icon' +import { WalletConnector } from '../../WalletConnector/WalletConnector' +import { AddButton } from './AddButton' +import { Rate } from './Rate' +import { ReviewAddDialogTrigger } from './ReviewAddDialogTrigger' + +export const ReviewAddDialog = () => { + const { token0, token1, amountInToken0, amountInToken1 } = usePoolState() + const closeBtnRef = useRef(null) + const { address, connected } = useWallet() + const isConnected = address && connected + const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice( + { token: token0 }, + ) + const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice( + { token: token1 }, + ) + + const closeModal = () => { + closeBtnRef?.current?.click() + } + + return ( + + {isConnected ? ( + + ) : ( + + )} + + + + Add liquidity + + Please review your entered details. + + +
    +
    + + + +
    +
    + + {/* show max 12 decimals so nothing is cut off */} +
    {formatUnits(amountInToken0, 0, 12)}
    {' '} +
    {token0?.symbol}
    +
    + {isLoadingToken0Price ? ( + + ) : ( +
    + {formatUSD( + Number(token0Price) * Number(amountInToken0), + )} +
    + )} +
    +
    + +
    +
    + + {/* show max 12 decimals so nothing is cut off */} +
    {formatUnits(amountInToken1, 0, 12)}
    {' '} +
    {token1?.symbol}
    +
    + {isLoadingToken1Price ? ( + + ) : ( +
    + {formatUSD( + Number(token1Price) * Number(amountInToken1), + )} +
    + )} +
    +
    + + + +
    +
    + +
    +
    +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx b/apps/tron/src/app/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx new file mode 100644 index 0000000000..d278370dff --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx @@ -0,0 +1,166 @@ +import { Button, DialogTrigger } from '@sushiswap/ui' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { useMemo } from 'react' +import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' +import { useAllowance } from '~tron/_common/lib/hooks/useAllowance' +import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' +import { formatUnitsForInput } from '~tron/_common/lib/utils/formatters' +import { ApproveToken } from '~tron/_common/ui/Shared/ApproveToken' +import { usePoolState } from '~tron/pool/pool-provider' + +export const ReviewAddDialogTrigger = () => { + const { token0, token1, isTxnPending, amountInToken0, amountInToken1 } = + usePoolState() + const { address } = useWallet() + + const { data: token0Balance, isLoading: isLoadingToken0Balance } = + useTokenBalance({ + accountAddress: address, + tokenAddress: token0?.address, + }) + + const { data: token1Balance, isLoading: isLoadingToken1Balance } = + useTokenBalance({ + accountAddress: address, + tokenAddress: token1?.address, + }) + + const { data: token0AllowanceAmount, refetch: refetchToken0Allowance } = + useAllowance({ + tokenAddress: token0?.address as string, + ownerAddress: address as string, + spenderAddress: ROUTER_CONTRACT, + }) + + const { data: token1AllowanceAmount, refetch: refetchToken1Allowance } = + useAllowance({ + tokenAddress: token1?.address as string, + ownerAddress: address as string, + spenderAddress: ROUTER_CONTRACT, + }) + + const hasInsufficientToken0Balance = useMemo(() => { + if (isLoadingToken0Balance) return true + return ( + Number( + formatUnitsForInput(token0Balance ?? '0', token0?.decimals ?? 18), + ) < Number(amountInToken0) + ) + }, [token0Balance, token0, amountInToken0, isLoadingToken0Balance]) + + const hasInsufficientToken1Balance = useMemo(() => { + if (isLoadingToken1Balance) return true + return ( + Number( + formatUnitsForInput(token1Balance ?? '0', token1?.decimals ?? 18), + ) < Number(amountInToken1) + ) + }, [token1Balance, token1, amountInToken1, isLoadingToken1Balance]) + + const token0AllowanceFormatted = formatUnitsForInput( + token0AllowanceAmount ?? '0', + token0?.decimals ?? 18, + ) + + const token1AllowanceFormatted = formatUnitsForInput( + token1AllowanceAmount ?? '0', + token1?.decimals ?? 18, + ) + + const hasInsufficientToken0Allowance = useMemo(() => { + return ( + !!token1AllowanceAmount && + Number(token0AllowanceFormatted) < Number(amountInToken0) + ) + }, [token0AllowanceFormatted, amountInToken0, token1AllowanceAmount]) + + const hasInsufficientToken1Allowance = useMemo(() => { + return ( + !!token1AllowanceAmount && + Number(token1AllowanceFormatted) < Number(amountInToken1) + ) + }, [token1AllowanceFormatted, amountInToken1, token1AllowanceAmount]) + + const invalidAmount = useMemo(() => { + return ( + amountInToken0 === '' || + amountInToken1 === '' || + Number(amountInToken0) === 0 || + Number(amountInToken1) === 0 + ) + }, [amountInToken0, amountInToken1]) + + const buttonText = useMemo(() => { + if (isTxnPending) { + return 'Adding Liquidity' + } + if (invalidAmount) { + return 'Enter Amount' + } + if (hasInsufficientToken0Balance) { + return `Insufficient ${token0?.symbol} Balance` + } + if (hasInsufficientToken1Balance) { + return `Insufficient ${token1?.symbol} Balance` + } + if (hasInsufficientToken0Allowance) { + return `Approve ${token0?.symbol} Token` + } + if (hasInsufficientToken1Allowance) { + return `Approve ${token1?.symbol} Token` + } + + return 'Add Liquidity' + }, [ + hasInsufficientToken0Balance, + hasInsufficientToken1Balance, + hasInsufficientToken0Allowance, + hasInsufficientToken1Allowance, + invalidAmount, + token0, + token1, + isTxnPending, + ]) + + if (buttonText === `Approve ${token0?.symbol} Token`) { + return ( + { + await refetchToken0Allowance() + }} + /> + ) + } + + if (buttonText === `Approve ${token1?.symbol} Token`) { + return ( + { + await refetchToken1Allowance() + }} + /> + ) + } + + return ( + + + + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Add/SelectTokensForm.tsx b/apps/tron/src/app/_common/ui/Pools/Add/SelectTokensForm.tsx new file mode 100644 index 0000000000..28d40c8e25 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Add/SelectTokensForm.tsx @@ -0,0 +1,45 @@ +'use client' +import { FormSection } from '@sushiswap/ui' +import { useEffect } from 'react' +import { useIsContract } from '~tron/_common/lib/hooks/useIsContract' +import { usePairContract } from '~tron/_common/lib/hooks/usePairContract' +import { TokenListSelect } from '~tron/_common/ui/General/TokenListSelect' +import { usePoolDispatch, usePoolState } from '~tron/pool/pool-provider' + +export const SelectTokensForm = () => { + const { token0, token1 } = usePoolState() + const { setToken0, setToken1, setPairAddress } = usePoolDispatch() + const { data: _pairAddress } = usePairContract({ + token0Address: token0?.address, + token1Address: token1?.address, + }) + const { data: isContract } = useIsContract({ address: _pairAddress }) + + useEffect(() => { + if (isContract && _pairAddress) { + setPairAddress(_pairAddress) + } else { + setPairAddress(undefined) + } + }, [isContract, _pairAddress]) + + return ( + +
    + + +
    +
    + ) +} diff --git a/apps/tron/src/components/Pools/BackButton.tsx b/apps/tron/src/app/_common/ui/Pools/BackButton.tsx similarity index 100% rename from apps/tron/src/components/Pools/BackButton.tsx rename to apps/tron/src/app/_common/ui/Pools/BackButton.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Manage/AddSection.tsx b/apps/tron/src/app/_common/ui/Pools/Manage/AddSection.tsx new file mode 100644 index 0000000000..65d21b5196 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Manage/AddSection.tsx @@ -0,0 +1,54 @@ +import { CogIcon } from '@heroicons/react/24/outline' +import { SlippageToleranceStorageKey } from '@sushiswap/hooks' +import { + IconButton, + SettingsModule, + SettingsOverlay, + Widget, + WidgetAction, + WidgetDescription, + WidgetHeader, + WidgetTitle, +} from '@sushiswap/ui' +import { AmountInToken0 } from '../Add/AmountInToken0' +import { AmountInToken1 } from '../Add/AmountIntToken1' +import { Plus } from '../Add/Plus' +import { ReviewAddDialog } from '../Add/ReviewAddDialog' + +export const AddSection = () => { + return ( + + + Add Liquidity + + Provide liquidity to receive SLP tokens. + + + + + + + +
    + + + +
    +
    + +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Manage/Manage.tsx b/apps/tron/src/app/_common/ui/Pools/Manage/Manage.tsx new file mode 100644 index 0000000000..d5e0ba4488 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Manage/Manage.tsx @@ -0,0 +1,62 @@ +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, + Separator, + Tabs, + TabsContent, + TabsList, + TabsTrigger, +} from '@sushiswap/ui' +import { useState } from 'react' +import { AddSection } from './AddSection' +import { RemoveSection } from './RemoveSection' + +export const Manage = () => { + const [tab, setTab] = useState('add') + + return ( + + + Manage + Manage your position + + + + + + Add + + + Remove + + + +
    + +
    + + + + + + + + + + + +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Manage/RemoveSection.tsx b/apps/tron/src/app/_common/ui/Pools/Manage/RemoveSection.tsx new file mode 100644 index 0000000000..9d7ead7ca9 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Manage/RemoveSection.tsx @@ -0,0 +1,44 @@ +import { CogIcon } from '@heroicons/react/24/outline' +import { SlippageToleranceStorageKey } from '@sushiswap/hooks' +import { + IconButton, + SettingsModule, + SettingsOverlay, + Widget, + WidgetAction, + WidgetDescription, + WidgetHeader, + WidgetTitle, +} from '@sushiswap/ui' +import { RemoveLiquidity } from '../Remove/RemoveLiquidity' + +export const RemoveSection = () => { + return ( + + + Remove Liquidity + + Trade in your LP tokens to receive your underlying tokens + + + + + + + + + + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PoolDetails/LiquidityItem.tsx b/apps/tron/src/app/_common/ui/Pools/PoolDetails/LiquidityItem.tsx new file mode 100644 index 0000000000..860d752f8d --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PoolDetails/LiquidityItem.tsx @@ -0,0 +1,38 @@ +import { CardItem } from '@sushiswap/ui' +import { formatNumber, formatUSD } from 'sushi/format' +import { formatUnits } from '~tron/_common/lib/utils/formatters' +import { IToken } from '~tron/_common/types/token-type' +import { Icon } from '~tron/_common/ui/General/Icon' + +export const LiquidityItem = ({ + isLoading, + token, + amount, + usdAmount, +}: { + isLoading: boolean + token: IToken | undefined + amount: string + usdAmount: string +}) => { + if (isLoading || !token) { + return + } + return ( + + + {token?.symbol} + + } + > + + {formatNumber(formatUnits(amount ?? '', token?.decimals ?? 0, 4))}{' '} + + {formatUSD(usdAmount)} + + + + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PoolDetails/PoolHeader.tsx b/apps/tron/src/app/_common/ui/Pools/PoolDetails/PoolHeader.tsx new file mode 100644 index 0000000000..4be232e6bc --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PoolDetails/PoolHeader.tsx @@ -0,0 +1,81 @@ +import { + Button, + Currency, + LinkExternal, + SkeletonCircle, + SkeletonText, + classNames, + typographyVariants, +} from '@sushiswap/ui' +import { IToken } from '~tron/_common/types/token-type' +import { Icon } from '~tron/_common/ui/General/Icon' + +export const PoolHeader = ({ + token0, + token1, + isLoading, + pairAddress, +}: { + token0: IToken | undefined + token1: IToken | undefined + isLoading: boolean + pairAddress: string +}) => { + return ( +
    +
    + + {isLoading ? ( + + ) : ( + + )} + {isLoading ? ( + + ) : ( + + )} + + +
    + +
    + Network + Tron +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx b/apps/tron/src/app/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx new file mode 100644 index 0000000000..8b79bef3b9 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx @@ -0,0 +1,87 @@ +import { + Card, + CardContent, + CardDescription, + CardGroup, + CardHeader, + CardItem, + CardLabel, + CardTitle, + List, + SkeletonCircle, + SkeletonText, +} from '@sushiswap/ui' +import { formatNumber, formatUSD } from 'sushi/format' +import { useReserves } from '~tron/_common/lib/hooks/useReserves' +import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' +import { + formatUnits, + formatUnitsForInput, +} from '~tron/_common/lib/utils/formatters' +import { IToken } from '~tron/_common/types/token-type' +import { Icon } from '~tron/_common/ui/General/Icon' +import { LiquidityItem } from './LiquidityItem' + +export const PoolLiquidity = ({ + token0, + token1, + isLoading, + pairAddress, +}: { + token0: IToken | undefined + token1: IToken | undefined + isLoading: boolean + pairAddress: string +}) => { + const { data, isLoading: isLoadingReserves } = useReserves({ + pairAddress, + token0, + token1, + }) + + const reserve0 = data?.[0]?.reserve ?? '0' + const reserve0Formatted = formatUnitsForInput(reserve0, token0?.decimals ?? 0) + + const reserve1 = data?.[1]?.reserve ?? '0' + const reserve1Formatted = formatUnitsForInput(reserve1, token1?.decimals ?? 0) + + const { data: token0Price } = useStablePrice({ token: token0 }) + const { data: token1Price } = useStablePrice({ token: token1 }) + + const token0PoolPrice = ( + Number(token0Price) * Number(reserve0Formatted) + ).toString(10) + const token1PoolPrice = ( + Number(token1Price) * Number(reserve1Formatted) + ).toString(10) + + const isLoadingData = isLoading || isLoadingReserves + + return ( + + + Pool Liquidity + + {formatUSD(Number(token0PoolPrice) + Number(token1PoolPrice))} + + + + + Tokens + + + + + + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PoolPosition/PoolPosition.tsx b/apps/tron/src/app/_common/ui/Pools/PoolPosition/PoolPosition.tsx new file mode 100644 index 0000000000..1c4dba9f65 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PoolPosition/PoolPosition.tsx @@ -0,0 +1,180 @@ +import { + Card, + CardContent, + CardDescription, + CardGroup, + CardHeader, + CardLabel, + CardTitle, +} from '@sushiswap/ui' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { useEffect, useMemo } from 'react' +import { formatUSD } from 'sushi/format' +import { PAIR_DECIMALS } from '~tron/_common/constants/pair-decimals' +import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' +import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' +import { useTotalSupply } from '~tron/_common/lib/hooks/useTotalSupply' +import { + formatUnitsForInput, + parseUnits, + toBigNumber, +} from '~tron/_common/lib/utils/formatters' +import { IToken } from '~tron/_common/types/token-type' +import { useRemoveLiqDispatch } from '~tron/pool/[poolId]/remove-provider' +import { usePoolState } from '~tron/pool/pool-provider' +import { LiquidityItem } from '../PoolDetails/LiquidityItem' + +export const PoolPosition = ({ + token0, + token1, + isLoading, +}: { + token0: IToken | undefined + token1: IToken | undefined + isLoading: boolean +}) => { + const token0StakedInUsd = 0 + const token1StakedInUsd = 0 + const { reserve0, reserve1, pairAddress } = usePoolState() + const { + setTotalSupplyLP, + setAmountToken0PerLP, + setAmountToken1PerLP, + setLPBalance, + } = useRemoveLiqDispatch() + const { data: totalSupply, isLoading: isLoadingTotalSupply } = useTotalSupply( + { + tokenAddress: pairAddress, + }, + ) + const { address } = useWallet() + const { data: lpBalance, isLoading: isLoadingLPBalance } = useTokenBalance({ + accountAddress: address, + tokenAddress: pairAddress, + }) + const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice( + { token: token0 }, + ) + const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice( + { token: token1 }, + ) + + useEffect(() => { + if (lpBalance && !isLoadingLPBalance) { + setLPBalance(lpBalance) + } + }, [lpBalance, isLoadingLPBalance]) + + useEffect(() => { + if (totalSupply && !isLoadingTotalSupply) { + setTotalSupplyLP(totalSupply) + } + }, [totalSupply, isLoadingTotalSupply]) + + const _amountToken0PerLP = useMemo(() => { + if (!totalSupply || !reserve0) return '' + const formattedReserve0 = formatUnitsForInput( + reserve0, + token0?.decimals ?? 0, + ) + const formattedTotalSupply = formatUnitsForInput(totalSupply, PAIR_DECIMALS) + const resBN = toBigNumber(formattedReserve0) + const totalSupplyBN = toBigNumber(formattedTotalSupply) + return String(resBN.div(totalSupplyBN)) + }, [reserve0, totalSupply, token0]) + + useEffect(() => { + if (_amountToken0PerLP) { + setAmountToken0PerLP(_amountToken0PerLP) + } + }, [_amountToken0PerLP]) + + const _amountToken1PerLP = useMemo(() => { + if (!totalSupply || !reserve1) return '' + const formattedReserve1 = formatUnitsForInput( + reserve1, + token1?.decimals ?? 0, + ) + const formattedTotalSupply = formatUnitsForInput(totalSupply, PAIR_DECIMALS) + const resBN = toBigNumber(formattedReserve1) + const totalSupplyBN = toBigNumber(formattedTotalSupply) + return String(resBN.div(totalSupplyBN)) + }, [reserve1, totalSupply, token1]) + + useEffect(() => { + if (_amountToken1PerLP) { + setAmountToken1PerLP(_amountToken1PerLP) + } + }, [_amountToken1PerLP]) + + const amountToken0 = useMemo(() => { + if (!lpBalance || !_amountToken0PerLP) return '0' + const formattedLP = formatUnitsForInput(lpBalance, PAIR_DECIMALS) + const lpTokenAmountBeingRemovedBN = toBigNumber(formattedLP) + const amountToken0PerLPBN = toBigNumber(_amountToken0PerLP) + return String(lpTokenAmountBeingRemovedBN.times(amountToken0PerLPBN)) + }, [lpBalance, _amountToken0PerLP]) + + const amountToken1 = useMemo(() => { + if (!lpBalance || !_amountToken1PerLP) return '0' + const formattedLP = formatUnitsForInput(lpBalance, PAIR_DECIMALS) + const lpTokenAmountBeingRemovedBN = toBigNumber(formattedLP) + const amountToken1PerLPBN = toBigNumber(_amountToken1PerLP) + return String(lpTokenAmountBeingRemovedBN.times(amountToken1PerLPBN)) + }, [lpBalance, _amountToken1PerLP]) + + const loading = isLoading || isLoadingToken0Price || isLoadingToken1Price + + const token0UnstakedInUsd = Number(token0Price) * Number(amountToken0) + const token1UnstakedInUsd = Number(token1Price) * Number(amountToken1) + + return ( + + + My Position + + + {formatUSD( + token0StakedInUsd + + token1StakedInUsd + + token0UnstakedInUsd + + token1UnstakedInUsd, + )} + + + + + + Unstaked + + + + + Staked + + + + + + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PoolRewards/PoolRewards.tsx b/apps/tron/src/app/_common/ui/Pools/PoolRewards/PoolRewards.tsx new file mode 100644 index 0000000000..c83e551305 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PoolRewards/PoolRewards.tsx @@ -0,0 +1,46 @@ +import { + Card, + CardContent, + CardDescription, + CardGroup, + CardHeader, + CardLabel, + CardTitle, +} from '@sushiswap/ui' +import { CardItem } from '@sushiswap/ui' +import Image from 'next/image' +import { WTRX } from '~tron/_common/constants/token-list' + +export const PoolRewards = () => { + return ( + + + Pool Rewards + + Distributed to everyone who provides liquidity to this pool.
    +
    +
    + + + Tokens (per day) + + {' '} + TRX + + } + > + {'0'} + + + +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PoolSearchBar.tsx b/apps/tron/src/app/_common/ui/Pools/PoolSearchBar.tsx new file mode 100644 index 0000000000..92540ba871 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PoolSearchBar.tsx @@ -0,0 +1,42 @@ +import { FC, useCallback, useState, useTransition } from 'react' +import { ChipInput } from '@sushiswap/ui' +import { MagnifyingGlassIcon } from '@heroicons/react/20/solid' + +type PoolSearchBarProps = { + query: string + setQuery: React.Dispatch> + placeholder: string +} + +export const PoolSearchBar: FC = ({ + setQuery, + query, + placeholder, +}) => { + const [isPending, startTransition] = useTransition() + const [values, setValues] = useState(query.split(' ')) + + const onValueChange = useCallback( + (values: string[]) => { + const value = values?.[0]?.replaceAll(' ', '') + setValues([value ?? '']) + startTransition(() => setQuery(values.join(' '))) + }, + [setQuery], + ) + + return ( +
    + +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolAprCell.tsx b/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolAprCell.tsx new file mode 100644 index 0000000000..e1fa2b04a9 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolAprCell.tsx @@ -0,0 +1,5 @@ +import { formatPercent } from 'sushi/format' + +export const PoolAprCell = () => { + return
    {formatPercent(0)}
    +} diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolColumns.tsx b/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolColumns.tsx new file mode 100644 index 0000000000..af36b7c3f1 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolColumns.tsx @@ -0,0 +1,55 @@ +import { SkeletonCircle, SkeletonText } from '@sushiswap/ui' +import { ColumnDef } from '@tanstack/react-table' +import { ICON_SIZE } from '~tron/_common/constants/icon-size' +import { PoolNameCell } from './PoolNameCell' +import { PoolReservesCell } from './PoolReservesCell' +import { PoolTvlCell } from './PoolTvlCell' + +export const NAME_COLUMN: ColumnDef = { + id: 'name', + header: 'Name', + cell: (props) => , + meta: { + skeleton: ( +
    +
    + + +
    +
    + +
    +
    + ), + }, +} + +export const TVL_COLUMN: ColumnDef = { + id: 'TVL', + header: 'TVL', + cell: (props) => , + meta: { + skeleton: ( +
    +
    + +
    +
    + ), + }, +} + +export const RESERVES_COLUMN: ColumnDef = { + id: 'reserves', + header: 'Reserves', + cell: (props) => , + meta: { + skeleton: ( +
    +
    + +
    +
    + ), + }, +} diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolNameCell.tsx b/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolNameCell.tsx new file mode 100644 index 0000000000..89acb0bf54 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolNameCell.tsx @@ -0,0 +1,51 @@ +import { Currency, SkeletonText, classNames } from '@sushiswap/ui' +import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' +import { getBase58Address } from '~tron/_common/lib/utils/helpers' +import { Icon } from '../../General/Icon' +import { IRowData } from './PoolsTable' + +export const PoolNameCell = ({ data }: { data: IRowData }) => { + const { token0Address, token1Address } = data + const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ + tokenAddress: getBase58Address(token0Address), + }) + + const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ + tokenAddress: getBase58Address(token1Address), + }) + + return ( +
    +
    + {token0Address && token1Address && ( + + + + + )} +
    +
    + + {isLoadingToken0 ? ( + + ) : ( + token0Data?.symbol + )} + + / + + {isLoadingToken1 ? ( + + ) : ( + token1Data?.symbol + )} +
    + +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolReservesCell.tsx b/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolReservesCell.tsx new file mode 100644 index 0000000000..acfdedc3e5 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolReservesCell.tsx @@ -0,0 +1,30 @@ +import { SkeletonText } from '@sushiswap/ui' +import { formatNumber } from 'sushi/format' +import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' +import { formatUnits } from '~tron/_common/lib/utils/formatters' +import { getBase58Address } from '~tron/_common/lib/utils/helpers' +import { IRowData } from './PoolsTable' + +export const PoolReservesCell = ({ data }: { data: IRowData }) => { + const { token0Address, token1Address, reserve0, reserve1 } = data + const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ + tokenAddress: getBase58Address(token0Address), + }) + + const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ + tokenAddress: getBase58Address(token1Address), + }) + + if (isLoadingToken0 || isLoadingToken1) { + return + } + + return ( +
    + {formatNumber(formatUnits(reserve0, token0Data?.decimals ?? 18, 4))}{' '} + {token0Data?.symbol} /{' '} + {formatNumber(formatUnits(reserve1, token1Data?.decimals ?? 18, 4))}{' '} + {token1Data?.symbol} +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolTvlCell.tsx b/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolTvlCell.tsx new file mode 100644 index 0000000000..aecc3a7996 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolTvlCell.tsx @@ -0,0 +1,52 @@ +import { SkeletonText } from '@sushiswap/ui' +import { formatUSD } from 'sushi/format' +import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' +import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' +import { getBase58Address } from '~tron/_common/lib/utils/helpers' +import { IRowData } from './PoolsTable' + +export const PoolTvlCell = ({ data }: { data: IRowData }) => { + const { token0Address, token1Address, reserve0, reserve1 } = data + const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ + tokenAddress: getBase58Address(token0Address), + }) + + const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ + tokenAddress: getBase58Address(token1Address), + }) + + const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice( + { token: token0Data }, + ) + const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice( + { token: token1Data }, + ) + + if ( + isLoadingToken0 || + isLoadingToken1 || + isLoadingToken0Price || + isLoadingToken1Price + ) { + return + } + + const reserve0Usd = + (Number(token0Price) ?? 0) * + (Number(reserve0) / 10 ** (token0Data?.decimals ?? 18)) + const reserve1Usd = + (Number(token1Price) ?? 0) * + (Number(reserve1) / 10 ** (token1Data?.decimals ?? 18)) + + const poolTvl = reserve0Usd + reserve1Usd + + return ( +
    +
    + + {formatUSD(poolTvl)} + +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolsTable.tsx b/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolsTable.tsx new file mode 100644 index 0000000000..460c1c5bce --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolsTable.tsx @@ -0,0 +1,77 @@ +import { useDebounce } from '@sushiswap/hooks' +import { DataTable } from '@sushiswap/ui' +import { PaginationState } from '@tanstack/react-table' +import { useEffect, useMemo, useState } from 'react' +import { usePools } from '~tron/_common/lib/hooks/usePools' +import { NAME_COLUMN, RESERVES_COLUMN, TVL_COLUMN } from './PoolColumns' + +export type IRowData = { + name: string + pairAddress: string + token0Address: string + token1Address: string + reserve0: string + reserve1: string +} + +type PoolsTableProps = { + query: string + handlePoolsOnView: (pools: number) => void +} + +export const PoolsTable = ({ query, handlePoolsOnView }: PoolsTableProps) => { + const [paginationState, setPaginationState] = useState({ + pageIndex: 0, + pageSize: 10, + }) + const debouncedQuery = useDebounce(query, 250) + const { data, isLoading } = usePools() + + const filteredData = useMemo(() => { + if (!data) return [] + if (!debouncedQuery) return data + const lowercasedQuery = debouncedQuery.toLowerCase()?.replaceAll(' ', '') + + return data.filter((pool) => { + return ( + ['pairAddress', 'token0Address', 'token1Address'] as Array< + keyof (typeof data)[0] + > + ).some((key) => pool[key].toLowerCase().includes(lowercasedQuery)) + }) + }, [data, debouncedQuery]) + + useEffect(() => { + if (filteredData && !isLoading) { + handlePoolsOnView(filteredData.length) + } + }, [filteredData, isLoading]) + + return ( + ({ + name: pool.token0Address + '/' + pool.token1Address, + pairAddress: pool.pairAddress, + token0Address: pool.token0Address, + token1Address: pool.token1Address, + reserve0: pool.reserve0, + reserve1: pool.reserve1, + })) ?? [] + } + columns={[NAME_COLUMN, TVL_COLUMN, RESERVES_COLUMN]} + linkFormatter={(data) => { + const token0 = data.name.split('/')[0] + const token1 = data.name.split('/')[1] + return `/pool/${token0}:${token1}:${data.pairAddress}` + }} + pagination={true} + externalLink={false} + onPaginationChange={setPaginationState} + state={{ + pagination: paginationState, + }} + /> + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsView.tsx b/apps/tron/src/app/_common/ui/Pools/PoolsView.tsx new file mode 100644 index 0000000000..7c262fe807 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PoolsView.tsx @@ -0,0 +1,101 @@ +import { Tab } from '@headlessui/react' +import { Card, CardHeader, CardTitle, Container } from '@sushiswap/ui' +import { Button } from '@sushiswap/ui' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import React, { Fragment, useState } from 'react' +import { PoolSearchBar } from './PoolSearchBar' +import { PoolsTable } from './PoolsTable/PoolsTable' +import { PositionsTable } from './PositionsTable/PositionsTable' + +export const PoolsView = () => { + const [tab, setTab] = useState(0) + const { address } = useWallet() + const [query, setQuery] = useState('') + const [poolsOnView, setPoolsOnView] = useState(-1) + const [myPositionsOnView, setMyPositionsOnView] = useState(-1) + + const handlePoolsOnView = (pools: number) => { + setPoolsOnView(pools) + } + + const handleMyPositionsOnView = (positions: number) => { + setMyPositionsOnView(positions) + } + + return ( +
    + + +
    + + {({ selected }) => ( + + )} + + {address && ( + <> + + {({ selected }) => ( + + )} + + + )} +
    +
    + + + + + +
    + + + + Pools ({poolsOnView === -1 ? '-' : poolsOnView}) + + + + +
    +
    + +
    + + + + My Positions ( + {myPositionsOnView === -1 ? '-' : myPositionsOnView}) + + + + +
    +
    + +
    +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionColumns.tsx b/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionColumns.tsx new file mode 100644 index 0000000000..64615a0655 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionColumns.tsx @@ -0,0 +1,56 @@ +import { SkeletonCircle, SkeletonText } from '@sushiswap/ui' +import { ColumnDef } from '@tanstack/react-table' +import { ICON_SIZE } from '~tron/_common/constants/icon-size' +import { IMyPositionData } from '~tron/_common/types/get-pools-type' +import { PositionNameCell } from './PositionNameCell' +import { PositionSizeCell } from './PositionSizeCell' +import { PositionTvlCell } from './PositionTvlCell' + +export const POSITION_NAME_COLUMN: ColumnDef = { + id: 'name', + header: 'Name', + cell: (props) => , + meta: { + skeleton: ( +
    +
    + + +
    +
    + +
    +
    + ), + }, +} + +export const TVL_COLUMN: ColumnDef = { + id: 'TVL', + header: 'TVL', + cell: (props) => , + meta: { + skeleton: ( +
    +
    + +
    +
    + ), + }, +} + +export const SIZE_COLUMN: ColumnDef = { + id: 'size', + header: 'Size', + cell: (props) => , + meta: { + skeleton: ( +
    +
    + +
    +
    + ), + }, +} diff --git a/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionNameCell.tsx b/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionNameCell.tsx new file mode 100644 index 0000000000..b048bed543 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionNameCell.tsx @@ -0,0 +1,34 @@ +import { Currency, classNames } from '@sushiswap/ui' +import { IMyPositionData } from '~tron/_common/types/get-pools-type' +import { Icon } from '../../General/Icon' + +export const PositionNameCell = ({ data }: { data: IMyPositionData }) => { + const { token0, token1 } = data + + return ( +
    +
    + {token0 && token1 && ( + + + + + )} +
    +
    + + {token0?.symbol} + + / + + {token1?.symbol} +
    + +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionSizeCell.tsx b/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionSizeCell.tsx new file mode 100644 index 0000000000..7446962dd3 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionSizeCell.tsx @@ -0,0 +1,18 @@ +import { formatPercent } from 'sushi/format' +import { usePoolOwnership } from '~tron/_common/lib/hooks/usePoolOwnership' +import { IMyPositionData } from '~tron/_common/types/get-pools-type' + +export const PositionSizeCell = ({ data }: { data: IMyPositionData }) => { + const { pairAddress } = data + const { data: ownership } = usePoolOwnership({ pairAddress }) + + return ( +
    +
    + + {formatPercent(ownership?.ownership)} + +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionTvlCell.tsx b/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionTvlCell.tsx new file mode 100644 index 0000000000..11fd0df8b6 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionTvlCell.tsx @@ -0,0 +1,39 @@ +import { SkeletonText } from '@sushiswap/ui' +import { formatUSD } from 'sushi/format' +import { usePoolOwnership } from '~tron/_common/lib/hooks/usePoolOwnership' +import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' +import { IPositionRowData } from './PositionsTable' + +export const PositionTvlCell = ({ data }: { data: IPositionRowData }) => { + const { token0, token1, reserve0, reserve1, pairAddress } = data + const { data: ownership } = usePoolOwnership({ pairAddress }) + + const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice( + { token: token0 }, + ) + const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice( + { token: token1 }, + ) + + if (isLoadingToken0Price || isLoadingToken1Price) { + return + } + + const reserve0Usd = + (Number(token0Price) ?? 0) * (Number(reserve0) / 10 ** token0?.decimals) + const reserve1Usd = + (Number(token1Price) ?? 0) * (Number(reserve1) / 10 ** token1?.decimals) + + const poolTvl = + (reserve0Usd + reserve1Usd) * (Number(ownership?.ownership) ?? 0) + + return ( +
    +
    + + {formatUSD(poolTvl)} + +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionsTable.tsx b/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionsTable.tsx new file mode 100644 index 0000000000..7573bd2bbd --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionsTable.tsx @@ -0,0 +1,92 @@ +import { useDebounce } from '@sushiswap/hooks' +import { DataTable } from '@sushiswap/ui' +import { PaginationState } from '@tanstack/react-table' +import { useEffect, useMemo, useState } from 'react' +import { useMyPositions } from '~tron/_common/lib/hooks/useMyPositions' +import { IMyPositionData } from '~tron/_common/types/get-pools-type' +import { IToken } from '~tron/_common/types/token-type' +import { + POSITION_NAME_COLUMN, + SIZE_COLUMN, + TVL_COLUMN, +} from './PositionColumns' + +type PositionsTableProps = { + query: string + handleMyPositionsOnView: (positions: number) => void +} + +export type IPositionRowData = { + token0: IToken + token1: IToken + pairAddress: string + reserve0: string + reserve1: string +} + +export const PositionsTable = ({ + query, + handleMyPositionsOnView, +}: PositionsTableProps) => { + const [paginationState, setPaginationState] = useState({ + pageIndex: 0, + pageSize: 10, + }) + const debouncedQuery = useDebounce(query, 250) + const { data, isLoading } = useMyPositions() + + const filteredData = useMemo(() => { + if (!data) return [] + if (!debouncedQuery) return data + const lowercasedQuery = debouncedQuery.toLowerCase()?.replaceAll(' ', '') + + return data.filter((pool) => { + const poolValues = [ + pool.pairAddress, + pool.token0?.address, + pool.token1?.address, + pool.token0?.symbol, + pool.token1?.symbol, + pool.token0?.name, + pool.token1?.name, + ] + + return poolValues.some((value) => + value?.toLowerCase().includes(lowercasedQuery), + ) + }) + }, [data, debouncedQuery]) + + useEffect(() => { + if (filteredData && !isLoading) { + handleMyPositionsOnView(filteredData.length) + } + }, [filteredData, isLoading]) + + return ( + ({ + token0: pool?.token0, + token1: pool?.token1, + pairAddress: pool?.pairAddress, + reserve0: pool?.reserve0, + reserve1: pool?.reserve1, + })) ?? [] + } + columns={[POSITION_NAME_COLUMN, TVL_COLUMN, SIZE_COLUMN]} + linkFormatter={(data: IMyPositionData) => { + const token0 = data?.token0?.address + const token1 = data?.token1?.address + return `/pool/${token0}:${token1}:${data?.pairAddress}` + }} + externalLink={false} + pagination={true} + state={{ + pagination: paginationState, + }} + onPaginationChange={setPaginationState} + /> + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Remove/MinimumReceive.tsx b/apps/tron/src/app/_common/ui/Pools/Remove/MinimumReceive.tsx new file mode 100644 index 0000000000..18ef3ab9aa --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Remove/MinimumReceive.tsx @@ -0,0 +1,131 @@ +import { + SlippageToleranceStorageKey, + useSlippageTolerance, +} from '@sushiswap/hooks' +import { Card, CardGroup, CardLabel } from '@sushiswap/ui' +import { useEffect, useMemo } from 'react' +import { PAIR_DECIMALS } from '~tron/_common/constants/pair-decimals' +import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' +import { + formatUnitsForInput, + parseUnits, + removeDecimals, + toBigNumber, +} from '~tron/_common/lib/utils/formatters' +import { + useRemoveLiqDispatch, + useRemoveLiqState, +} from '~tron/pool/[poolId]/remove-provider' +import { usePoolState } from '~tron/pool/pool-provider' +import { LiquidityItem } from '../PoolDetails/LiquidityItem' + +export const MinimumReceive = () => { + const { + percentage, + lpBalance, + totalSupplyLP, + amountToken0PerLP, + amountToken1PerLP, + } = useRemoveLiqState() + const { setLPToRemove, setMinAmountToken0, setMinAmountToken1 } = + useRemoveLiqDispatch() + const { token0, token1 } = usePoolState() + const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice( + { token: token0 }, + ) + const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice( + { token: token1 }, + ) + const [slippageTolerance] = useSlippageTolerance( + SlippageToleranceStorageKey.RemoveLiquidity, + ) + const slippage = + slippageTolerance === 'AUTO' ? 0.005 : Number(slippageTolerance) / 100 + + const lpTokenAmountBeingRemoved = useMemo(() => { + if (!lpBalance) return '0' + const lpBalanceBN = toBigNumber(lpBalance) + const percentageBN = toBigNumber(percentage).div(100) + //will be in wei + return removeDecimals(lpBalanceBN.times(percentageBN)) + }, [lpBalance, percentage]) + + useEffect(() => { + if (lpTokenAmountBeingRemoved) { + setLPToRemove(lpTokenAmountBeingRemoved) + } + }, [lpTokenAmountBeingRemoved]) + + const amountToken0 = useMemo(() => { + if (!lpTokenAmountBeingRemoved || !amountToken0PerLP) return '0' + const formattedLP = formatUnitsForInput( + lpTokenAmountBeingRemoved, + PAIR_DECIMALS, + ) + const lpTokenAmountBeingRemovedBN = toBigNumber(formattedLP) + const amountToken0PerLPBN = toBigNumber(amountToken0PerLP) + return String(lpTokenAmountBeingRemovedBN.times(amountToken0PerLPBN)) + }, [lpTokenAmountBeingRemoved, amountToken0PerLP]) + + const amountToken1 = useMemo(() => { + if (!lpTokenAmountBeingRemoved || !amountToken1PerLP) return '0' + const formattedLP = formatUnitsForInput( + lpTokenAmountBeingRemoved, + PAIR_DECIMALS, + ) + const lpTokenAmountBeingRemovedBN = toBigNumber(formattedLP) + const amountToken1PerLPBN = toBigNumber(amountToken1PerLP) + return String(lpTokenAmountBeingRemovedBN.times(amountToken1PerLPBN)) + }, [lpTokenAmountBeingRemoved, amountToken1PerLP]) + + const minAmountToken0 = useMemo(() => { + if (!amountToken0) return '' + const output = Number(amountToken0) * (1 - slippage) + return output.toString() + }, [slippageTolerance, amountToken0, slippage]) + + useEffect(() => { + if (minAmountToken0) { + const parsedAmount = parseUnits(minAmountToken0, token0?.decimals ?? 18) + + setMinAmountToken0(parsedAmount) + } + }, [minAmountToken0]) + + const minAmountToken1 = useMemo(() => { + if (!amountToken1) return '' + const output = Number(amountToken1) * (1 - slippage) + return output.toString() + }, [slippageTolerance, amountToken1, slippage]) + + useEffect(() => { + if (minAmountToken1) { + const parsedAmount = parseUnits(minAmountToken1, token1?.decimals ?? 18) + + setMinAmountToken1(parsedAmount) + } + }, [minAmountToken1]) + + const isLoading = + !totalSupplyLP || isLoadingToken0Price || isLoadingToken1Price + + return ( + + + You'll receive at least: + + + + + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Remove/RemoveButton.tsx b/apps/tron/src/app/_common/ui/Pools/Remove/RemoveButton.tsx new file mode 100644 index 0000000000..d2070baa82 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Remove/RemoveButton.tsx @@ -0,0 +1,235 @@ +import { + createFailedToast, + createInfoToast, + createSuccessToast, +} from '@sushiswap/notifications' +import { Button } from '@sushiswap/ui' +import { useQueryClient } from '@tanstack/react-query' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { useMemo } from 'react' +import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' +import { PAIR_DECIMALS } from '~tron/_common/constants/pair-decimals' +import { useAllowance } from '~tron/_common/lib/hooks/useAllowance' +import { useTronWeb } from '~tron/_common/lib/hooks/useTronWeb' +import { formatUnitsForInput } from '~tron/_common/lib/utils/formatters' +import { + cleanArgs, + getArgsForRemoveLiquidity, + getDeadline, + getRemoveLiquidityFunctionSelector, + getTransactionInfo, + parseTxnError, + safeGasEstimates, +} from '~tron/_common/lib/utils/helpers' +import { getTronscanTxnLink } from '~tron/_common/lib/utils/tronscan-helpers' +import { ApproveToken } from '~tron/_common/ui/Shared/ApproveToken' +import { WalletConnector } from '~tron/_common/ui/WalletConnector/WalletConnector' +import { + useRemoveLiqDispatch, + useRemoveLiqState, +} from '~tron/pool/[poolId]/remove-provider' +import { usePoolState } from '~tron/pool/pool-provider' + +export const RemoveButton = () => { + const queryClient = useQueryClient() + const { address, connected, signTransaction } = useWallet() + const isConnected = address && connected + const { + percentage, + isTxnPending, + lpToRemove, + minAmountToken0, + minAmountToken1, + } = useRemoveLiqState() + const { setIsTxnPending, setPercentage } = useRemoveLiqDispatch() + const { token0, token1, pairAddress } = usePoolState() + const { tronWeb } = useTronWeb() + const { data: allowanceAmount, refetch } = useAllowance({ + tokenAddress: pairAddress as string, + ownerAddress: address as string, + spenderAddress: ROUTER_CONTRACT, + }) + + const removeLiquidity = async () => { + if ( + !isConnected || + !address || + !token0 || + !token1 || + !lpToRemove || + !minAmountToken0 || + !minAmountToken1 + ) { + return + } + try { + setIsTxnPending(true) + const methodNames = getRemoveLiquidityFunctionSelector(token0, token1) + const deadline = getDeadline() + const args = [] + for (let i = 0; i < methodNames.length; i++) { + const _args = getArgsForRemoveLiquidity( + methodNames[i], + token0.address, + token1.address, + lpToRemove, + minAmountToken0, + minAmountToken1, + address, + deadline, + ) + args.push(_args) + } + console.log(args) + const estimates = await safeGasEstimates(tronWeb, args) + console.log('estimates', estimates) + const safeGasEstimate = estimates.findIndex( + (predicate) => predicate !== undefined, + ) + console.log('safeGasEstimate', safeGasEstimate) + if (safeGasEstimate === -1) { + throw new Error('Failed to estimate energy. Transaction will fail.') + } + const argsForTransaction = cleanArgs(args[safeGasEstimate]) + console.log('argsForTransaction', argsForTransaction) + + const { transaction } = + await tronWeb.transactionBuilder.triggerSmartContract( + ...argsForTransaction, + ) + const signedTransation = await signTransaction(transaction) + const result = await tronWeb.trx.sendRawTransaction(signedTransation) + + if (!result.result && 'code' in result) { + throw new Error(parseTxnError(result.code)) + } + const txId = result?.txid + + createInfoToast({ + summary: `Removing liquidity from the ${token0.symbol}/${token1.symbol} pair.`, + type: 'swap', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + txHash: txId, + href: getTronscanTxnLink(txId), + }) + + const transactionInfo = await getTransactionInfo(tronWeb, txId) + if (transactionInfo?.receipt?.result !== 'SUCCESS') { + throw new Error('Transaction failed') + } + + //create success toast + createSuccessToast({ + summary: 'Successfully removed liquidity!', + txHash: txId, + type: 'swap', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + href: getTronscanTxnLink(txId), + }) + onSuccess() + } catch (error) { + const errorMessage = + typeof error === 'string' + ? error + : (error as Error)?.message ?? + 'An error occurred while trying to remove liquidity.' + //create error toast + createFailedToast({ + summary: errorMessage, + type: 'swap', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + }) + console.log(error) + setIsTxnPending(false) + } + } + + const onSuccess = () => { + setPercentage(0) + setIsTxnPending(false) + queryClient.invalidateQueries({ + queryKey: [ + 'useTokenBalance', + { accountAddress: address, tokenAddress: pairAddress }, + ], + }) + } + + const allowanceFormatted = formatUnitsForInput( + allowanceAmount ?? '0', + token0?.decimals ?? 18, + ) + + const buttonText = useMemo(() => { + if (isTxnPending) { + ;('Removing') + } + if (percentage === 0) { + return 'Enter Amount' + } + if ( + allowanceAmount && + Number(formatUnitsForInput(lpToRemove, PAIR_DECIMALS)) > + Number(allowanceFormatted) + ) { + return 'Approve' + } + return 'Remove' + }, [ + percentage, + isTxnPending, + allowanceFormatted, + allowanceAmount, + lpToRemove, + ]) + + if (!isConnected) { + return ( + + ) + } + + if (buttonText === 'Approve') { + return ( + { + await refetch() + }} + /> + ) + } + + return ( + + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Remove/RemoveInput.tsx b/apps/tron/src/app/_common/ui/Pools/Remove/RemoveInput.tsx new file mode 100644 index 0000000000..7f575d82ad --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Remove/RemoveInput.tsx @@ -0,0 +1,52 @@ +import { Button, Card, Message } from '@sushiswap/ui' +import { + useRemoveLiqDispatch, + useRemoveLiqState, +} from '~tron/pool/[poolId]/remove-provider' + +const PercentageOptions = [25, 50, 75, 100] + +export const RemoveInput = () => { + const { percentage, lpBalance } = useRemoveLiqState() + const { setPercentage } = useRemoveLiqDispatch() + + const noLpToken = Number(lpBalance) <= 0 + + return ( + <> + {noLpToken ? ( + + No LP tokens found. + + ) : null} + +
    +
    {`${percentage}%`}
    +
    + {PercentageOptions.map((option) => ( + + ))} +
    +
    + setPercentage(Number(e.target.value))} + type="range" + min="1" + max="100" + className="w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer range-lg dark:bg-gray-700" + disabled={noLpToken} + /> +
    + + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/Remove/RemoveLiquidity.tsx b/apps/tron/src/app/_common/ui/Pools/Remove/RemoveLiquidity.tsx new file mode 100644 index 0000000000..be56ed5e82 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/Remove/RemoveLiquidity.tsx @@ -0,0 +1,14 @@ +'use client' +import { RemoveInput } from './RemoveInput' +import { MinimumReceive } from './MinimumReceive' +import { RemoveButton } from './RemoveButton' + +export const RemoveLiquidity = () => { + return ( +
    + + + +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Pools/ReserveHelper.tsx b/apps/tron/src/app/_common/ui/Pools/ReserveHelper.tsx new file mode 100644 index 0000000000..7ac4f019ac --- /dev/null +++ b/apps/tron/src/app/_common/ui/Pools/ReserveHelper.tsx @@ -0,0 +1,45 @@ +import { useEffect } from 'react' +import { useReserves } from '~tron/_common/lib/hooks/useReserves' +import { getValidTokenAddress } from '~tron/_common/lib/utils/helpers' +import { usePoolDispatch, usePoolState } from '~tron/pool/pool-provider' + +export const ReserveHelper = () => { + const { token0, token1, pairAddress } = usePoolState() + const { setReserve0, setReserve1 } = usePoolDispatch() + + const { data, isLoading } = useReserves({ + pairAddress: pairAddress, + token0: token0, + token1: token1, + }) + + useEffect(() => { + if (!pairAddress) { + setReserve0('') + setReserve1('') + } + if ( + !isLoading && + data && + data?.length > 0 && + pairAddress && + token0 && + token1 + ) { + const reserve0 = data.find( + (d) => + getValidTokenAddress(d.address!) === + getValidTokenAddress(token0?.address), + ) + const reserve1 = data.find( + (d) => + getValidTokenAddress(d.address!) === + getValidTokenAddress(token1?.address), + ) + setReserve0(reserve0?.reserve ?? '') + setReserve1(reserve1?.reserve ?? '') + } + }, [data, isLoading, pairAddress, token0, token1]) + + return null +} diff --git a/apps/tron/src/app/_common/ui/Shared/ApproveToken.tsx b/apps/tron/src/app/_common/ui/Shared/ApproveToken.tsx new file mode 100644 index 0000000000..6c670e590a --- /dev/null +++ b/apps/tron/src/app/_common/ui/Shared/ApproveToken.tsx @@ -0,0 +1,165 @@ +import { + createFailedToast, + createInfoToast, + createSuccessToast, +} from '@sushiswap/notifications' +import { + Button, + Command, + CommandGroup, + CommandItem, + Popover, + PopoverContent, + PopoverTrigger, +} from '@sushiswap/ui' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { useState } from 'react' +import { MAX_UINT256 } from '~tron/_common/constants/max-uint256' +import { useTronWeb } from '~tron/_common/lib/hooks/useTronWeb' +import { parseUnits, toBigNumber } from '~tron/_common/lib/utils/formatters' +import { + getTransactionInfo, + parseTxnError, +} from '~tron/_common/lib/utils/helpers' +import { getTronscanTxnLink } from '~tron/_common/lib/utils/tronscan-helpers' +import { IToken } from '~tron/_common/types/token-type' + +export const ApproveToken = ({ + tokenToApprove, + amount, + spenderAddress, + onSuccess, +}: { + tokenToApprove: IToken + amount: string + spenderAddress: string + onSuccess: () => Promise +}) => { + const [isApproving, setIsApproving] = useState(false) + const { address, signTransaction } = useWallet() + const { tronWeb } = useTronWeb() + + const approveToken = async (type: 'one-time' | 'unlimited') => { + try { + setIsApproving(true) + const parsedAmount = parseUnits(amount, tokenToApprove.decimals) + const approvalAmount = type === 'one-time' ? parsedAmount : MAX_UINT256 + const { transaction } = + await tronWeb.transactionBuilder.triggerSmartContract( + tokenToApprove.address, //contract address + 'approve(address,uint256)', //function name + {}, // options + [ + { type: 'address', value: spenderAddress }, + { type: 'uint256', value: approvalAmount }, + ], //parameters + address, //issuerAddress + ) + const signedTransation = await signTransaction(transaction) + const _result = await tronWeb.trx.sendRawTransaction(signedTransation) + if (!_result.result && 'code' in _result) { + throw new Error(parseTxnError(_result.code)) + } + const txId = _result?.txid + createInfoToast({ + summary: + type === 'one-time' + ? 'Approving One Time...' + : 'Approval Unlimited Amount...', + type: 'approval', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + txHash: txId, + href: getTronscanTxnLink(txId), + }) + const transactionInfo = await getTransactionInfo(tronWeb, txId) + if (transactionInfo?.receipt?.result !== 'SUCCESS') { + throw new Error('Approval failed') + } + //create success toast + createSuccessToast({ + summary: 'Approval successful', + txHash: txId, + type: 'swap', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + href: getTronscanTxnLink(txId), + }) + await onSuccess() + setIsApproving(false) + } catch (error) { + const errorMessage = + typeof error === 'string' + ? error + : (error as Error)?.message ?? + 'An error occurred while setting approval' + //create error toast + createFailedToast({ + summary: errorMessage, + type: 'swap', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + }) + console.log(error) + setIsApproving(false) + } + } + + return ( + + + + + + + +
    { + await approveToken('one-time') + }} + className="flex flex-col" + > +

    Approve one-time only

    +

    + You'll give your approval to spend{' '} + {toBigNumber(amount).toString(10)} {tokenToApprove.symbol}{' '} + on your behalf +

    +
    +
    + +
    { + await approveToken('unlimited') + }} + className="flex flex-col" + > +

    Approve unlimited amount

    +

    + You won't need to approve again next time you want to + spend {tokenToApprove.symbol}. +

    +
    +
    +
    +
    +
    +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Shared/DollarAmountDisplay.tsx b/apps/tron/src/app/_common/ui/Shared/DollarAmountDisplay.tsx new file mode 100644 index 0000000000..811c3256de --- /dev/null +++ b/apps/tron/src/app/_common/ui/Shared/DollarAmountDisplay.tsx @@ -0,0 +1,36 @@ +import { SkeletonText } from '@sushiswap/ui' + +type DollarAmountDisplayProps = { + isLoading: boolean + error?: string + value: string +} +export const DollarAmountDisplay = ({ + isLoading, + error, + value, +}: DollarAmountDisplayProps) => { + const [big, portion] = (value ? `${Number(value).toFixed(2)}` : '0.00').split( + '.', + ) + + if (isLoading) { + return ( +
    + +
    + ) + } + + if (error) { + return ( +

    {error}

    + ) + } + + return ( +

    + $ {big}.{portion} +

    + ) +} diff --git a/apps/tron/src/app/_common/ui/Shared/TokenBalanceDisplay.tsx b/apps/tron/src/app/_common/ui/Shared/TokenBalanceDisplay.tsx new file mode 100644 index 0000000000..2764114be3 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Shared/TokenBalanceDisplay.tsx @@ -0,0 +1,51 @@ +import { SkeletonText, classNames } from '@sushiswap/ui' +import { WalletIcon } from '@sushiswap/ui/icons/WalletIcon' +import { useMemo } from 'react' +import { formatUnits } from '~tron/_common/lib/utils/formatters' + +type TokenBalanceDisplayProps = { + amount: number + isLoading: boolean + decimals: number + maxAmount?: () => void + type: 'input' | 'output' +} + +export const TokenBalanceDisplay = ({ + amount, + isLoading, + decimals, + maxAmount, + type, +}: TokenBalanceDisplayProps) => { + const [big, portion] = useMemo( + () => (amount ? formatUnits(amount, decimals, 4) : '0.00')?.split('.'), + [amount, decimals], + ) + + return ( + + ) +} diff --git a/apps/tron/src/app/_common/ui/Swap/AmountIn.tsx b/apps/tron/src/app/_common/ui/Swap/AmountIn.tsx new file mode 100644 index 0000000000..bf00d51b29 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Swap/AmountIn.tsx @@ -0,0 +1,52 @@ +import { useDebounce } from '@sushiswap/hooks' +import { useEffect } from 'react' +import { useAmountsOut } from '~tron/_common/lib/hooks/useAmountsOut' +import { + formatUnitsForInput, + parseUnits, +} from '~tron/_common/lib/utils/formatters' +import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' +import { TokenInput } from '../Input/TokenInput' + +export const AmountIn = () => { + const { token0, amountIn, token1 } = useSwapState() + const { setToken0, setAmountIn, setAmountOut } = useSwapDispatch() + + const debouncedAmountIn = useDebounce(amountIn, 500) + + const { data: amountsOut } = useAmountsOut({ + amountIn: parseUnits(debouncedAmountIn, token0.decimals), + }) + + useEffect(() => { + if (amountsOut && amountsOut?.length !== 0) { + const _amountOut = formatUnitsForInput( + amountsOut[amountsOut?.length - 1], + token1.decimals, + ) + if (_amountOut === '0') { + setAmountOut('') + } else { + setAmountOut(_amountOut) + } + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [amountsOut, token1?.decimals]) + + useEffect(() => { + if (Number(amountIn) === 0) { + setAmountOut('') + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [amountIn]) + + return ( + + ) +} diff --git a/apps/tron/src/app/_common/ui/Swap/AmountOut.tsx b/apps/tron/src/app/_common/ui/Swap/AmountOut.tsx new file mode 100644 index 0000000000..338b14dec0 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Swap/AmountOut.tsx @@ -0,0 +1,17 @@ +import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' +import { TokenInput } from '../Input/TokenInput' + +export const AmountOut = () => { + const { token1, amountOut } = useSwapState() + const { setToken1, setAmountOut } = useSwapDispatch() + + return ( + + ) +} diff --git a/apps/tron/src/app/_common/ui/Swap/ReviewSwapDialog.tsx b/apps/tron/src/app/_common/ui/Swap/ReviewSwapDialog.tsx new file mode 100644 index 0000000000..5fb30b4c01 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Swap/ReviewSwapDialog.tsx @@ -0,0 +1,168 @@ +import { PlusIcon } from '@heroicons/react/24/outline' +import { + SlippageToleranceStorageKey, + useSlippageTolerance, +} from '@sushiswap/hooks' +import { Badge } from '@sushiswap/ui' +import { List } from '@sushiswap/ui' +import { SkeletonCircle } from '@sushiswap/ui' +import { Dialog, DialogClose, DialogContent, classNames } from '@sushiswap/ui' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import Link from 'next/link' +import { useMemo, useRef } from 'react' +import { formatPercent } from 'sushi/format' +import { truncateText } from '~tron/_common/lib/utils/formatters' +import { getTronscanAddressLink } from '~tron/_common/lib/utils/tronscan-helpers' +import { + warningSeverity, + warningSeverityClassName, +} from '~tron/_common/lib/utils/warning-severity' +import { useSwapState } from '~tron/swap/swap-provider' +import { Icon } from '../General/Icon' +import { WalletConnector } from '../WalletConnector/WalletConnector' +import { ReviewSwapDialogTrigger } from './ReviewSwapDialogTrigger' +import { SwapButton } from './SwapButton' + +export const ReviewSwapDialog = () => { + const { token0, token1, amountIn, amountOut, priceImpactPercentage } = + useSwapState() + const closeBtnRef = useRef(null) + const { address, connected } = useWallet() + const isConnected = address && connected + const [slippageTolerance] = useSlippageTolerance( + SlippageToleranceStorageKey.Swap, + ) + const slippage = + slippageTolerance === 'AUTO' ? 0.005 : Number(slippageTolerance) / 100 + + const closeModal = () => { + closeBtnRef?.current?.click() + } + + const minOutput = useMemo(() => { + if (!amountOut) return '' + if ( + (token0?.symbol === 'WTRX' && token1?.address === 'TRON') || + (token0?.address === 'TRON' && token1?.symbol === 'WTRX') + ) { + return amountIn + } + + const output = Number(amountOut) * (1 - slippage) + return String(output) + }, [amountOut, slippage, token0, token1, amountIn]) + + const severityClass = useMemo(() => { + return warningSeverityClassName(warningSeverity(priceImpactPercentage)) + }, [priceImpactPercentage]) + + return ( + + {isConnected ? ( + + ) : ( + + )} + + +
    +
    +
    +

    + Buy {amountOut} {token1?.symbol} +

    +

    + Sell {amountIn} {token0?.symbol} +

    +
    +
    +
    + + +
    + } + > + {token1 ? ( + + ) : ( + + )} + +
    +
    +
    +
    + + + TRON + + + -{formatPercent(priceImpactPercentage / 100)} + + + + {minOutput} {token1?.symbol} + + + ~$0.00 + + + {address && ( + + + + + {truncateText(address)} + + + + + )} + +
    +
    +
    + +
    +
    +
    + + + ) +} diff --git a/apps/tron/src/app/_common/ui/Swap/ReviewSwapDialogTrigger.tsx b/apps/tron/src/app/_common/ui/Swap/ReviewSwapDialogTrigger.tsx new file mode 100644 index 0000000000..dd86fc0a4c --- /dev/null +++ b/apps/tron/src/app/_common/ui/Swap/ReviewSwapDialogTrigger.tsx @@ -0,0 +1,197 @@ +import { Button, Checkbox, DialogTrigger } from '@sushiswap/ui' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { useEffect, useMemo, useState } from 'react' +import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' +import { useAllowance } from '~tron/_common/lib/hooks/useAllowance' +import { usePriceImpact } from '~tron/_common/lib/hooks/usePriceImpact' +import { useReserves } from '~tron/_common/lib/hooks/useReserves' +import { useRoutes } from '~tron/_common/lib/hooks/useRoutes' +import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' +import { formatUnitsForInput } from '~tron/_common/lib/utils/formatters' +import { getIfWrapOrUnwrap } from '~tron/_common/lib/utils/helpers' +import { warningSeverity } from '~tron/_common/lib/utils/warning-severity' +import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' +import { ApproveToken } from '../Shared/ApproveToken' + +export const ReviewSwapDialogTrigger = () => { + const [isChecked, setIsChecked] = useState(false) + const { token0, token1, amountIn, amountOut, isTxnPending } = useSwapState() + const { setPriceImpactPercentage, setRoute } = useSwapDispatch() + const { address } = useWallet() + const { data: allowanceAmount, refetch } = useAllowance({ + tokenAddress: token0?.address as string, + ownerAddress: address as string, + spenderAddress: ROUTER_CONTRACT, + }) + const { data: tokenBalance, isLoading } = useTokenBalance({ + accountAddress: address, + tokenAddress: token0.address, + }) + const { data: routeData, isLoading: isLoadingRoutes } = useRoutes({ + token0, + token1, + }) + //these reserves are always going to be defined if a pair exists + const { data: reserves, isLoading: isReservesLoading } = useReserves({ + pairAddress: routeData?.pairs?.[0], + token0, + token1, + }) + //these reserves are for is the swap needs an intermediate pair + const { data: reserves1, isLoading: isReserves1Loading } = useReserves({ + pairAddress: routeData?.pairs?.[1], + token0, + token1, + }) + + //this number is always going to be defined if the reserves exists + const { data: priceImpactPercentage } = usePriceImpact({ + amount: amountIn, + token: token0, + reserves, + }) + + //this number is for the price impact of the second pair in a hop is needed + const { data: priceImpactPercentage1 } = usePriceImpact({ + amount: amountOut, + token: token1, + reserves: reserves1, + }) + + const priceImpactTotal = + (priceImpactPercentage ?? 0) + (priceImpactPercentage1 ?? 0) + + useEffect(() => { + if (isLoadingRoutes) { + setRoute([]) + } + if (routeData && routeData.route.length > 0 && !isLoadingRoutes) { + setRoute(routeData.route) + } + }, [routeData, isLoadingRoutes]) + + const swapType = useMemo(() => { + return getIfWrapOrUnwrap(token0, token1) + }, [token0, token1]) + + useEffect(() => { + setPriceImpactPercentage(priceImpactTotal ?? 0) + }, [priceImpactTotal]) + + const refreshAllowance = async () => { + await refetch() + } + + const hasInsufficientBalance = useMemo(() => { + if (isLoading) return true + return ( + Number(formatUnitsForInput(tokenBalance ?? '0', token0.decimals)) < + Number(amountIn) + ) + }, [tokenBalance, token0, amountIn, isLoading]) + + const noRoutes = + swapType === 'swap' && + !isLoadingRoutes && + routeData && + routeData.route?.length === 0 + + const allowanceFormatted = formatUnitsForInput( + allowanceAmount ?? '0', + token0?.decimals, + ) + + const insufficientLiquidity = priceImpactTotal && priceImpactTotal >= 100 + + const buttonText = useMemo(() => { + if (isTxnPending) { + return 'Swapping' + } + if (!amountIn || amountIn === '0') { + return 'Enter Amount' + } + if (hasInsufficientBalance) { + return 'Insufficient Balance' + } + if (swapType === 'unwrap') { + return 'Unwrap' + } + if (swapType === 'wrap') { + return 'Wrap' + } + if (noRoutes) { + return 'No Routes Found' + } + if (insufficientLiquidity) { + return 'Insufficient Liquidity' + } + if ( + allowanceAmount && + Number(amountIn) > Number(allowanceFormatted) && + swapType === 'swap' + ) { + return 'Approve' + } + return 'Review Swap' + }, [ + amountIn, + allowanceAmount, + hasInsufficientBalance, + noRoutes, + allowanceFormatted, + swapType, + insufficientLiquidity, + isTxnPending, + ]) + + const userConfirmationNeeded = useMemo(() => { + if ( + warningSeverity(priceImpactPercentage ?? 0) > 3 && + (buttonText === 'Review Swap' || buttonText === 'Approve') + ) { + return true + } + return false + }, [priceImpactPercentage, buttonText]) + + return ( + <> + {buttonText === 'Approve' ? ( + + ) : ( + + + + )} + {userConfirmationNeeded && !isChecked ? ( +
    setIsChecked(!isChecked)} + className="flex items-start px-4 py-3 mt-4 rounded-xl bg-red/20 dark:bg-red/40 cursor-pointer" + > + + +
    + ) : null} + + ) +} diff --git a/apps/tron/src/app/_common/ui/Swap/SwapButton.tsx b/apps/tron/src/app/_common/ui/Swap/SwapButton.tsx new file mode 100644 index 0000000000..be73d1b9e7 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Swap/SwapButton.tsx @@ -0,0 +1,244 @@ +import { + createFailedToast, + createInfoToast, + createSuccessToast, +} from '@sushiswap/notifications' +import { useQueryClient } from '@tanstack/react-query' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { useMemo } from 'react' +import { WTRX } from '~tron/_common/constants/token-list' +import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' + +import { Button, Dots } from '@sushiswap/ui' +import { useTronWeb } from '~tron/_common/lib/hooks/useTronWeb' +import { parseUnits } from '~tron/_common/lib/utils/formatters' +import { + cleanArgs, + getArgsForSwap, + getDeadline, + getIfWrapOrUnwrap, + getRouterFunctionSelectors, + getTransactionInfo, + parseTxnError, + safeGasEstimates, +} from '~tron/_common/lib/utils/helpers' +import { getTronscanTxnLink } from '~tron/_common/lib/utils/tronscan-helpers' + +export const SwapButton = ({ + closeModal, + minOutput, +}: { closeModal: () => void; minOutput: string }) => { + const queryClient = useQueryClient() + const { token0, token1, isTxnPending, amountIn, amountOut, route } = + useSwapState() + const { + setIsTxnPending, + setAmountIn, + setAmountOut, + setPriceImpactPercentage, + } = useSwapDispatch() + const { tronWeb } = useTronWeb() + const { address, signTransaction } = useWallet() + + const swapType = useMemo(() => { + return getIfWrapOrUnwrap(token0, token1) + }, [token0, token1]) + + const swapToken = async () => { + if (!address) return + let txId = '' + try { + setIsTxnPending(true) + const parsedAmountIn = parseUnits(amountIn, token0?.decimals) + const parsedAmountOut = parseUnits(amountOut, token1?.decimals) + + if (swapType === 'wrap') { + const { transaction } = + await tronWeb.transactionBuilder.triggerSmartContract( + WTRX.address, //contract address + 'deposit()', //function name + { callValue: parsedAmountIn }, // options + [], //parameters + address, //issuerAddress + ) + const signedTransation = await signTransaction(transaction) + const _result = await tronWeb.trx.sendRawTransaction(signedTransation) + console.log('_result', _result) + if (!_result.result && 'code' in _result) { + throw new Error(parseTxnError(_result.code)) + } + txId = _result?.txid + createInfoToast({ + summary: 'Wrapping TRX...', + type: 'swap', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + txHash: txId, + href: getTronscanTxnLink(txId), + }) + } else if (swapType === 'unwrap') { + const { transaction } = + await tronWeb.transactionBuilder.triggerSmartContract( + WTRX.address, //contract address + 'withdraw(uint256)', //function name + {}, // options + [{ type: 'uint256', value: parsedAmountIn }], //parameters + address, //issuerAddress + ) + const signedTransation = await signTransaction(transaction) + const _result = await tronWeb.trx.sendRawTransaction(signedTransation) + console.log('_result', _result) + if (!_result.result && 'code' in _result) { + throw new Error(parseTxnError(_result.code)) + } + + txId = _result?.txid + createInfoToast({ + summary: 'Unwrapping WTRX...', + type: 'swap', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + txHash: txId, + href: getTronscanTxnLink(txId), + }) + } else { + const methodNames = getRouterFunctionSelectors(route) + console.log('methodNames', methodNames) + const deadline = getDeadline() + const parsedAmountOutMin = parseUnits(minOutput, token1?.decimals) + + const args = [] + for (let i = 0; i < methodNames.length; i++) { + const _args = getArgsForSwap( + methodNames[i], + parsedAmountIn, + parsedAmountOut, + parsedAmountIn, + parsedAmountOutMin, + route, + address, + deadline, + address, + ) + args.push(_args) + } + console.log('args', args) + + const estimates = await safeGasEstimates(tronWeb, args) + console.log('estimates', estimates) + const safeGasEstimate = estimates.findIndex( + (predicate) => predicate !== undefined, + ) + console.log('safeGasEstimate', safeGasEstimate) + if (safeGasEstimate === -1) { + throw new Error('Failed to estimate energy. Transaction will fail.') + } + const argsForTransaction = cleanArgs(args[safeGasEstimate]) + console.log('argsForTransaction', argsForTransaction) + + const { transaction } = + await tronWeb.transactionBuilder.triggerSmartContract( + ...argsForTransaction, + ) + + const signedTransation = await signTransaction(transaction) + const _result = await tronWeb.trx.sendRawTransaction(signedTransation) + + if (!_result.result && 'code' in _result) { + throw new Error(parseTxnError(_result.code)) + } + txId = _result?.txid + createInfoToast({ + summary: 'Swap initiated...', + type: 'swap', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + txHash: txId, + href: getTronscanTxnLink(txId), + }) + } + + const transactionInfo = await getTransactionInfo(tronWeb, txId) + if (transactionInfo?.receipt?.result !== 'SUCCESS') { + throw new Error('Transaction failed') + } + //create success toast + createSuccessToast({ + summary: 'Swap successful', + txHash: txId, + type: 'swap', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + href: getTronscanTxnLink(txId), + }) + onSuccess() + } catch (error) { + const errorMessage = + typeof error === 'string' + ? error + : (error as Error)?.message ?? + 'An error occurred while trying to swap' + //create error toast + createFailedToast({ + summary: errorMessage, + type: 'swap', + account: address as string, + chainId: 1, + groupTimestamp: Date.now(), + timestamp: Date.now(), + href: txId ? getTronscanTxnLink(txId) : undefined, + }) + console.log(error) + + setIsTxnPending(false) + } + } + + const onSuccess = () => { + setAmountIn('') + setAmountOut('') + setPriceImpactPercentage(0) + setIsTxnPending(false) + closeModal() + + queryClient.invalidateQueries({ + queryKey: [ + 'useTokenBalance', + { accountAddress: address, tokenAddress: token0?.address }, + ], + }) + + queryClient.invalidateQueries({ + queryKey: [ + 'useTokenBalance', + { accountAddress: address, tokenAddress: token1?.address }, + ], + }) + } + + return ( + + ) +} diff --git a/apps/tron/src/app/_common/ui/Swap/SwapRoutesDialog.tsx b/apps/tron/src/app/_common/ui/Swap/SwapRoutesDialog.tsx new file mode 100644 index 0000000000..d084a657f6 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Swap/SwapRoutesDialog.tsx @@ -0,0 +1,51 @@ +import { Button } from '@sushiswap/ui' +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, +} from '@sushiswap/ui' +import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' +import { useSwapState } from '~tron/swap/swap-provider' +import { Icon } from '../General/Icon' + +export const SwapRoutesDialog = () => { + const { route } = useSwapState() + + return ( + + + + + + + + Trade Route + + Optimized route to get the best price + + +
    +
    + {route?.map((tokenAddress, idx) => ( + + ))} +
    +
    +
    +
    + ) +} + +const SwapItem = ({ tokenAddress }: { tokenAddress: string }) => { + const { data } = useTokenInfo({ tokenAddress }) + + return ( +
    + + {data?.symbol} +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Swap/SwapStats.tsx b/apps/tron/src/app/_common/ui/Swap/SwapStats.tsx new file mode 100644 index 0000000000..a8bad94464 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Swap/SwapStats.tsx @@ -0,0 +1,150 @@ +import { Transition } from '@headlessui/react' +import { + SlippageToleranceStorageKey, + useSlippageTolerance, +} from '@sushiswap/hooks' +import { classNames } from '@sushiswap/ui' +import { SkeletonBox } from '@sushiswap/ui' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import Link from 'next/link' +import { useMemo } from 'react' +import { formatPercent } from 'sushi/format' +import { truncateText } from '~tron/_common/lib/utils/formatters' +import { getIfWrapOrUnwrap } from '~tron/_common/lib/utils/helpers' +import { getTronscanAddressLink } from '~tron/_common/lib/utils/tronscan-helpers' +import { + warningSeverity, + warningSeverityClassName, +} from '~tron/_common/lib/utils/warning-severity' +import { useSwapState } from '~tron/swap/swap-provider' +import { SwapRoutesDialog } from './SwapRoutesDialog' + +export const SwapStats = () => { + const { token0, token1, amountOut, amountIn, priceImpactPercentage, route } = + useSwapState() + const { address } = useWallet() + + const swapType = useMemo(() => { + return getIfWrapOrUnwrap(token0, token1) + }, [token0, token1]) + + const isLoading = + priceImpactPercentage === undefined || + (priceImpactPercentage === 0 && swapType === 'swap') || + amountOut === '' || + amountOut === '' + + const [slippageTolerance] = useSlippageTolerance( + SlippageToleranceStorageKey.Swap, + ) + + const slippage = + slippageTolerance === 'AUTO' ? 0.005 : Number(slippageTolerance) / 100 + + const minOutput = useMemo(() => { + if (!amountOut) return '' + if ( + (token0?.symbol === 'WTRX' && token1?.address === 'TRON') || + (token0?.address === 'TRON' && token1?.symbol === 'WTRX') + ) { + return amountIn + } + + const output = Number(amountOut) * (1 - slippage) + return output + }, [amountOut, slippage, token0, token1, amountIn]) + + const severityColor = useMemo(() => { + return warningSeverityClassName(warningSeverity(priceImpactPercentage)) + }, [priceImpactPercentage]) + + return ( + 0} + enter="transition duration-300 ease-out" + enterFrom="transform translate-y-[16px] opacity-0" + enterTo="transform translate-y-0 opacity-100" + leave="transition duration-300 ease-out" + leaveFrom="transform translate-y-0 opacity-100" + leaveTo="transform translate-y-[16px] opacity-0" + > +
    +
    + + Price impact + + + {isLoading ? ( + + ) : ( + + {priceImpactPercentage + ? `-${formatPercent(priceImpactPercentage / 100)}` + : formatPercent(0)} + + )} + +
    +
    + + Est. received + + + {isLoading ? ( + + ) : ( + `${amountOut} ${token1.symbol}` + )} + +
    +
    + + Min. received + + + {isLoading ? ( + + ) : ( + `${minOutput} ${token1.symbol}` + )} + +
    +
    + + Route + + + {isLoading ? ( + + ) : ( + + )} + +
    + {address && ( +
    + + Recipient + + + + {truncateText(address)} + + +
    + )} +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Swap/SwitchSwapDirection.tsx b/apps/tron/src/app/_common/ui/Swap/SwitchSwapDirection.tsx new file mode 100644 index 0000000000..4723f23a73 --- /dev/null +++ b/apps/tron/src/app/_common/ui/Swap/SwitchSwapDirection.tsx @@ -0,0 +1,20 @@ +import { ArrowsUpDownIcon } from '@heroicons/react/24/outline' +import React from 'react' +import { useSwapDispatch } from '~tron/swap/swap-provider' + +export const SwitchSwapDirection = () => { + const { swapTokens } = useSwapDispatch() + return ( +
    + +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/Swap/SwitchSwapType.tsx b/apps/tron/src/app/_common/ui/Swap/SwitchSwapType.tsx new file mode 100644 index 0000000000..2386e8011f --- /dev/null +++ b/apps/tron/src/app/_common/ui/Swap/SwitchSwapType.tsx @@ -0,0 +1,11 @@ +import { Button } from '@sushiswap/ui' + +export const SwitchSwapType = () => { + return ( +
    + +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/WalletConnector/DefaultView.tsx b/apps/tron/src/app/_common/ui/WalletConnector/DefaultView.tsx new file mode 100644 index 0000000000..08bcf3743d --- /dev/null +++ b/apps/tron/src/app/_common/ui/WalletConnector/DefaultView.tsx @@ -0,0 +1,111 @@ +import { + Cog6ToothIcon, + DocumentDuplicateIcon, + LinkIcon, +} from '@heroicons/react/24/outline' +import { ArrowLeftOnRectangleIcon } from '@heroicons/react/24/outline' +import { ClipboardController, IconButton, SkeletonText } from '@sushiswap/ui' +import { JazzIcon } from '@sushiswap/ui/icons/JazzIcon' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import Link from 'next/link' +import React, { Dispatch, SetStateAction } from 'react' +import { formatNumber, formatUSD } from 'sushi/format' +import { WTRX } from '~tron/_common/constants/token-list' +import { useNativeBalance } from '~tron/_common/lib/hooks/useNativeBalance' +import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' +import { truncateText } from '~tron/_common/lib/utils/formatters' +import { getTronscanAddressLink } from '~tron/_common/lib/utils/tronscan-helpers' +import { IProfileView } from './WalletConnector' + +type DefaultViewProps = { + setView: Dispatch> +} + +export const DefaultView = ({ setView }: DefaultViewProps) => { + const { address, disconnect } = useWallet() + const { data, isLoading: isLoadingBalance } = useNativeBalance() + + const { data: price, isLoading: isLoadingPrice } = useStablePrice({ + token: WTRX, + }) + + const isLoading = isLoadingBalance || isLoadingPrice + + return ( +
    +
    +
    + {address && } + + {({ setCopied }) => ( + setCopied(address ?? '')} + > + {truncateText(address ?? '')} + + )} + +
    +
    + setView('settings')} + name="Settings" + description="Settings" + size="xs" + /> + + {({ setCopied }) => ( + setCopied(address ?? '')} + name={'Copy Address'} + description={'Copy Address'} + size="xs" + /> + )} + + + + + await disconnect()} + name="Disconnect" + size="xs" + description="Disconnect" + /> +
    +
    +
    + {isLoading || !price || data?.formattedBalance === undefined ? ( +
    + + TRX +
    + ) : ( +

    + {formatNumber(data?.formattedBalance)} TRX +

    + )} + {isLoading || !price || data?.formattedBalance === undefined ? ( + + ) : ( +

    + {formatUSD(Number(price) * data?.formattedBalance)} +

    + )} +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/WalletConnector/SettingsView.tsx b/apps/tron/src/app/_common/ui/WalletConnector/SettingsView.tsx new file mode 100644 index 0000000000..0c9c241b4c --- /dev/null +++ b/apps/tron/src/app/_common/ui/WalletConnector/SettingsView.tsx @@ -0,0 +1,66 @@ +import { ArrowLeftIcon } from '@heroicons/react/20/solid' +import { List } from '@sushiswap/ui' +import React, { FC, Fragment } from 'react' +import { IconButton } from '@sushiswap/ui' +import { RadioGroup } from '@headlessui/react' +import { classNames } from '@sushiswap/ui' +import { MoonIcon, SunIcon } from '@heroicons/react/24/outline' +import { useTheme } from 'next-themes' +import { IProfileView } from './WalletConnector' + +type SettingsViewProps = { + setView: React.Dispatch> +} + +const options = { + system: Auto, + light: , + dark: , +} + +export const SettingsView: FC = ({ setView }) => { + const { theme, setTheme } = useTheme() + return ( +
    +
    +
    + setView('default')} + icon={ArrowLeftIcon} + name="Back" + className="bg-transparent" + /> +
    + Settings +
    +
    + + Preferences + + + +
    + {Object.entries(options).map(([k, v], i) => ( + + {({ checked }) => ( + + )} + + ))} +
    +
    +
    +
    +
    +
    + ) +} diff --git a/apps/tron/src/app/_common/ui/WalletConnector/WalletConnector.tsx b/apps/tron/src/app/_common/ui/WalletConnector/WalletConnector.tsx new file mode 100644 index 0000000000..275aeb0fd3 --- /dev/null +++ b/apps/tron/src/app/_common/ui/WalletConnector/WalletConnector.tsx @@ -0,0 +1,80 @@ +import { + Button, + Chip, + Popover, + PopoverContent, + PopoverTrigger, + SelectIcon, +} from '@sushiswap/ui' +import { JazzIcon } from '@sushiswap/ui/icons/JazzIcon' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { useState } from 'react' +import { IS_TESTNET } from '~tron/_common/constants/is-testnet' +import { truncateText } from '~tron/_common/lib/utils/formatters' +import { DefaultView } from './DefaultView' +import { SettingsView } from './SettingsView' +import { WalletListView } from './WalletListView' + +export type IProfileView = 'default' | 'settings' + +type WalletConnectorProps = { + hideChevron?: boolean + fullWidth?: boolean + size?: 'default' | 'lg' + variant?: 'secondary' | 'default' +} + +export const WalletConnector = ({ + hideChevron, + fullWidth, + size = 'default', + variant = 'secondary', +}: WalletConnectorProps) => { + const [view, setView] = useState('default') + const { connected, connecting, address } = useWallet() + const isConnected = address && connected + + return ( + + + + {IS_TESTNET && isConnected ? ( + + Testnet + + ) : null} + + + + {!isConnected ? : null} + {view === 'default' && isConnected ? ( + + ) : null} + {view === 'settings' && isConnected ? ( + + ) : null} + + + ) +} diff --git a/apps/tron/src/app/_common/ui/WalletConnector/WalletListView.tsx b/apps/tron/src/app/_common/ui/WalletConnector/WalletListView.tsx new file mode 100644 index 0000000000..742609975b --- /dev/null +++ b/apps/tron/src/app/_common/ui/WalletConnector/WalletListView.tsx @@ -0,0 +1,39 @@ +import { List, SelectIcon } from '@sushiswap/ui' +import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import Image from 'next/image' +import { useWalletAdapters } from '~tron/_common/lib/hooks/useWalletAdapters' + +export const WalletListView = () => { + const { adapters } = useWalletAdapters() + const { select } = useWallet() + + return ( + + + {adapters.map((adapter) => ( + ( + {adapter.name} + )} + className="w-full items-center text-left justify-start flex" + key={adapter.name} + title={adapter.name} + onClick={async () => { + if (adapter.readyState === 'Found') { + select(adapter.name) + } else { + window.open(adapter.url, '_blank') + } + }} + hoverIcon={() => } + /> + ))} + + + ) +} diff --git a/apps/tron/src/app/api/pools/get-reserves/route.ts b/apps/tron/src/app/api/pools/get-reserves/route.ts index 386f65dc36..9333d5d18f 100644 --- a/apps/tron/src/app/api/pools/get-reserves/route.ts +++ b/apps/tron/src/app/api/pools/get-reserves/route.ts @@ -1,31 +1,37 @@ -import { NextResponse } from "next/server"; -import { BITQUERY_ENDPOINT } from "src/bitquery/bitquery-endpoint"; -import { getOptions } from "src/bitquery/bitquery-options"; -import { getReserves } from "src/bitquery/queries/getReserves"; +import { NextResponse } from 'next/server' +import { BITQUERY_ENDPOINT } from '~tron/_common/lib/bitquery/bitquery-endpoint' +import { getOptions } from '~tron/_common/lib/bitquery/bitquery-options' +import { getReserves } from '~tron/_common/lib/bitquery/queries/getReserves' export async function GET(req: Request): Promise { - const { searchParams } = new URL(req.url); - const pairAddresses = searchParams.get("pairAddresses"); + const { searchParams } = new URL(req.url) + const pairAddresses = searchParams.get('pairAddresses') - if (!pairAddresses) { - return NextResponse.json({ success: false, message: "pairAddresses is required" }); - } + if (!pairAddresses) { + return NextResponse.json({ + success: false, + message: 'pairAddresses is required', + }) + } - try { - const pairAddressArray = pairAddresses.split(","); - const query = getReserves(pairAddressArray); + try { + const pairAddressArray = pairAddresses.split(',') + const query = getReserves(pairAddressArray) - const options = getOptions(query); + const options = getOptions(query) - const res = await fetch(BITQUERY_ENDPOINT, { ...options, next: { revalidate: 60 } }); - if (!res.ok) { - throw new Error("Failed to fetch data from Bitquery API"); - } - const data = await res.json(); + const res = await fetch(BITQUERY_ENDPOINT, { + ...options, + next: { revalidate: 60 }, + }) + if (!res.ok) { + throw new Error('Failed to fetch data from Bitquery API') + } + const data = await res.json() - return NextResponse.json({ ...data }); - } catch (error) { - console.error(error); - return NextResponse.json(undefined); - } + return NextResponse.json({ ...data }) + } catch (error) { + console.error(error) + return NextResponse.json(undefined) + } } diff --git a/apps/tron/src/app/api/pools/my-positions/route.ts b/apps/tron/src/app/api/pools/my-positions/route.ts index 4d86332308..febda0f00f 100644 --- a/apps/tron/src/app/api/pools/my-positions/route.ts +++ b/apps/tron/src/app/api/pools/my-positions/route.ts @@ -1,39 +1,45 @@ -import { NextResponse } from "next/server"; -import { BITQUERY_ENDPOINT } from "src/bitquery/bitquery-endpoint"; -import { getOptions } from "src/bitquery/bitquery-options"; -import { getTransfersToPairs } from "src/bitquery/queries/getTransfersToPairs"; +import { NextResponse } from 'next/server' +import { BITQUERY_ENDPOINT } from '~tron/_common/lib/bitquery/bitquery-endpoint' +import { getOptions } from '~tron/_common/lib/bitquery/bitquery-options' +import { getTransfersToPairs } from '~tron/_common/lib/bitquery/queries/getTransfersToPairs' export async function GET(req: Request): Promise { - const { searchParams } = new URL(req.url); - const pairAddresses = searchParams.get("pairAddresses"); - const walletAddress = searchParams.get("walletAddress"); + const { searchParams } = new URL(req.url) + const pairAddresses = searchParams.get('pairAddresses') + const walletAddress = searchParams.get('walletAddress') - if (!pairAddresses) { - return NextResponse.json({ success: false, message: "pairAddresses is required" }); - } + if (!pairAddresses) { + return NextResponse.json({ + success: false, + message: 'pairAddresses is required', + }) + } - if (!walletAddress) { - return NextResponse.json({ success: false, message: "walletAddress is required" }); - } + if (!walletAddress) { + return NextResponse.json({ + success: false, + message: 'walletAddress is required', + }) + } - try { - const pairAddressArray = pairAddresses.split(","); - const query = getTransfersToPairs(pairAddressArray, walletAddress); + try { + const pairAddressArray = pairAddresses.split(',') + const query = getTransfersToPairs(pairAddressArray, walletAddress) - const options = getOptions(query); + const options = getOptions(query) - const res = await fetch(BITQUERY_ENDPOINT, { - ...options, - next: { revalidate: 60 }, - }); - if (!res.ok) { - throw new Error("Failed to fetch data from Bitquery API"); - } - const data = await res.json(); + const res = await fetch(BITQUERY_ENDPOINT, { + ...options, + next: { revalidate: 60 }, + }) + if (!res.ok) { + throw new Error('Failed to fetch data from Bitquery API') + } + const data = await res.json() - return NextResponse.json({ ...data }); - } catch (error) { - console.error(error); - return NextResponse.json(undefined); - } + return NextResponse.json({ ...data }) + } catch (error) { + console.error(error) + return NextResponse.json(undefined) + } } diff --git a/apps/tron/src/app/api/pools/route.ts b/apps/tron/src/app/api/pools/route.ts index c843ba2a7e..090ee17e07 100644 --- a/apps/tron/src/app/api/pools/route.ts +++ b/apps/tron/src/app/api/pools/route.ts @@ -1,30 +1,36 @@ -import { NextResponse } from "next/server"; -import { BITQUERY_ENDPOINT } from "src/bitquery/bitquery-endpoint"; -import { getOptions } from "src/bitquery/bitquery-options"; -import { getAllPools } from "src/bitquery/queries/getAllPools"; +import { NextResponse } from 'next/server' +import { BITQUERY_ENDPOINT } from '~tron/_common/lib/bitquery/bitquery-endpoint' +import { getOptions } from '~tron/_common/lib/bitquery/bitquery-options' +import { getAllPools } from '~tron/_common/lib/bitquery/queries/getAllPools' export async function GET(req: Request): Promise { - const { searchParams } = new URL(req.url); - const factoryAddress = searchParams.get("factoryAddress"); + const { searchParams } = new URL(req.url) + const factoryAddress = searchParams.get('factoryAddress') - if (!factoryAddress) { - return NextResponse.json({ success: false, message: "factoryAddress is required" }); - } + if (!factoryAddress) { + return NextResponse.json({ + success: false, + message: 'factoryAddress is required', + }) + } - try { - const query = getAllPools(factoryAddress); + try { + const query = getAllPools(factoryAddress) - const options = getOptions(query); + const options = getOptions(query) - const res = await fetch(BITQUERY_ENDPOINT, { ...options, next: { revalidate: 120 } }); // revalidate every 2 minutes - if (!res.ok) { - throw new Error("Failed to fetch data from Bitquery API"); - } - const data = await res.json(); + const res = await fetch(BITQUERY_ENDPOINT, { + ...options, + next: { revalidate: 120 }, + }) // revalidate every 2 minutes + if (!res.ok) { + throw new Error('Failed to fetch data from Bitquery API') + } + const data = await res.json() - return NextResponse.json({ ...data }); - } catch (error) { - console.error(error); - return NextResponse.json(undefined); - } + return NextResponse.json({ ...data }) + } catch (error) { + console.error(error) + return NextResponse.json(undefined) + } } diff --git a/apps/tron/src/app/api/pricing/route.ts b/apps/tron/src/app/api/pricing/route.ts index d389b5524e..bf14ce1c59 100644 --- a/apps/tron/src/app/api/pricing/route.ts +++ b/apps/tron/src/app/api/pricing/route.ts @@ -1,23 +1,26 @@ -import { NextResponse } from "next/server"; -import { BITQUERY_ENDPOINT } from "src/bitquery/bitquery-endpoint"; -import { getOptions } from "src/bitquery/bitquery-options"; -import { getTronInUSDT } from "src/bitquery/queries/getTronInUSDT"; +import { NextResponse } from 'next/server' +import { BITQUERY_ENDPOINT } from '~tron/_common/lib/bitquery/bitquery-endpoint' +import { getOptions } from '~tron/_common/lib/bitquery/bitquery-options' +import { getTronInUSDT } from '~tron/_common/lib/bitquery/queries/getTronInUSDT' export async function GET(): Promise { - try { - const query = getTronInUSDT(); + try { + const query = getTronInUSDT() - const options = getOptions(query); + const options = getOptions(query) - const res = await fetch(BITQUERY_ENDPOINT, { ...options, next: { revalidate: 120 } }); // revalidate every 2 minutes - if (!res.ok) { - throw new Error("Failed to fetch data from Bitquery API"); - } - const data = await res.json(); + const res = await fetch(BITQUERY_ENDPOINT, { + ...options, + next: { revalidate: 120 }, + }) // revalidate every 2 minutes + if (!res.ok) { + throw new Error('Failed to fetch data from Bitquery API') + } + const data = await res.json() - return NextResponse.json({ ...data }); - } catch (error) { - console.error(error); - return NextResponse.json(undefined); - } + return NextResponse.json({ ...data }) + } catch (error) { + console.error(error) + return NextResponse.json(undefined) + } } diff --git a/apps/tron/src/app/api/token-info/route.ts b/apps/tron/src/app/api/token-info/route.ts index 0714000aa9..9cbc03caae 100644 --- a/apps/tron/src/app/api/token-info/route.ts +++ b/apps/tron/src/app/api/token-info/route.ts @@ -1,30 +1,36 @@ -import { NextResponse } from "next/server"; -import { BITQUERY_ENDPOINT } from "src/bitquery/bitquery-endpoint"; -import { getOptions } from "src/bitquery/bitquery-options"; -import { getTokenInfo } from "src/bitquery/queries/getTokenInfo"; +import { NextResponse } from 'next/server' +import { BITQUERY_ENDPOINT } from '~tron/_common/lib/bitquery/bitquery-endpoint' +import { getOptions } from '~tron/_common/lib/bitquery/bitquery-options' +import { getTokenInfo } from '~tron/_common/lib/bitquery/queries/getTokenInfo' export async function GET(req: Request): Promise { - const { searchParams } = new URL(req.url); - const contractAddress = searchParams.get("contractAddress"); + const { searchParams } = new URL(req.url) + const contractAddress = searchParams.get('contractAddress') - if (!contractAddress) { - return NextResponse.json({ success: false, message: "contractAddress is required" }); - } + if (!contractAddress) { + return NextResponse.json({ + success: false, + message: 'contractAddress is required', + }) + } - try { - const query = getTokenInfo(contractAddress); + try { + const query = getTokenInfo(contractAddress) - const options = getOptions(query); + const options = getOptions(query) - const res = await fetch(BITQUERY_ENDPOINT, { ...options, next: { revalidate: Infinity } }); - if (!res.ok) { - throw new Error("Failed to fetch data from Bitquery API"); - } - const data = await res.json(); + const res = await fetch(BITQUERY_ENDPOINT, { + ...options, + next: { revalidate: Infinity }, + }) + if (!res.ok) { + throw new Error('Failed to fetch data from Bitquery API') + } + const data = await res.json() - return NextResponse.json({ ...data }); - } catch (error) { - console.error(error); - return NextResponse.json(undefined); - } + return NextResponse.json({ ...data }) + } catch (error) { + console.error(error) + return NextResponse.json(undefined) + } } diff --git a/apps/tron/src/app/header.tsx b/apps/tron/src/app/header.tsx index b304e7eea9..d451b30ffa 100644 --- a/apps/tron/src/app/header.tsx +++ b/apps/tron/src/app/header.tsx @@ -7,7 +7,7 @@ import { } from '@sushiswap/ui' import React, { FC } from 'react' -import { WalletConnector } from 'src/components/WalletConnector/WalletConnector' +import { WalletConnector } from '~tron/_common/ui/WalletConnector/WalletConnector' const nagivationElements: NavigationElement[] = [ { diff --git a/apps/tron/src/app/layout.tsx b/apps/tron/src/app/layout.tsx index f3da27e400..28f1fc8384 100644 --- a/apps/tron/src/app/layout.tsx +++ b/apps/tron/src/app/layout.tsx @@ -1,55 +1,72 @@ -import "@sushiswap/ui/index.css"; +import '@sushiswap/ui/index.css' -import type { Metadata } from "next"; -import { Inter, Roboto_Mono } from "next/font/google"; -import React from "react"; -import { Header } from "./header"; -import { Providers } from "./providers"; -import { Trackers } from "./trackers"; +import type { Metadata } from 'next' +import { Inter, Roboto_Mono } from 'next/font/google' +import React from 'react' +import { Header } from './header' +import { Providers } from './providers' +import { Trackers } from './trackers' const inter = Inter({ - subsets: ["latin"], - display: "swap", - variable: "--font-inter", -}); + subsets: ['latin'], + display: 'swap', + variable: '--font-inter', +}) const roboto_mono = Roboto_Mono({ - subsets: ["latin"], - display: "swap", - variable: "--font-roboto-mono", -}); + subsets: ['latin'], + display: 'swap', + variable: '--font-roboto-mono', +}) export const metadata: Metadata = { - title: { - default: "Sushi 🍣", - template: "%s | Sushi 🍣", - }, - description: - "A Decentralised Finance (DeFi) app with features such as swap, cross chain swap, streaming, vesting, and permissionless market making for liquidity providers.", -}; + title: { + default: 'Sushi 🍣', + template: '%s | Sushi 🍣', + }, + description: + 'A Decentralised Finance (DeFi) app with features such as swap, cross chain swap, streaming, vesting, and permissionless market making for liquidity providers.', +} -export default function RootLayout({ children }: { children: React.ReactNode }) { - return ( - // - - - - - - - - -
    - -
    - {children} - - -
    - - - ); +export default function RootLayout({ + children, +}: { children: React.ReactNode }) { + return ( + // + + + + + + + + +
    + +
    + {children} + + +
    + + + ) } diff --git a/apps/tron/src/app/pool/[poolId]/layout.tsx b/apps/tron/src/app/pool/[poolId]/layout.tsx index 105625e06a..84682d8efd 100644 --- a/apps/tron/src/app/pool/[poolId]/layout.tsx +++ b/apps/tron/src/app/pool/[poolId]/layout.tsx @@ -1,5 +1,7 @@ -import { RemoveProvider } from "./remove-provider"; +import { RemoveProvider } from './remove-provider' -export default function RemoveLiqLayout({ children }: { children: React.ReactNode }) { - return {children}; +export default function RemoveLiqLayout({ + children, +}: { children: React.ReactNode }) { + return {children} } diff --git a/apps/tron/src/app/pool/[poolId]/page.tsx b/apps/tron/src/app/pool/[poolId]/page.tsx index b5b371f3b7..731d10e15c 100644 --- a/apps/tron/src/app/pool/[poolId]/page.tsx +++ b/apps/tron/src/app/pool/[poolId]/page.tsx @@ -1,73 +1,83 @@ -"use client"; -import { Breadcrumb, Container } from "@sushiswap/ui"; -import { useEffect } from "react"; -import { Manage } from "src/components/Pools/Manage/Manage"; -import { PoolHeader } from "src/components/Pools/PoolDetails/PoolHeader"; -import { PoolLiquidity } from "src/components/Pools/PoolDetails/PoolLiquidity"; -import { PoolPosition } from "src/components/Pools/PoolPosition/PoolPosition"; -import { PoolRewards } from "src/components/Pools/PoolRewards/PoolRewards"; -import { useTokenInfo } from "src/hooks/useTokenInfo"; -import { usePoolDispatch } from "../pool-provider"; -import { isAddress } from "src/utils/helpers"; +'use client' +import { Breadcrumb, Container } from '@sushiswap/ui' +import { useEffect } from 'react' +import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' +import { isAddress } from '~tron/_common/lib/utils/helpers' +import { Manage } from '~tron/_common/ui/Pools/Manage/Manage' +import { PoolHeader } from '~tron/_common/ui/Pools/PoolDetails/PoolHeader' +import { PoolLiquidity } from '~tron/_common/ui/Pools/PoolDetails/PoolLiquidity' +import { PoolPosition } from '~tron/_common/ui/Pools/PoolPosition/PoolPosition' +import { PoolRewards } from '~tron/_common/ui/Pools/PoolRewards/PoolRewards' +import { usePoolDispatch } from '../pool-provider' -export default function PoolByIdPage({ params }: { params: { poolId: string } }) { - const { poolId } = params; - const decodedPoolId = decodeURIComponent(poolId); - const token0 = decodedPoolId?.split(":")?.[0]; - const token1 = decodedPoolId?.split(":")?.[1]; - const pairAddress = decodedPoolId?.split(":")?.[2]; - const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ tokenAddress: token0 }); - const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ tokenAddress: token1 }); - const isLoadingTokens = isLoadingToken0 || isLoadingToken1; - const { setToken0, setToken1, setPairAddress } = usePoolDispatch(); +export default function PoolByIdPage({ + params, +}: { params: { poolId: string } }) { + const { poolId } = params + const decodedPoolId = decodeURIComponent(poolId) + const token0 = decodedPoolId?.split(':')?.[0] + const token1 = decodedPoolId?.split(':')?.[1] + const pairAddress = decodedPoolId?.split(':')?.[2] + const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ + tokenAddress: token0, + }) + const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ + tokenAddress: token1, + }) + const isLoadingTokens = isLoadingToken0 || isLoadingToken1 + const { setToken0, setToken1, setPairAddress } = usePoolDispatch() - useEffect(() => { - if (pairAddress && isAddress(pairAddress)) { - setPairAddress(pairAddress); - } - }, [pairAddress]); + useEffect(() => { + if (pairAddress && isAddress(pairAddress)) { + setPairAddress(pairAddress) + } + }, [pairAddress]) - useEffect(() => { - if (token0Data) { - setToken0(token0Data); - } - if (token1Data) { - setToken1(token1Data); - } - }, [token0Data, token1Data]); + useEffect(() => { + if (token0Data) { + setToken0(token0Data) + } + if (token1Data) { + setToken1(token1Data) + } + }, [token0Data, token1Data]) - return ( - <> -
    - - - - - - -
    -
    - -
    - - -
    -
    - - -
    -
    -
    - - ); + return ( + <> +
    + + + + + + +
    +
    + +
    + + +
    +
    + + +
    +
    +
    + + ) } diff --git a/apps/tron/src/app/pool/[poolId]/remove-provider.tsx b/apps/tron/src/app/pool/[poolId]/remove-provider.tsx index 4742dd3236..ed3dc5e288 100644 --- a/apps/tron/src/app/pool/[poolId]/remove-provider.tsx +++ b/apps/tron/src/app/pool/[poolId]/remove-provider.tsx @@ -1,133 +1,145 @@ -"use client"; +'use client' -import { FC, createContext, useContext, useMemo, useReducer } from "react"; +import { FC, createContext, useContext, useMemo, useReducer } from 'react' type Action = - | { type: "setPercentage"; value: number } - | { type: "setIsTxnPending"; value: boolean } - | { type: "setAmountToken0PerLP"; value: string } - | { type: "setAmountToken1PerLP"; value: string } - | { type: "setTotalSupplyLP"; value: string } - | { type: "setLPBalance"; value: string } - | { type: "setLPToRemove"; value: string } - | { type: "setMinAmountToken0"; value: string } - | { type: "setMinAmountToken1"; value: string }; + | { type: 'setPercentage'; value: number } + | { type: 'setIsTxnPending'; value: boolean } + | { type: 'setAmountToken0PerLP'; value: string } + | { type: 'setAmountToken1PerLP'; value: string } + | { type: 'setTotalSupplyLP'; value: string } + | { type: 'setLPBalance'; value: string } + | { type: 'setLPToRemove'; value: string } + | { type: 'setMinAmountToken0'; value: string } + | { type: 'setMinAmountToken1'; value: string } type Dispatch = { - setIsTxnPending(isPending: boolean): void; - setPercentage(percentage: number): void; - setAmountToken0PerLP(amount: string): void; - setAmountToken1PerLP(amount: string): void; - setTotalSupplyLP(amount: string): void; - setLPBalance(amount: string): void; - setLPToRemove(amount: string): void; - setMinAmountToken0(amount: string): void; - setMinAmountToken1(amount: string): void; -}; + setIsTxnPending(isPending: boolean): void + setPercentage(percentage: number): void + setAmountToken0PerLP(amount: string): void + setAmountToken1PerLP(amount: string): void + setTotalSupplyLP(amount: string): void + setLPBalance(amount: string): void + setLPToRemove(amount: string): void + setMinAmountToken0(amount: string): void + setMinAmountToken1(amount: string): void +} type State = { - percentage: number; - isTxnPending: boolean; - amountToken0PerLP: string; - amountToken1PerLP: string; - totalSupplyLP: string; - lpBalance: string; - lpToRemove: string; - minAmountToken0: string; - minAmountToken1: string; -}; + percentage: number + isTxnPending: boolean + amountToken0PerLP: string + amountToken1PerLP: string + totalSupplyLP: string + lpBalance: string + lpToRemove: string + minAmountToken0: string + minAmountToken1: string +} -type RemoveProviderProps = { children: React.ReactNode }; +type RemoveProviderProps = { children: React.ReactNode } -const RemoveContext = createContext<{ state: State; dispatch: Dispatch } | undefined>(undefined); +const RemoveContext = createContext< + { state: State; dispatch: Dispatch } | undefined +>(undefined) function removeReducer(_state: State, action: Action) { - switch (action.type) { - case "setPercentage": { - return { ..._state, percentage: action.value }; - } - case "setIsTxnPending": { - return { ..._state, isTxnPending: action.value }; - } - case "setAmountToken0PerLP": { - return { ..._state, amountToken0PerLP: action.value }; - } - case "setAmountToken1PerLP": { - return { ..._state, amountToken1PerLP: action.value }; - } - case "setTotalSupplyLP": { - return { ..._state, totalSupplyLP: action.value }; - } - case "setLPBalance": { - return { ..._state, lpBalance: action.value }; - } - case "setLPToRemove": { - return { ..._state, lpToRemove: action.value }; - } - case "setMinAmountToken0": { - return { ..._state, minAmountToken0: action.value }; - } - case "setMinAmountToken1": { - return { ..._state, minAmountToken1: action.value }; - } - } + switch (action.type) { + case 'setPercentage': { + return { ..._state, percentage: action.value } + } + case 'setIsTxnPending': { + return { ..._state, isTxnPending: action.value } + } + case 'setAmountToken0PerLP': { + return { ..._state, amountToken0PerLP: action.value } + } + case 'setAmountToken1PerLP': { + return { ..._state, amountToken1PerLP: action.value } + } + case 'setTotalSupplyLP': { + return { ..._state, totalSupplyLP: action.value } + } + case 'setLPBalance': { + return { ..._state, lpBalance: action.value } + } + case 'setLPToRemove': { + return { ..._state, lpToRemove: action.value } + } + case 'setMinAmountToken0': { + return { ..._state, minAmountToken0: action.value } + } + case 'setMinAmountToken1': { + return { ..._state, minAmountToken1: action.value } + } + } } const RemoveProvider: FC = ({ children }) => { - const [state, dispatch] = useReducer(removeReducer, { - percentage: 0, //0-100 - isTxnPending: false, - amountToken0PerLP: "", //will be formatted, will not be in wei amount - amountToken1PerLP: "", //will be formatted, will not be in wei amount - totalSupplyLP: "", //will be in wei - lpBalance: "", //will be in wei - lpToRemove: "", //will be in wei - minAmountToken0: "", //will be in wei - minAmountToken1: "", //will be in wei - }); + const [state, dispatch] = useReducer(removeReducer, { + percentage: 0, //0-100 + isTxnPending: false, + amountToken0PerLP: '', //will be formatted, will not be in wei amount + amountToken1PerLP: '', //will be formatted, will not be in wei amount + totalSupplyLP: '', //will be in wei + lpBalance: '', //will be in wei + lpToRemove: '', //will be in wei + minAmountToken0: '', //will be in wei + minAmountToken1: '', //will be in wei + }) - const dispatchWithAction = useMemo( - () => ({ - setPercentage: (value: number) => dispatch({ type: "setPercentage", value }), - setIsTxnPending: (value: boolean) => dispatch({ type: "setIsTxnPending", value }), - setAmountToken0PerLP: (value: string) => dispatch({ type: "setAmountToken0PerLP", value }), - setAmountToken1PerLP: (value: string) => dispatch({ type: "setAmountToken1PerLP", value }), - setTotalSupplyLP: (value: string) => dispatch({ type: "setTotalSupplyLP", value }), - setLPBalance: (value: string) => dispatch({ type: "setLPBalance", value }), - setLPToRemove: (value: string) => dispatch({ type: "setLPToRemove", value }), - setMinAmountToken0: (value: string) => dispatch({ type: "setMinAmountToken0", value }), - setMinAmountToken1: (value: string) => dispatch({ type: "setMinAmountToken1", value }), - }), - [dispatch] - ); + const dispatchWithAction = useMemo( + () => ({ + setPercentage: (value: number) => + dispatch({ type: 'setPercentage', value }), + setIsTxnPending: (value: boolean) => + dispatch({ type: 'setIsTxnPending', value }), + setAmountToken0PerLP: (value: string) => + dispatch({ type: 'setAmountToken0PerLP', value }), + setAmountToken1PerLP: (value: string) => + dispatch({ type: 'setAmountToken1PerLP', value }), + setTotalSupplyLP: (value: string) => + dispatch({ type: 'setTotalSupplyLP', value }), + setLPBalance: (value: string) => + dispatch({ type: 'setLPBalance', value }), + setLPToRemove: (value: string) => + dispatch({ type: 'setLPToRemove', value }), + setMinAmountToken0: (value: string) => + dispatch({ type: 'setMinAmountToken0', value }), + setMinAmountToken1: (value: string) => + dispatch({ type: 'setMinAmountToken1', value }), + }), + [dispatch], + ) - return ( - { - return { state, dispatch: dispatchWithAction }; - }, [state])}> - {children} - - ); -}; + return ( + { + return { state, dispatch: dispatchWithAction } + }, [state])} + > + {children} + + ) +} const useRemoveContext = () => { - const context = useContext(RemoveContext); - if (!context) { - throw new Error("Hook can only be used inside Remove Liq Provider"); - } + const context = useContext(RemoveContext) + if (!context) { + throw new Error('Hook can only be used inside Remove Liq Provider') + } - return context; -}; + return context +} const useRemoveLiqState = () => { - const context = useRemoveContext(); - return context.state; -}; + const context = useRemoveContext() + return context.state +} const useRemoveLiqDispatch = () => { - const context = useRemoveContext(); - return context.dispatch; -}; + const context = useRemoveContext() + return context.dispatch +} -export { RemoveProvider, useRemoveLiqState, useRemoveLiqDispatch }; +export { RemoveProvider, useRemoveLiqState, useRemoveLiqDispatch } diff --git a/apps/tron/src/app/pool/add/layout.tsx b/apps/tron/src/app/pool/add/layout.tsx index b0386a20df..7fbb23fe1a 100644 --- a/apps/tron/src/app/pool/add/layout.tsx +++ b/apps/tron/src/app/pool/add/layout.tsx @@ -1,32 +1,41 @@ -import { Container, typographyVariants } from "@sushiswap/ui"; -import { Metadata } from "next"; -import { BackButton } from "src/components/Pools/BackButton"; +import { Container, typographyVariants } from '@sushiswap/ui' +import { Metadata } from 'next' +import { BackButton } from '~tron/_common/ui/Pools/BackButton' export const metadata: Metadata = { - title: "Pool 💦", -}; + title: 'Pool 💦', +} -export default function CreatePositionLayout({ children }: { children: React.ReactNode }) { - return ( - <> - -
    -
    - -

    Add Liquidity

    -
    -

    - Create a new pool or create a liquidity position on an existing pool. -

    -
    -
    -
    -
    - - {children} - -
    -
    - - ); +export default function CreatePositionLayout({ + children, +}: { children: React.ReactNode }) { + return ( + <> + +
    +
    + +

    + Add Liquidity +

    +
    +

    + Create a new pool or create a liquidity position on an existing + pool. +

    +
    +
    +
    +
    + + {children} + +
    +
    + + ) } diff --git a/apps/tron/src/app/pool/add/page.tsx b/apps/tron/src/app/pool/add/page.tsx index b04a420110..ccc88e3cb3 100644 --- a/apps/tron/src/app/pool/add/page.tsx +++ b/apps/tron/src/app/pool/add/page.tsx @@ -1,11 +1,11 @@ -import { DepositForm } from "src/components/Pools/Add/DepositForm"; -import { SelectTokensForm } from "src/components/Pools/Add/SelectTokensForm"; +import { DepositForm } from '~tron/_common/ui/Pools/Add/DepositForm' +import { SelectTokensForm } from '~tron/_common/ui/Pools/Add/SelectTokensForm' export default function AddPage() { - return ( - <> - - - - ); + return ( + <> + + + + ) } diff --git a/apps/tron/src/app/pool/layout.tsx b/apps/tron/src/app/pool/layout.tsx index e218abb8ed..99edcc757e 100644 --- a/apps/tron/src/app/pool/layout.tsx +++ b/apps/tron/src/app/pool/layout.tsx @@ -1,10 +1,12 @@ -import { Metadata } from "next"; -import { PoolProvider } from "./pool-provider"; +import { Metadata } from 'next' +import { PoolProvider } from './pool-provider' export const metadata: Metadata = { - title: "Pool", -}; + title: 'Pool', +} -export default function PoolLayout({ children }: { children: React.ReactNode }) { - return {children}; +export default function PoolLayout({ + children, +}: { children: React.ReactNode }) { + return {children} } diff --git a/apps/tron/src/app/pool/page.tsx b/apps/tron/src/app/pool/page.tsx index 8cccf020b6..0faf917edd 100644 --- a/apps/tron/src/app/pool/page.tsx +++ b/apps/tron/src/app/pool/page.tsx @@ -1,61 +1,78 @@ -"use client"; -import { ChevronRightIcon } from "@heroicons/react/24/outline"; -import { Container, LinkExternal, LinkInternal, typographyVariants } from "@sushiswap/ui"; -import { Button } from "@sushiswap/ui"; -import { DiscordIcon } from "@sushiswap/ui"; -import Link from "next/link"; -import { PoolsView } from "src/components/Pools/PoolsView"; +'use client' +import { ChevronRightIcon } from '@heroicons/react/24/outline' +import { + Button, + Container, + LinkExternal, + LinkInternal, + typographyVariants, +} from '@sushiswap/ui' +import { DiscordIcon } from '@sushiswap/ui/icons/DiscordIcon' +import { PoolsView } from '~tron/_common/ui/Pools/PoolsView' export default function Pool() { - return ( - <> - -
    -
    -
    -

    - Put your funds to work
    - by providing liquidity. -

    -

    - When you add liquidity to a pool, you can receive a share of its trading volume and - potentially snag extra rewards when there are incentives involved! -

    -
    -
    -
    - -
    -
    -
    -
    -
    - Looking for a partnership with Sushi? - -
    -
    - Need Help? - -
    -
    -
    -
    + return ( + <> + +
    +
    +
    +

    + Put your funds to work
    + by providing liquidity. +

    +

    + When you add liquidity to a pool, you can receive a share of its + trading volume and potentially snag extra rewards when there are + incentives involved! +

    +
    +
    +
    + +
    +
    +
    +
    +
    + + Looking for a partnership with Sushi? + + +
    +
    + Need Help? + +
    +
    +
    +
    - - - ); + + + ) } diff --git a/apps/tron/src/app/pool/pool-provider.tsx b/apps/tron/src/app/pool/pool-provider.tsx index 6dee0bd86e..96b8c66f80 100644 --- a/apps/tron/src/app/pool/pool-provider.tsx +++ b/apps/tron/src/app/pool/pool-provider.tsx @@ -1,160 +1,176 @@ -"use client"; +'use client' -import { FC, createContext, useContext, useMemo, useReducer } from "react"; -import { ReserveHelper } from "src/components/Pools/ReserveHelper"; -import { DEFAULT_TOKEN_LIST } from "src/constants/token-list"; -import { IToken } from "src/types/token-type"; +import { FC, createContext, useContext, useMemo, useReducer } from 'react' +import { DEFAULT_TOKEN_LIST } from '~tron/_common/constants/token-list' +import { IToken } from '~tron/_common/types/token-type' +import { ReserveHelper } from '~tron/_common/ui/Pools/ReserveHelper' -type InputFieldType = "token0" | "token1"; +type InputFieldType = 'token0' | 'token1' type Action = - | { type: "setToken0"; value: IToken } - | { type: "setToken1"; value: IToken } - | { type: "setIsTxnPending"; value: boolean } - | { type: "setAmountInToken0"; value: string } - | { type: "setAmountInToken1"; value: string } - | { type: "setPairAddress"; value: string | undefined | null } - | { type: "setReserve0"; value: string } - | { type: "setReserve1"; value: string } - | { type: "setInputField"; value: InputFieldType }; + | { type: 'setToken0'; value: IToken } + | { type: 'setToken1'; value: IToken } + | { type: 'setIsTxnPending'; value: boolean } + | { type: 'setAmountInToken0'; value: string } + | { type: 'setAmountInToken1'; value: string } + | { type: 'setPairAddress'; value: string | undefined | null } + | { type: 'setReserve0'; value: string } + | { type: 'setReserve1'; value: string } + | { type: 'setInputField'; value: InputFieldType } type Dispatch = { - setToken0(token: IToken): void; - setToken1(token: IToken): void; - setIsTxnPending(isPending: boolean): void; - setAmountInToken0(amount: string): void; - setAmountInToken1(amount: string): void; - setPairAddress(pairAddress: string | undefined | null): void; - setReserve0(reserve0: string): void; - setReserve1(reserve1: string): void; - setInputField(inputField: InputFieldType): void; -}; + setToken0(token: IToken): void + setToken1(token: IToken): void + setIsTxnPending(isPending: boolean): void + setAmountInToken0(amount: string): void + setAmountInToken1(amount: string): void + setPairAddress(pairAddress: string | undefined | null): void + setReserve0(reserve0: string): void + setReserve1(reserve1: string): void + setInputField(inputField: InputFieldType): void +} type State = { - token0: IToken | undefined; - token1: IToken | undefined; - isTxnPending: boolean; - amountInToken0: string; - amountInToken1: string; - pairAddress: string | undefined | null; - reserve0: string; - reserve1: string; - inputField: "token0" | "token1"; -}; + token0: IToken | undefined + token1: IToken | undefined + isTxnPending: boolean + amountInToken0: string + amountInToken1: string + pairAddress: string | undefined | null + reserve0: string + reserve1: string + inputField: 'token0' | 'token1' +} -type PoolProviderProps = { children: React.ReactNode }; +type PoolProviderProps = { children: React.ReactNode } -const PoolContext = createContext<{ state: State; dispatch: Dispatch } | undefined>(undefined); +const PoolContext = createContext< + { state: State; dispatch: Dispatch } | undefined +>(undefined) function poolReducer(_state: State, action: Action) { - switch (action.type) { - case "setToken0": { - if (_state?.token1?.address === action.value.address) { - //if token1 is the same as the new token0, swap them - return { ..._state, token1: _state.token0, token0: action.value }; - } - //if token1 is TRX and the new token is WRTX or vice versa, go back to default pair - if ( - (_state?.token1?.symbol === "TRX" && action.value.symbol === "WTRX") || - (_state?.token1?.symbol === "WTRX" && action.value.symbol === "TRX") - ) { - return { ..._state, token0: DEFAULT_TOKEN_LIST[0], token1: DEFAULT_TOKEN_LIST[2] }; - } - return { ..._state, token0: action.value }; - } - case "setToken1": { - if (_state?.token0?.address === action.value.address) { - //if token0 is the same as the new token1, swap them - return { ..._state, token0: _state.token1, token1: action.value }; - } - if ( - (_state?.token0?.symbol === "TRX" && action.value.symbol === "WTRX") || - (_state?.token0?.symbol === "WTRX" && action.value.symbol === "TRX") - ) { - return { ..._state, token0: DEFAULT_TOKEN_LIST[0], token1: DEFAULT_TOKEN_LIST[2] }; - } - return { ..._state, token1: action.value }; - } - case "setIsTxnPending": { - return { ..._state, isTxnPending: action.value }; - } - case "setAmountInToken0": { - return { ..._state, amountInToken0: action.value }; - } - case "setAmountInToken1": { - return { ..._state, amountInToken1: action.value }; - } - case "setPairAddress": { - return { ..._state, pairAddress: action.value }; - } - case "setReserve0": { - return { ..._state, reserve0: action.value }; - } - case "setReserve1": { - return { ..._state, reserve1: action.value }; - } - case "setInputField": { - return { ..._state, inputField: action.value }; - } - } + switch (action.type) { + case 'setToken0': { + if (_state?.token1?.address === action.value.address) { + //if token1 is the same as the new token0, swap them + return { ..._state, token1: _state.token0, token0: action.value } + } + //if token1 is TRX and the new token is WRTX or vice versa, go back to default pair + if ( + (_state?.token1?.symbol === 'TRX' && action.value.symbol === 'WTRX') || + (_state?.token1?.symbol === 'WTRX' && action.value.symbol === 'TRX') + ) { + return { + ..._state, + token0: DEFAULT_TOKEN_LIST[0], + token1: DEFAULT_TOKEN_LIST[2], + } + } + return { ..._state, token0: action.value } + } + case 'setToken1': { + if (_state?.token0?.address === action.value.address) { + //if token0 is the same as the new token1, swap them + return { ..._state, token0: _state.token1, token1: action.value } + } + if ( + (_state?.token0?.symbol === 'TRX' && action.value.symbol === 'WTRX') || + (_state?.token0?.symbol === 'WTRX' && action.value.symbol === 'TRX') + ) { + return { + ..._state, + token0: DEFAULT_TOKEN_LIST[0], + token1: DEFAULT_TOKEN_LIST[2], + } + } + return { ..._state, token1: action.value } + } + case 'setIsTxnPending': { + return { ..._state, isTxnPending: action.value } + } + case 'setAmountInToken0': { + return { ..._state, amountInToken0: action.value } + } + case 'setAmountInToken1': { + return { ..._state, amountInToken1: action.value } + } + case 'setPairAddress': { + return { ..._state, pairAddress: action.value } + } + case 'setReserve0': { + return { ..._state, reserve0: action.value } + } + case 'setReserve1': { + return { ..._state, reserve1: action.value } + } + case 'setInputField': { + return { ..._state, inputField: action.value } + } + } } const PoolProvider: FC = ({ children }) => { - const [state, dispatch] = useReducer(poolReducer, { - token0: DEFAULT_TOKEN_LIST[0], - token1: DEFAULT_TOKEN_LIST[2], - isTxnPending: false, - amountInToken0: "", - amountInToken1: "", - pairAddress: undefined, - reserve0: "", - reserve1: "", - inputField: "token0", - }); - - const dispatchWithAction = useMemo( - () => ({ - setToken0: (value: IToken) => dispatch({ type: "setToken0", value }), - setToken1: (value: IToken) => dispatch({ type: "setToken1", value }), - setIsTxnPending: (value: boolean) => dispatch({ type: "setIsTxnPending", value }), - setAmountInToken0: (value: string) => dispatch({ type: "setAmountInToken0", value }), - setAmountInToken1: (value: string) => dispatch({ type: "setAmountInToken1", value }), - setPairAddress: (value: string | undefined | null) => dispatch({ type: "setPairAddress", value }), - setReserve0: (value: string) => dispatch({ type: "setReserve0", value }), - setReserve1: (value: string) => dispatch({ type: "setReserve1", value }), - setInputField: (value: InputFieldType) => dispatch({ type: "setInputField", value }), - }), - [dispatch] - ); - - return ( - { - return { state, dispatch: dispatchWithAction }; - }, [state])}> - - {children} - - ); -}; + const [state, dispatch] = useReducer(poolReducer, { + token0: DEFAULT_TOKEN_LIST[0], + token1: DEFAULT_TOKEN_LIST[2], + isTxnPending: false, + amountInToken0: '', + amountInToken1: '', + pairAddress: undefined, + reserve0: '', + reserve1: '', + inputField: 'token0', + }) + + const dispatchWithAction = useMemo( + () => ({ + setToken0: (value: IToken) => dispatch({ type: 'setToken0', value }), + setToken1: (value: IToken) => dispatch({ type: 'setToken1', value }), + setIsTxnPending: (value: boolean) => + dispatch({ type: 'setIsTxnPending', value }), + setAmountInToken0: (value: string) => + dispatch({ type: 'setAmountInToken0', value }), + setAmountInToken1: (value: string) => + dispatch({ type: 'setAmountInToken1', value }), + setPairAddress: (value: string | undefined | null) => + dispatch({ type: 'setPairAddress', value }), + setReserve0: (value: string) => dispatch({ type: 'setReserve0', value }), + setReserve1: (value: string) => dispatch({ type: 'setReserve1', value }), + setInputField: (value: InputFieldType) => + dispatch({ type: 'setInputField', value }), + }), + [dispatch], + ) + + return ( + { + return { state, dispatch: dispatchWithAction } + }, [state])} + > + + {children} + + ) +} const usePoolContext = () => { - const context = useContext(PoolContext); - if (!context) { - throw new Error("Hook can only be used inside Pool Provider"); - } + const context = useContext(PoolContext) + if (!context) { + throw new Error('Hook can only be used inside Pool Provider') + } - return context; -}; + return context +} const usePoolState = () => { - const context = usePoolContext(); - return context.state; -}; + const context = usePoolContext() + return context.state +} const usePoolDispatch = () => { - const context = usePoolContext(); - return context.dispatch; -}; + const context = usePoolContext() + return context.dispatch +} -export { PoolProvider, usePoolState, usePoolDispatch }; +export { PoolProvider, usePoolState, usePoolDispatch } diff --git a/apps/tron/src/app/providers.tsx b/apps/tron/src/app/providers.tsx index d9ed705505..3f0c5a7699 100644 --- a/apps/tron/src/app/providers.tsx +++ b/apps/tron/src/app/providers.tsx @@ -7,8 +7,8 @@ import { WalletError } from '@tronweb3/tronwallet-abstract-adapter' import { WalletProvider } from '@tronweb3/tronwallet-adapter-react-hooks' import { WalletModalProvider } from '@tronweb3/tronwallet-adapter-react-ui' import { useCallback } from 'react' -import { useWalletAdapters } from 'src/hooks/useWalletAdapters' -import { QueryClientProvider } from '../providers/query-client-provider' +import { useWalletAdapters } from '~tron/_common/lib/hooks/useWalletAdapters' +import { QueryClientProvider } from './_common/providers/query-client-provider' export function Providers({ children }: { children: React.ReactNode }) { const { adapters } = useWalletAdapters() diff --git a/apps/tron/src/app/swap/layout.tsx b/apps/tron/src/app/swap/layout.tsx index 51d39e9728..30fb454f7d 100644 --- a/apps/tron/src/app/swap/layout.tsx +++ b/apps/tron/src/app/swap/layout.tsx @@ -1,10 +1,12 @@ -import { Metadata } from "next"; -import { Providers } from "./providers"; +import { Metadata } from 'next' +import { Providers } from './providers' export const metadata: Metadata = { - title: "SushiSwap on Tron", -}; + title: 'SushiSwap on Tron', +} -export default function SwapLayout({ children }: { children: React.ReactNode }) { - return {children}; +export default function SwapLayout({ + children, +}: { children: React.ReactNode }) { + return {children} } diff --git a/apps/tron/src/app/swap/page.tsx b/apps/tron/src/app/swap/page.tsx index 49f913e210..f8ae159dad 100644 --- a/apps/tron/src/app/swap/page.tsx +++ b/apps/tron/src/app/swap/page.tsx @@ -1,31 +1,34 @@ -"use client"; -import { Container, SettingsModule, SettingsOverlay } from "@sushiswap/ui"; -import { SwitchSwapType } from "src/components/Swap/SwitchSwapType"; -import { SwitchSwapDirection } from "src/components/Swap/SwitchSwapDirection"; -import { ReviewSwapDialog } from "src/components/Swap/ReviewSwapDialog"; -import { AmountIn } from "src/components/Swap/AmountIn"; -import { AmountOut } from "src/components/Swap/AmountOut"; -import { SwapStats } from "src/components/Swap/SwapStats"; -import { Title } from "src/components/General/Title"; +'use client' +import { SlippageToleranceStorageKey } from '@sushiswap/hooks' +import { Container, SettingsModule, SettingsOverlay } from '@sushiswap/ui' +import { Title } from '~tron/_common/ui/General/Title' +import { AmountIn } from '~tron/_common/ui/Swap/AmountIn' +import { AmountOut } from '~tron/_common/ui/Swap/AmountOut' +import { ReviewSwapDialog } from '~tron/_common/ui/Swap/ReviewSwapDialog' +import { SwapStats } from '~tron/_common/ui/Swap/SwapStats' +import { SwitchSwapDirection } from '~tron/_common/ui/Swap/SwitchSwapDirection' +import { SwitchSwapType } from '~tron/_common/ui/Swap/SwitchSwapType' export default function SwapSimplePage() { - return ( - - Trade -
    - - -
    -
    - - - -
    - - -
    - ); + return ( + + Trade +
    + + +
    +
    + + + +
    + + +
    + ) } diff --git a/apps/tron/src/app/swap/providers.tsx b/apps/tron/src/app/swap/providers.tsx index eddff729fe..43a28d7c86 100644 --- a/apps/tron/src/app/swap/providers.tsx +++ b/apps/tron/src/app/swap/providers.tsx @@ -1,6 +1,6 @@ -"use client"; -import { SwapProvider } from "./swap-provider"; +'use client' +import { SwapProvider } from './swap-provider' export async function Providers({ children }: { children: React.ReactNode }) { - return {children}; + return {children} } diff --git a/apps/tron/src/app/swap/swap-provider.tsx b/apps/tron/src/app/swap/swap-provider.tsx index d715ea9daf..50807d251f 100644 --- a/apps/tron/src/app/swap/swap-provider.tsx +++ b/apps/tron/src/app/swap/swap-provider.tsx @@ -1,136 +1,142 @@ -"use client"; +'use client' -import { FC, createContext, useContext, useMemo, useReducer } from "react"; -import { DEFAULT_TOKEN_LIST } from "src/constants/token-list"; -import { IToken } from "src/types/token-type"; +import { FC, createContext, useContext, useMemo, useReducer } from 'react' +import { DEFAULT_TOKEN_LIST } from '~tron/_common/constants/token-list' +import { IToken } from '~tron/_common/types/token-type' type Action = - | { type: "swapTokens" } - | { type: "setToken0"; value: IToken } - | { type: "setToken1"; value: IToken } - | { type: "setIsTxnPending"; value: boolean } - | { type: "setAmountIn"; value: string } - | { type: "setAmountOut"; value: string } - | { type: "setRoute"; value: string[] } - | { type: "setPriceImpactPercentage"; value: number }; + | { type: 'swapTokens' } + | { type: 'setToken0'; value: IToken } + | { type: 'setToken1'; value: IToken } + | { type: 'setIsTxnPending'; value: boolean } + | { type: 'setAmountIn'; value: string } + | { type: 'setAmountOut'; value: string } + | { type: 'setRoute'; value: string[] } + | { type: 'setPriceImpactPercentage'; value: number } type Dispatch = { - swapTokens(): void; - setToken0(token: IToken): void; - setToken1(token: IToken): void; - setIsTxnPending(isPending: boolean): void; - setAmountIn(amount: string): void; - setAmountOut(amount: string): void; - setPriceImpactPercentage(priceImpactPercentage: number): void; - setRoute(route: string[]): void; -}; + swapTokens(): void + setToken0(token: IToken): void + setToken1(token: IToken): void + setIsTxnPending(isPending: boolean): void + setAmountIn(amount: string): void + setAmountOut(amount: string): void + setPriceImpactPercentage(priceImpactPercentage: number): void + setRoute(route: string[]): void +} type State = { - token0: IToken; - token1: IToken; - isTxnPending: boolean; - amountIn: string; - amountOut: string; - priceImpactPercentage: number; - route: string[]; -}; + token0: IToken + token1: IToken + isTxnPending: boolean + amountIn: string + amountOut: string + priceImpactPercentage: number + route: string[] +} -type SwapProviderProps = { children: React.ReactNode }; +type SwapProviderProps = { children: React.ReactNode } -const SwapContext = createContext<{ state: State; dispatch: Dispatch } | undefined>(undefined); +const SwapContext = createContext< + { state: State; dispatch: Dispatch } | undefined +>(undefined) function swapReducer(_state: State, action: Action) { - switch (action.type) { - case "setToken0": { - if (_state.token1.address === action.value.address) { - //if token1 is the same as the new token0, swap them - return { ..._state, token1: _state.token0, token0: action.value }; - } - return { ..._state, token0: action.value }; - } - case "setToken1": { - if (_state.token0.address === action.value.address) { - //if token0 is the same as the new token1, swap them - return { ..._state, token0: _state.token1, token1: action.value }; - } - return { ..._state, token1: action.value }; - } - case "swapTokens": { - return { ..._state, token0: _state.token1, token1: _state.token0 }; - } - case "setIsTxnPending": { - return { ..._state, isTxnPending: action.value }; - } - case "setAmountIn": { - return { ..._state, amountIn: action.value }; - } - case "setAmountOut": { - return { ..._state, amountOut: action.value }; - } - case "setPriceImpactPercentage": { - return { ..._state, priceImpactPercentage: action.value }; - } - case "setRoute": { - return { ..._state, route: action.value }; - } - // default: { - // throw new Error(`Unhandled action type: ${action.type}`); - // } - } + switch (action.type) { + case 'setToken0': { + if (_state.token1.address === action.value.address) { + //if token1 is the same as the new token0, swap them + return { ..._state, token1: _state.token0, token0: action.value } + } + return { ..._state, token0: action.value } + } + case 'setToken1': { + if (_state.token0.address === action.value.address) { + //if token0 is the same as the new token1, swap them + return { ..._state, token0: _state.token1, token1: action.value } + } + return { ..._state, token1: action.value } + } + case 'swapTokens': { + return { ..._state, token0: _state.token1, token1: _state.token0 } + } + case 'setIsTxnPending': { + return { ..._state, isTxnPending: action.value } + } + case 'setAmountIn': { + return { ..._state, amountIn: action.value } + } + case 'setAmountOut': { + return { ..._state, amountOut: action.value } + } + case 'setPriceImpactPercentage': { + return { ..._state, priceImpactPercentage: action.value } + } + case 'setRoute': { + return { ..._state, route: action.value } + } + // default: { + // throw new Error(`Unhandled action type: ${action.type}`); + // } + } } const SwapProvider: FC = ({ children }) => { - const [state, dispatch] = useReducer(swapReducer, { - token0: DEFAULT_TOKEN_LIST[0], - token1: DEFAULT_TOKEN_LIST[1], - isTxnPending: false, - amountIn: "", - amountOut: "", - priceImpactPercentage: 0, - route: [], - }); + const [state, dispatch] = useReducer(swapReducer, { + token0: DEFAULT_TOKEN_LIST[0], + token1: DEFAULT_TOKEN_LIST[1], + isTxnPending: false, + amountIn: '', + amountOut: '', + priceImpactPercentage: 0, + route: [], + }) - const dispatchWithAction = useMemo( - () => ({ - setToken0: (value: IToken) => dispatch({ type: "setToken0", value }), - setToken1: (value: IToken) => dispatch({ type: "setToken1", value }), - swapTokens: () => dispatch({ type: "swapTokens" }), - setIsTxnPending: (value: boolean) => dispatch({ type: "setIsTxnPending", value }), - setAmountIn: (value: string) => dispatch({ type: "setAmountIn", value }), - setAmountOut: (value: string) => dispatch({ type: "setAmountOut", value }), - setPriceImpactPercentage: (value: number) => dispatch({ type: "setPriceImpactPercentage", value }), - setRoute: (value: string[]) => dispatch({ type: "setRoute", value }), - }), - [dispatch] - ); + const dispatchWithAction = useMemo( + () => ({ + setToken0: (value: IToken) => dispatch({ type: 'setToken0', value }), + setToken1: (value: IToken) => dispatch({ type: 'setToken1', value }), + swapTokens: () => dispatch({ type: 'swapTokens' }), + setIsTxnPending: (value: boolean) => + dispatch({ type: 'setIsTxnPending', value }), + setAmountIn: (value: string) => dispatch({ type: 'setAmountIn', value }), + setAmountOut: (value: string) => + dispatch({ type: 'setAmountOut', value }), + setPriceImpactPercentage: (value: number) => + dispatch({ type: 'setPriceImpactPercentage', value }), + setRoute: (value: string[]) => dispatch({ type: 'setRoute', value }), + }), + [dispatch], + ) - return ( - { - return { state, dispatch: dispatchWithAction }; - }, [state])}> - {children} - - ); -}; + return ( + { + return { state, dispatch: dispatchWithAction } + }, [state])} + > + {children} + + ) +} const useSwapContext = () => { - const context = useContext(SwapContext); - if (!context) { - throw new Error("Hook can only be used inside Swap Provider"); - } + const context = useContext(SwapContext) + if (!context) { + throw new Error('Hook can only be used inside Swap Provider') + } - return context; -}; + return context +} const useSwapState = () => { - const context = useSwapContext(); - return context.state; -}; + const context = useSwapContext() + return context.state +} const useSwapDispatch = () => { - const context = useSwapContext(); - return context.dispatch; -}; + const context = useSwapContext() + return context.dispatch +} -export { SwapProvider, useSwapState, useSwapDispatch }; +export { SwapProvider, useSwapState, useSwapDispatch } diff --git a/apps/tron/src/bitquery/bitquery-endpoint.ts b/apps/tron/src/bitquery/bitquery-endpoint.ts deleted file mode 100644 index 36d0b74a11..0000000000 --- a/apps/tron/src/bitquery/bitquery-endpoint.ts +++ /dev/null @@ -1 +0,0 @@ -export const BITQUERY_ENDPOINT = "https://graphql.bitquery.io"; diff --git a/apps/tron/src/bitquery/bitquery-headers.ts b/apps/tron/src/bitquery/bitquery-headers.ts deleted file mode 100644 index 16261591c2..0000000000 --- a/apps/tron/src/bitquery/bitquery-headers.ts +++ /dev/null @@ -1,13 +0,0 @@ -export const getBitqueryHeaders = () => { - if (!process.env.BITQUERY_API_KEY) { - throw new Error("BITQUERY_API_KEY is not set"); - } - if (!process.env.BITQUERY_BEARER_TOKEN) { - throw new Error("BITQUERY_BEARER_TOKEN is not set"); - } - const headers = new Headers(); - headers.append("Content-Type", "application/json"); - headers.append("X-API-KEY", process.env.BITQUERY_API_KEY); - headers.append("Authorization", `Bearer ${process.env.BITQUERY_BEARER_TOKEN}`); - return headers; -}; diff --git a/apps/tron/src/bitquery/bitquery-options.ts b/apps/tron/src/bitquery/bitquery-options.ts deleted file mode 100644 index 7ac68b73e5..0000000000 --- a/apps/tron/src/bitquery/bitquery-options.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { getBitqueryHeaders } from "./bitquery-headers"; - -export const getOptions = (query: string) => { - const headers = getBitqueryHeaders(); - return { - method: "POST", - headers, - body: query, - redirect: "follow" as RequestRedirect, - }; -}; diff --git a/apps/tron/src/bitquery/queries/getAllPools.ts b/apps/tron/src/bitquery/queries/getAllPools.ts deleted file mode 100644 index 65302bb2e0..0000000000 --- a/apps/tron/src/bitquery/queries/getAllPools.ts +++ /dev/null @@ -1,9 +0,0 @@ -export const getAllPools = (factoryContract: string) => { - const query = JSON.stringify({ - query: - 'query ($factoryContract: String!) {\n tron {\n smartContractEvents(\n smartContractEvent: {is: "PairCreated"}\n smartContractAddress: {is: $factoryContract}\n options: {desc: "block.height"}\n ) {\n arguments {\n argument\n value\n }\n block {\n height\n }\n }\n }\n}\n', - variables: `{\n \"factoryContract\": \"${factoryContract}\"\n}`, - }); - - return query; -}; diff --git a/apps/tron/src/bitquery/queries/getReserves.ts b/apps/tron/src/bitquery/queries/getReserves.ts deleted file mode 100644 index af3de73e22..0000000000 --- a/apps/tron/src/bitquery/queries/getReserves.ts +++ /dev/null @@ -1,15 +0,0 @@ -export const getReserves = (pairAddresses: string[]) => { - if (pairAddresses.length === 0 || pairAddresses.length > 100) { - throw new Error("Invalid pairAddresses length. Must be between 1 and 100."); - } - - const pairAddressesString = pairAddresses.map((address) => `"${address}"`).join(", "); - - const query = JSON.stringify({ - query: - 'query ($pairAddresses: [String!]) {\n tron {\n smartContractEvents(\n smartContractEvent: {is: "Sync"}\n smartContractAddress: {in: $pairAddresses}\n options: {desc: "block.height", limitBy: {limit: 1, each: "smartContract.address.address"}}\n ) {\n arguments {\n argument\n value\n }\n block {\n height\n }\n smartContract {\n address {\n address\n }\n }\n }\n }\n}\n', - variables: `{\n \"pairAddresses\": [\n ${pairAddressesString}\n ]\n}`, - }); - - return query; -}; diff --git a/apps/tron/src/bitquery/queries/getTokenInfo.ts b/apps/tron/src/bitquery/queries/getTokenInfo.ts deleted file mode 100644 index ba64993547..0000000000 --- a/apps/tron/src/bitquery/queries/getTokenInfo.ts +++ /dev/null @@ -1,9 +0,0 @@ -export const getTokenInfo = (contractAddress: string) => { - const query = JSON.stringify({ - query: - "query ($contractAddress: String!) {\n tron {\n address(address: {is: $contractAddress}) {\n smartContract {\n currency {\n decimals\n name\n symbol\n }\n }\n }\n }\n}", - variables: `{\n \"contractAddress\": \"${contractAddress}\"\n}`, - }); - - return query; -}; diff --git a/apps/tron/src/bitquery/queries/getTransfersToPairs.ts b/apps/tron/src/bitquery/queries/getTransfersToPairs.ts deleted file mode 100644 index e6b7407c55..0000000000 --- a/apps/tron/src/bitquery/queries/getTransfersToPairs.ts +++ /dev/null @@ -1,15 +0,0 @@ -export const getTransfersToPairs = (pairAddresses: string[], walletAddress: string) => { - if (pairAddresses.length === 0 || pairAddresses.length > 100) { - throw new Error("Invalid pairAddresses length. Must be between 1 and 100."); - } - - const pairAddressesString = pairAddresses.map((address) => `"${address}"`).join(", "); - - const query = JSON.stringify({ - query: - "query ($pairAddresses: [String!], $walletAddress: String!) {\n tron {\n transfers(\n sender: {is: $walletAddress}\n receiver: {in: $pairAddresses}\n ) {\n currency {\n address\n decimals\n name\n symbol\n }\n txHash\n receiver {\n address\n }\n }\n }\n}\n", - variables: `{\n \"walletAddress\": \"${walletAddress}\",\n \"pairAddresses\": [\n ${pairAddressesString}\n ]\n}`, - }); - - return query; -}; diff --git a/apps/tron/src/bitquery/queries/getTronInUSDT.ts b/apps/tron/src/bitquery/queries/getTronInUSDT.ts deleted file mode 100644 index fe63d3f852..0000000000 --- a/apps/tron/src/bitquery/queries/getTronInUSDT.ts +++ /dev/null @@ -1,9 +0,0 @@ -export const getTronInUSDT = () => { - const query = JSON.stringify({ - query: - 'query GetTronInUSDT {\n tron {\n dexTrades(\n baseCurrency: {is: "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR"}\n quoteCurrency: {is: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"}\n options: {limit: 1, desc: "block.timestamp.time"}\n ) {\n block {\n timestamp {\n time(format: "%Y-%m-%d %H:%M:%S")\n }\n }\n baseCurrency {\n address\n }\n quoteCurrency {\n address\n }\n quotePrice\n }\n }\n}\n', - variables: "{}", - }); - - return query; -}; diff --git a/apps/tron/src/components/General/Icon.tsx b/apps/tron/src/components/General/Icon.tsx deleted file mode 100644 index 9d80a81242..0000000000 --- a/apps/tron/src/components/General/Icon.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import Image from "next/image"; -import { IToken } from "src/types/token-type"; -import { hashStringToColor } from "src/utils/formatters"; - -type IconProps = { - currency: IToken | undefined; - height?: number; - width?: number; -}; - -export const Icon = ({ currency, height = 40, width = 40 }: IconProps) => { - return ( - <> - {currency?.logoURI ? ( - - ) : ( -
    - {currency?.symbol?.substring(0, 2) ?? "??"} -
    - )} - - ); -}; diff --git a/apps/tron/src/components/General/IconList.tsx b/apps/tron/src/components/General/IconList.tsx deleted file mode 100644 index 3261eb90ff..0000000000 --- a/apps/tron/src/components/General/IconList.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { classNames } from "@sushiswap/ui"; -import { Children, cloneElement, FC, isValidElement, ReactNode } from "react"; - -type IconListProps = { - children: ReactNode; - iconWidth: number; - iconHeight: number; -}; - -export const IconList: FC = ({ children, iconWidth, iconHeight }) => { - return ( -
    -
    - {Children.map(children, (child, index) => { - if (isValidElement(child)) { - return ( -
    0 ? -iconWidth / 3 : 0 }}> - {cloneElement(child, { - ...child.props, - width: iconWidth || child.props.width, - height: iconHeight || child.props.height, - })} -
    - ); - } - })} -
    -
    - ); -}; diff --git a/apps/tron/src/components/General/Title.tsx b/apps/tron/src/components/General/Title.tsx deleted file mode 100644 index 44a2422197..0000000000 --- a/apps/tron/src/components/General/Title.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { ReactNode } from "react"; - -export const Title = ({ children, className }: { children: ReactNode; className?: string }) => { - return ( -

    - {children} -

    - ); -}; diff --git a/apps/tron/src/components/General/TokenListSelect.tsx b/apps/tron/src/components/General/TokenListSelect.tsx deleted file mode 100644 index 6602915377..0000000000 --- a/apps/tron/src/components/General/TokenListSelect.tsx +++ /dev/null @@ -1,187 +0,0 @@ -import { - Badge, - Button, - Dialog, - DialogClose, - DialogContent, - DialogDescription, - DialogHeader, - DialogTitle, - DialogTrigger, - List, - SelectIcon, -} from "@sushiswap/ui"; -import { Search } from "../Input/Search"; -import { useMemo, useRef, useState } from "react"; -import { Icon } from "./Icon"; -import { IToken } from "src/types/token-type"; -import { DEFAULT_TOKEN_LIST, DEFAULT_TOKEN_LIST_WITH_KEY } from "src/constants/token-list"; -import { useDebounce } from "@sushiswap/hooks"; -import { useTokenInfo } from "src/hooks/useTokenInfo"; -import { useCustomTokens } from "src/hooks/useCustomTokens"; -import { useSortedTokenList } from "src/hooks/useSortedTokenList"; -import { classNames } from "@sushiswap/ui"; -import { CheckCircleIcon } from "@heroicons/react/20/solid"; - -export const TokenListSelect = ({ - token, - setToken, - className, -}: { - token: IToken | undefined; - setToken: (token: IToken) => void; - className?: string; -}) => { - const [query, setQuery] = useState(""); - const debouncedQuery = useDebounce(query, 500); - const closeBtnRef = useRef(null); - const { data: newToken } = useTokenInfo({ tokenAddress: debouncedQuery }); - const { customTokens, addOrRemoveToken, hasToken } = useCustomTokens(); - const { data: sortedTokenList } = useSortedTokenList({ - query: debouncedQuery, - tokenMap: DEFAULT_TOKEN_LIST_WITH_KEY(), - customTokenMap: customTokens, - }); - - const closeModal = () => { - closeBtnRef?.current?.click(); - setQuery(""); - }; - - const selectToken = (token: IToken) => { - setToken(token); - closeModal(); - }; - - return ( - - - - - - - - Select a token - - Select a token from our default list or search for a token by symbol or address. - - -
    - -
    - -
    - - - {newToken ? ( - [newToken].map((_token) => ( - - )) - ) : sortedTokenList?.length === 0 ? ( -

    No tokens found

    - ) : ( - sortedTokenList?.map((_token) => ( - - )) - )} -
    -
    -
    -
    -
    - ); -}; - -const TokenButton = ({ - token, - selectToken, - hasToken, - addOrRemoveToken, - isSelected, -}: { - token: IToken; - selectToken: (_token: IToken) => void; - hasToken?: (currency: IToken) => boolean; - isSelected: boolean; - addOrRemoveToken?: (type: "add" | "remove", currency: IToken[]) => void; -}) => { - const isOnDefaultList = useMemo(() => DEFAULT_TOKEN_LIST.some((t) => t.address === token.address), [token]); - const isNew = hasToken && !hasToken(token); - const isCustomAdded = hasToken && hasToken(token); - - return ( -
    -
    - - {isNew && !isOnDefaultList ? ( - - ) : null} - {isCustomAdded && !isOnDefaultList ? ( - - ) : null} -
    - ); -}; diff --git a/apps/tron/src/components/Input/Search.tsx b/apps/tron/src/components/Input/Search.tsx deleted file mode 100644 index 4bdc789f1f..0000000000 --- a/apps/tron/src/components/Input/Search.tsx +++ /dev/null @@ -1,220 +0,0 @@ -import { classNames } from "@sushiswap/ui"; -import React, { FC, KeyboardEvent, ReactElement, forwardRef, useCallback, useEffect, useState } from "react"; -import { MagnifyingGlassIcon, XMarkIcon } from "@heroicons/react/24/outline"; -import { Loader } from "@sushiswap/ui"; - -interface Search { - className?: string; - id: string; - input?(props: any): ReactElement | null; - value: string; - loading: boolean; - onChange(val: string): void; - size?: "sm" | "default"; - delimiter?: string; - placeholder?: string; -} - -export const Search: FC = forwardRef(function Search( - { className, id, loading, input: Input, value, onChange, size = "default", delimiter, placeholder }, - ref -) { - const [values, setValues] = useState({ - all: value.split(delimiter || " "), - typed: "", - }); - const _onChange = useCallback( - (val: string) => { - if (val.slice(-1) === (delimiter || " ")) { - setValues((prev) => ({ - typed: "", - all: [...prev.all, prev.typed], - })); - } else { - setValues((prev) => ({ - typed: val, - all: prev.all, - })); - } - }, - [delimiter] - ); - - const remove = useCallback((val: string) => { - setValues((prev) => ({ - typed: prev.typed, - all: prev.all.filter((_val) => _val !== val), - })); - }, []); - - const handleKeyDown = useCallback((event: KeyboardEvent) => { - if (event.key === "Backspace") { - setValues((prev) => ({ - typed: prev.typed, - all: prev.all.slice(0, -1), - })); - } - if (event.key === "Enter") { - setValues((prev) => ({ - typed: "", - all: [...prev.all, prev.typed], - })); - } - }, []); - - useEffect(() => { - if (delimiter) { - onChange(`${values.typed} ${values.all.filter((el) => el !== " " && el !== "").join(" ")}`); - } - }, [delimiter, onChange, values]); - - if (delimiter) { - return ( -
    -
    - -
    - -
    - {values.all - .filter((el) => el !== " " && el !== "") - .map((el, i) => ( -
    remove(el)} - key={i} - className="font-semibold text-gray-600 dark:text-slate-300 flex items-center text-sm rounded-full p-1 pl-2.5 bg-black/[0.08] dark:bg-white/[0.16] gap-1"> - {el} -
    - -
    -
    - ))} -
    - _onChange(e.target.value)} - onKeyDown={handleKeyDown} - className={classNames( - "truncate outline-none font-semibold w-full bg-transparent !p-0 placeholder:font-medium placeholder:text-gray-400 placeholder:dark:text-slate-500 text-gray-900 dark:text-slate-200" - )} - autoCorrect="off" - autoCapitalize="off" - spellCheck="false" - autoComplete="off" - /> - {(loading || value) && ( -
    - {loading ? ( -
    - -
    - ) : value ? ( -
    - setValues({ - all: [], - typed: "", - }) - }> - -
    - ) : ( - <> - )} -
    - )} -
    - ); - } - return ( -
    - - {Input ? ( - - ) : ( - onChange(e.target.value)} - className={classNames( - "truncate font-semibold w-full bg-transparent !p-0 placeholder:font-medium placeholder:text-gray-400 placeholder:dark:text-slate-500 text-gray-900 dark:text-slate-200" - )} - autoCorrect="off" - autoCapitalize="off" - spellCheck="false" - autoComplete="off" - /> - )} - {(loading || value) && ( -
    - {loading ? ( -
    - -
    - ) : value ? ( -
    onChange("")}> - -
    - ) : ( - <> - )} -
    - )} -
    - ); -}); diff --git a/apps/tron/src/components/Input/TokenInput.tsx b/apps/tron/src/components/Input/TokenInput.tsx deleted file mode 100644 index 1fa8cd1994..0000000000 --- a/apps/tron/src/components/Input/TokenInput.tsx +++ /dev/null @@ -1,92 +0,0 @@ -import { Button, TextField } from "@sushiswap/ui"; -import { TokenListSelect } from "../General/TokenListSelect"; -import { DollarAmountDisplay } from "../Shared/DollarAmountDisplay"; -import { TokenBalanceDisplay } from "../Shared/TokenBalanceDisplay"; -import { IToken } from "src/types/token-type"; -import { useTokenBalance } from "src/hooks/useTokenBalance"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { formatUnitsForInput } from "src/utils/formatters"; -import { useStablePrice } from "src/hooks/useStablePrice"; -import { Icon } from "../General/Icon"; - -type TokenInputProps = { - type: "input" | "output"; - token: IToken | undefined; - setToken: (token: IToken) => void; - amount: string; - setAmount: (amount: string) => void; - hasTokenListSelect?: boolean; -}; - -export const TokenInput = ({ - type, - token, - setToken, - amount, - setAmount, - hasTokenListSelect = true, -}: TokenInputProps) => { - const { address } = useWallet(); - const { data: tokenBalance, isInitialLoading: isInitialLoadingTokenBalance } = useTokenBalance({ - accountAddress: address, - tokenAddress: token?.address, - }); - const { data: usdValue, isLoading: isUSDValueLoading } = useStablePrice({ token: token }); - - const usdAmount = amount ? (Number(amount) * (usdValue ? Number(usdValue) : 0)).toString(10) : "0.00"; - - return ( -
    -
    - { - if (type === "output") return; - const value = e.target.value; - - setAmount(value); - }} - // isError={true} - /> - {hasTokenListSelect ? ( - - ) : ( - - )} -
    -
    - - { - if (type === "output") return; - if (tokenBalance === "0") { - setAmount(""); - return; - } - setAmount(formatUnitsForInput(tokenBalance ?? "0", token?.decimals ?? 0)); - }} - /> -
    -
    - ); -}; diff --git a/apps/tron/src/components/Pools/Add/AddButton.tsx b/apps/tron/src/components/Pools/Add/AddButton.tsx deleted file mode 100644 index 88c46eeae2..0000000000 --- a/apps/tron/src/components/Pools/Add/AddButton.tsx +++ /dev/null @@ -1,162 +0,0 @@ -import { useSlippageTolerance } from "@sushiswap/hooks"; -import { Button, Dots, createFailedToast, createInfoToast, createSuccessToast } from "@sushiswap/ui"; -import { useQueryClient } from "@tanstack/react-query"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { useMemo } from "react"; -import { usePoolDispatch, usePoolState } from "src/app/pool/pool-provider"; -import { useTronWeb } from "src/hooks/useTronWeb"; -import { parseUnits } from "src/utils/formatters"; -import { - cleanArgs, - getArgsForAddLiquidity, - getDeadline, - getLiquidityFunctionSelector, - getTransactionInfo, - parseTxnError, - safeGasEstimates, -} from "src/utils/helpers"; -import { getTronscanTxnLink } from "src/utils/tronscan-helpers"; - -export const AddButton = ({ closeModal }: { closeModal: () => void }) => { - const queryClient = useQueryClient(); - - const { token0, token1, isTxnPending, amountInToken0, amountInToken1, pairAddress } = usePoolState(); - const { setIsTxnPending, setAmountInToken0, setAmountInToken1 } = usePoolDispatch(); - const { address, signTransaction } = useWallet(); - const { tronWeb } = useTronWeb(); - const [slippageTolerance] = useSlippageTolerance("sushi-tron-slippage-add-liq"); - const slippage = slippageTolerance === "AUTO" ? 0.005 : Number(slippageTolerance) / 100; - - const pairExists = !!pairAddress; - - const minAmountToken0 = useMemo(() => { - if (!amountInToken0) return ""; - const output = Number(amountInToken0) * (1 - slippage); - return output.toString(); - }, [slippage, amountInToken0]); - - const minAmountToken1 = useMemo(() => { - if (!amountInToken1) return ""; - const output = Number(amountInToken1) * (1 - slippage); - return output.toString(); - }, [slippage, amountInToken1]); - - const addLiquidity = async () => { - if (!token0 || !token1 || !amountInToken0 || !amountInToken1 || !address) return; - try { - setIsTxnPending(true); - const methodName = getLiquidityFunctionSelector(token0, token1); - const deadline = getDeadline(); - const parsedAmount0 = parseUnits(amountInToken0, token0.decimals); - const parsedAmount1 = parseUnits(amountInToken1, token1.decimals); - const parsedMinAmount0 = parseUnits(minAmountToken0, token0.decimals); - const parsedMinAmount1 = parseUnits(minAmountToken1, token1.decimals); - - const args = getArgsForAddLiquidity( - methodName, - token0.address, - token1.address, - parsedAmount0, - parsedAmount1, - parsedMinAmount0, - parsedMinAmount1, - address, - deadline - ); - console.log("args", args); - const estimates = await safeGasEstimates(tronWeb, [args]); - console.log(estimates); - const safeGasEstimate = estimates.findIndex((predicate) => predicate !== undefined); - console.log("safeGasEstimate", safeGasEstimate); - - if (safeGasEstimate === -1) { - throw new Error("Failed to estimate energy. Transaction will fail."); - } - const feeLimit = pairExists ? undefined : 3000000000; //3000 trx since contract will need to be deployed - const cleanedArgs = cleanArgs(args, feeLimit); - console.log("cleanedArgs", cleanedArgs); - const { transaction } = await tronWeb.transactionBuilder.triggerSmartContract(...cleanedArgs); - const signedTransation = await signTransaction(transaction); - - const result = await tronWeb.trx.sendRawTransaction(signedTransation); - - if (!result.result && "code" in result) { - throw new Error(parseTxnError(result.code)); - } - const txId = result?.txid; - - createInfoToast({ - summary: "Add liquidity initiated...", - type: "swap", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - txHash: txId, - href: getTronscanTxnLink(txId), - }); - - const transactionInfo = await getTransactionInfo(tronWeb, txId); - if (transactionInfo?.receipt?.result !== "SUCCESS") { - throw new Error("Transaction failed"); - } - - //create success toast - createSuccessToast({ - summary: "Add liquidity successful", - txHash: txId, - type: "swap", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - href: getTronscanTxnLink(txId), - }); - - onSuccess(); - } catch (error) { - const errorMessage = - typeof error === "string" - ? error - : (error as Error)?.message ?? "An error occurred while trying to add liquidity"; - //create error toast - createFailedToast({ - summary: errorMessage, - type: "swap", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - }); - console.log(error); - setIsTxnPending(false); - } - }; - - const onSuccess = () => { - setIsTxnPending(false); - setAmountInToken0(""); - setAmountInToken1(""); - closeModal(); - queryClient.invalidateQueries([ - "useTokenBalance", - { accountAddress: address, tokenAddress: token0?.address }, - ]); - queryClient.invalidateQueries([ - "useTokenBalance", - { accountAddress: address, tokenAddress: token1?.address }, - ]); - }; - - return ( - - ); -}; diff --git a/apps/tron/src/components/Pools/Add/AmountInToken0.tsx b/apps/tron/src/components/Pools/Add/AmountInToken0.tsx deleted file mode 100644 index 6eada5b211..0000000000 --- a/apps/tron/src/components/Pools/Add/AmountInToken0.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { useEffect, useMemo } from "react"; -import { usePoolDispatch, usePoolState } from "src/app/pool/pool-provider"; -import { TokenInput } from "src/components/Input/TokenInput"; -import { formatUnitsForInput, parseUnits } from "src/utils/formatters"; -import { getToken1AmountForLiquidity } from "src/utils/helpers"; - -export const AmountInToken0 = () => { - const { token0, token1, amountInToken0, reserve0, reserve1, pairAddress, inputField } = usePoolState(); - const { setToken0, setAmountInToken0, setAmountInToken1, setInputField } = usePoolDispatch(); - - const pairExists = !!pairAddress; - - const rateOfToken1 = useMemo(() => { - if (!reserve0 || !reserve1) return; - if (!token0 || !token1) return; - return getToken1AmountForLiquidity(parseUnits(amountInToken0 ?? 0, token0?.decimals), reserve0, reserve1); - }, [token0, token1, reserve0, reserve1, amountInToken0]); - - useEffect(() => { - if (inputField === "token1") { - return; - } - if (pairExists && amountInToken0 === "") { - setAmountInToken1(""); - return; - } - if (pairExists && rateOfToken1 && rateOfToken1 !== "NaN" && token1) { - const amountFormatted = formatUnitsForInput(rateOfToken1, token1?.decimals); - if (amountFormatted) { - setAmountInToken1(amountFormatted); - } else { - setAmountInToken1(""); - } - } - }, [amountInToken0, pairExists, rateOfToken1, rateOfToken1, token1, inputField]); - - const setAmount = (amount: string) => { - setInputField("token0"); - setAmountInToken0(amount); - }; - - return ( - - ); -}; diff --git a/apps/tron/src/components/Pools/Add/AmountIntToken1.tsx b/apps/tron/src/components/Pools/Add/AmountIntToken1.tsx deleted file mode 100644 index 97501e067f..0000000000 --- a/apps/tron/src/components/Pools/Add/AmountIntToken1.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { useEffect, useMemo } from "react"; -import { usePoolDispatch, usePoolState } from "src/app/pool/pool-provider"; -import { TokenInput } from "src/components/Input/TokenInput"; -import { formatUnitsForInput, parseUnits } from "src/utils/formatters"; -import { getToken0AmountForLiquidity } from "src/utils/helpers"; - -export const AmountInToken1 = () => { - const { token0, token1, amountInToken1, pairAddress, reserve0, reserve1, inputField } = usePoolState(); - const { setToken1, setAmountInToken1, setAmountInToken0, setInputField } = usePoolDispatch(); - - const pairExists = !!pairAddress; - - const rateOfToken0 = useMemo(() => { - if (!reserve0 || !reserve1) return; - if (!token0 || !token1) return; - return getToken0AmountForLiquidity(parseUnits(amountInToken1 ?? 0, token1?.decimals), reserve0, reserve1); - }, [token0, token1, reserve0, reserve1, amountInToken1]); - - useEffect(() => { - if (inputField === "token0") { - return; - } - if (pairExists && amountInToken1 === "") { - setAmountInToken0(""); - return; - } - if (pairExists && rateOfToken0 && rateOfToken0 !== "NaN" && token0) { - const amountFormatted = formatUnitsForInput(rateOfToken0, token0?.decimals); - if (amountFormatted) { - setAmountInToken0(amountFormatted); - } else { - setAmountInToken0(""); - } - } - }, [amountInToken1, pairExists, rateOfToken0, token0, inputField]); - - const setAmount = (amount: string) => { - setInputField("token1"); - setAmountInToken1(amount); - }; - - return ( - - ); -}; diff --git a/apps/tron/src/components/Pools/Add/DepositForm.tsx b/apps/tron/src/components/Pools/Add/DepositForm.tsx deleted file mode 100644 index 557551d5e1..0000000000 --- a/apps/tron/src/components/Pools/Add/DepositForm.tsx +++ /dev/null @@ -1,21 +0,0 @@ -"use client"; -import { FormSection } from "@sushiswap/ui"; -import { AmountInToken0 } from "./AmountInToken0"; -import { Plus } from "./Plus"; -import { AmountInToken1 } from "./AmountIntToken1"; -import { ReviewAddDialog } from "./ReviewAddDialog"; - -export const DepositForm = () => { - return ( - -
    - - - -
    -
    - -
    -
    - ); -}; diff --git a/apps/tron/src/components/Pools/Add/Plus.tsx b/apps/tron/src/components/Pools/Add/Plus.tsx deleted file mode 100644 index 667efd3327..0000000000 --- a/apps/tron/src/components/Pools/Add/Plus.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { PlusIcon } from "@heroicons/react/20/solid"; - -export const Plus = () => { - return ( -
    - -
    - ); -}; diff --git a/apps/tron/src/components/Pools/Add/Rate.tsx b/apps/tron/src/components/Pools/Add/Rate.tsx deleted file mode 100644 index b269ea8eae..0000000000 --- a/apps/tron/src/components/Pools/Add/Rate.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { Button, SkeletonBox } from "@sushiswap/ui"; -import { useMemo, useState } from "react"; -import { usePoolState } from "src/app/pool/pool-provider"; -import { formatUnits, parseUnits } from "src/utils/formatters"; -import { getToken0AmountForLiquidity, getToken1AmountForLiquidity } from "src/utils/helpers"; -import { formatUSD } from "sushi/format"; - -export const Rate = ({ - token0Price, - token1Price, - isLoading, -}: { - token0Price: string | undefined; - token1Price: string | undefined; - isLoading: boolean; -}) => { - const [showToken0First, setShowToken0First] = useState(false); - const { token0, token1, reserve0, reserve1 } = usePoolState(); - - const handleToggleRate = () => { - setShowToken0First(!showToken0First); - }; - - const rateOfToken0 = useMemo(() => { - if (!reserve0 || !reserve1) return; - if (!token0 || !token1) return; - return getToken0AmountForLiquidity(parseUnits("1", token1?.decimals), reserve0, reserve1); - }, [token0, token1, reserve0, reserve1]); - - const rateOfToken1 = useMemo(() => { - if (!reserve0 || !reserve1) return; - if (!token0 || !token1) return; - return getToken1AmountForLiquidity(parseUnits("1", token0?.decimals), reserve0, reserve1); - }, [token0, token1, reserve0, reserve1]); - - return ( -
    - - {isLoading ? ( - - ) : ( -
    - {showToken0First ? formatUSD(token0Price ?? "") : formatUSD(token1Price ?? "")} -
    - )} -
    - ); -}; diff --git a/apps/tron/src/components/Pools/Add/ReviewAddDialog.tsx b/apps/tron/src/components/Pools/Add/ReviewAddDialog.tsx deleted file mode 100644 index 9816291a5a..0000000000 --- a/apps/tron/src/components/Pools/Add/ReviewAddDialog.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import { List, SkeletonBox } from "@sushiswap/ui"; -import { Icon } from "../../General/Icon"; -import { - Dialog, - DialogClose, - DialogContent, - DialogDescription, - DialogHeader, - DialogTitle, -} from "@sushiswap/ui"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { useRef } from "react"; -import { WalletConnector } from "../../WalletConnector/WalletConnector"; -import { usePoolState } from "src/app/pool/pool-provider"; -import { Rate } from "./Rate"; -import { ReviewAddDialogTrigger } from "./ReviewAddDialogTrigger"; -import { useStablePrice } from "src/hooks/useStablePrice"; -import { AddButton } from "./AddButton"; -import { formatUSD } from "sushi/format"; -import { formatUnits } from "src/utils/formatters"; - -export const ReviewAddDialog = () => { - const { token0, token1, amountInToken0, amountInToken1 } = usePoolState(); - const closeBtnRef = useRef(null); - const { address, connected } = useWallet(); - const isConnected = address && connected; - const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice({ token: token0 }); - const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice({ token: token1 }); - - const closeModal = () => { - closeBtnRef?.current?.click(); - }; - - return ( - - {isConnected ? ( - - ) : ( - - )} - - - - Add liquidity - Please review your entered details. - -
    -
    - - - -
    -
    - - {/* show max 12 decimals so nothing is cut off */} -
    {formatUnits(amountInToken0, 0, 12)}
    {token0?.symbol}
    -
    - {isLoadingToken0Price ? ( - - ) : ( -
    - {formatUSD(Number(token0Price) * Number(amountInToken0))} -
    - )} -
    -
    - -
    -
    - - {/* show max 12 decimals so nothing is cut off */} -
    {formatUnits(amountInToken1, 0, 12)}
    {token1?.symbol}
    -
    - {isLoadingToken1Price ? ( - - ) : ( -
    - {formatUSD(Number(token1Price) * Number(amountInToken1))} -
    - )} -
    -
    - - - -
    -
    - -
    -
    -
    -
    - ); -}; diff --git a/apps/tron/src/components/Pools/Add/ReviewAddDialogTrigger.tsx b/apps/tron/src/components/Pools/Add/ReviewAddDialogTrigger.tsx deleted file mode 100644 index c255f04c62..0000000000 --- a/apps/tron/src/components/Pools/Add/ReviewAddDialogTrigger.tsx +++ /dev/null @@ -1,135 +0,0 @@ -import { Button, DialogTrigger } from "@sushiswap/ui"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { useMemo } from "react"; -import { usePoolState } from "src/app/pool/pool-provider"; -import { ApproveToken } from "src/components/Shared/ApproveToken"; -import { ROUTER_CONTRACT } from "src/constants/contracts"; -import { useAllowance } from "src/hooks/useAllowance"; -import { useTokenBalance } from "src/hooks/useTokenBalance"; -import { formatUnitsForInput } from "src/utils/formatters"; - -export const ReviewAddDialogTrigger = () => { - const { token0, token1, isTxnPending, amountInToken0, amountInToken1 } = usePoolState(); - const { address } = useWallet(); - - const { data: token0Balance, isLoading: isLoadingToken0Balance } = useTokenBalance({ - accountAddress: address, - tokenAddress: token0?.address, - }); - - const { data: token1Balance, isLoading: isLoadingToken1Balance } = useTokenBalance({ - accountAddress: address, - tokenAddress: token1?.address, - }); - - const { data: token0AllowanceAmount, refetch: refetchToken0Allowance } = useAllowance({ - tokenAddress: token0?.address as string, - ownerAddress: address as string, - spenderAddress: ROUTER_CONTRACT, - }); - - const { data: token1AllowanceAmount, refetch: refetchToken1Allowance } = useAllowance({ - tokenAddress: token1?.address as string, - ownerAddress: address as string, - spenderAddress: ROUTER_CONTRACT, - }); - - const hasInsufficientToken0Balance = useMemo(() => { - if (isLoadingToken0Balance) return true; - return Number(formatUnitsForInput(token0Balance ?? "0", token0?.decimals ?? 18)) < Number(amountInToken0); - }, [token0Balance, token0, amountInToken0, isLoadingToken0Balance]); - - const hasInsufficientToken1Balance = useMemo(() => { - if (isLoadingToken1Balance) return true; - return Number(formatUnitsForInput(token1Balance ?? "0", token1?.decimals ?? 18)) < Number(amountInToken1); - }, [token1Balance, token1, amountInToken1, isLoadingToken1Balance]); - - const token0AllowanceFormatted = formatUnitsForInput(token0AllowanceAmount ?? "0", token0?.decimals ?? 18); - - const token1AllowanceFormatted = formatUnitsForInput(token1AllowanceAmount ?? "0", token1?.decimals ?? 18); - - const hasInsufficientToken0Allowance = useMemo(() => { - return !!token1AllowanceAmount && Number(token0AllowanceFormatted) < Number(amountInToken0); - }, [token0AllowanceFormatted, amountInToken0, token1AllowanceAmount]); - - const hasInsufficientToken1Allowance = useMemo(() => { - return !!token1AllowanceAmount && Number(token1AllowanceFormatted) < Number(amountInToken1); - }, [token1AllowanceFormatted, amountInToken1, token1AllowanceAmount]); - - const invalidAmount = useMemo(() => { - return ( - amountInToken0 === "" || - amountInToken1 === "" || - Number(amountInToken0) === 0 || - Number(amountInToken1) === 0 - ); - }, [amountInToken0, amountInToken1]); - - const buttonText = useMemo(() => { - if (isTxnPending) { - return "Adding Liquidity"; - } - if (invalidAmount) { - return "Enter Amount"; - } - if (hasInsufficientToken0Balance) { - return `Insufficient ${token0?.symbol} Balance`; - } - if (hasInsufficientToken1Balance) { - return `Insufficient ${token1?.symbol} Balance`; - } - if (hasInsufficientToken0Allowance) { - return `Approve ${token0?.symbol} Token`; - } - if (hasInsufficientToken1Allowance) { - return `Approve ${token1?.symbol} Token`; - } - - return "Add Liquidity"; - }, [ - hasInsufficientToken0Balance, - hasInsufficientToken1Balance, - hasInsufficientToken0Allowance, - hasInsufficientToken1Allowance, - invalidAmount, - token0, - token1, - isTxnPending, - ]); - - if (buttonText === `Approve ${token0?.symbol} Token`) { - return ( - { - await refetchToken0Allowance(); - }} - /> - ); - } - - if (buttonText === `Approve ${token1?.symbol} Token`) { - return ( - { - await refetchToken1Allowance(); - }} - /> - ); - } - - return ( - - - - ); -}; diff --git a/apps/tron/src/components/Pools/Add/SelectTokensForm.tsx b/apps/tron/src/components/Pools/Add/SelectTokensForm.tsx deleted file mode 100644 index 0f559592b1..0000000000 --- a/apps/tron/src/components/Pools/Add/SelectTokensForm.tsx +++ /dev/null @@ -1,34 +0,0 @@ -"use client"; -import { FormSection } from "@sushiswap/ui"; -import { useEffect } from "react"; -import { usePoolDispatch, usePoolState } from "src/app/pool/pool-provider"; -import { TokenListSelect } from "src/components/General/TokenListSelect"; -import { useIsContract } from "src/hooks/useIsContract"; -import { usePairContract } from "src/hooks/usePairContract"; - -export const SelectTokensForm = () => { - const { token0, token1 } = usePoolState(); - const { setToken0, setToken1, setPairAddress } = usePoolDispatch(); - const { data: _pairAddress } = usePairContract({ - token0Address: token0?.address, - token1Address: token1?.address, - }); - const { data: isContract } = useIsContract({ address: _pairAddress }); - - useEffect(() => { - if (isContract && _pairAddress) { - setPairAddress(_pairAddress); - } else { - setPairAddress(undefined); - } - }, [isContract, _pairAddress]); - - return ( - -
    - - -
    -
    - ); -}; diff --git a/apps/tron/src/components/Pools/Manage/AddSection.tsx b/apps/tron/src/components/Pools/Manage/AddSection.tsx deleted file mode 100644 index d765336e9f..0000000000 --- a/apps/tron/src/components/Pools/Manage/AddSection.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { CogIcon } from "@heroicons/react/24/outline"; -import { - IconButton, - SettingsModule, - SettingsOverlay, - Widget, - WidgetAction, - WidgetDescription, - WidgetHeader, - WidgetTitle, -} from "@sushiswap/ui"; -import { AmountInToken0 } from "../Add/AmountInToken0"; -import { AmountInToken1 } from "../Add/AmountIntToken1"; -import { Plus } from "../Add/Plus"; -import { ReviewAddDialog } from "../Add/ReviewAddDialog"; - -export const AddSection = () => { - return ( - - - Add Liquidity - Provide liquidity to receive SLP tokens. - - - - - - -
    - - - -
    -
    - -
    -
    - ); -}; diff --git a/apps/tron/src/components/Pools/Manage/Manage.tsx b/apps/tron/src/components/Pools/Manage/Manage.tsx deleted file mode 100644 index 4909505ad0..0000000000 --- a/apps/tron/src/components/Pools/Manage/Manage.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, - Separator, - Tabs, - TabsContent, - TabsList, - TabsTrigger, -} from "@sushiswap/ui"; -import { useState } from "react"; -import { AddSection } from "./AddSection"; -import { RemoveSection } from "./RemoveSection"; - -export const Manage = () => { - const [tab, setTab] = useState("add"); - - return ( - - - Manage - Manage your position - - - - - - Add - - - Remove - - - -
    - -
    - - - - - - - - - - - -
    -
    - ); -}; diff --git a/apps/tron/src/components/Pools/Manage/RemoveSection.tsx b/apps/tron/src/components/Pools/Manage/RemoveSection.tsx deleted file mode 100644 index 0f3d8706b3..0000000000 --- a/apps/tron/src/components/Pools/Manage/RemoveSection.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { CogIcon } from "@heroicons/react/24/outline"; -import { - IconButton, - SettingsModule, - SettingsOverlay, - Widget, - WidgetAction, - WidgetDescription, - WidgetHeader, - WidgetTitle, -} from "@sushiswap/ui"; -import { RemoveLiquidity } from "../Remove/RemoveLiquidity"; - -export const RemoveSection = () => { - return ( - - - Remove Liquidity - Trade in your LP tokens to receive your underlying tokens - - - - - - - - - ); -}; diff --git a/apps/tron/src/components/Pools/PoolDetails/LiquidityItem.tsx b/apps/tron/src/components/Pools/PoolDetails/LiquidityItem.tsx deleted file mode 100644 index 77876db52f..0000000000 --- a/apps/tron/src/components/Pools/PoolDetails/LiquidityItem.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { CardItem } from "@sushiswap/ui"; -import { Icon } from "src/components/General/Icon"; -import { IToken } from "src/types/token-type"; -import { formatUnits } from "src/utils/formatters"; -import { formatNumber, formatUSD } from "sushi/format"; - -export const LiquidityItem = ({ - isLoading, - token, - amount, - usdAmount, -}: { - isLoading: boolean; - token: IToken | undefined; - amount: string; - usdAmount: string; -}) => { - if (isLoading || !token) { - return ; - } - return ( - - - {token?.symbol} -
    - }> - - {formatNumber(formatUnits(amount ?? "", token?.decimals ?? 0, 4))}{" "} - {formatUSD(usdAmount)} - -
    - ); -}; diff --git a/apps/tron/src/components/Pools/PoolDetails/PoolHeader.tsx b/apps/tron/src/components/Pools/PoolDetails/PoolHeader.tsx deleted file mode 100644 index 8dc2c23d58..0000000000 --- a/apps/tron/src/components/Pools/PoolDetails/PoolHeader.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { ArrowTopRightOnSquareIcon } from "@heroicons/react/24/solid"; -import { - Button, - LinkExternal, - SkeletonCircle, - SkeletonText, - classNames, - typographyVariants, -} from "@sushiswap/ui"; -import { IconList } from "@sushiswap/ui/components/currency/IconList"; -import { Icon } from "src/components/General/Icon"; -import { IToken } from "src/types/token-type"; - -export const PoolHeader = ({ - token0, - token1, - isLoading, - pairAddress, -}: { - token0: IToken | undefined; - token1: IToken | undefined; - isLoading: boolean; - pairAddress: string; -}) => { - return ( -
    -
    - - {isLoading ? : } - {isLoading ? : } - - -
    - -
    - Network - Tron -
    -
    - ); -}; diff --git a/apps/tron/src/components/Pools/PoolDetails/PoolLiquidity.tsx b/apps/tron/src/components/Pools/PoolDetails/PoolLiquidity.tsx deleted file mode 100644 index be25140cf4..0000000000 --- a/apps/tron/src/components/Pools/PoolDetails/PoolLiquidity.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import { formatUSD, formatNumber } from "sushi/format"; -import { - Card, - CardContent, - CardDescription, - CardGroup, - CardHeader, - CardItem, - CardLabel, - CardTitle, - List, - SkeletonCircle, - SkeletonText, -} from "@sushiswap/ui"; -import { Icon } from "src/components/General/Icon"; -import { IToken } from "src/types/token-type"; -import { useReserves } from "src/hooks/useReserves"; -import { formatUnits, formatUnitsForInput } from "src/utils/formatters"; -import { useStablePrice } from "src/hooks/useStablePrice"; -import { LiquidityItem } from "./LiquidityItem"; - -export const PoolLiquidity = ({ - token0, - token1, - isLoading, - pairAddress, -}: { - token0: IToken | undefined; - token1: IToken | undefined; - isLoading: boolean; - pairAddress: string; -}) => { - const { data, isLoading: isLoadingReserves } = useReserves({ pairAddress, token0, token1 }); - - const reserve0 = data?.[0]?.reserve ?? "0"; - const reserve0Formatted = formatUnitsForInput(reserve0, token0?.decimals ?? 0); - - const reserve1 = data?.[1]?.reserve ?? "0"; - const reserve1Formatted = formatUnitsForInput(reserve1, token1?.decimals ?? 0); - - const { data: token0Price } = useStablePrice({ token: token0 }); - const { data: token1Price } = useStablePrice({ token: token1 }); - - const token0PoolPrice = (Number(token0Price) * Number(reserve0Formatted)).toString(10); - const token1PoolPrice = (Number(token1Price) * Number(reserve1Formatted)).toString(10); - - const isLoadingData = isLoading || isLoadingReserves; - - return ( - - - Pool Liquidity - {formatUSD(Number(token0PoolPrice) + Number(token1PoolPrice))} - - - - Tokens - - - - - - ); -}; diff --git a/apps/tron/src/components/Pools/PoolPosition/PoolPosition.tsx b/apps/tron/src/components/Pools/PoolPosition/PoolPosition.tsx deleted file mode 100644 index 8a4858c1db..0000000000 --- a/apps/tron/src/components/Pools/PoolPosition/PoolPosition.tsx +++ /dev/null @@ -1,145 +0,0 @@ -import { formatUSD } from "sushi/format"; -import { IToken } from "src/types/token-type"; -import { - Card, - CardContent, - CardDescription, - CardGroup, - CardHeader, - CardLabel, - CardTitle, -} from "@sushiswap/ui"; -import { usePoolState } from "src/app/pool/pool-provider"; -import { useTotalSupply } from "src/hooks/useTotalSupply"; -import { useEffect, useMemo } from "react"; -import { useRemoveLiqDispatch } from "src/app/pool/[poolId]/remove-provider"; -import { formatUnitsForInput, parseUnits, toBigNumber } from "src/utils/formatters"; -import { PAIR_DECIMALS } from "src/constants/pair-decimals"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { useTokenBalance } from "src/hooks/useTokenBalance"; -import { LiquidityItem } from "../PoolDetails/LiquidityItem"; -import { useStablePrice } from "src/hooks/useStablePrice"; - -export const PoolPosition = ({ - token0, - token1, - isLoading, -}: { - token0: IToken | undefined; - token1: IToken | undefined; - isLoading: boolean; -}) => { - const token0StakedInUsd = 0; - const token1StakedInUsd = 0; - const { reserve0, reserve1, pairAddress } = usePoolState(); - const { setTotalSupplyLP, setAmountToken0PerLP, setAmountToken1PerLP, setLPBalance } = - useRemoveLiqDispatch(); - const { data: totalSupply, isLoading: isLoadingTotalSupply } = useTotalSupply({ - tokenAddress: pairAddress, - }); - const { address } = useWallet(); - const { data: lpBalance, isLoading: isLoadingLPBalance } = useTokenBalance({ - accountAddress: address, - tokenAddress: pairAddress, - }); - const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice({ token: token0 }); - const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice({ token: token1 }); - - useEffect(() => { - if (lpBalance && !isLoadingLPBalance) { - setLPBalance(lpBalance); - } - }, [lpBalance, isLoadingLPBalance]); - - useEffect(() => { - if (totalSupply && !isLoadingTotalSupply) { - setTotalSupplyLP(totalSupply); - } - }, [totalSupply, isLoadingTotalSupply]); - - const _amountToken0PerLP = useMemo(() => { - if (!totalSupply || !reserve0) return ""; - const formattedReserve0 = formatUnitsForInput(reserve0, token0?.decimals ?? 0); - const formattedTotalSupply = formatUnitsForInput(totalSupply, PAIR_DECIMALS); - const resBN = toBigNumber(formattedReserve0); - const totalSupplyBN = toBigNumber(formattedTotalSupply); - return String(resBN.div(totalSupplyBN)); - }, [reserve0, totalSupply, token0]); - - useEffect(() => { - if (_amountToken0PerLP) { - setAmountToken0PerLP(_amountToken0PerLP); - } - }, [_amountToken0PerLP]); - - const _amountToken1PerLP = useMemo(() => { - if (!totalSupply || !reserve1) return ""; - const formattedReserve1 = formatUnitsForInput(reserve1, token1?.decimals ?? 0); - const formattedTotalSupply = formatUnitsForInput(totalSupply, PAIR_DECIMALS); - const resBN = toBigNumber(formattedReserve1); - const totalSupplyBN = toBigNumber(formattedTotalSupply); - return String(resBN.div(totalSupplyBN)); - }, [reserve1, totalSupply, token1]); - - useEffect(() => { - if (_amountToken1PerLP) { - setAmountToken1PerLP(_amountToken1PerLP); - } - }, [_amountToken1PerLP]); - - const amountToken0 = useMemo(() => { - if (!lpBalance || !_amountToken0PerLP) return "0"; - const formattedLP = formatUnitsForInput(lpBalance, PAIR_DECIMALS); - const lpTokenAmountBeingRemovedBN = toBigNumber(formattedLP); - const amountToken0PerLPBN = toBigNumber(_amountToken0PerLP); - return String(lpTokenAmountBeingRemovedBN.times(amountToken0PerLPBN)); - }, [lpBalance, _amountToken0PerLP]); - - const amountToken1 = useMemo(() => { - if (!lpBalance || !_amountToken1PerLP) return "0"; - const formattedLP = formatUnitsForInput(lpBalance, PAIR_DECIMALS); - const lpTokenAmountBeingRemovedBN = toBigNumber(formattedLP); - const amountToken1PerLPBN = toBigNumber(_amountToken1PerLP); - return String(lpTokenAmountBeingRemovedBN.times(amountToken1PerLPBN)); - }, [lpBalance, _amountToken1PerLP]); - - const loading = isLoading || isLoadingToken0Price || isLoadingToken1Price; - - const token0UnstakedInUsd = Number(token0Price) * Number(amountToken0); - const token1UnstakedInUsd = Number(token1Price) * Number(amountToken1); - - return ( - - - My Position - - - {formatUSD(token0StakedInUsd + token1StakedInUsd + token0UnstakedInUsd + token1UnstakedInUsd)} - - - - - - Unstaked - - - - - Staked - - - - - - ); -}; diff --git a/apps/tron/src/components/Pools/PoolRewards/PoolRewards.tsx b/apps/tron/src/components/Pools/PoolRewards/PoolRewards.tsx deleted file mode 100644 index 542d799c4d..0000000000 --- a/apps/tron/src/components/Pools/PoolRewards/PoolRewards.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { - Card, - CardContent, - CardDescription, - CardGroup, - CardHeader, - CardLabel, - CardTitle, -} from "@sushiswap/ui"; -import { CardItem } from "@sushiswap/ui"; -import Image from "next/image"; -import { WTRX } from "src/constants/token-list"; - -export const PoolRewards = () => { - return ( - - - Pool Rewards - - Distributed to everyone who provides liquidity to this pool.
    -
    -
    - - - Tokens (per day) - - TRX - - }> - {"0"} - - - -
    - ); -}; diff --git a/apps/tron/src/components/Pools/PoolSearchBar.tsx b/apps/tron/src/components/Pools/PoolSearchBar.tsx deleted file mode 100644 index f7e08b2dad..0000000000 --- a/apps/tron/src/components/Pools/PoolSearchBar.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { FC, useCallback, useState, useTransition } from "react"; -import { ChipInput } from "@sushiswap/ui"; -import { MagnifyingGlassIcon } from "@heroicons/react/20/solid"; - -type PoolSearchBarProps = { - query: string; - setQuery: React.Dispatch>; - placeholder: string; -}; - -export const PoolSearchBar: FC = ({ setQuery, query, placeholder }) => { - const [isPending, startTransition] = useTransition(); - const [values, setValues] = useState(query.split(" ")); - - const onValueChange = useCallback( - (values: string[]) => { - const value = values?.[0]?.replaceAll(" ", ""); - setValues([value ?? ""]); - startTransition(() => setQuery(values.join(" "))); - }, - [setQuery] - ); - - return ( -
    - -
    - ); -}; diff --git a/apps/tron/src/components/Pools/PoolsTable/PoolAprCell.tsx b/apps/tron/src/components/Pools/PoolsTable/PoolAprCell.tsx deleted file mode 100644 index 2a2f45fa8c..0000000000 --- a/apps/tron/src/components/Pools/PoolsTable/PoolAprCell.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { formatPercent } from "sushi/format"; - -export const PoolAprCell = () => { - return
    {formatPercent(0)}
    ; -}; diff --git a/apps/tron/src/components/Pools/PoolsTable/PoolColumns.tsx b/apps/tron/src/components/Pools/PoolsTable/PoolColumns.tsx deleted file mode 100644 index 4f1466c625..0000000000 --- a/apps/tron/src/components/Pools/PoolsTable/PoolColumns.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import { SkeletonCircle, SkeletonText } from "@sushiswap/ui"; -import { PoolNameCell } from "./PoolNameCell"; -import { ICON_SIZE } from "src/constants/icon-size"; -import { PoolTvlCell } from "./PoolTvlCell"; -import { ColumnDef } from "@tanstack/react-table"; -import { PoolReservesCell } from "./PoolReservesCell"; - -export const NAME_COLUMN: ColumnDef = { - id: "name", - header: "Name", - cell: (props) => , - meta: { - skeleton: ( -
    -
    - - -
    -
    - -
    -
    - ), - }, -}; - -export const TVL_COLUMN: ColumnDef = { - id: "TVL", - header: "TVL", - cell: (props) => , - meta: { - skeleton: ( -
    -
    - -
    -
    - ), - }, -}; - -export const RESERVES_COLUMN: ColumnDef = { - id: "reserves", - header: "Reserves", - cell: (props) => , - meta: { - skeleton: ( -
    -
    - -
    -
    - ), - }, -}; diff --git a/apps/tron/src/components/Pools/PoolsTable/PoolNameCell.tsx b/apps/tron/src/components/Pools/PoolsTable/PoolNameCell.tsx deleted file mode 100644 index 3071263af9..0000000000 --- a/apps/tron/src/components/Pools/PoolsTable/PoolNameCell.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { SkeletonText, classNames } from "@sushiswap/ui"; -import { Icon } from "../../General/Icon"; -import { IconList } from "@sushiswap/ui/components/currency/IconList"; -import { getBase58Address } from "src/utils/helpers"; -import { useTokenInfo } from "src/hooks/useTokenInfo"; -import { IRowData } from "./PoolsTable"; - -export const PoolNameCell = ({ data }: { data: IRowData }) => { - const { token0Address, token1Address } = data; - const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ - tokenAddress: getBase58Address(token0Address), - }); - - const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ - tokenAddress: getBase58Address(token1Address), - }); - - return ( -
    -
    - {token0Address && token1Address && ( - - - - - )} -
    -
    - - {isLoadingToken0 ? : token0Data?.symbol} - / - {isLoadingToken1 ? : token1Data?.symbol} -
    -
    -
    -
    - ); -}; diff --git a/apps/tron/src/components/Pools/PoolsTable/PoolReservesCell.tsx b/apps/tron/src/components/Pools/PoolsTable/PoolReservesCell.tsx deleted file mode 100644 index 68c0619024..0000000000 --- a/apps/tron/src/components/Pools/PoolsTable/PoolReservesCell.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { getBase58Address } from "src/utils/helpers"; -import { IRowData } from "./PoolsTable"; -import { useTokenInfo } from "src/hooks/useTokenInfo"; -import { formatUnits } from "src/utils/formatters"; -import { SkeletonText } from "@sushiswap/ui"; -import { formatNumber } from "sushi/format"; - -export const PoolReservesCell = ({ data }: { data: IRowData }) => { - const { token0Address, token1Address, reserve0, reserve1 } = data; - const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ - tokenAddress: getBase58Address(token0Address), - }); - - const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ - tokenAddress: getBase58Address(token1Address), - }); - - if (isLoadingToken0 || isLoadingToken1) { - return ; - } - - return ( -
    - {formatNumber(formatUnits(reserve0, token0Data?.decimals ?? 18, 4))} {token0Data?.symbol} /{" "} - {formatNumber(formatUnits(reserve1, token1Data?.decimals ?? 18, 4))} {token1Data?.symbol} -
    - ); -}; diff --git a/apps/tron/src/components/Pools/PoolsTable/PoolTvlCell.tsx b/apps/tron/src/components/Pools/PoolsTable/PoolTvlCell.tsx deleted file mode 100644 index 9b44c51eae..0000000000 --- a/apps/tron/src/components/Pools/PoolsTable/PoolTvlCell.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { formatUSD } from "sushi/format"; -import { IRowData } from "./PoolsTable"; -import { useStablePrice } from "src/hooks/useStablePrice"; -import { getBase58Address } from "src/utils/helpers"; -import { useTokenInfo } from "src/hooks/useTokenInfo"; -import { SkeletonText } from "@sushiswap/ui"; - -export const PoolTvlCell = ({ data }: { data: IRowData }) => { - const { token0Address, token1Address, reserve0, reserve1 } = data; - const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ - tokenAddress: getBase58Address(token0Address), - }); - - const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ - tokenAddress: getBase58Address(token1Address), - }); - - const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice({ token: token0Data }); - const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice({ token: token1Data }); - - if (isLoadingToken0 || isLoadingToken1 || isLoadingToken0Price || isLoadingToken1Price) { - return ; - } - - const reserve0Usd = (Number(token0Price) ?? 0) * (Number(reserve0) / 10 ** (token0Data?.decimals ?? 18)); - const reserve1Usd = (Number(token1Price) ?? 0) * (Number(reserve1) / 10 ** (token1Data?.decimals ?? 18)); - - const poolTvl = reserve0Usd + reserve1Usd; - - return ( -
    -
    - - {formatUSD(poolTvl)} - -
    -
    - ); -}; diff --git a/apps/tron/src/components/Pools/PoolsTable/PoolsTable.tsx b/apps/tron/src/components/Pools/PoolsTable/PoolsTable.tsx deleted file mode 100644 index 6d6a4d08c4..0000000000 --- a/apps/tron/src/components/Pools/PoolsTable/PoolsTable.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import { DataTable } from "@sushiswap/ui"; -import { TVL_COLUMN, NAME_COLUMN, RESERVES_COLUMN } from "./PoolColumns"; -import { usePools } from "src/hooks/usePools"; -import { PaginationState } from "@tanstack/react-table"; -import { useEffect, useMemo, useState } from "react"; -import { useDebounce } from "@sushiswap/hooks"; - -export type IRowData = { - name: string; - pairAddress: string; - token0Address: string; - token1Address: string; - reserve0: string; - reserve1: string; -}; - -type PoolsTableProps = { - query: string; - handlePoolsOnView: (pools: number) => void; -}; - -export const PoolsTable = ({ query, handlePoolsOnView }: PoolsTableProps) => { - const [paginationState, setPaginationState] = useState({ - pageIndex: 0, - pageSize: 10, - }); - const debouncedQuery = useDebounce(query, 250); - const { data, isLoading } = usePools(); - - const filteredData = useMemo(() => { - if (!data) return []; - if (!debouncedQuery) return data; - const lowercasedQuery = debouncedQuery.toLowerCase()?.replaceAll(" ", ""); - - return data.filter((pool) => { - return (["pairAddress", "token0Address", "token1Address"] as Array).some( - (key) => pool[key].toLowerCase().includes(lowercasedQuery) - ); - }); - }, [data, debouncedQuery]); - - useEffect(() => { - if (filteredData && !isLoading) { - handlePoolsOnView(filteredData.length); - } - }, [filteredData, isLoading]); - - return ( - ({ - name: pool.token0Address + "/" + pool.token1Address, - pairAddress: pool.pairAddress, - token0Address: pool.token0Address, - token1Address: pool.token1Address, - reserve0: pool.reserve0, - reserve1: pool.reserve1, - })) ?? [] - } - columns={[NAME_COLUMN, TVL_COLUMN, RESERVES_COLUMN]} - linkFormatter={(data) => { - const token0 = data.name.split("/")[0]; - const token1 = data.name.split("/")[1]; - return `/pool/${token0}:${token1}:${data.pairAddress}`; - }} - pagination={true} - externalLink={false} - onPaginationChange={setPaginationState} - state={{ - pagination: paginationState, - }} - /> - ); -}; diff --git a/apps/tron/src/components/Pools/PoolsView.tsx b/apps/tron/src/components/Pools/PoolsView.tsx deleted file mode 100644 index d6ffbd5626..0000000000 --- a/apps/tron/src/components/Pools/PoolsView.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { Tab } from "@headlessui/react"; -import { Card, CardHeader, CardTitle, Container } from "@sushiswap/ui"; -import { Button } from "@sushiswap/ui"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import React, { Fragment, useState } from "react"; -import { PoolSearchBar } from "./PoolSearchBar"; -import { PoolsTable } from "./PoolsTable/PoolsTable"; -import { PositionsTable } from "./PositionsTable/PositionsTable"; - -export const PoolsView = () => { - const [tab, setTab] = useState(0); - const { address } = useWallet(); - const [query, setQuery] = useState(""); - const [poolsOnView, setPoolsOnView] = useState(-1); - const [myPositionsOnView, setMyPositionsOnView] = useState(-1); - - const handlePoolsOnView = (pools: number) => { - setPoolsOnView(pools); - }; - - const handleMyPositionsOnView = (positions: number) => { - setMyPositionsOnView(positions); - }; - - return ( -
    - - -
    - - {({ selected }) => ( - - )} - - {address && ( - <> - - {({ selected }) => ( - - )} - - - )} -
    -
    - - - - - -
    - - - Pools ({poolsOnView === -1 ? "-" : poolsOnView}) - - - -
    -
    - -
    - - - My Positions ({myPositionsOnView === -1 ? "-" : myPositionsOnView}) - - - -
    -
    - -
    -
    -
    - ); -}; diff --git a/apps/tron/src/components/Pools/PositionsTable/PositionColumns.tsx b/apps/tron/src/components/Pools/PositionsTable/PositionColumns.tsx deleted file mode 100644 index 341b1c11d3..0000000000 --- a/apps/tron/src/components/Pools/PositionsTable/PositionColumns.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { SkeletonCircle, SkeletonText } from "@sushiswap/ui"; -import { PositionSizeCell } from "./PositionSizeCell"; -import { ColumnDef } from "@tanstack/react-table"; -import { ICON_SIZE } from "src/constants/icon-size"; -import { PositionNameCell } from "./PositionNameCell"; -import { IMyPositionData } from "src/types/get-pools-type"; -import { PositionTvlCell } from "./PositionTvlCell"; - -export const POSITION_NAME_COLUMN: ColumnDef = { - id: "name", - header: "Name", - cell: (props) => , - meta: { - skeleton: ( -
    -
    - - -
    -
    - -
    -
    - ), - }, -}; - -export const TVL_COLUMN: ColumnDef = { - id: "TVL", - header: "TVL", - cell: (props) => , - meta: { - skeleton: ( -
    -
    - -
    -
    - ), - }, -}; - -export const SIZE_COLUMN: ColumnDef = { - id: "size", - header: "Size", - cell: (props) => , - meta: { - skeleton: ( -
    -
    - -
    -
    - ), - }, -}; diff --git a/apps/tron/src/components/Pools/PositionsTable/PositionNameCell.tsx b/apps/tron/src/components/Pools/PositionsTable/PositionNameCell.tsx deleted file mode 100644 index 10abc4b499..0000000000 --- a/apps/tron/src/components/Pools/PositionsTable/PositionNameCell.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { classNames } from "@sushiswap/ui"; -import { Icon } from "../../General/Icon"; -import { IconList } from "@sushiswap/ui/components/currency/IconList"; -import { IMyPositionData } from "src/types/get-pools-type"; - -export const PositionNameCell = ({ data }: { data: IMyPositionData }) => { - const { token0, token1 } = data; - - return ( -
    -
    - {token0 && token1 && ( - - - - - )} -
    -
    - - {token0?.symbol} - / - {token1?.symbol} -
    -
    -
    -
    - ); -}; diff --git a/apps/tron/src/components/Pools/PositionsTable/PositionSizeCell.tsx b/apps/tron/src/components/Pools/PositionsTable/PositionSizeCell.tsx deleted file mode 100644 index fbb6a7a018..0000000000 --- a/apps/tron/src/components/Pools/PositionsTable/PositionSizeCell.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { IMyPositionData } from "src/types/get-pools-type"; -import { formatPercent } from "sushi/format"; -import { usePoolOwnership } from "../../../hooks/usePoolOwnership"; - -export const PositionSizeCell = ({ data }: { data: IMyPositionData }) => { - const { pairAddress } = data; - const { data: ownership } = usePoolOwnership({ pairAddress }); - - return ( -
    -
    - - {formatPercent(ownership?.ownership)} - -
    -
    - ); -}; diff --git a/apps/tron/src/components/Pools/PositionsTable/PositionTvlCell.tsx b/apps/tron/src/components/Pools/PositionsTable/PositionTvlCell.tsx deleted file mode 100644 index 655c8b4e88..0000000000 --- a/apps/tron/src/components/Pools/PositionsTable/PositionTvlCell.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { formatUSD } from "sushi/format"; -import { useStablePrice } from "src/hooks/useStablePrice"; -import { SkeletonText } from "@sushiswap/ui"; -import { IPositionRowData } from "./PositionsTable"; -import { usePoolOwnership } from "src/hooks/usePoolOwnership"; - -export const PositionTvlCell = ({ data }: { data: IPositionRowData }) => { - const { token0, token1, reserve0, reserve1, pairAddress } = data; - const { data: ownership } = usePoolOwnership({ pairAddress }); - - const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice({ token: token0 }); - const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice({ token: token1 }); - - if (isLoadingToken0Price || isLoadingToken1Price) { - return ; - } - - const reserve0Usd = (Number(token0Price) ?? 0) * (Number(reserve0) / 10 ** token0?.decimals); - const reserve1Usd = (Number(token1Price) ?? 0) * (Number(reserve1) / 10 ** token1?.decimals); - - const poolTvl = (reserve0Usd + reserve1Usd) * (Number(ownership?.ownership) ?? 0); - - return ( -
    -
    - - {formatUSD(poolTvl)} - -
    -
    - ); -}; diff --git a/apps/tron/src/components/Pools/PositionsTable/PositionsTable.tsx b/apps/tron/src/components/Pools/PositionsTable/PositionsTable.tsx deleted file mode 100644 index b70c480407..0000000000 --- a/apps/tron/src/components/Pools/PositionsTable/PositionsTable.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { DataTable } from "@sushiswap/ui"; -import { POSITION_NAME_COLUMN, SIZE_COLUMN, TVL_COLUMN } from "./PositionColumns"; -import { useMyPositions } from "src/hooks/useMyPositions"; -import { useEffect, useMemo, useState } from "react"; -import { PaginationState } from "@tanstack/react-table"; -import { useDebounce } from "@sushiswap/hooks"; -import { IMyPositionData } from "src/types/get-pools-type"; -import { IToken } from "src/types/token-type"; - -type PositionsTableProps = { - query: string; - handleMyPositionsOnView: (positions: number) => void; -}; - -export type IPositionRowData = { - token0: IToken; - token1: IToken; - pairAddress: string; - reserve0: string; - reserve1: string; -}; - -export const PositionsTable = ({ query, handleMyPositionsOnView }: PositionsTableProps) => { - const [paginationState, setPaginationState] = useState({ - pageIndex: 0, - pageSize: 10, - }); - const debouncedQuery = useDebounce(query, 250); - const { data, isLoading } = useMyPositions(); - - const filteredData = useMemo(() => { - if (!data) return []; - if (!debouncedQuery) return data; - const lowercasedQuery = debouncedQuery.toLowerCase()?.replaceAll(" ", ""); - - return data.filter((pool) => { - const poolValues = [ - pool.pairAddress, - pool.token0?.address, - pool.token1?.address, - pool.token0?.symbol, - pool.token1?.symbol, - pool.token0?.name, - pool.token1?.name, - ]; - - return poolValues.some((value) => value?.toLowerCase().includes(lowercasedQuery)); - }); - }, [data, debouncedQuery]); - - useEffect(() => { - if (filteredData && !isLoading) { - handleMyPositionsOnView(filteredData.length); - } - }, [filteredData, isLoading]); - - return ( - ({ - token0: pool?.token0, - token1: pool?.token1, - pairAddress: pool?.pairAddress, - reserve0: pool?.reserve0, - reserve1: pool?.reserve1, - })) ?? [] - } - columns={[POSITION_NAME_COLUMN, TVL_COLUMN, SIZE_COLUMN]} - linkFormatter={(data: IMyPositionData) => { - const token0 = data?.token0?.address; - const token1 = data?.token1?.address; - return `/pool/${token0}:${token1}:${data?.pairAddress}`; - }} - externalLink={false} - pagination={true} - state={{ - pagination: paginationState, - }} - onPaginationChange={setPaginationState} - /> - ); -}; diff --git a/apps/tron/src/components/Pools/Remove/MinimumReceive.tsx b/apps/tron/src/components/Pools/Remove/MinimumReceive.tsx deleted file mode 100644 index b26690fc16..0000000000 --- a/apps/tron/src/components/Pools/Remove/MinimumReceive.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import { Card, CardGroup, CardLabel } from "@sushiswap/ui"; -import { useRemoveLiqDispatch, useRemoveLiqState } from "src/app/pool/[poolId]/remove-provider"; -import { LiquidityItem } from "../PoolDetails/LiquidityItem"; -import { usePoolState } from "src/app/pool/pool-provider"; -import { useEffect, useMemo } from "react"; -import { formatUnitsForInput, parseUnits, removeDecimals, toBigNumber } from "src/utils/formatters"; -import { PAIR_DECIMALS } from "src/constants/pair-decimals"; -import { useSlippageTolerance } from "@sushiswap/hooks"; -import { useStablePrice } from "src/hooks/useStablePrice"; - -export const MinimumReceive = () => { - const { percentage, lpBalance, totalSupplyLP, amountToken0PerLP, amountToken1PerLP } = useRemoveLiqState(); - const { setLPToRemove, setMinAmountToken0, setMinAmountToken1 } = useRemoveLiqDispatch(); - const { token0, token1 } = usePoolState(); - const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice({ token: token0 }); - const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice({ token: token1 }); - const [slippageTolerance] = useSlippageTolerance("sushi-tron-slippage-remove-liq"); - const slippage = slippageTolerance === "AUTO" ? 0.005 : Number(slippageTolerance) / 100; - - const lpTokenAmountBeingRemoved = useMemo(() => { - if (!lpBalance) return "0"; - const lpBalanceBN = toBigNumber(lpBalance); - const percentageBN = toBigNumber(percentage).div(100); - //will be in wei - return removeDecimals(lpBalanceBN.times(percentageBN)); - }, [lpBalance, percentage]); - - useEffect(() => { - if (lpTokenAmountBeingRemoved) { - setLPToRemove(lpTokenAmountBeingRemoved); - } - }, [lpTokenAmountBeingRemoved]); - - const amountToken0 = useMemo(() => { - if (!lpTokenAmountBeingRemoved || !amountToken0PerLP) return "0"; - const formattedLP = formatUnitsForInput(lpTokenAmountBeingRemoved, PAIR_DECIMALS); - const lpTokenAmountBeingRemovedBN = toBigNumber(formattedLP); - const amountToken0PerLPBN = toBigNumber(amountToken0PerLP); - return String(lpTokenAmountBeingRemovedBN.times(amountToken0PerLPBN)); - }, [lpTokenAmountBeingRemoved, amountToken0PerLP]); - - const amountToken1 = useMemo(() => { - if (!lpTokenAmountBeingRemoved || !amountToken1PerLP) return "0"; - const formattedLP = formatUnitsForInput(lpTokenAmountBeingRemoved, PAIR_DECIMALS); - const lpTokenAmountBeingRemovedBN = toBigNumber(formattedLP); - const amountToken1PerLPBN = toBigNumber(amountToken1PerLP); - return String(lpTokenAmountBeingRemovedBN.times(amountToken1PerLPBN)); - }, [lpTokenAmountBeingRemoved, amountToken1PerLP]); - - const minAmountToken0 = useMemo(() => { - if (!amountToken0) return ""; - const output = Number(amountToken0) * (1 - slippage); - return output.toString(); - }, [slippageTolerance, amountToken0, slippage]); - - useEffect(() => { - if (minAmountToken0) { - const parsedAmount = parseUnits(minAmountToken0, token0?.decimals ?? 18); - - setMinAmountToken0(parsedAmount); - } - }, [minAmountToken0]); - - const minAmountToken1 = useMemo(() => { - if (!amountToken1) return ""; - const output = Number(amountToken1) * (1 - slippage); - return output.toString(); - }, [slippageTolerance, amountToken1, slippage]); - - useEffect(() => { - if (minAmountToken1) { - const parsedAmount = parseUnits(minAmountToken1, token1?.decimals ?? 18); - - setMinAmountToken1(parsedAmount); - } - }, [minAmountToken1]); - - const isLoading = !totalSupplyLP || isLoadingToken0Price || isLoadingToken1Price; - - return ( - - - You'll receive at least: - - - - - ); -}; diff --git a/apps/tron/src/components/Pools/Remove/RemoveButton.tsx b/apps/tron/src/components/Pools/Remove/RemoveButton.tsx deleted file mode 100644 index 12662fc19a..0000000000 --- a/apps/tron/src/components/Pools/Remove/RemoveButton.tsx +++ /dev/null @@ -1,195 +0,0 @@ -import { Button, Dots, createFailedToast, createInfoToast, createSuccessToast } from "@sushiswap/ui"; -import { useQueryClient } from "@tanstack/react-query"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { useMemo } from "react"; -import { useRemoveLiqDispatch, useRemoveLiqState } from "src/app/pool/[poolId]/remove-provider"; -import { usePoolState } from "src/app/pool/pool-provider"; -import { ApproveToken } from "src/components/Shared/ApproveToken"; -import { WalletConnector } from "src/components/WalletConnector/WalletConnector"; -import { ROUTER_CONTRACT } from "src/constants/contracts"; -import { PAIR_DECIMALS } from "src/constants/pair-decimals"; -import { useAllowance } from "src/hooks/useAllowance"; -import { useTronWeb } from "src/hooks/useTronWeb"; -import { formatUnitsForInput } from "src/utils/formatters"; -import { - cleanArgs, - getArgsForRemoveLiquidity, - getDeadline, - getRemoveLiquidityFunctionSelector, - getTransactionInfo, - parseTxnError, - safeGasEstimates, -} from "src/utils/helpers"; -import { getTronscanTxnLink } from "src/utils/tronscan-helpers"; - -export const RemoveButton = () => { - const queryClient = useQueryClient(); - const { address, connected, signTransaction } = useWallet(); - const isConnected = address && connected; - const { percentage, isTxnPending, lpToRemove, minAmountToken0, minAmountToken1 } = useRemoveLiqState(); - const { setIsTxnPending, setPercentage } = useRemoveLiqDispatch(); - const { token0, token1, pairAddress } = usePoolState(); - const { tronWeb } = useTronWeb(); - const { data: allowanceAmount, refetch } = useAllowance({ - tokenAddress: pairAddress as string, - ownerAddress: address as string, - spenderAddress: ROUTER_CONTRACT, - }); - - const removeLiquidity = async () => { - if ( - !isConnected || - !address || - !token0 || - !token1 || - !lpToRemove || - !minAmountToken0 || - !minAmountToken1 - ) { - return; - } - try { - setIsTxnPending(true); - const methodNames = getRemoveLiquidityFunctionSelector(token0, token1); - const deadline = getDeadline(); - const args = []; - for (let i = 0; i < methodNames.length; i++) { - const _args = getArgsForRemoveLiquidity( - methodNames[i], - token0.address, - token1.address, - lpToRemove, - minAmountToken0, - minAmountToken1, - address, - deadline - ); - args.push(_args); - } - console.log(args); - const estimates = await safeGasEstimates(tronWeb, args); - console.log("estimates", estimates); - const safeGasEstimate = estimates.findIndex((predicate) => predicate !== undefined); - console.log("safeGasEstimate", safeGasEstimate); - if (safeGasEstimate === -1) { - throw new Error("Failed to estimate energy. Transaction will fail."); - } - const argsForTransaction = cleanArgs(args[safeGasEstimate]); - console.log("argsForTransaction", argsForTransaction); - - const { transaction } = await tronWeb.transactionBuilder.triggerSmartContract(...argsForTransaction); - const signedTransation = await signTransaction(transaction); - const result = await tronWeb.trx.sendRawTransaction(signedTransation); - - if (!result.result && "code" in result) { - throw new Error(parseTxnError(result.code)); - } - const txId = result?.txid; - - createInfoToast({ - summary: `Removing liquidity from the ${token0.symbol}/${token1.symbol} pair.`, - type: "swap", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - txHash: txId, - href: getTronscanTxnLink(txId), - }); - - const transactionInfo = await getTransactionInfo(tronWeb, txId); - if (transactionInfo?.receipt?.result !== "SUCCESS") { - throw new Error("Transaction failed"); - } - - //create success toast - createSuccessToast({ - summary: "Successfully removed liquidity!", - txHash: txId, - type: "swap", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - href: getTronscanTxnLink(txId), - }); - onSuccess(); - } catch (error) { - const errorMessage = - typeof error === "string" - ? error - : (error as Error)?.message ?? "An error occurred while trying to remove liquidity."; - //create error toast - createFailedToast({ - summary: errorMessage, - type: "swap", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - }); - console.log(error); - setIsTxnPending(false); - } - }; - - const onSuccess = () => { - setPercentage(0); - setIsTxnPending(false); - queryClient.invalidateQueries([ - "useTokenBalance", - { accountAddress: address, tokenAddress: pairAddress }, - ]); - }; - - const allowanceFormatted = formatUnitsForInput(allowanceAmount ?? "0", token0?.decimals ?? 18); - - const buttonText = useMemo(() => { - if (isTxnPending) { - ("Removing"); - } - if (percentage === 0) { - return "Enter Amount"; - } - if ( - allowanceAmount && - Number(formatUnitsForInput(lpToRemove, PAIR_DECIMALS)) > Number(allowanceFormatted) - ) { - return "Approve"; - } - return "Remove"; - }, [percentage, isTxnPending, allowanceFormatted, allowanceAmount, lpToRemove]); - - if (!isConnected) { - return ; - } - - if (buttonText === "Approve") { - return ( - { - await refetch(); - }} - /> - ); - } - - return ( - - ); -}; diff --git a/apps/tron/src/components/Pools/Remove/RemoveInput.tsx b/apps/tron/src/components/Pools/Remove/RemoveInput.tsx deleted file mode 100644 index e1921292db..0000000000 --- a/apps/tron/src/components/Pools/Remove/RemoveInput.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { Button, Card, Message } from "@sushiswap/ui"; -import { useRemoveLiqDispatch, useRemoveLiqState } from "src/app/pool/[poolId]/remove-provider"; - -const PercentageOptions = [25, 50, 75, 100]; - -export const RemoveInput = () => { - const { percentage, lpBalance } = useRemoveLiqState(); - const { setPercentage } = useRemoveLiqDispatch(); - - const noLpToken = Number(lpBalance) <= 0; - - return ( - <> - {noLpToken ? ( - - No LP tokens found. - - ) : null} - -
    -
    {`${percentage}%`}
    -
    - {PercentageOptions.map((option) => ( - - ))} -
    -
    - setPercentage(Number(e.target.value))} - type="range" - min="1" - max="100" - className="w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer range-lg dark:bg-gray-700" - disabled={noLpToken} - /> -
    - - ); -}; diff --git a/apps/tron/src/components/Pools/Remove/RemoveLiquidity.tsx b/apps/tron/src/components/Pools/Remove/RemoveLiquidity.tsx deleted file mode 100644 index f0081793a5..0000000000 --- a/apps/tron/src/components/Pools/Remove/RemoveLiquidity.tsx +++ /dev/null @@ -1,14 +0,0 @@ -"use client"; -import { RemoveInput } from "./RemoveInput"; -import { MinimumReceive } from "./MinimumReceive"; -import { RemoveButton } from "./RemoveButton"; - -export const RemoveLiquidity = () => { - return ( -
    - - - -
    - ); -}; diff --git a/apps/tron/src/components/Pools/ReserveHelper.tsx b/apps/tron/src/components/Pools/ReserveHelper.tsx deleted file mode 100644 index dc891269d9..0000000000 --- a/apps/tron/src/components/Pools/ReserveHelper.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { useEffect } from "react"; -import { usePoolDispatch, usePoolState } from "src/app/pool/pool-provider"; -import { useReserves } from "src/hooks/useReserves"; -import { getValidTokenAddress } from "src/utils/helpers"; - -export const ReserveHelper = () => { - const { token0, token1, pairAddress } = usePoolState(); - const { setReserve0, setReserve1 } = usePoolDispatch(); - - const { data, isLoading } = useReserves({ - pairAddress: pairAddress, - token0: token0, - token1: token1, - }); - - useEffect(() => { - if (!pairAddress) { - setReserve0(""); - setReserve1(""); - } - if (!isLoading && data && data?.length > 0 && pairAddress && token0 && token1) { - const reserve0 = data.find( - (d) => getValidTokenAddress(d.address!) === getValidTokenAddress(token0?.address) - ); - const reserve1 = data.find( - (d) => getValidTokenAddress(d.address!) === getValidTokenAddress(token1?.address) - ); - setReserve0(reserve0?.reserve ?? ""); - setReserve1(reserve1?.reserve ?? ""); - } - }, [data, isLoading, pairAddress, token0, token1]); - - return null; -}; diff --git a/apps/tron/src/components/Shared/ApproveToken.tsx b/apps/tron/src/components/Shared/ApproveToken.tsx deleted file mode 100644 index 914aea2cc1..0000000000 --- a/apps/tron/src/components/Shared/ApproveToken.tsx +++ /dev/null @@ -1,151 +0,0 @@ -import { getTronscanTxnLink } from "src/utils/tronscan-helpers"; -import { - Button, - Command, - CommandGroup, - CommandItem, - Dots, - Popover, - PopoverContent, - PopoverTrigger, - createFailedToast, - createInfoToast, - createSuccessToast, -} from "@sushiswap/ui"; -import { useState } from "react"; -import { IToken } from "src/types/token-type"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { useTronWeb } from "src/hooks/useTronWeb"; -import { parseUnits, toBigNumber } from "src/utils/formatters"; -import { getTransactionInfo, parseTxnError } from "src/utils/helpers"; -import { MAX_UINT256 } from "src/constants/max-uint256"; - -export const ApproveToken = ({ - tokenToApprove, - amount, - spenderAddress, - onSuccess, -}: { - tokenToApprove: IToken; - amount: string; - spenderAddress: string; - onSuccess: () => Promise; -}) => { - const [isApproving, setIsApproving] = useState(false); - const { address, signTransaction } = useWallet(); - const { tronWeb } = useTronWeb(); - - const approveToken = async (type: "one-time" | "unlimited") => { - try { - setIsApproving(true); - const parsedAmount = parseUnits(amount, tokenToApprove.decimals); - const approvalAmount = type === "one-time" ? parsedAmount : MAX_UINT256; - const { transaction } = await tronWeb.transactionBuilder.triggerSmartContract( - tokenToApprove.address, //contract address - "approve(address,uint256)", //function name - {}, // options - [ - { type: "address", value: spenderAddress }, - { type: "uint256", value: approvalAmount }, - ], //parameters - address //issuerAddress - ); - const signedTransation = await signTransaction(transaction); - const _result = await tronWeb.trx.sendRawTransaction(signedTransation); - if (!_result.result && "code" in _result) { - throw new Error(parseTxnError(_result.code)); - } - const txId = _result?.txid; - createInfoToast({ - summary: type === "one-time" ? "Approving One Time..." : "Approval Unlimited Amount...", - type: "approval", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - txHash: txId, - href: getTronscanTxnLink(txId), - }); - const transactionInfo = await getTransactionInfo(tronWeb, txId); - if (transactionInfo?.receipt?.result !== "SUCCESS") { - throw new Error("Approval failed"); - } - //create success toast - createSuccessToast({ - summary: "Approval successful", - txHash: txId, - type: "swap", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - href: getTronscanTxnLink(txId), - }); - await onSuccess(); - setIsApproving(false); - } catch (error) { - const errorMessage = - typeof error === "string" - ? error - : (error as Error)?.message ?? "An error occurred while setting approval"; - //create error toast - createFailedToast({ - summary: errorMessage, - type: "swap", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - }); - console.log(error); - setIsApproving(false); - } - }; - - return ( - - - - - - - -
    { - await approveToken("one-time"); - }} - className="flex flex-col"> -

    Approve one-time only

    -

    - You'll give your approval to spend {toBigNumber(amount).toString(10)}{" "} - {tokenToApprove.symbol} on your behalf -

    -
    -
    - -
    { - await approveToken("unlimited"); - }} - className="flex flex-col"> -

    Approve unlimited amount

    -

    - You won't need to approve again next time you want to spend {tokenToApprove.symbol}. -

    -
    -
    -
    -
    -
    -
    -
    - ); -}; diff --git a/apps/tron/src/components/Shared/DollarAmountDisplay.tsx b/apps/tron/src/components/Shared/DollarAmountDisplay.tsx deleted file mode 100644 index 222a1a7a66..0000000000 --- a/apps/tron/src/components/Shared/DollarAmountDisplay.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { SkeletonText } from "@sushiswap/ui"; - -type DollarAmountDisplayProps = { - isLoading: boolean; - error?: string; - value: string; -}; -export const DollarAmountDisplay = ({ isLoading, error, value }: DollarAmountDisplayProps) => { - const [big, portion] = (value ? `${Number(value).toFixed(2)}` : "0.00").split("."); - - if (isLoading) { - return ( -
    - -
    - ); - } - - if (error) { - return

    {error}

    ; - } - - return ( -

    - $ {big}.{portion} -

    - ); -}; diff --git a/apps/tron/src/components/Shared/TokenBalanceDisplay.tsx b/apps/tron/src/components/Shared/TokenBalanceDisplay.tsx deleted file mode 100644 index e7df08f3b8..0000000000 --- a/apps/tron/src/components/Shared/TokenBalanceDisplay.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { classNames } from "@sushiswap/ui"; -import { WalletIcon } from "@sushiswap/ui"; -import { SkeletonText } from "@sushiswap/ui"; -import { useMemo } from "react"; -import { formatUnits } from "src/utils/formatters"; - -type TokenBalanceDisplayProps = { - amount: number; - isLoading: boolean; - decimals: number; - maxAmount?: () => void; - type: "input" | "output"; -}; - -export const TokenBalanceDisplay = ({ - amount, - isLoading, - decimals, - maxAmount, - type, -}: TokenBalanceDisplayProps) => { - const [big, portion] = useMemo( - () => (amount ? formatUnits(amount, decimals, 4) : "0.00")?.split("."), - [amount, decimals] - ); - - return ( - - ); -}; diff --git a/apps/tron/src/components/Swap/AmountIn.tsx b/apps/tron/src/components/Swap/AmountIn.tsx deleted file mode 100644 index 1a5bebfdc2..0000000000 --- a/apps/tron/src/components/Swap/AmountIn.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { useSwapDispatch, useSwapState } from "src/app/swap/swap-provider"; -import { TokenInput } from "../Input/TokenInput"; -import { useDebounce } from "@sushiswap/hooks"; -import { useAmountsOut } from "src/hooks/useAmountsOut"; -import { formatUnitsForInput, parseUnits } from "src/utils/formatters"; -import { useEffect } from "react"; - -export const AmountIn = () => { - const { token0, amountIn, token1 } = useSwapState(); - const { setToken0, setAmountIn, setAmountOut } = useSwapDispatch(); - - const debouncedAmountIn = useDebounce(amountIn, 500); - - const { data: amountsOut } = useAmountsOut({ - amountIn: parseUnits(debouncedAmountIn, token0.decimals), - }); - - useEffect(() => { - if (amountsOut && amountsOut?.length !== 0) { - const _amountOut = formatUnitsForInput(amountsOut[amountsOut?.length - 1], token1.decimals); - if (_amountOut === "0") { - setAmountOut(""); - } else { - setAmountOut(_amountOut); - } - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [amountsOut, token1?.decimals]); - - useEffect(() => { - if (Number(amountIn) === 0) { - setAmountOut(""); - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [amountIn]); - - return ( - - ); -}; diff --git a/apps/tron/src/components/Swap/AmountOut.tsx b/apps/tron/src/components/Swap/AmountOut.tsx deleted file mode 100644 index 246df62d88..0000000000 --- a/apps/tron/src/components/Swap/AmountOut.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { useSwapDispatch, useSwapState } from "src/app/swap/swap-provider"; -import { TokenInput } from "../Input/TokenInput"; - -export const AmountOut = () => { - const { token1, amountOut } = useSwapState(); - const { setToken1, setAmountOut } = useSwapDispatch(); - - return ( - - ); -}; diff --git a/apps/tron/src/components/Swap/ReviewSwapDialog.tsx b/apps/tron/src/components/Swap/ReviewSwapDialog.tsx deleted file mode 100644 index 0ed1c538ea..0000000000 --- a/apps/tron/src/components/Swap/ReviewSwapDialog.tsx +++ /dev/null @@ -1,141 +0,0 @@ -import { PlusIcon } from "@heroicons/react/24/outline"; -import { useSlippageTolerance } from "@sushiswap/hooks"; -import { Badge } from "@sushiswap/ui"; -import { List } from "@sushiswap/ui"; -import { SkeletonCircle } from "@sushiswap/ui"; -import { Icon } from "../General/Icon"; -import { Dialog, DialogClose, DialogContent, classNames } from "@sushiswap/ui"; -import { useSwapState } from "src/app/swap/swap-provider"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { warningSeverity, warningSeverityClassName } from "src/utils/warning-severity"; -import Link from "next/link"; -import { truncateText } from "src/utils/formatters"; -import { getTronscanAddressLink } from "src/utils/tronscan-helpers"; -import { useMemo, useRef } from "react"; -import { WalletConnector } from "../WalletConnector/WalletConnector"; -import { ReviewSwapDialogTrigger } from "./ReviewSwapDialogTrigger"; -import { formatPercent } from "sushi/format"; -import { SwapButton } from "./SwapButton"; - -export const ReviewSwapDialog = () => { - const { token0, token1, amountIn, amountOut, priceImpactPercentage } = useSwapState(); - const closeBtnRef = useRef(null); - const { address, connected } = useWallet(); - const isConnected = address && connected; - const [slippageTolerance] = useSlippageTolerance("sushi-tron-slippage"); - const slippage = slippageTolerance === "AUTO" ? 0.005 : Number(slippageTolerance) / 100; - - const closeModal = () => { - closeBtnRef?.current?.click(); - }; - - const minOutput = useMemo(() => { - if (!amountOut) return ""; - if ( - (token0?.symbol === "WTRX" && token1?.address === "TRON") || - (token0?.address === "TRON" && token1?.symbol === "WTRX") - ) { - return amountIn; - } - - const output = Number(amountOut) * (1 - slippage); - return String(output); - }, [amountOut, slippage, token0, token1, amountIn]); - - const severityClass = useMemo(() => { - return warningSeverityClassName(warningSeverity(priceImpactPercentage)); - }, [priceImpactPercentage]); - - return ( - - {isConnected ? ( - - ) : ( - - )} - - -
    -
    -
    -

    - Buy {amountOut} {token1?.symbol} -

    -

    - Sell {amountIn} {token0?.symbol} -

    -
    -
    -
    - - -
    - }> - {token1 ? ( - - ) : ( - - )} - -
    -
    -
    -
    - - - TRON - - - -{formatPercent(priceImpactPercentage / 100)} - - - - {minOutput} {token1?.symbol} - - - ~$0.00 - - - {address && ( - - - - - {truncateText(address)} - - - - - )} - -
    -
    -
    - -
    -
    - -
    -
    - ); -}; diff --git a/apps/tron/src/components/Swap/ReviewSwapDialogTrigger.tsx b/apps/tron/src/components/Swap/ReviewSwapDialogTrigger.tsx deleted file mode 100644 index 61bb460a4a..0000000000 --- a/apps/tron/src/components/Swap/ReviewSwapDialogTrigger.tsx +++ /dev/null @@ -1,174 +0,0 @@ -import { Button, Checkbox, DialogTrigger } from "@sushiswap/ui"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { useEffect, useMemo, useState } from "react"; -import { useSwapDispatch, useSwapState } from "src/app/swap/swap-provider"; -import { ROUTER_CONTRACT } from "src/constants/contracts"; -import { useAllowance } from "src/hooks/useAllowance"; -import { useTokenBalance } from "src/hooks/useTokenBalance"; -import { formatUnitsForInput } from "src/utils/formatters"; -import { ApproveToken } from "../Shared/ApproveToken"; -import { useReserves } from "src/hooks/useReserves"; -import { usePriceImpact } from "src/hooks/usePriceImpact"; -import { warningSeverity } from "src/utils/warning-severity"; -import { useRoutes } from "src/hooks/useRoutes"; -import { getIfWrapOrUnwrap } from "src/utils/helpers"; - -export const ReviewSwapDialogTrigger = () => { - const [isChecked, setIsChecked] = useState(false); - const { token0, token1, amountIn, amountOut, isTxnPending } = useSwapState(); - const { setPriceImpactPercentage, setRoute } = useSwapDispatch(); - const { address } = useWallet(); - const { data: allowanceAmount, refetch } = useAllowance({ - tokenAddress: token0?.address as string, - ownerAddress: address as string, - spenderAddress: ROUTER_CONTRACT, - }); - const { data: tokenBalance, isLoading } = useTokenBalance({ - accountAddress: address, - tokenAddress: token0.address, - }); - const { data: routeData, isLoading: isLoadingRoutes } = useRoutes({ token0, token1 }); - //these reserves are always going to be defined if a pair exists - const { data: reserves, isLoading: isReservesLoading } = useReserves({ - pairAddress: routeData?.pairs?.[0], - token0, - token1, - }); - //these reserves are for is the swap needs an intermediate pair - const { data: reserves1, isLoading: isReserves1Loading } = useReserves({ - pairAddress: routeData?.pairs?.[1], - token0, - token1, - }); - - //this number is always going to be defined if the reserves exists - const { data: priceImpactPercentage } = usePriceImpact({ - amount: amountIn, - token: token0, - reserves, - }); - - //this number is for the price impact of the second pair in a hop is needed - const { data: priceImpactPercentage1 } = usePriceImpact({ - amount: amountOut, - token: token1, - reserves: reserves1, - }); - - const priceImpactTotal = (priceImpactPercentage ?? 0) + (priceImpactPercentage1 ?? 0); - - useEffect(() => { - if (isLoadingRoutes) { - setRoute([]); - } - if (routeData && routeData.route.length > 0 && !isLoadingRoutes) { - setRoute(routeData.route); - } - }, [routeData, isLoadingRoutes]); - - const swapType = useMemo(() => { - return getIfWrapOrUnwrap(token0, token1); - }, [token0, token1]); - - useEffect(() => { - setPriceImpactPercentage(priceImpactTotal ?? 0); - }, [priceImpactTotal]); - - const refreshAllowance = async () => { - await refetch(); - }; - - const hasInsufficientBalance = useMemo(() => { - if (isLoading) return true; - return Number(formatUnitsForInput(tokenBalance ?? "0", token0.decimals)) < Number(amountIn); - }, [tokenBalance, token0, amountIn, isLoading]); - - const noRoutes = swapType === "swap" && !isLoadingRoutes && routeData && routeData.route?.length === 0; - - const allowanceFormatted = formatUnitsForInput(allowanceAmount ?? "0", token0?.decimals); - - const insufficientLiquidity = priceImpactTotal && priceImpactTotal >= 100; - - const buttonText = useMemo(() => { - if (isTxnPending) { - return "Swapping"; - } - if (!amountIn || amountIn === "0") { - return "Enter Amount"; - } - if (hasInsufficientBalance) { - return "Insufficient Balance"; - } - if (swapType === "unwrap") { - return "Unwrap"; - } - if (swapType === "wrap") { - return "Wrap"; - } - if (noRoutes) { - return "No Routes Found"; - } - if (insufficientLiquidity) { - return "Insufficient Liquidity"; - } - if (allowanceAmount && Number(amountIn) > Number(allowanceFormatted) && swapType === "swap") { - return "Approve"; - } - return "Review Swap"; - }, [ - amountIn, - allowanceAmount, - hasInsufficientBalance, - noRoutes, - allowanceFormatted, - swapType, - insufficientLiquidity, - isTxnPending, - ]); - - const userConfirmationNeeded = useMemo(() => { - if ( - warningSeverity(priceImpactPercentage ?? 0) > 3 && - (buttonText === "Review Swap" || buttonText === "Approve") - ) { - return true; - } - return false; - }, [priceImpactPercentage, buttonText]); - - return ( - <> - {buttonText === "Approve" ? ( - - ) : ( - - - - )} - {userConfirmationNeeded && !isChecked ? ( -
    setIsChecked(!isChecked)} - className="flex items-start px-4 py-3 mt-4 rounded-xl bg-red/20 dark:bg-red/40 cursor-pointer"> - - -
    - ) : null} - - ); -}; diff --git a/apps/tron/src/components/Swap/SwapButton.tsx b/apps/tron/src/components/Swap/SwapButton.tsx deleted file mode 100644 index b4e81493ca..0000000000 --- a/apps/tron/src/components/Swap/SwapButton.tsx +++ /dev/null @@ -1,210 +0,0 @@ -import { Button, Dots, createFailedToast, createInfoToast, createSuccessToast } from "@sushiswap/ui"; -import { useQueryClient } from "@tanstack/react-query"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { useMemo } from "react"; -import { useSwapDispatch, useSwapState } from "src/app/swap/swap-provider"; -import { WTRX } from "src/constants/token-list"; - -import { useTronWeb } from "src/hooks/useTronWeb"; -import { parseUnits } from "src/utils/formatters"; -import { - cleanArgs, - getArgsForSwap, - getDeadline, - getIfWrapOrUnwrap, - getRouterFunctionSelectors, - getTransactionInfo, - parseTxnError, - safeGasEstimates, -} from "src/utils/helpers"; -import { getTronscanTxnLink } from "src/utils/tronscan-helpers"; - -export const SwapButton = ({ closeModal, minOutput }: { closeModal: () => void; minOutput: string }) => { - const queryClient = useQueryClient(); - const { token0, token1, isTxnPending, amountIn, amountOut, route } = useSwapState(); - const { setIsTxnPending, setAmountIn, setAmountOut, setPriceImpactPercentage } = useSwapDispatch(); - const { tronWeb } = useTronWeb(); - const { address, signTransaction } = useWallet(); - - const swapType = useMemo(() => { - return getIfWrapOrUnwrap(token0, token1); - }, [token0, token1]); - - const swapToken = async () => { - if (!address) return; - let txId: string = ""; - try { - setIsTxnPending(true); - const parsedAmountIn = parseUnits(amountIn, token0?.decimals); - const parsedAmountOut = parseUnits(amountOut, token1?.decimals); - - if (swapType === "wrap") { - const { transaction } = await tronWeb.transactionBuilder.triggerSmartContract( - WTRX.address, //contract address - "deposit()", //function name - { callValue: parsedAmountIn }, // options - [], //parameters - address //issuerAddress - ); - const signedTransation = await signTransaction(transaction); - const _result = await tronWeb.trx.sendRawTransaction(signedTransation); - console.log("_result", _result); - if (!_result.result && "code" in _result) { - throw new Error(parseTxnError(_result.code)); - } - txId = _result?.txid; - createInfoToast({ - summary: "Wrapping TRX...", - type: "swap", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - txHash: txId, - href: getTronscanTxnLink(txId), - }); - } else if (swapType === "unwrap") { - const { transaction } = await tronWeb.transactionBuilder.triggerSmartContract( - WTRX.address, //contract address - "withdraw(uint256)", //function name - {}, // options - [{ type: "uint256", value: parsedAmountIn }], //parameters - address //issuerAddress - ); - const signedTransation = await signTransaction(transaction); - const _result = await tronWeb.trx.sendRawTransaction(signedTransation); - console.log("_result", _result); - if (!_result.result && "code" in _result) { - throw new Error(parseTxnError(_result.code)); - } - - txId = _result?.txid; - createInfoToast({ - summary: "Unwrapping WTRX...", - type: "swap", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - txHash: txId, - href: getTronscanTxnLink(txId), - }); - } else { - const methodNames = getRouterFunctionSelectors(route); - console.log("methodNames", methodNames); - const deadline = getDeadline(); - const parsedAmountOutMin = parseUnits(minOutput, token1?.decimals); - - const args = []; - for (let i = 0; i < methodNames.length; i++) { - const _args = getArgsForSwap( - methodNames[i], - parsedAmountIn, - parsedAmountOut, - parsedAmountIn, - parsedAmountOutMin, - route, - address, - deadline, - address - ); - args.push(_args); - } - console.log("args", args); - - const estimates = await safeGasEstimates(tronWeb, args); - console.log("estimates", estimates); - const safeGasEstimate = estimates.findIndex((predicate) => predicate !== undefined); - console.log("safeGasEstimate", safeGasEstimate); - if (safeGasEstimate === -1) { - throw new Error("Failed to estimate energy. Transaction will fail."); - } - const argsForTransaction = cleanArgs(args[safeGasEstimate]); - console.log("argsForTransaction", argsForTransaction); - - const { transaction } = await tronWeb.transactionBuilder.triggerSmartContract(...argsForTransaction); - - const signedTransation = await signTransaction(transaction); - const _result = await tronWeb.trx.sendRawTransaction(signedTransation); - - if (!_result.result && "code" in _result) { - throw new Error(parseTxnError(_result.code)); - } - txId = _result?.txid; - createInfoToast({ - summary: "Swap initiated...", - type: "swap", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - txHash: txId, - href: getTronscanTxnLink(txId), - }); - } - - const transactionInfo = await getTransactionInfo(tronWeb, txId); - if (transactionInfo?.receipt?.result !== "SUCCESS") { - throw new Error("Transaction failed"); - } - //create success toast - createSuccessToast({ - summary: "Swap successful", - txHash: txId, - type: "swap", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - href: getTronscanTxnLink(txId), - }); - onSuccess(); - } catch (error) { - const errorMessage = - typeof error === "string" - ? error - : (error as Error)?.message ?? "An error occurred while trying to swap"; - //create error toast - createFailedToast({ - summary: errorMessage, - type: "swap", - account: address as string, - chainId: 1, - groupTimestamp: Date.now(), - timestamp: Date.now(), - href: txId ? getTronscanTxnLink(txId) : undefined, - }); - console.log(error); - - setIsTxnPending(false); - } - }; - - const onSuccess = () => { - setAmountIn(""); - setAmountOut(""); - setPriceImpactPercentage(0); - setIsTxnPending(false); - closeModal(); - queryClient.invalidateQueries([ - "useTokenBalance", - { accountAddress: address, tokenAddress: token0?.address }, - ]); - queryClient.invalidateQueries([ - "useTokenBalance", - { accountAddress: address, tokenAddress: token1?.address }, - ]); - }; - - return ( - - ); -}; diff --git a/apps/tron/src/components/Swap/SwapRoutesDialog.tsx b/apps/tron/src/components/Swap/SwapRoutesDialog.tsx deleted file mode 100644 index 7923187f14..0000000000 --- a/apps/tron/src/components/Swap/SwapRoutesDialog.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { Button } from "@sushiswap/ui"; -import { - Dialog, - DialogContent, - DialogDescription, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "@sushiswap/ui"; -import { Icon } from "../General/Icon"; -import { useSwapState } from "src/app/swap/swap-provider"; -import { useTokenInfo } from "src/hooks/useTokenInfo"; - -export const SwapRoutesDialog = () => { - const { route } = useSwapState(); - - return ( - - - - - - - - Trade Route - Optimized route to get the best price - -
    -
    - {route?.map((tokenAddress, idx) => ( - - ))} -
    -
    -
    -
    - ); -}; - -const SwapItem = ({ tokenAddress }: { tokenAddress: string }) => { - const { data } = useTokenInfo({ tokenAddress }); - - return ( -
    - - {data?.symbol} -
    - ); -}; diff --git a/apps/tron/src/components/Swap/SwapStats.tsx b/apps/tron/src/components/Swap/SwapStats.tsx deleted file mode 100644 index 408d4269ce..0000000000 --- a/apps/tron/src/components/Swap/SwapStats.tsx +++ /dev/null @@ -1,116 +0,0 @@ -import { Transition } from "@headlessui/react"; -import { classNames } from "@sushiswap/ui"; -import { SkeletonBox } from "@sushiswap/ui"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import Link from "next/link"; -import { useSwapState } from "src/app/swap/swap-provider"; -import { truncateText } from "src/utils/formatters"; -import { getTronscanAddressLink } from "src/utils/tronscan-helpers"; -import { warningSeverity, warningSeverityClassName } from "src/utils/warning-severity"; -import { SwapRoutesDialog } from "./SwapRoutesDialog"; -import { useSlippageTolerance } from "@sushiswap/hooks"; -import { useMemo } from "react"; -import { formatPercent } from "sushi/format"; -import { getIfWrapOrUnwrap } from "src/utils/helpers"; - -export const SwapStats = () => { - const { token0, token1, amountOut, amountIn, priceImpactPercentage, route } = useSwapState(); - const { address } = useWallet(); - - const swapType = useMemo(() => { - return getIfWrapOrUnwrap(token0, token1); - }, [token0, token1]); - - const isLoading = - priceImpactPercentage === undefined || - (priceImpactPercentage === 0 && swapType === "swap") || - amountOut === "" || - amountOut === ""; - - const [slippageTolerance] = useSlippageTolerance("sushi-tron-slippage"); - - const slippage = slippageTolerance === "AUTO" ? 0.005 : Number(slippageTolerance) / 100; - - const minOutput = useMemo(() => { - if (!amountOut) return ""; - if ( - (token0?.symbol === "WTRX" && token1?.address === "TRON") || - (token0?.address === "TRON" && token1?.symbol === "WTRX") - ) { - return amountIn; - } - - const output = Number(amountOut) * (1 - slippage); - return output; - }, [amountOut, slippage, token0, token1, amountIn]); - - const severityColor = useMemo(() => { - return warningSeverityClassName(warningSeverity(priceImpactPercentage)); - }, [priceImpactPercentage]); - - return ( - 0} - enter="transition duration-300 ease-out" - enterFrom="transform translate-y-[16px] opacity-0" - enterTo="transform translate-y-0 opacity-100" - leave="transition duration-300 ease-out" - leaveFrom="transform translate-y-0 opacity-100" - leaveTo="transform translate-y-[16px] opacity-0"> -
    -
    - Price impact - - {isLoading ? ( - - ) : ( - - {priceImpactPercentage ? `-${formatPercent(priceImpactPercentage / 100)}` : formatPercent(0)} - - )} - -
    -
    - Est. received - - {isLoading ? ( - - ) : ( - `${amountOut} ${token1.symbol}` - )} - -
    -
    - Min. received - - {isLoading ? ( - - ) : ( - `${minOutput} ${token1.symbol}` - )} - -
    -
    - Route - - {isLoading ? : } - -
    - {address && ( -
    - Recipient - - - {truncateText(address)} - - -
    - )} -
    -
    - ); -}; diff --git a/apps/tron/src/components/Swap/SwitchSwapDirection.tsx b/apps/tron/src/components/Swap/SwitchSwapDirection.tsx deleted file mode 100644 index 0c2aaac80c..0000000000 --- a/apps/tron/src/components/Swap/SwitchSwapDirection.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from "react"; -import { ArrowsUpDownIcon } from "@heroicons/react/24/outline"; -import { useSwapDispatch } from "src/app/swap/swap-provider"; - -export const SwitchSwapDirection = () => { - const { swapTokens } = useSwapDispatch(); - return ( -
    - -
    - ); -}; diff --git a/apps/tron/src/components/Swap/SwitchSwapType.tsx b/apps/tron/src/components/Swap/SwitchSwapType.tsx deleted file mode 100644 index adf6916b5d..0000000000 --- a/apps/tron/src/components/Swap/SwitchSwapType.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Button } from "@sushiswap/ui/components/button"; - -export const SwitchSwapType = () => { - return ( -
    - -
    - ); -}; diff --git a/apps/tron/src/components/WalletConnector/DefaultView.tsx b/apps/tron/src/components/WalletConnector/DefaultView.tsx deleted file mode 100644 index 22fdb56007..0000000000 --- a/apps/tron/src/components/WalletConnector/DefaultView.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import { Cog6ToothIcon, DocumentDuplicateIcon, LinkIcon } from "@heroicons/react/24/outline"; -import { ArrowLeftOnRectangleIcon } from "@heroicons/react/24/outline"; -import { IconButton, JazzIcon } from "@sushiswap/ui"; -import React, { Dispatch, SetStateAction } from "react"; -import { IProfileView } from "./WalletConnector"; -import { SkeletonText } from "@sushiswap/ui"; -import { formatUSD, formatNumber } from "sushi/format"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { truncateText } from "src/utils/formatters"; -import { useNativeBalance } from "src/hooks/useNativeBalance"; -import Link from "next/link"; -import { getTronscanAddressLink } from "src/utils/tronscan-helpers"; -import { ClipboardController } from "@sushiswap/ui"; -import { useStablePrice } from "src/hooks/useStablePrice"; -import { WTRX } from "src/constants/token-list"; - -type DefaultViewProps = { - setView: Dispatch>; -}; - -export const DefaultView = ({ setView }: DefaultViewProps) => { - const { address, disconnect } = useWallet(); - const { data, isLoading: isLoadingBalance } = useNativeBalance(); - - const { data: price, isLoading: isLoadingPrice } = useStablePrice({ token: WTRX }); - - const isLoading = isLoadingBalance || isLoadingPrice; - - return ( -
    -
    -
    - {address && } - - {({ setCopied }) => ( - setCopied(address ?? "")}> - {truncateText(address ?? "")} - - )} - -
    -
    - setView("settings")} - name="Settings" - description="Settings" - size="xs" - /> - - {({ setCopied }) => ( - setCopied(address ?? "")} - name={"Copy Address"} - description={"Copy Address"} - size="xs" - /> - )} - - - - - await disconnect()} - name="Disconnect" - size="xs" - description="Disconnect" - /> -
    -
    -
    - {isLoading || !price || data?.formattedBalance === undefined ? ( -
    - - TRX -
    - ) : ( -

    {formatNumber(data?.formattedBalance)} TRX

    - )} - {isLoading || !price || data?.formattedBalance === undefined ? ( - - ) : ( -

    {formatUSD(Number(price) * data?.formattedBalance)}

    - )} -
    -
    - ); -}; diff --git a/apps/tron/src/components/WalletConnector/SettingsView.tsx b/apps/tron/src/components/WalletConnector/SettingsView.tsx deleted file mode 100644 index bc0e086661..0000000000 --- a/apps/tron/src/components/WalletConnector/SettingsView.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { ArrowLeftIcon } from "@heroicons/react/20/solid"; -import { List } from "@sushiswap/ui"; -import React, { FC, Fragment } from "react"; -import { IconButton } from "@sushiswap/ui"; -import { RadioGroup } from "@headlessui/react"; -import { classNames } from "@sushiswap/ui"; -import { MoonIcon, SunIcon } from "@heroicons/react/24/outline"; -import { useTheme } from "next-themes"; -import { IProfileView } from "./WalletConnector"; - -type SettingsViewProps = { - setView: React.Dispatch>; -}; - -const options = { - system: Auto, - light: , - dark: , -}; - -export const SettingsView: FC = ({ setView }) => { - const { theme, setTheme } = useTheme(); - return ( -
    -
    -
    - setView("default")} - icon={ArrowLeftIcon} - name="Back" - className="bg-transparent" - /> -
    - Settings -
    -
    - - Preferences - - - -
    - {Object.entries(options).map(([k, v], i) => ( - - {({ checked }) => ( - - )} - - ))} -
    -
    -
    -
    -
    -
    - ); -}; diff --git a/apps/tron/src/components/WalletConnector/WalletConnector.tsx b/apps/tron/src/components/WalletConnector/WalletConnector.tsx deleted file mode 100644 index de5f6b423f..0000000000 --- a/apps/tron/src/components/WalletConnector/WalletConnector.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { Button, Popover, PopoverContent, PopoverTrigger, SelectIcon, JazzIcon, Chip } from "@sushiswap/ui"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { truncateText } from "src/utils/formatters"; -import { WalletListView } from "./WalletListView"; -import { useState } from "react"; -import { DefaultView } from "./DefaultView"; -import { SettingsView } from "./SettingsView"; -import { IS_TESTNET } from "src/constants/is-testnet"; - -export type IProfileView = "default" | "settings"; - -type WalletConnectorProps = { - hideChevron?: boolean; - fullWidth?: boolean; - size?: "default" | "lg"; - variant?: "secondary" | "default"; -}; - -export const WalletConnector = ({ - hideChevron, - fullWidth, - size = "default", - variant = "secondary", -}: WalletConnectorProps) => { - const [view, setView] = useState("default"); - const { connected, connecting, address } = useWallet(); - const isConnected = address && connected; - - return ( - - - - {IS_TESTNET && isConnected ? ( - - Testnet - - ) : null} - - - - {!isConnected ? : null} - {view === "default" && isConnected ? : null} - {view === "settings" && isConnected ? : null} - - - ); -}; diff --git a/apps/tron/src/components/WalletConnector/WalletListView.tsx b/apps/tron/src/components/WalletConnector/WalletListView.tsx deleted file mode 100644 index 46ec6896d7..0000000000 --- a/apps/tron/src/components/WalletConnector/WalletListView.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { useWalletAdapters } from "src/hooks/useWalletAdapters"; -import Image from "next/image"; -import { SelectIcon, List } from "@sushiswap/ui"; - -export const WalletListView = () => { - const { adapters } = useWalletAdapters(); - const { select } = useWallet(); - - return ( - - - {adapters.map((adapter) => ( - {adapter.name}} - className="w-full items-center text-left justify-start flex" - key={adapter.name} - title={adapter.name} - onClick={async () => { - if (adapter.readyState === "Found") { - select(adapter.name); - } else { - window.open(adapter.url, "_blank"); - } - }} - hoverIcon={() => } - /> - ))} - - - ); -}; diff --git a/apps/tron/src/constants/abis/factory-abi.ts b/apps/tron/src/constants/abis/factory-abi.ts deleted file mode 100644 index c3e2dccf98..0000000000 --- a/apps/tron/src/constants/abis/factory-abi.ts +++ /dev/null @@ -1,83 +0,0 @@ -export const FACTORY_ABI = [ - { - outputs: [{ type: "address" }], - constant: true, - name: "feeTo", - stateMutability: "view", - type: "function", - }, - { - outputs: [{ type: "address" }], - constant: true, - name: "feeToSetter", - stateMutability: "view", - type: "function", - }, - { - outputs: [{ type: "address" }], - constant: true, - inputs: [{ type: "uint256" }], - name: "allPairs", - stateMutability: "view", - type: "function", - }, - { - outputs: [{ type: "uint256" }], - constant: true, - name: "allPairsLength", - stateMutability: "view", - type: "function", - }, - { - outputs: [{ type: "bytes32" }], - constant: true, - name: "getPairHash", - stateMutability: "view", - type: "function", - }, - { - inputs: [{ name: "_feeToSetter", type: "address" }], - name: "setFeeToSetter", - stateMutability: "Nonpayable", - type: "Function", - }, - { - outputs: [{ name: "pair", type: "address" }], - inputs: [ - { name: "tokenA", type: "address" }, - { name: "tokenB", type: "address" }, - ], - name: "createPair", - stateMutability: "Nonpayable", - type: "Function", - }, - { - outputs: [{ type: "address" }], - constant: true, - inputs: [{ type: "address" }, { type: "address" }], - name: "getPair", - stateMutability: "view", - type: "function", - }, - { - inputs: [{ name: "_feeTo", type: "address" }], - name: "setFeeTo", - stateMutability: "Nonpayable", - type: "Function", - }, - { - inputs: [{ name: "_feeToSetter", type: "address" }], - stateMutability: "Nonpayable", - type: "Constructor", - }, - { - inputs: [ - { indexed: true, name: "token0", type: "address" }, - { indexed: true, name: "token1", type: "address" }, - { name: "pair", type: "address" }, - { type: "uint256" }, - ], - name: "PairCreated", - type: "Event", - }, -]; diff --git a/apps/tron/src/constants/abis/pair-abi.ts b/apps/tron/src/constants/abis/pair-abi.ts deleted file mode 100644 index e9575156d9..0000000000 --- a/apps/tron/src/constants/abis/pair-abi.ts +++ /dev/null @@ -1,345 +0,0 @@ -export const PAIR_ABI = [ - { inputs: [], payable: false, stateMutability: "nonpayable", type: "constructor" }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: "address", name: "owner", type: "address" }, - { indexed: true, internalType: "address", name: "spender", type: "address" }, - { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: "address", name: "sender", type: "address" }, - { indexed: false, internalType: "uint256", name: "amount0", type: "uint256" }, - { indexed: false, internalType: "uint256", name: "amount1", type: "uint256" }, - { indexed: true, internalType: "address", name: "to", type: "address" }, - ], - name: "Burn", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: "address", name: "sender", type: "address" }, - { indexed: false, internalType: "uint256", name: "amount0", type: "uint256" }, - { indexed: false, internalType: "uint256", name: "amount1", type: "uint256" }, - ], - name: "Mint", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: "address", name: "sender", type: "address" }, - { indexed: false, internalType: "uint256", name: "amount0In", type: "uint256" }, - { indexed: false, internalType: "uint256", name: "amount1In", type: "uint256" }, - { indexed: false, internalType: "uint256", name: "amount0Out", type: "uint256" }, - { indexed: false, internalType: "uint256", name: "amount1Out", type: "uint256" }, - { indexed: true, internalType: "address", name: "to", type: "address" }, - ], - name: "Swap", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: false, internalType: "uint112", name: "reserve0", type: "uint112" }, - { indexed: false, internalType: "uint112", name: "reserve1", type: "uint112" }, - ], - name: "Sync", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: "address", name: "from", type: "address" }, - { indexed: true, internalType: "address", name: "to", type: "address" }, - { indexed: false, internalType: "uint256", name: "value", type: "uint256" }, - ], - name: "Transfer", - type: "event", - }, - { - constant: true, - inputs: [], - name: "DOMAIN_SEPARATOR", - outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "MINIMUM_LIQUIDITY", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "PERMIT_TYPEHASH", - outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [ - { internalType: "address", name: "", type: "address" }, - { internalType: "address", name: "", type: "address" }, - ], - name: "allowance", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { internalType: "address", name: "spender", type: "address" }, - { internalType: "uint256", name: "value", type: "uint256" }, - ], - name: "approve", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [{ internalType: "address", name: "", type: "address" }], - name: "balanceOf", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [{ internalType: "address", name: "to", type: "address" }], - name: "burn", - outputs: [ - { internalType: "uint256", name: "amount0", type: "uint256" }, - { internalType: "uint256", name: "amount1", type: "uint256" }, - ], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "decimals", - outputs: [{ internalType: "uint8", name: "", type: "uint8" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "factory", - outputs: [{ internalType: "address", name: "", type: "address" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "getReserves", - outputs: [ - { internalType: "uint112", name: "_reserve0", type: "uint112" }, - { internalType: "uint112", name: "_reserve1", type: "uint112" }, - { internalType: "uint32", name: "_blockTimestampLast", type: "uint32" }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { internalType: "address", name: "_token0", type: "address" }, - { internalType: "address", name: "_token1", type: "address" }, - ], - name: "initialize", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "kLast", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [{ internalType: "address", name: "to", type: "address" }], - name: "mint", - outputs: [{ internalType: "uint256", name: "liquidity", type: "uint256" }], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "name", - outputs: [{ internalType: "string", name: "", type: "string" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [{ internalType: "address", name: "", type: "address" }], - name: "nonces", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { internalType: "address", name: "owner", type: "address" }, - { internalType: "address", name: "spender", type: "address" }, - { internalType: "uint256", name: "value", type: "uint256" }, - { internalType: "uint256", name: "deadline", type: "uint256" }, - { internalType: "uint8", name: "v", type: "uint8" }, - { internalType: "bytes32", name: "r", type: "bytes32" }, - { internalType: "bytes32", name: "s", type: "bytes32" }, - ], - name: "permit", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "price0CumulativeLast", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "price1CumulativeLast", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [{ internalType: "address", name: "to", type: "address" }], - name: "skim", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [ - { internalType: "uint256", name: "amount0Out", type: "uint256" }, - { internalType: "uint256", name: "amount1Out", type: "uint256" }, - { internalType: "address", name: "to", type: "address" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "swap", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "symbol", - outputs: [{ internalType: "string", name: "", type: "string" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [], - name: "sync", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "token0", - outputs: [{ internalType: "address", name: "", type: "address" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "token1", - outputs: [{ internalType: "address", name: "", type: "address" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "totalSupply", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { internalType: "address", name: "to", type: "address" }, - { internalType: "uint256", name: "value", type: "uint256" }, - ], - name: "transfer", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [ - { internalType: "address", name: "from", type: "address" }, - { internalType: "address", name: "to", type: "address" }, - { internalType: "uint256", name: "value", type: "uint256" }, - ], - name: "transferFrom", - outputs: [{ internalType: "bool", name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, -]; diff --git a/apps/tron/src/constants/abis/router-abi.ts b/apps/tron/src/constants/abis/router-abi.ts deleted file mode 100644 index d6c7bc7ffb..0000000000 --- a/apps/tron/src/constants/abis/router-abi.ts +++ /dev/null @@ -1,335 +0,0 @@ -export const ROUTER_ABI = [ - { - inputs: [ - { name: "_factory", type: "address" }, - { name: "_WETH", type: "address" }, - ], - stateMutability: "Nonpayable", - type: "Constructor", - }, - { outputs: [{ type: "address" }], name: "WETH", stateMutability: "View", type: "Function" }, - { - outputs: [ - { name: "amountA", type: "uint256" }, - { name: "amountB", type: "uint256" }, - { name: "liquidity", type: "uint256" }, - ], - inputs: [ - { name: "tokenA", type: "address" }, - { name: "tokenB", type: "address" }, - { name: "amountADesired", type: "uint256" }, - { name: "amountBDesired", type: "uint256" }, - { name: "amountAMin", type: "uint256" }, - { name: "amountBMin", type: "uint256" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "addLiquidity", - stateMutability: "Nonpayable", - type: "Function", - }, - { - outputs: [ - { name: "amountToken", type: "uint256" }, - { name: "amountETH", type: "uint256" }, - { name: "liquidity", type: "uint256" }, - ], - inputs: [ - { name: "token", type: "address" }, - { name: "amountTokenDesired", type: "uint256" }, - { name: "amountTokenMin", type: "uint256" }, - { name: "amountETHMin", type: "uint256" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "addLiquidityETH", - stateMutability: "Payable", - type: "Function", - }, - { outputs: [{ type: "address" }], name: "factory", stateMutability: "View", type: "Function" }, - { - outputs: [{ name: "amountIn", type: "uint256" }], - inputs: [ - { name: "amountOut", type: "uint256" }, - { name: "reserveIn", type: "uint256" }, - { name: "reserveOut", type: "uint256" }, - ], - name: "getAmountIn", - stateMutability: "Pure", - type: "Function", - }, - { - outputs: [{ name: "amountOut", type: "uint256" }], - inputs: [ - { name: "amountIn", type: "uint256" }, - { name: "reserveIn", type: "uint256" }, - { name: "reserveOut", type: "uint256" }, - ], - name: "getAmountOut", - stateMutability: "Pure", - type: "Function", - }, - { - outputs: [{ name: "amounts", type: "uint256[]" }], - inputs: [ - { name: "amountOut", type: "uint256" }, - { name: "path", type: "address[]" }, - ], - name: "getAmountsIn", - stateMutability: "View", - type: "Function", - }, - { - outputs: [{ name: "amounts", type: "uint256[]" }], - inputs: [ - { name: "amountIn", type: "uint256" }, - { name: "path", type: "address[]" }, - ], - name: "getAmountsOut", - stateMutability: "View", - type: "Function", - }, - { - outputs: [{ name: "pair", type: "address" }], - inputs: [ - { name: "tokenA", type: "address" }, - { name: "tokenB", type: "address" }, - ], - name: "getPairOffChain", - stateMutability: "View", - type: "Function", - }, - { - outputs: [{ name: "amountB", type: "uint256" }], - inputs: [ - { name: "amountA", type: "uint256" }, - { name: "reserveA", type: "uint256" }, - { name: "reserveB", type: "uint256" }, - ], - name: "quote", - stateMutability: "Pure", - type: "Function", - }, - { - outputs: [ - { name: "amountA", type: "uint256" }, - { name: "amountB", type: "uint256" }, - ], - inputs: [ - { name: "tokenA", type: "address" }, - { name: "tokenB", type: "address" }, - { name: "liquidity", type: "uint256" }, - { name: "amountAMin", type: "uint256" }, - { name: "amountBMin", type: "uint256" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "removeLiquidity", - stateMutability: "Nonpayable", - type: "Function", - }, - { - outputs: [ - { name: "amountToken", type: "uint256" }, - { name: "amountETH", type: "uint256" }, - ], - inputs: [ - { name: "token", type: "address" }, - { name: "liquidity", type: "uint256" }, - { name: "amountTokenMin", type: "uint256" }, - { name: "amountETHMin", type: "uint256" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "removeLiquidityETH", - stateMutability: "Nonpayable", - type: "Function", - }, - { - outputs: [{ name: "amountETH", type: "uint256" }], - inputs: [ - { name: "token", type: "address" }, - { name: "liquidity", type: "uint256" }, - { name: "amountTokenMin", type: "uint256" }, - { name: "amountETHMin", type: "uint256" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "removeLiquidityETHSupportingFeeOnTransferTokens", - stateMutability: "Nonpayable", - type: "Function", - }, - { - outputs: [ - { name: "amountToken", type: "uint256" }, - { name: "amountETH", type: "uint256" }, - ], - inputs: [ - { name: "token", type: "address" }, - { name: "liquidity", type: "uint256" }, - { name: "amountTokenMin", type: "uint256" }, - { name: "amountETHMin", type: "uint256" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - { name: "approveMax", type: "bool" }, - { name: "v", type: "uint8" }, - { name: "r", type: "bytes32" }, - { name: "s", type: "bytes32" }, - ], - name: "removeLiquidityETHWithPermit", - stateMutability: "Nonpayable", - type: "Function", - }, - { - outputs: [{ name: "amountETH", type: "uint256" }], - inputs: [ - { name: "token", type: "address" }, - { name: "liquidity", type: "uint256" }, - { name: "amountTokenMin", type: "uint256" }, - { name: "amountETHMin", type: "uint256" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - { name: "approveMax", type: "bool" }, - { name: "v", type: "uint8" }, - { name: "r", type: "bytes32" }, - { name: "s", type: "bytes32" }, - ], - name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens", - stateMutability: "Nonpayable", - type: "Function", - }, - { - outputs: [ - { name: "amountA", type: "uint256" }, - { name: "amountB", type: "uint256" }, - ], - inputs: [ - { name: "tokenA", type: "address" }, - { name: "tokenB", type: "address" }, - { name: "liquidity", type: "uint256" }, - { name: "amountAMin", type: "uint256" }, - { name: "amountBMin", type: "uint256" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - { name: "approveMax", type: "bool" }, - { name: "v", type: "uint8" }, - { name: "r", type: "bytes32" }, - { name: "s", type: "bytes32" }, - ], - name: "removeLiquidityWithPermit", - stateMutability: "Nonpayable", - type: "Function", - }, - { - outputs: [{ name: "amounts", type: "uint256[]" }], - inputs: [ - { name: "amountOut", type: "uint256" }, - { name: "path", type: "address[]" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "swapETHForExactTokens", - stateMutability: "Payable", - type: "Function", - }, - { - outputs: [{ name: "amounts", type: "uint256[]" }], - inputs: [ - { name: "amountOutMin", type: "uint256" }, - { name: "path", type: "address[]" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "swapExactETHForTokens", - stateMutability: "Payable", - type: "Function", - }, - { - inputs: [ - { name: "amountOutMin", type: "uint256" }, - { name: "path", type: "address[]" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "swapExactETHForTokensSupportingFeeOnTransferTokens", - stateMutability: "Payable", - type: "Function", - }, - { - outputs: [{ name: "amounts", type: "uint256[]" }], - inputs: [ - { name: "amountIn", type: "uint256" }, - { name: "amountOutMin", type: "uint256" }, - { name: "path", type: "address[]" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "swapExactTokensForETH", - stateMutability: "Nonpayable", - type: "Function", - }, - { - inputs: [ - { name: "amountIn", type: "uint256" }, - { name: "amountOutMin", type: "uint256" }, - { name: "path", type: "address[]" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "swapExactTokensForETHSupportingFeeOnTransferTokens", - stateMutability: "Nonpayable", - type: "Function", - }, - { - outputs: [{ name: "amounts", type: "uint256[]" }], - inputs: [ - { name: "amountIn", type: "uint256" }, - { name: "amountOutMin", type: "uint256" }, - { name: "path", type: "address[]" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "swapExactTokensForTokens", - stateMutability: "Nonpayable", - type: "Function", - }, - { - inputs: [ - { name: "amountIn", type: "uint256" }, - { name: "amountOutMin", type: "uint256" }, - { name: "path", type: "address[]" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "swapExactTokensForTokensSupportingFeeOnTransferTokens", - stateMutability: "Nonpayable", - type: "Function", - }, - { - outputs: [{ name: "amounts", type: "uint256[]" }], - inputs: [ - { name: "amountOut", type: "uint256" }, - { name: "amountInMax", type: "uint256" }, - { name: "path", type: "address[]" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "swapTokensForExactETH", - stateMutability: "Nonpayable", - type: "Function", - }, - { - outputs: [{ name: "amounts", type: "uint256[]" }], - inputs: [ - { name: "amountOut", type: "uint256" }, - { name: "amountInMax", type: "uint256" }, - { name: "path", type: "address[]" }, - { name: "to", type: "address" }, - { name: "deadline", type: "uint256" }, - ], - name: "swapTokensForExactTokens", - stateMutability: "Nonpayable", - type: "Function", - }, - { stateMutability: "Payable", type: "Receive" }, -]; diff --git a/apps/tron/src/constants/abis/trc20-abi.ts b/apps/tron/src/constants/abis/trc20-abi.ts deleted file mode 100644 index a74091f2fc..0000000000 --- a/apps/tron/src/constants/abis/trc20-abi.ts +++ /dev/null @@ -1,222 +0,0 @@ -export const TRC_20_ABI = [ - { - constant: true, - inputs: [], - name: "name", - outputs: [ - { - name: "", - type: "string", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { - name: "_spender", - type: "address", - }, - { - name: "_value", - type: "uint256", - }, - ], - name: "approve", - outputs: [ - { - name: "", - type: "bool", - }, - ], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "totalSupply", - outputs: [ - { - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { - name: "_from", - type: "address", - }, - { - name: "_to", - type: "address", - }, - { - name: "_value", - type: "uint256", - }, - ], - name: "transferFrom", - outputs: [ - { - name: "", - type: "bool", - }, - ], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "decimals", - outputs: [ - { - name: "", - type: "uint8", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [ - { - name: "_owner", - type: "address", - }, - ], - name: "balanceOf", - outputs: [ - { - name: "balance", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "symbol", - outputs: [ - { - name: "", - type: "string", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { - name: "_to", - type: "address", - }, - { - name: "_value", - type: "uint256", - }, - ], - name: "transfer", - outputs: [ - { - name: "", - type: "bool", - }, - ], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [ - { - name: "_owner", - type: "address", - }, - { - name: "_spender", - type: "address", - }, - ], - name: "allowance", - outputs: [ - { - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, - { - payable: true, - stateMutability: "payable", - type: "fallback", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - name: "owner", - type: "address", - }, - { - indexed: true, - name: "spender", - type: "address", - }, - { - indexed: false, - name: "value", - type: "uint256", - }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - name: "from", - type: "address", - }, - { - indexed: true, - name: "to", - type: "address", - }, - { - indexed: false, - name: "value", - type: "uint256", - }, - ], - name: "Transfer", - type: "event", - }, -]; diff --git a/apps/tron/src/constants/abis/tron-multicall.ts b/apps/tron/src/constants/abis/tron-multicall.ts deleted file mode 100644 index 36566dd75c..0000000000 --- a/apps/tron/src/constants/abis/tron-multicall.ts +++ /dev/null @@ -1,109 +0,0 @@ -export const TRON_MULTICALL_ABI = [ - { - inputs: [ - { - components: [ - { internalType: "address", name: "target", type: "address" }, - { internalType: "bytes", name: "callData", type: "bytes" }, - ], - internalType: "struct TronMulticall.Call[]", - name: "calls", - type: "tuple[]", - }, - ], - name: "aggregate", - outputs: [ - { internalType: "uint256", name: "blockNumber", type: "uint256" }, - { internalType: "bytes[]", name: "returnData", type: "bytes[]" }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getBasefee", - outputs: [{ internalType: "uint256", name: "basefee", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "uint256", name: "blockNumber", type: "uint256" }], - name: "getBlockHash", - outputs: [{ internalType: "bytes32", name: "blockHash", type: "bytes32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getBlockNumber", - outputs: [{ internalType: "uint256", name: "blockNumber", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getChainId", - outputs: [{ internalType: "uint256", name: "chainid", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getCurrentBlockCoinbase", - outputs: [{ internalType: "address", name: "coinbase", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getCurrentBlockDifficulty", - outputs: [{ internalType: "uint256", name: "difficulty", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getCurrentBlockTimestamp", - outputs: [{ internalType: "uint256", name: "timestamp", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "address", name: "addr", type: "address" }], - name: "getEthBalance", - outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getLastBlockHash", - outputs: [{ internalType: "bytes32", name: "blockHash", type: "bytes32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "accountAddress", type: "address" }, - { internalType: "trcToken", name: "id", type: "trcToken" }, - ], - name: "getTokenBalance", - outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "address", name: "addr", type: "address" }], - name: "isContract", - outputs: [{ internalType: "bool", name: "result", type: "bool" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "bytes[]", name: "data", type: "bytes[]" }], - name: "multicall", - outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], - stateMutability: "view", - type: "function", - }, -]; diff --git a/apps/tron/src/constants/abis/wrapped-trx-abi.ts b/apps/tron/src/constants/abis/wrapped-trx-abi.ts deleted file mode 100644 index 72053f81e9..0000000000 --- a/apps/tron/src/constants/abis/wrapped-trx-abi.ts +++ /dev/null @@ -1,162 +0,0 @@ -export const WRAPPED_TRX_ABI = [ - { - constant: true, - inputs: [], - name: "name", - outputs: [{ name: "", type: "string" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { name: "guy", type: "address" }, - { name: "sad", type: "uint256" }, - ], - name: "approve", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "totalSupply", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { name: "src", type: "address" }, - { name: "dst", type: "address" }, - { name: "sad", type: "uint256" }, - ], - name: "transferFrom", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [{ name: "sad", type: "uint256" }], - name: "withdraw", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "decimals", - outputs: [{ name: "", type: "uint8" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [{ name: "guy", type: "address" }], - name: "balanceOf", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "symbol", - outputs: [{ name: "", type: "string" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { name: "dst", type: "address" }, - { name: "sad", type: "uint256" }, - ], - name: "transfer", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [], - name: "deposit", - outputs: [], - payable: true, - stateMutability: "payable", - type: "function", - }, - { - constant: false, - inputs: [{ name: "guy", type: "address" }], - name: "approve", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [ - { name: "src", type: "address" }, - { name: "guy", type: "address" }, - ], - name: "allowance", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { payable: true, stateMutability: "payable", type: "fallback" }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "src", type: "address" }, - { indexed: true, name: "guy", type: "address" }, - { indexed: false, name: "sad", type: "uint256" }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "src", type: "address" }, - { indexed: true, name: "dst", type: "address" }, - { indexed: false, name: "sad", type: "uint256" }, - ], - name: "Transfer", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "dst", type: "address" }, - { indexed: false, name: "sad", type: "uint256" }, - ], - name: "Deposit", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "src", type: "address" }, - { indexed: false, name: "sad", type: "uint256" }, - ], - name: "Withdrawal", - type: "event", - }, -]; diff --git a/apps/tron/src/constants/contracts.ts b/apps/tron/src/constants/contracts.ts deleted file mode 100644 index d166f5ce4b..0000000000 --- a/apps/tron/src/constants/contracts.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { IS_TESTNET } from "./is-testnet"; - -export const FACTORY_CONTRACT = IS_TESTNET ? "" : "TKWJdrQkqHisa1X8HUdHEfREvTzw4pMAaY"; //sun.io factory contract address -export const ROUTER_CONTRACT = IS_TESTNET ? "" : "TKzxdSv2FZKQrEqkKVgp5DcwEXBEKMg2Ax"; //sun.io router contract address -export const MULTICALL_CONTRACT = IS_TESTNET ? "" : "TGXuuKAb4bnrn137u39EKbYzKNXvdCes98"; diff --git a/apps/tron/src/constants/icon-size.ts b/apps/tron/src/constants/icon-size.ts deleted file mode 100644 index 615d6e241e..0000000000 --- a/apps/tron/src/constants/icon-size.ts +++ /dev/null @@ -1 +0,0 @@ -export const ICON_SIZE = 26; diff --git a/apps/tron/src/constants/is-testnet.ts b/apps/tron/src/constants/is-testnet.ts deleted file mode 100644 index d7f94e5fde..0000000000 --- a/apps/tron/src/constants/is-testnet.ts +++ /dev/null @@ -1 +0,0 @@ -export const IS_TESTNET: boolean = false; diff --git a/apps/tron/src/constants/max-uint256.ts b/apps/tron/src/constants/max-uint256.ts deleted file mode 100644 index c8d7feb6d8..0000000000 --- a/apps/tron/src/constants/max-uint256.ts +++ /dev/null @@ -1 +0,0 @@ -export const MAX_UINT256 = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"; diff --git a/apps/tron/src/constants/pair-decimals.ts b/apps/tron/src/constants/pair-decimals.ts deleted file mode 100644 index 84e19a822d..0000000000 --- a/apps/tron/src/constants/pair-decimals.ts +++ /dev/null @@ -1 +0,0 @@ -export const PAIR_DECIMALS = 18; diff --git a/apps/tron/src/constants/token-list.tsx b/apps/tron/src/constants/token-list.tsx deleted file mode 100644 index e3254eb770..0000000000 --- a/apps/tron/src/constants/token-list.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import { IToken } from "src/types/token-type"; -import { IS_TESTNET } from "./is-testnet"; - -export const TRON: IToken = { - address: "TRON", - decimals: 6, - logoURI: - "https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415", - name: "TRX (TRON)", - symbol: "TRX", -}; - -export const WTRX: IToken = { - address: "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR", - decimals: 6, - logoURI: - "https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415", - name: "Wrapped TRX", - symbol: "WTRX", -}; - -export const INTERMEDIATE_TOKEN = WTRX; - -const MAINNET_TOKENS: IToken[] = [ - { - address: "TRON", - decimals: 6, - logoURI: - "https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415", - name: "TRX (TRON)", - symbol: "TRX", - }, - { - address: "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR", - decimals: 6, - logoURI: - "https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415", - name: "Wrapped TRX", - symbol: "WTRX", - }, - { - address: "TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4", - decimals: 18, - logoURI: "https://static.tronscan.org/production/logo/TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4.png", - name: "TrueUSD", - symbol: "TUSD", - }, - { - address: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", - decimals: 6, - logoURI: "https://static.tronscan.org/production/logo/usdtlogo.png", - name: "Tether USD", - symbol: "USDT", - }, - { - address: "TPYmHEhy5n8TCEfYGqW2rPxsghSfzghPDn", - decimals: 18, - logoURI: "https://static.tronscan.org/production/upload/logo/TPYmHEhy5n8TCEfYGqW2rPxsghSfzghPDn.png", - name: "Decentralized USD", - symbol: "USDD", - }, -]; - -const TESTNET_TOKENS: IToken[] = [ - { - address: "TRON", - decimals: 6, - logoURI: - "https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415", - name: "TRX (TRON)", - symbol: "TRX", - }, - { - address: "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR", //mainnet address currently - decimals: 6, - logoURI: - "https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415", - name: "Wrapped TRX", - symbol: "WTRX", - }, - { - address: "TSdZwNqpHofzP6BsBKGQUWdBeJphLmF6id", - decimals: 6, - logoURI: "https://static.tronscan.org/production/upload/logo/TEkxiTehnzSmSe2XqrBj4w32RUN966rdz81.png", - name: "USDC Coin", - symbol: "USDC", - }, -]; - -export const DEFAULT_TOKEN_LIST = IS_TESTNET ? TESTNET_TOKENS : MAINNET_TOKENS; - -export const DEFAULT_TOKEN_LIST_WITH_KEY = () => { - return DEFAULT_TOKEN_LIST.reduce>( - (acc, { address, decimals, name, symbol, logoURI }) => { - acc[address] = { - name, - decimals, - symbol, - address, - logoURI, - }; - return acc; - }, - {} - ); -}; - -export const STABLE_TOKENS = DEFAULT_TOKEN_LIST.filter( - (token) => token.symbol === "USDT" || token.symbol === "TUSD" || token.symbol === "USDD" -); diff --git a/apps/tron/src/hooks/useAllowance.ts b/apps/tron/src/hooks/useAllowance.ts deleted file mode 100644 index 8880e08268..0000000000 --- a/apps/tron/src/hooks/useAllowance.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { useTronWeb } from "./useTronWeb"; -import { useQuery } from "@tanstack/react-query"; -import { MAX_UINT256 } from "src/constants/max-uint256"; -import { isAddress } from "src/utils/helpers"; - -const abi = [ - { - constant: true, - inputs: [ - { - name: "_owner", - type: "address", - }, - { - name: "_spender", - type: "address", - }, - ], - name: "allowance", - outputs: [ - { - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, -]; - -export const useAllowance = ({ - tokenAddress, - ownerAddress, - spenderAddress, -}: { - tokenAddress: string; - ownerAddress: string; - spenderAddress: string; -}) => { - const { tronWeb } = useTronWeb(); - - return useQuery({ - queryKey: ["useAllowance", { tokenAddress, ownerAddress, spenderAddress }], - queryFn: async () => { - if (tokenAddress === "TRON") { - return MAX_UINT256; - } - tronWeb.setAddress(tokenAddress); - const tokenContract = await tronWeb.contract(abi, tokenAddress); - const allowance = await tokenContract.allowance(ownerAddress, spenderAddress).call(); - - return allowance?.toString() as string; - }, - enabled: - (isAddress(tokenAddress) || tokenAddress === "TRON") && - isAddress(ownerAddress) && - isAddress(spenderAddress) && - !!tronWeb, - }); -}; diff --git a/apps/tron/src/hooks/useAmountsOut.ts b/apps/tron/src/hooks/useAmountsOut.ts deleted file mode 100644 index 91b6e6e9b2..0000000000 --- a/apps/tron/src/hooks/useAmountsOut.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { useTronWeb } from "./useTronWeb"; -import { useQuery } from "@tanstack/react-query"; -import TronWeb from "tronweb"; -import { ROUTER_CONTRACT } from "src/constants/contracts"; -import { getIfWrapOrUnwrap, getValidTokenAddress } from "src/utils/helpers"; -import { ROUTER_ABI } from "src/constants/abis/router-abi"; -import { useSwapState } from "src/app/swap/swap-provider"; - -export const useAmountsOut = ({ amountIn }: { amountIn: string }) => { - const { tronWeb } = useTronWeb(); - const { route, token0, token1 } = useSwapState(); - - return useQuery({ - queryKey: ["useAmountsOut", { route, amountIn }], - queryFn: async () => { - const swapType = getIfWrapOrUnwrap(token0, token1); - if (swapType === "wrap" || swapType === "unwrap") { - return [amountIn, amountIn]; - } - if (!route) return []; - - const cleanedAddressRoute = route?.map((i) => getValidTokenAddress(i)); - if (!amountIn || isNaN(Number(amountIn))) return []; - try { - tronWeb.setAddress(ROUTER_CONTRACT); - const routerContract = await tronWeb.contract(ROUTER_ABI, ROUTER_CONTRACT); - const amountsOuts = await routerContract.getAmountsOut(amountIn, cleanedAddressRoute).call(); - - return amountsOuts?.amounts?.map((i: typeof TronWeb.BigNumber) => i.toString()) as string[]; - } catch (error) { - console.log("useAmountsOut error", error); - return [amountIn, ""]; - } - }, - enabled: !!amountIn && !!tronWeb, - }); -}; diff --git a/apps/tron/src/hooks/useCustomTokens.ts b/apps/tron/src/hooks/useCustomTokens.ts deleted file mode 100644 index e2665331ee..0000000000 --- a/apps/tron/src/hooks/useCustomTokens.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { useLocalStorage } from "@sushiswap/hooks"; -import { useCallback, useMemo } from "react"; -import { IToken } from "src/types/token-type"; -import { IS_TESTNET } from "src/constants/is-testnet"; -import { isAddress } from "src/utils/helpers"; - -const localStorageKey = IS_TESTNET ? "sushi.customTokens.shasta" : "sushi.customTokens.tron"; - -export const useCustomTokens = () => { - const [value, setValue] = useLocalStorage>(localStorageKey, {}); - - const hydrate = useCallback((data: Record) => { - return Object.entries(data).reduce>( - (acc, [k, { address, decimals, name, symbol }]) => { - acc[k] = { address, decimals, name: String(name), symbol: String(symbol) }; - return acc; - }, - {} - ); - }, []); - - const addCustomToken = useCallback( - (currencies: IToken[]) => { - const data: IToken[] = currencies.map((currency) => ({ - address: currency.address, - name: currency.name, - symbol: currency.symbol, - decimals: currency.decimals, - })); - - setValue((prev) => { - return data.reduce( - (acc, cur) => { - acc[`${cur.address}`] = cur; - return acc; - }, - { ...prev } - ); - }); - }, - [setValue] - ); - - const removeCustomToken = useCallback( - (currency: IToken) => { - setValue((prev) => { - return Object.entries(prev).reduce>((acc, cur) => { - if (cur[0] === `${currency.address}`) { - return acc; // filter - } - acc[cur[0]] = cur[1]; // add - return acc; - }, {}); - }); - }, - [setValue] - ); - - const hasToken = useCallback( - (currency: IToken): boolean => { - if (currency.address === "TRON") return false; - if (!isAddress(currency.address)) { - throw new Error("Invalid address"); - } - - return !!value[currency.address]; - }, - [value] - ); - - const addOrRemoveToken = useCallback( - (type: "add" | "remove", currency: IToken[]) => { - if (type === "add") addCustomToken(currency); - if (type === "remove") removeCustomToken(currency[0]); - }, - [addCustomToken, removeCustomToken] - ); - - return useMemo(() => { - return { - customTokens: hydrate(value), - addOrRemoveToken, - hasToken, - }; - }, [hydrate, addOrRemoveToken, hasToken, value]); -}; diff --git a/apps/tron/src/hooks/useIsContract.ts b/apps/tron/src/hooks/useIsContract.ts deleted file mode 100644 index ecc7464f17..0000000000 --- a/apps/tron/src/hooks/useIsContract.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { isContract } from "src/utils/helpers"; -import { useTronWeb } from "./useTronWeb"; -import { useQuery } from "@tanstack/react-query"; - -export const useIsContract = ({ address }: { address: string | null | undefined }) => { - const { tronWeb } = useTronWeb(); - - return useQuery({ - queryKey: ["useIsContract", { address }], - queryFn: async () => { - if (!address) return false; - return await isContract(tronWeb, address); - }, - enabled: !!address && !!tronWeb, - refetchOnMount: false, - refetchOnReconnect: false, - refetchOnWindowFocus: false, - }); -}; diff --git a/apps/tron/src/hooks/useMyPositions.ts b/apps/tron/src/hooks/useMyPositions.ts deleted file mode 100644 index 517045608f..0000000000 --- a/apps/tron/src/hooks/useMyPositions.ts +++ /dev/null @@ -1,206 +0,0 @@ -import { useQuery } from "@tanstack/react-query"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { DEFAULT_TOKEN_LIST, TRON } from "src/constants/token-list"; -import { getAllPairAddresses } from "src/lib/getAllPairAddresses"; -import { IReserveDataResponse } from "src/types/get-pools-type"; -import { IToken } from "src/types/token-type"; -import { sortTokenAddresses } from "src/utils/formatters"; -import { chunk, flatten, getValidTokenAddress, isAddress } from "src/utils/helpers"; - -type IPairDataResponse = { - data: { - tron: { - transfers: { - currency: { - address: string; - decimals: number; - name: string; - symbol: string; - }; - txHash: string; - receiver: { - address: string; - }; - }[]; - }; - }; -}; - -type _IPools = { - token0: IToken; - token1: IToken; - pairAddress: string; - reserve0: string; - reserve1: string; -}[]; - -const getPairContributions = async ({ - pairAddresses, - walletAddress, -}: { - pairAddresses: string[]; - walletAddress: string; -}) => { - try { - const res = await fetch( - `/api/pools/my-positions?pairAddresses=${pairAddresses}&walletAddress=${walletAddress}`, - { method: "GET" } - ); - if (!res.ok) { - throw new Error("Failed to fetch data from my-positions API"); - } - const data: IPairDataResponse | undefined = await res.json(); - - if (!data?.data?.tron.transfers) return []; - const groupedData = data?.data?.tron.transfers.reduce( - (acc, curr) => { - if (!acc[curr.txHash]) { - acc[curr.txHash] = []; - } - - acc[curr.txHash].push({ - currency: curr.currency, - receiver: curr.receiver.address, - }); - return acc; - }, - {} as Record< - string, - { - currency: { - address: string; - decimals: number; - name: string; - symbol: string; - }; - receiver: string; - }[] - > - ); - if (!groupedData) return []; - - const groupedDataArray = Object.entries(groupedData).map(([txHash, data]) => { - const [token0, token1] = sortTokenAddresses( - data?.[0]?.currency?.address ?? getValidTokenAddress(TRON.address), - data?.[1]?.currency?.address ?? getValidTokenAddress(TRON.address) - ); - const pairAddress = data?.[0]?.receiver as string; - - //if token0 or token1 is equal to pairAddress, skip this pair - if (token0 === pairAddress || token1 === pairAddress) { - return; - } - - const _token0: IToken = { - address: token0, - decimals: data.find((i) => i?.currency?.address === token0)?.currency?.decimals ?? TRON.decimals, - name: data.find((i) => i.currency.address === token0)?.currency.name ?? TRON.name, - symbol: data.find((i) => i.currency.address === token0)?.currency.symbol ?? TRON.symbol, - logoURI: - DEFAULT_TOKEN_LIST.find((i) => getValidTokenAddress(i.address) === getValidTokenAddress(token0)) - ?.logoURI ?? undefined, - }; - const _token1: IToken = { - address: token1, - decimals: data.find((i) => i.currency.address === token1)?.currency.decimals ?? TRON.decimals, - name: data.find((i) => i.currency.address === token1)?.currency.name ?? TRON.name, - symbol: data.find((i) => i.currency.address === token1)?.currency.symbol ?? TRON.symbol, - logoURI: - DEFAULT_TOKEN_LIST.find((i) => getValidTokenAddress(i.address) === getValidTokenAddress(token1)) - ?.logoURI ?? undefined, - }; - return { - token0: _token0, - token1: _token1, - pairAddress: pairAddress, - reserve0: "0", - reserve1: "0", - }; - }); - // //filter out all objects that have duplicate pair addresses or are undefined - const filteredDataArray = groupedDataArray.filter( - (v, i, a) => v && a.findIndex((t) => t?.pairAddress === v.pairAddress) === i - ); - - return filteredDataArray; - } catch (error) { - console.log(error); - return []; - } -}; - -const injectReserves = async (pools: _IPools) => { - try { - const chunkedPools = chunk(pools, 100); - const poolsCopy = [...pools]; - - for (const chunk of chunkedPools) { - const pairAddresses = chunk.map((pool) => pool.pairAddress); - const res = await fetch(`/api/pools/get-reserves?pairAddresses=${pairAddresses}`, { method: "GET" }); - if (!res.ok) { - throw new Error("Failed to fetch data from Tron API"); - } - const data: IReserveDataResponse | undefined = await res.json(); - if (!data) return []; - // find the reserves in the data and inject them into the pool object by pairAddress - - for (const pool of chunk) { - const reserveData = data?.data?.tron.smartContractEvents.find( - (event) => - event?.smartContract?.address?.address?.toLowerCase() === pool?.pairAddress?.toLowerCase() - ); - - if (reserveData) { - const reserve0 = reserveData.arguments.find((arg) => arg.argument === "reserve0")?.value ?? "0"; - const reserve1 = reserveData.arguments.find((arg) => arg.argument === "reserve1")?.value ?? "0"; - - const _pool = poolsCopy.find((p) => p.pairAddress === pool.pairAddress); - if (_pool) { - _pool.reserve0 = reserve0; - _pool.reserve1 = reserve1; - } - } - } - } - return poolsCopy; - } catch (error) { - console.log(error); - return []; - } -}; - -export const useMyPositions = () => { - const { address } = useWallet(); - return useQuery({ - queryKey: ["useMyPositions", { address: address }], - queryFn: async (data) => { - if (!address) return []; - if (!isAddress(address)) return []; - const allPairs = await getAllPairAddresses(); - //split allPairs into chunks of 100 - const chunkedPairs = chunk(allPairs, 100); - //get pair contributions for each chunk - let _result = []; - for (const chunk of chunkedPairs) { - const _data = await getPairContributions({ - pairAddresses: chunk.map((pair) => pair.pairAddress), - walletAddress: address, - }); - _result.push(_data); - } - const pools = flatten(_result); - if (!pools || pools?.length === 0) { - return []; - } - console.log({ pools }); - const poolsWithReserves = await injectReserves(pools as _IPools); - - return poolsWithReserves; - }, - - enabled: !!address, - refetchOnMount: false, - refetchOnWindowFocus: false, - refetchOnReconnect: false, - }); -}; diff --git a/apps/tron/src/hooks/useNativeBalance.ts b/apps/tron/src/hooks/useNativeBalance.ts deleted file mode 100644 index 8a3514e071..0000000000 --- a/apps/tron/src/hooks/useNativeBalance.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { useQuery } from "@tanstack/react-query"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { useTronWeb } from "./useTronWeb"; - -export const useNativeBalance = () => { - const { address } = useWallet(); - const { tronWeb } = useTronWeb(); - return useQuery({ - queryKey: ["useNativeBalance"], - queryFn: async () => { - const balance = await tronWeb.trx.getUnconfirmedBalance(address); - const formattedBalance = tronWeb.fromSun(balance); - return { balance, formattedBalance }; - }, - refetchOnMount: true, - refetchOnWindowFocus: true, - enabled: !!address && !!tronWeb, - }); -}; diff --git a/apps/tron/src/hooks/usePairContract.ts b/apps/tron/src/hooks/usePairContract.ts deleted file mode 100644 index d0bffee8ce..0000000000 --- a/apps/tron/src/hooks/usePairContract.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { useMemo } from "react"; -import { useTronWeb } from "./useTronWeb"; -import { sortTokenAddresses } from "src/utils/formatters"; -import { useQuery } from "@tanstack/react-query"; -import { FACTORY_CONTRACT } from "src/constants/contracts"; -import { getBase58Address, getValidTokenAddress } from "src/utils/helpers"; -import { FACTORY_ABI } from "src/constants/abis/factory-abi"; - -export const usePairContract = ({ - token0Address, - token1Address, -}: { - token0Address: string | undefined; - token1Address: string | undefined; -}) => { - const { tronWeb } = useTronWeb(); - const [token0, token1] = useMemo(() => { - if (!token0Address || !token1Address) return [undefined, undefined]; - return sortTokenAddresses(getValidTokenAddress(token0Address), getValidTokenAddress(token1Address)); - }, [token0Address, token1Address]); - return useQuery({ - queryKey: ["usePairContract", { token0Address, token1Address }], - queryFn: async () => { - if (!token0 || !token1 || !tronWeb) return null; - if (token0 === token1) return null; - tronWeb.setAddress(FACTORY_CONTRACT); - const factoryContract = await tronWeb.contract(FACTORY_ABI, FACTORY_CONTRACT); - const pairAddress: string | undefined = await factoryContract.getPair(token0, token1).call(); - if (!pairAddress) return null; - return getBase58Address(pairAddress); - }, - enabled: !!token0 && !!token1 && !!tronWeb, - refetchOnMount: false, - refetchOnReconnect: false, - refetchOnWindowFocus: false, - }); -}; diff --git a/apps/tron/src/hooks/usePoolOwnership.tsx b/apps/tron/src/hooks/usePoolOwnership.tsx deleted file mode 100644 index 144b91498e..0000000000 --- a/apps/tron/src/hooks/usePoolOwnership.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { useTronWeb } from "./useTronWeb"; -import { useQuery } from "@tanstack/react-query"; -import { useWallet } from "@tronweb3/tronwallet-adapter-react-hooks"; -import { PAIR_ABI } from "../constants/abis/pair-abi"; -import { isAddress } from "../utils/helpers"; - -export const usePoolOwnership = ({ pairAddress }: { pairAddress: string | undefined | null }) => { - const { tronWeb } = useTronWeb(); - const { address } = useWallet(); - - return useQuery({ - queryKey: ["usePoolOwnership", { pairAddress }], - queryFn: async () => { - if (!pairAddress || !tronWeb || !isAddress(pairAddress) || !address || !isAddress(address)) { - return { ownership: "0", ownedSupply: "0" }; - } - tronWeb.setAddress(pairAddress); - const pairInstance = await tronWeb.contract(PAIR_ABI, pairAddress); - const totalSupply = await pairInstance.totalSupply().call(); - const ownedSupply = await pairInstance.balanceOf(address).call(); - - const ownership = (ownedSupply / totalSupply).toString(); - - return { ownership, ownedSupply: ownedSupply.toString() }; - }, - enabled: !!address && isAddress(address) && !!pairAddress && isAddress(pairAddress) && !!tronWeb, - }); -}; diff --git a/apps/tron/src/hooks/usePools.ts b/apps/tron/src/hooks/usePools.ts deleted file mode 100644 index bf7c8469e1..0000000000 --- a/apps/tron/src/hooks/usePools.ts +++ /dev/null @@ -1,153 +0,0 @@ -import { useQuery } from "@tanstack/react-query"; -import { FACTORY_CONTRACT } from "src/constants/contracts"; -import { IPoolDataResponse, IReserveDataResponse } from "src/types/get-pools-type"; -import { useTronWeb } from "./useTronWeb"; -import { chunk } from "src/utils/helpers"; - -type _IPools = { - token0Address: string; - token1Address: string; - pairAddress: string; - reserve0: string; - reserve1: string; -}[]; - -const getPoolsByEvent = async ({ factoryAddress }: { factoryAddress: string }): Promise<_IPools> => { - try { - const res = await fetch(`/api/pools?factoryAddress=${factoryAddress}`, { method: "GET" }); - if (!res.ok) { - throw new Error("Failed to fetch data from Tron API"); - } - const data: IPoolDataResponse | undefined = await res.json(); - if (!data) return []; - - const cleanedData = data?.data?.tron.smartContractEvents.map((event) => { - const pairAddress = event.arguments.find((arg) => arg.argument === "pair")?.value ?? ""; - const token0Address = event.arguments.find((arg) => arg.argument === "token0")?.value ?? ""; - const token1Address = event.arguments.find((arg) => arg.argument === "token1")?.value ?? ""; - - return { - pairAddress, - token0Address, - token1Address, - reserve0: "0", - reserve1: "0", - }; - }); - - return cleanedData; - } catch (error) { - console.log(error); - return []; - } -}; - -const injectReserves = async (pools: _IPools) => { - try { - const chunkedPools = chunk(pools, 100); - const poolsCopy = [...pools]; - - for (const chunk of chunkedPools) { - const pairAddresses = chunk.map((pool) => pool.pairAddress); - const res = await fetch(`/api/pools/get-reserves?pairAddresses=${pairAddresses}`, { method: "GET" }); - if (!res.ok) { - throw new Error("Failed to fetch data from Tron API"); - } - const data: IReserveDataResponse | undefined = await res.json(); - if (!data) return []; - // find the reserves in the data and inject them into the pool object by pairAddress - - for (const pool of chunk) { - const reserveData = data?.data?.tron.smartContractEvents.find( - (event) => event.smartContract.address.address.toLowerCase() === pool.pairAddress.toLowerCase() - ); - - if (reserveData) { - const reserve0 = reserveData.arguments.find((arg) => arg.argument === "reserve0")?.value ?? "0"; - const reserve1 = reserveData.arguments.find((arg) => arg.argument === "reserve1")?.value ?? "0"; - - // Find the corresponding pool in the original array and update its reserve0 and reserve1 properties - const originalPool = poolsCopy.find((p) => p.pairAddress === pool.pairAddress); - if (originalPool) { - originalPool.reserve0 = reserve0; - originalPool.reserve1 = reserve1; - } - } - } - } - - return poolsCopy; - } catch (error) { - console.log(error); - return pools; - } -}; -export const usePools = () => { - const { tronWeb } = useTronWeb(); - return useQuery({ - queryKey: ["usePools"], - staleTime: Infinity, //TODO: remove after testing - queryFn: async () => { - if (!tronWeb) return []; - const pools = await getPoolsByEvent({ factoryAddress: FACTORY_CONTRACT }); - const _pools = await injectReserves(pools); - - return _pools; - }, - keepPreviousData: true, - enabled: !!tronWeb, - refetchOnMount: false, - refetchOnWindowFocus: false, - refetchOnReconnect: false, - }); -}; - -// const multicallAddress = "TGXuuKAb4bnrn137u39EKbYzKNXvdCes98"; -// tronWeb.setAddress(multicallAddress); -// const multicall = await tronWeb.contract(TRON_MULTICALL_ABI, multicallAddress); - -// //loop through all the pools and get the reserves in chunks so the tron vm doesn't timeout -// //TODO: find way to optimize this so the user isnt waiting so long - -// const chunkSize = 20; -// const chunkedPools = chunk(_pools, chunkSize); - -// let chunkIndex = 0; - -// while (chunkIndex < chunkedPools.length) { -// try { -// const pools = chunkedPools[chunkIndex]; -// const calls = pools.map((pool) => { -// return [ -// pool.pairAddress, -// "0x0902f1ac", //getReserves encoded -// ]; -// }); - -// const _multicallReturn = await multicall.aggregate(calls).call(); -// const { returnData } = _multicallReturn; - -// for (let i = 0; i < returnData.length; i++) { -// const decoded = ethers.utils.defaultAbiCoder.decode( -// ["uint112", "uint112", "uint32"], -// returnData[i] -// ); -// const _reserve0 = decoded[0].toString(); -// const _reserve1 = decoded[1].toString(); - -// //add the reserves to the pool object with the pair address as the key -// const pool = _pools.find( -// (pool) => getBase58Address(pool.pairAddress) === getBase58Address(calls[i][0]) -// ); -// if (pool) { -// pool.reserve0 = _reserve0; -// pool.reserve1 = _reserve1; -// } -// } - -// chunkIndex++; // Move to the next chunk only if the current chunk was processed successfully -// } catch (error) { -// console.error(`Error processing chunk ${chunkIndex}: ${error}`); -// // If a CPU timeout error occurred, the while loop will retry processing the current chunk -// } -// } diff --git a/apps/tron/src/hooks/usePriceImpact.ts b/apps/tron/src/hooks/usePriceImpact.ts deleted file mode 100644 index 77a075b0c8..0000000000 --- a/apps/tron/src/hooks/usePriceImpact.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { useTronWeb } from "./useTronWeb"; -import { useQuery } from "@tanstack/react-query"; -import { IReserves, IToken } from "src/types/token-type"; -import { parseUnits, toBigNumber } from "src/utils/formatters"; -import { getValidTokenAddress, isAddress } from "src/utils/helpers"; - -const calculatePriceImpact = ({ - initialReserve0, - initialReserve1, - tokenAmount0, -}: { - initialReserve0: any; - initialReserve1: any; - tokenAmount0: any; -}): number => { - const k = initialReserve0.times(initialReserve1); // Constant product - const newReserveX = initialReserve0.plus(tokenAmount0); // Updated reserve of token X - const newReserveY = k.div(newReserveX); // Updated reserve of token Y using constant product formula - const receivedTokenY = initialReserve1.minus(newReserveY); // Amount of token Y received - const priceImpact = receivedTokenY.div(newReserveY).times(toBigNumber(100)); // Price impact percentage - return Number(priceImpact); -}; -export const usePriceImpact = ({ - amount, - token, - reserves, -}: { - amount: string; - token: IToken; - reserves: IReserves[] | undefined; -}) => { - const { tronWeb } = useTronWeb(); - - return useQuery({ - queryKey: ["usePriceImpact", { reserves, token, amount }], - queryFn: async () => { - if (!reserves || !token || !amount) return 0; - - const reserve0 = reserves?.find( - (reserve) => getValidTokenAddress(reserve.address as string) === getValidTokenAddress(token.address) - ); - const reserve1 = reserves?.find( - (reserve) => getValidTokenAddress(reserve.address as string) !== getValidTokenAddress(token.address) - ); - if (!reserve0 || !reserve1) return 0; - - const priceImpactPercentage = calculatePriceImpact({ - initialReserve0: toBigNumber(reserve0.reserve ?? ""), - initialReserve1: toBigNumber(reserve1.reserve ?? ""), - tokenAmount0: toBigNumber(Number(parseUnits(amount, token.decimals))), - }); - - return priceImpactPercentage; - }, - enabled: - !!amount && - !!token && - !!reserves?.[0]?.address && - !!reserves?.[1]?.address && - isAddress(getValidTokenAddress(token?.address)) && - isAddress(getValidTokenAddress(reserves?.[0]?.address)) && - isAddress(getValidTokenAddress(reserves?.[1]?.address)) && - !!tronWeb, - }); -}; diff --git a/apps/tron/src/hooks/useReserves.ts b/apps/tron/src/hooks/useReserves.ts deleted file mode 100644 index 2f435f036e..0000000000 --- a/apps/tron/src/hooks/useReserves.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { useMemo } from "react"; -import { useTronWeb } from "./useTronWeb"; -import { useQuery } from "@tanstack/react-query"; -import { PAIR_ABI } from "src/constants/abis/pair-abi"; -import { IToken } from "src/types/token-type"; -import { sortTokens } from "src/utils/formatters"; -import { isAddress } from "src/utils/helpers"; - -export const useReserves = ({ - pairAddress, - token0, - token1, - refetchInterval = false, -}: { - pairAddress: string | undefined | null; - token0: IToken | undefined; - token1: IToken | undefined; - refetchInterval?: number | false; -}) => { - const { tronWeb } = useTronWeb(); - const [_token0, _token1] = useMemo(() => { - if (!token0 || !token1) return []; - return sortTokens(token0, token1); - }, [token0, token1]); - - return useQuery({ - queryKey: ["useReserves", { pairAddress, token0, token1 }], - queryFn: async () => { - if (!pairAddress || !tronWeb || !isAddress(pairAddress) || !token0 || !token1) return []; - tronWeb.setAddress(pairAddress); - try { - const pairInstance = await tronWeb.contract(PAIR_ABI, pairAddress); - const [reserve0, reserve1] = await pairInstance.getReserves().call(); - //@DEV reserves are returned in order of token0, token1 in the pair contract - return [ - { - ..._token0, - reserve: reserve0.toString() as string, - }, - { ..._token1, reserve: reserve1.toString() as string }, - ]; - } catch (error) { - console.error("useReserves error", error); - return []; - } - }, - enabled: !!pairAddress && isAddress(pairAddress) && !!tronWeb && !!token0 && !!token1, - refetchInterval, - }); -}; diff --git a/apps/tron/src/hooks/useRoutes.ts b/apps/tron/src/hooks/useRoutes.ts deleted file mode 100644 index 38cb8af59a..0000000000 --- a/apps/tron/src/hooks/useRoutes.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { useQuery } from "@tanstack/react-query"; -import { IToken } from "../types/token-type"; -import { useTronWeb } from "./useTronWeb"; -import { INTERMEDIATE_TOKEN } from "src/constants/token-list"; -import { FACTORY_CONTRACT, MULTICALL_CONTRACT } from "src/constants/contracts"; -import { TRON_MULTICALL_ABI } from "src/constants/abis/tron-multicall"; -import { ethers } from "ethers"; -import { getBase58Address, getIfWrapOrUnwrap, getValidTokenAddress, isContract } from "src/utils/helpers"; - -const abi = { - outputs: [{ type: "address" }], - constant: true, - inputs: [{ type: "address" }, { type: "address" }], - name: "getPair", - stateMutability: "View", - type: "Function", -}; - -const functionSignature = "getPair(address,address)"; - -const getPairsToCall = (token0Address: string, token1Address: string, intermediateTokenAddress: string) => { - return [ - { token0Address, token1Address }, - { token0Address, token1Address: intermediateTokenAddress }, - { token0Address: intermediateTokenAddress, token1Address }, - ]; -}; - -export const useRoutes = ({ token0, token1 }: { token0: IToken; token1: IToken }) => { - const { tronWeb } = useTronWeb(); - return useQuery({ - queryKey: ["useRoutes", { token0, token1 }], - queryFn: async () => { - const swapType = getIfWrapOrUnwrap(token0, token1); - if (swapType === "wrap" || swapType === "unwrap") { - return { - pairs: [], - route: [], - }; - } - - const functionSelector = tronWeb.sha3(functionSignature).slice(0, 10); // first 4 bytes - const token0Address = getValidTokenAddress(token0.address); - const token1Address = getValidTokenAddress(token1.address); - const intermediateTokenAddress = INTERMEDIATE_TOKEN.address; - - const pairsToCall = getPairsToCall(token0Address, token1Address, intermediateTokenAddress); - - const calls = pairsToCall.map(({ token0Address, token1Address }) => { - const parameters = tronWeb.utils.abi.encodeParamsV2ByABI(abi, [token0Address, token1Address]); - const callData = functionSelector + parameters.replace(/^0x/, ""); - - return [FACTORY_CONTRACT, callData]; - }); - - tronWeb.setAddress(MULTICALL_CONTRACT); - const multicallInstance = await tronWeb.contract(TRON_MULTICALL_ABI, MULTICALL_CONTRACT); - - const _multicallReturn = await multicallInstance.aggregate(calls).call(); - const { returnData } = _multicallReturn; - - const _pairs: string[] = []; - for (let i = 0; i < returnData.length; i++) { - const pairAddress = ethers.utils.defaultAbiCoder.decode(["address"], returnData[i]); - _pairs.push(getBase58Address(pairAddress?.[0] as string)); - } - - //using multicall, check if there is a direct pair (index 0), if not check if there is a pair with intermediate token (index 1 or 2) - if (await isContract(tronWeb, _pairs?.[0])) { - return { - pairs: [_pairs?.[0]], - route: [token0.address, token1.address], - }; - } - if ((await isContract(tronWeb, _pairs?.[1])) && (await isContract(tronWeb, _pairs?.[2]))) { - return { - pairs: [_pairs?.[1], _pairs?.[2]], - route: [token0.address, INTERMEDIATE_TOKEN.address, token1.address], - }; - } - return { - pairs: [], - route: [], - }; - }, - enabled: !!token0 && !!token1 && !!tronWeb, - refetchOnMount: false, - refetchOnReconnect: false, - refetchOnWindowFocus: false, - }); -}; diff --git a/apps/tron/src/hooks/useSortedTokenList.ts b/apps/tron/src/hooks/useSortedTokenList.ts deleted file mode 100644 index 87fef10604..0000000000 --- a/apps/tron/src/hooks/useSortedTokenList.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { useDebounce } from "@sushiswap/hooks"; -import { useQuery } from "@tanstack/react-query"; -import { IToken } from "src/types/token-type"; -import { filterTokens, getSortedTokensByQuery, tokenComparator } from "src/utils/token-search-helpers"; - -type TokenListParams = { - query: string; - tokenMap: Record | undefined; - customTokenMap: Record | undefined; -}; - -export const useSortedTokenList = ({ query, tokenMap, customTokenMap }: TokenListParams) => { - const debouncedQuery = useDebounce(query, 250); - return useQuery({ - queryKey: ["sortedTokenList", { debouncedQuery, tokenMap, customTokenMap }], - queryFn: async () => { - const tokenMapValues = tokenMap ? Object.values(tokenMap) : []; - const customTokenMapValues = customTokenMap ? Object.values(customTokenMap) : []; - const filteredTokens: IToken[] = filterTokens(tokenMapValues, debouncedQuery); - const filteredCustomTokens: IToken[] = filterTokens(customTokenMapValues, debouncedQuery); - // const sortedTokens - const sortedTokens: IToken[] = [...filteredTokens, ...filteredCustomTokens].sort(tokenComparator()); - const filteredSortedTokens = getSortedTokensByQuery(sortedTokens, debouncedQuery); - return filteredSortedTokens; - }, - keepPreviousData: false, - }); -}; diff --git a/apps/tron/src/hooks/useStablePrice.ts b/apps/tron/src/hooks/useStablePrice.ts deleted file mode 100644 index 6a3c916f02..0000000000 --- a/apps/tron/src/hooks/useStablePrice.ts +++ /dev/null @@ -1,191 +0,0 @@ -import { STABLE_TOKENS, WTRX } from "src/constants/token-list"; -import { IToken } from "../types/token-type"; -import { getToken0Price, getToken1Price, getValidTokenAddress } from "src/utils/helpers"; -import { getAllPairAddresses } from "src/lib/getAllPairAddresses"; -import { IReserveDataResponse } from "src/types/get-pools-type"; -import { getTronPrice } from "src/lib/getTronPrice"; -import { useQuery } from "@tanstack/react-query"; - -type Pair = { - token0Address: string; - token1Address: string; - pairAddress: string; -}[]; - -//USDT -const BEST_STABLE = STABLE_TOKENS.find((token) => token.symbol === "USDT"); - -const getBestStable = (stablePairs: Pair) => { - const bestStable = stablePairs.find( - (pair) => pair.token0Address === BEST_STABLE?.address || pair.token1Address === BEST_STABLE?.address - ); - if (bestStable) { - return bestStable; - } else { - return stablePairs[0]; - } -}; - -const getTokenPrice = async (token: IToken | undefined) => { - //if token is undefined return 0 - if (!token) return "0"; - - //if token in STABLE_TOKENS return 1 - if ( - STABLE_TOKENS.find( - (stableToken) => - getValidTokenAddress(stableToken.address).toLowerCase() === - getValidTokenAddress(token.address).toLowerCase() - ) - ) { - return "1"; - } - //if native coin or WTRX, return native usd price - const isNativeOrWrappedTrx = - getValidTokenAddress(token.address).toLowerCase() === WTRX.address.toLowerCase(); - - if (isNativeOrWrappedTrx) { - const tronInUSDT = await getTronPrice(); - return tronInUSDT.toString(); - } - - const { stablePairs, wtrxPairs } = await getPairsIfItExists(token); - - //if pairs dont exist, return 0 - if (!stablePairs && !wtrxPairs) { - return "0"; - } - - if (stablePairs?.length > 0) { - const pair = getBestStable(stablePairs); - const { reserve0, reserve1 } = await getReserves(pair.pairAddress); - if (token.address === pair.token0Address) { - const token1Data = STABLE_TOKENS.find( - (stableToken) => - getValidTokenAddress(stableToken.address).toLowerCase() === - getValidTokenAddress(pair.token1Address).toLowerCase() - ); - if (!token1Data) return "0"; - - return getToken0Price(reserve0, reserve1, token.decimals, token1Data?.decimals); - } else if (token.address === pair.token1Address) { - const token0Data = STABLE_TOKENS.find( - (stableToken) => - getValidTokenAddress(stableToken.address).toLowerCase() === - getValidTokenAddress(pair.token0Address).toLowerCase() - ); - if (!token0Data) return "0"; - - return getToken1Price(reserve0, reserve1, token0Data?.decimals, token.decimals); - } - } - - // if token0Address or token1Address is WRTX in pair, then use getTronPrice to calculate the price of the other token - if (wtrxPairs?.length > 0) { - const pair = wtrxPairs[0]; - const { reserve0, reserve1 } = await getReserves(pair.pairAddress); - const tronInUSDT = await getTronPrice(); - if (getValidTokenAddress(pair.token0Address).toLowerCase() === WTRX.address.toLowerCase()) { - // token0 is WRTX, so token1 is the other token - const decimals0 = WTRX.decimals; - const decimals1 = token.decimals; - return (Number(getToken1Price(reserve0, reserve1, decimals0, decimals1)) * tronInUSDT).toString(10); - } else if (getValidTokenAddress(pair.token1Address).toLowerCase() === WTRX.address.toLowerCase()) { - // token1 is WRTX, so token0 is the other token - const decimals0 = token.decimals; - const decimals1 = WTRX.decimals; - return (Number(getToken0Price(reserve0, reserve1, decimals0, decimals1)) * tronInUSDT).toString(10); - } - } - - //if exotic pair, a usd price is not available - return "0"; -}; - -const getPairsIfItExists = async (token: IToken) => { - try { - const allPairs = await getAllPairAddresses(); - if (!allPairs) { - return { - stablePairs: undefined, - wtrxPairs: undefined, - }; - } - //find all stable and WRTX pairs that include the token - const stablePairsThatIncludeToken = allPairs.filter( - (pair) => - STABLE_TOKENS.find( - (stableToken) => - getValidTokenAddress(stableToken.address).toLowerCase() === - getValidTokenAddress(pair.token0Address).toLowerCase() || - getValidTokenAddress(stableToken.address).toLowerCase() === - getValidTokenAddress(pair.token1Address).toLowerCase() - ) && - (getValidTokenAddress(pair.token0Address).toLowerCase() === token.address.toLowerCase() || - getValidTokenAddress(pair.token1Address).toLowerCase() === token.address.toLowerCase()) - ); - const wtrxPairsThatIncludeToken = allPairs.filter( - (pair) => - (getValidTokenAddress(pair.token0Address).toLowerCase() === WTRX.address.toLowerCase() || - getValidTokenAddress(pair.token1Address).toLowerCase() === WTRX.address.toLowerCase()) && - (getValidTokenAddress(pair.token0Address).toLowerCase() === token.address.toLowerCase() || - getValidTokenAddress(pair.token1Address).toLowerCase() === token.address.toLowerCase()) - ); - return { - stablePairs: stablePairsThatIncludeToken, - wtrxPairs: wtrxPairsThatIncludeToken, - }; - } catch (error) { - console.log("getPairIfItExists Error: ", error); - return { - stablePairs: undefined, - wtrxPairs: undefined, - }; - } -}; - -const getReserves = async (pairAddress: string) => { - try { - const res = await fetch(`/api/pools/get-reserves?pairAddresses=${[pairAddress]}`, { method: "GET" }); - if (!res.ok) { - throw new Error("Failed to fetch data from Tron API"); - } - const data: IReserveDataResponse | undefined = await res.json(); - if (!data) { - return { - reserve0: "0", - reserve1: "0", - }; - } - return { - reserve0: - data?.data?.tron.smartContractEvents[0].arguments.find((arg) => arg.argument === "reserve0")?.value ?? - "", - reserve1: - data?.data?.tron.smartContractEvents[0].arguments.find((arg) => arg.argument === "reserve1")?.value ?? - "", - }; - } catch (error) { - console.log("getReserves Error: ", error); - return { - reserve0: "0", - reserve1: "0", - }; - } -}; - -export const useStablePrice = ({ token }: { token: IToken | undefined }) => { - return useQuery({ - queryKey: ["useStablePrice", { token: token?.address }], - queryFn: async () => { - const tokenPrice = await getTokenPrice(token); - - return tokenPrice; - }, - keepPreviousData: true, - enabled: !!token, - refetchOnMount: false, - refetchOnWindowFocus: false, - refetchOnReconnect: false, - }); -}; diff --git a/apps/tron/src/hooks/useTokenBalance.ts b/apps/tron/src/hooks/useTokenBalance.ts deleted file mode 100644 index 5ea0740d0c..0000000000 --- a/apps/tron/src/hooks/useTokenBalance.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { useTronWeb } from "./useTronWeb"; -import { useQuery } from "@tanstack/react-query"; - -const abi = [ - { - constant: true, - inputs: [{ internalType: "address", name: "", type: "address" }], - name: "balanceOf", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, -]; - -export const useTokenBalance = ({ - accountAddress, - tokenAddress, -}: { - accountAddress: string | null; - tokenAddress: string | undefined | null; -}) => { - const { tronWeb } = useTronWeb(); - - return useQuery({ - queryKey: ["useTokenBalance", { accountAddress, tokenAddress }], - queryFn: async () => { - if (!accountAddress || !tokenAddress) return "0"; - if (tokenAddress === "TRON") { - const balance = await tronWeb.trx.getUnconfirmedBalance(accountAddress); - return balance?.toString() as string; - } - tronWeb.setAddress(tokenAddress); - const contractInstance = await tronWeb.contract(abi, tokenAddress); - const balanceOf = await contractInstance.balanceOf(accountAddress).call(); - return balanceOf?.toString() as string; - }, - enabled: !!accountAddress && !!tokenAddress && !!tronWeb, - }); -}; diff --git a/apps/tron/src/hooks/useTokenInfo.ts b/apps/tron/src/hooks/useTokenInfo.ts deleted file mode 100644 index e69b9ae23b..0000000000 --- a/apps/tron/src/hooks/useTokenInfo.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { useQuery } from "@tanstack/react-query"; -import { DEFAULT_TOKEN_LIST, TRON, WTRX } from "src/constants/token-list"; -import { getTokenData } from "src/lib/getTokenData"; -import { getValidTokenAddress, isAddress } from "src/utils/helpers"; - -export const useTokenInfo = ({ tokenAddress }: { tokenAddress: string }) => { - return useQuery({ - queryKey: ["useTokenInfo2", { tokenAddress }], - staleTime: Infinity, - queryFn: async () => { - if (tokenAddress === "TRON") { - return TRON; - } - if (tokenAddress.toLowerCase() === WTRX.address.toLowerCase()) { - return WTRX; - } - - if (!isAddress(tokenAddress)) return undefined; - const foundInTokenList = DEFAULT_TOKEN_LIST.find( - (i) => getValidTokenAddress(i.address) === getValidTokenAddress(tokenAddress) - ); - if (foundInTokenList) return foundInTokenList; - - const tokenData = await getTokenData({ contractAddress: tokenAddress }); - - return { - address: tokenAddress, - decimals: Number(tokenData?.decimals ?? 0), - name: tokenData?.name ?? "N/A", - symbol: tokenData?.symbol ?? "N/A", - logoURI: - DEFAULT_TOKEN_LIST.find( - (i) => getValidTokenAddress(i.address) === getValidTokenAddress(tokenAddress) - )?.logoURI ?? undefined, - }; - }, - enabled: !!tokenAddress, - }); -}; diff --git a/apps/tron/src/hooks/useTotalSupply.ts b/apps/tron/src/hooks/useTotalSupply.ts deleted file mode 100644 index fad9fb98c6..0000000000 --- a/apps/tron/src/hooks/useTotalSupply.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { useTronWeb } from "./useTronWeb"; -import { useQuery } from "@tanstack/react-query"; - -const abi = [ - { - constant: true, - inputs: [], - name: "totalSupply", - outputs: [ - { - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, -]; - -export const useTotalSupply = ({ tokenAddress }: { tokenAddress: string | undefined | null }) => { - const { tronWeb } = useTronWeb(); - - return useQuery({ - queryKey: ["useTotalSupply", { tokenAddress }], - queryFn: async () => { - tronWeb.setAddress(tokenAddress); - const contractInstance = await tronWeb.contract(abi, tokenAddress); - const totalSupply = await contractInstance.totalSupply().call(); - return totalSupply?.toString() as string; - }, - enabled: !!tokenAddress && !!tronWeb, - }); -}; diff --git a/apps/tron/src/hooks/useTronWeb.ts b/apps/tron/src/hooks/useTronWeb.ts deleted file mode 100644 index ce8744ba73..0000000000 --- a/apps/tron/src/hooks/useTronWeb.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { useMemo } from "react"; -import { IS_TESTNET } from "src/constants/is-testnet"; -import TronWeb from "tronweb"; - -if (!process.env.NEXT_PUBLIC_TRON_PRO_API_KEY) { - throw new Error("NEXT_PUBLIC_TRON_PRO_API_KEY is not set"); -} - -export const useTronWeb = () => { - const tronWeb = useMemo(() => { - const host = IS_TESTNET ? "https://api.shasta.trongrid.io/" : "https://api.trongrid.io/"; - return new TronWeb({ - fullHost: host, - - headers: { "TRON-PRO-API-KEY": process.env.NEXT_PUBLIC_TRON_PRO_API_KEY }, - }); - }, []); - return { tronWeb }; -}; diff --git a/apps/tron/src/hooks/useWalletAdapters.ts b/apps/tron/src/hooks/useWalletAdapters.ts deleted file mode 100644 index 6d491431ad..0000000000 --- a/apps/tron/src/hooks/useWalletAdapters.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { TronLinkAdapter, WalletConnectAdapter } from "@tronweb3/tronwallet-adapters"; -import { useMemo } from "react"; -import { IS_TESTNET } from "src/constants/is-testnet"; - -export const useWalletAdapters = () => { - const adapters = useMemo(() => { - return [ - new TronLinkAdapter({ dappName: "SushiSwap on Tron" }), - new WalletConnectAdapter({ - network: IS_TESTNET ? "Shasta" : "Mainnet", - //TODO: Get real prjoect ID from sushi team - options: { projectId: "74b1794741f5f9376c04ca8af64705d8" }, - }), - ]; - }, []); - return { adapters }; -}; diff --git a/apps/tron/src/lib/getAllPairAddresses.ts b/apps/tron/src/lib/getAllPairAddresses.ts deleted file mode 100644 index b7e6ef8ede..0000000000 --- a/apps/tron/src/lib/getAllPairAddresses.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { FACTORY_CONTRACT } from "src/constants/contracts"; -import { IPoolDataResponse } from "src/types/get-pools-type"; - -export const getAllPairAddresses = async () => { - try { - const res = await fetch(`/api/pools?factoryAddress=${FACTORY_CONTRACT}`, { method: "GET" }); - if (!res.ok) { - throw new Error("Failed to fetch data from Tron API"); - } - const data: IPoolDataResponse | undefined = await res.json(); - - const cleanedData = data?.data?.tron.smartContractEvents.map((event) => { - const pairAddress = event.arguments.find((arg) => arg.argument === "pair")?.value ?? ""; - const token0Address = event.arguments.find((arg) => arg.argument === "token0")?.value ?? ""; - const token1Address = event.arguments.find((arg) => arg.argument === "token1")?.value ?? ""; - - return { - token0Address, - token1Address, - pairAddress, - }; - }); - if (!cleanedData) return []; - - return cleanedData; - } catch (error) { - console.log(error); - return []; - } -}; diff --git a/apps/tron/src/lib/getTokenData.ts b/apps/tron/src/lib/getTokenData.ts deleted file mode 100644 index 9a394544d7..0000000000 --- a/apps/tron/src/lib/getTokenData.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ITokenDataResponse } from "src/types/token-type"; - -export const getTokenData = async ({ contractAddress }: { contractAddress: string }) => { - try { - const res = await fetch(`/api/token-info?contractAddress=${contractAddress}`, { method: "GET" }); - if (!res.ok) { - throw new Error("Failed to fetch data from Tron API"); - } - const data: ITokenDataResponse | undefined = await res.json(); - - const cleanedData = { - decimals: data?.data?.tron.address[0].smartContract.currency.decimals ?? 0, - name: data?.data?.tron.address[0].smartContract.currency.name ?? "N/A", - symbol: data?.data?.tron.address[0].smartContract.currency.symbol ?? "N/A", - }; - return cleanedData; - } catch (error) { - console.log(error); - return undefined; - } -}; diff --git a/apps/tron/src/lib/getTronPrice.ts b/apps/tron/src/lib/getTronPrice.ts deleted file mode 100644 index 97b7274d00..0000000000 --- a/apps/tron/src/lib/getTronPrice.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { ITronInUSDTResponse } from "src/types/pricing-types"; - -export const getTronPrice = async () => { - try { - const res = await fetch(`/api/pricing`, { method: "GET" }); - if (!res.ok) { - throw new Error("Failed to fetch data from Tron API"); - } - const data: ITronInUSDTResponse | undefined = await res.json(); - if (!data) return 0; - - const cleanedQuotePrice = data?.data?.tron.dexTrades[0]?.quotePrice ?? 0; - return cleanedQuotePrice; - } catch (error) { - console.log("getTronPrice Error: ", error); - return 0; - } -}; diff --git a/apps/tron/src/tronweb.d.ts b/apps/tron/src/tronweb.d.ts deleted file mode 100644 index 21b02562ad..0000000000 --- a/apps/tron/src/tronweb.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module "tronweb"; diff --git a/apps/tron/src/types/get-pools-type.ts b/apps/tron/src/types/get-pools-type.ts deleted file mode 100644 index 8ea87390bd..0000000000 --- a/apps/tron/src/types/get-pools-type.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { IToken } from "./token-type"; - -export type IPoolData = { - token0Address: string; - token1Address: string; - pairAddress: string; -}[]; - -export type IPoolDataResponse = { - data: { - tron: { - smartContractEvents: { - arguments: [ - { - argument: "token0"; - value: string; - }, - { - argument: "token1"; - value: string; - }, - { - argument: "pair"; - value: string; - }, - { - argument: ""; - value: string; - } - ]; - block: { - height: number; - }; - }[]; - }; - }; -}; - -export type IMyPositionData = { - token0: IToken | undefined; - token1: IToken | undefined; - pairAddress: string | undefined; -}; - -export type IReserveDataResponse = { - data: { - tron: { - smartContractEvents: { - arguments: [ - { - argument: "reserve0"; - value: string; - }, - { - argument: "reserve1"; - value: string; - } - ]; - block: { - height: number; - }; - smartContract: { - address: { - address: string; - }; - }; - }[]; - }; - }; -}; diff --git a/apps/tron/src/types/pricing-types.ts b/apps/tron/src/types/pricing-types.ts deleted file mode 100644 index 8d193af058..0000000000 --- a/apps/tron/src/types/pricing-types.ts +++ /dev/null @@ -1,23 +0,0 @@ -export type ITronInUSDTResponse = { - data: { - tron: { - dexTrades: [ - { - block: { - timestamp: { - time: string; - // 2024-05-31 15:52:36 in this format - }; - }; - baseCurrency: { - address: "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR"; - }; - quoteCurrency: { - address: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"; - }; - quotePrice: number; - } - ]; - }; - }; -}; diff --git a/apps/tron/src/types/router-selector-type.ts b/apps/tron/src/types/router-selector-type.ts deleted file mode 100644 index ebf2e2ef7c..0000000000 --- a/apps/tron/src/types/router-selector-type.ts +++ /dev/null @@ -1,19 +0,0 @@ -export type IRouterFunctionSelector = - | "swapExactETHForTokens(uint256,address[],address,uint256)" - | "swapETHForExactTokens(uint256,address[],address,uint256)" - | "swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)" - | "swapExactTokensForETH(uint256,uint256,address[],address,uint256)" - | "swapTokensForExactETH(uint256,uint256,address[],address,uint256)" - | "swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)" - | "swapExactTokensForTokens(uint256,uint256,address[],address,uint256)" - | "swapTokensForExactTokens(uint256,uint256,address[],address,uint256)" - | "swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)"; - -export type IRouterLiquidityFunctionSelector = - | "addLiquidityETH(address,uint256,uint256,uint256,address,uint256)" - | "addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)"; - -export type IRouterRemoveLiquidityFunctionSelector = - | "removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)" - | "removeLiquidityETHSupportingFeeOnTransferTokens(address,uint256,uint256,uint256,address,uint256)" - | "removeLiquidity(address,address,uint256,uint256,uint256,address,uint256)"; diff --git a/apps/tron/src/types/token-type.ts b/apps/tron/src/types/token-type.ts deleted file mode 100644 index 6f29968135..0000000000 --- a/apps/tron/src/types/token-type.ts +++ /dev/null @@ -1,34 +0,0 @@ -export type IToken = { - address: string; - decimals: number; - logoURI?: string; - name: string; - symbol: string; -}; - -export type IReserves = { - reserve: string; - address?: string | undefined; - decimals?: number | undefined; - logoURI?: string | undefined; - name?: string | undefined; - symbol?: string | undefined; -}; - -export type ITokenDataResponse = { - data: { - tron: { - address: [ - { - smartContract: { - currency: { - decimals: number; - name: string; - symbol: string; - }; - }; - } - ]; - }; - }; -}; diff --git a/apps/tron/src/utils/formatters.ts b/apps/tron/src/utils/formatters.ts deleted file mode 100644 index e35aa2f4ac..0000000000 --- a/apps/tron/src/utils/formatters.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { IToken } from "src/types/token-type"; -import TronWeb from "tronweb"; -import { getValidTokenAddress } from "./helpers"; - -export const truncateText = (str: string | `0x${string}`, n = 5): string => { - if (str) { - if (str.length <= n) { - return str; - } - return `${str.slice(0, n)}...${str.slice(str.length - n)}`; - } - return ""; -}; - -export const hashStringToColor = (str: string) => { - const hash = _djb2(str); - const r = (hash & 0xff0000) >> 16; - const g = (hash & 0x00ff00) >> 8; - const b = hash & 0x0000ff; - return ( - "#" + - ("0" + r.toString(16)).substr(-2) + - ("0" + g.toString(16)).substr(-2) + - ("0" + b.toString(16)).substr(-2) - ); -}; - -const _djb2 = (str: string) => { - let hash = 5381; - for (let i = 0; i < str.length; i++) { - hash = (hash << 5) + hash + str.charCodeAt(i); /* hash * 33 + c */ - } - return hash; -}; - -export const sortTokenAddresses = (token0: string, token1: string): [string, string] => { - return token0.toLowerCase() < token1.toLowerCase() ? [token0, token1] : [token1, token0]; -}; - -export const sortTokens = (token0: IToken, token1: IToken): [IToken, IToken] => { - return getValidTokenAddress(token0.address).toLowerCase() < - getValidTokenAddress(token1.address).toLowerCase() - ? [token0, token1] - : [token1, token0]; -}; - -export const formatUnits = (amount: string | number, decimals: number, maxDecimals?: number): string => { - if (isNaN(Number(amount))) { - return "0"; - } - const val = TronWeb.toBigNumber(amount).div(10 ** decimals); - if (Number(val) < 0.0001) { - return "<0.0001"; - } - if (maxDecimals) { - return toBigNumber(parseFloat(val.toFixed(maxDecimals)).toString()).toString(10); - } - return toBigNumber(parseFloat(val.toFixed(decimals)).toString()).toString(10); -}; - -export const formatUnitsForInput = (amount: string | number, decimals: number): string => { - if (isNaN(Number(amount))) { - return "0"; - } - - const _decimals = toBigNumber(10).pow(decimals); - - const val = TronWeb.toBigNumber(amount).div(_decimals); - if (isNaN(val)) { - return "0"; - } - - return toBigNumber(parseFloat(val.toFixed(decimals)).toString()).toString(10); -}; - -export const parseUnits = (amount: string | number, decimals: number): string => { - if (isNaN(Number(amount))) { - return "0"; - } - - const val = TronWeb.toBigNumber(amount) - .times(10 ** decimals) - .toString(10); - - if (!toBigNumber(val).isInteger()) { - return toBigNumber(val) - .toFormat(0, { groupSeparator: "", decimalSeparator: ".", padFractionalPart: false }) - .toString(10); - } - - return val; -}; - -export const toBigNumber = (amount: string | number) => { - return TronWeb.toBigNumber(amount); -}; - -export const removeDecimals = (amount: string | number): string => { - const val = TronWeb.toBigNumber(amount); - if (!toBigNumber(val).isInteger()) { - return toBigNumber(val) - .toFormat(0, { groupSeparator: "", decimalSeparator: ".", padFractionalPart: false }) - .toString(10); - } - return val.toString(10); -}; diff --git a/apps/tron/src/utils/helpers.ts b/apps/tron/src/utils/helpers.ts deleted file mode 100644 index 0564d11031..0000000000 --- a/apps/tron/src/utils/helpers.ts +++ /dev/null @@ -1,512 +0,0 @@ -import { ROUTER_CONTRACT } from "src/constants/contracts"; -import { DEFAULT_TOKEN_LIST } from "src/constants/token-list"; -import { - IRouterFunctionSelector, - IRouterLiquidityFunctionSelector, - IRouterRemoveLiquidityFunctionSelector, -} from "src/types/router-selector-type"; -import { IToken } from "src/types/token-type"; -import TronWeb from "tronweb"; - -export const isAddress = (address: string): boolean => { - if (!address) return false; - return TronWeb.isAddress(address); -}; - -export const getValidTokenAddress = (address: string): string => { - let _tokenAddress = address; - if (address === "TRON") { - _tokenAddress = DEFAULT_TOKEN_LIST.find((token) => token.symbol === "WTRX")?.address as string; - } - return _tokenAddress; -}; - -export const getBase58Address = (address: string): string => { - return TronWeb.address.fromHex(address); -}; - -export const getHexAddress = (address: string): string => { - return TronWeb.address.toHex(address); -}; - -export const chunk = (arr: T[], chunkSize: number): T[][] => { - return Array.from({ length: Math.ceil(arr.length / chunkSize) }, (_, i) => - arr.slice(i * chunkSize, i * chunkSize + chunkSize) - ); -}; - -export const flatten = (arr: T[][]): T[] => { - return arr.flat(); -}; - -export const chunkAndFlatten = (arr: T[], chunkSize: number): T[] => { - const chunked = chunk(arr, chunkSize); - return flatten(chunked); -}; - -export const timer = (ms: number) => new Promise((res) => setTimeout(res, ms)); - -export const getToken0Price = ( - reserve0Amount: string, - reserve1Amount: string, - reserve0Decimals: number, - reserve1Decimals: number -): string => { - const reserve0 = TronWeb.toBigNumber(reserve0Amount).div(10 ** reserve0Decimals); - const reserve1 = TronWeb.toBigNumber(reserve1Amount).div(10 ** reserve1Decimals); - return reserve1.div(reserve0).toString(10); -}; - -export const getToken1Price = ( - reserve0Amount: string, - reserve1Amount: string, - reserve0Decimals: number, - reserve1Decimals: number -): string => { - const reserve0 = TronWeb.toBigNumber(reserve0Amount).div(10 ** reserve0Decimals); - const reserve1 = TronWeb.toBigNumber(reserve1Amount).div(10 ** reserve1Decimals); - return reserve0.div(reserve1).toString(10); -}; - -export const getToken0AmountForLiquidity = ( - token1Amount: string, - reserve0: string, - reserv1: string -): string => { - //@DEV parseUnits for token1Amount - const token1 = TronWeb.toBigNumber(token1Amount); - const reserve0BN = TronWeb.toBigNumber(reserve0); - const reserve1BN = TronWeb.toBigNumber(reserv1); - return token1.times(reserve0BN).div(reserve1BN).toString(10); -}; - -export const getToken1AmountForLiquidity = ( - token0Amount: string, - reserve0: string, - reserv1: string -): string => { - //@DEV parseUnits for token0Amount - const token0 = TronWeb.toBigNumber(token0Amount); - const reserve0BN = TronWeb.toBigNumber(reserve0); - const reserve1BN = TronWeb.toBigNumber(reserv1); - return token0.times(reserve1BN).div(reserve0BN).toString(10); -}; - -export const getIfWrapOrUnwrap = (token0: IToken, token1: IToken): "wrap" | "unwrap" | "swap" => { - if (token0.symbol === "WTRX" && token1.symbol === "TRX") { - return "unwrap"; - } - if (token0.symbol === "TRX" && token1.symbol === "WTRX") { - return "wrap"; - } - return "swap"; -}; - -export const isContract = async (tronWebInstace: any, address: string) => { - const code = await tronWebInstace.trx.getContract(address); - // will be empty object if not a contract - return "contract_address" in code; -}; - -export const parseTxnError = (error: string): string => { - console.log("parseTxnError: ", error); - switch (error) { - case "CONTRACT_VALIDATE_ERROR": - return "Insufficient TRX balance"; - - default: - return "An error occurred while processing the transaction."; - } -}; - -//TODO: Add type for transactionInfo -export const getTransactionInfo = async ( - tronWebInstance: any, - txId: string, - waitIntervalMs: number = 6000, - maxTries: number = 15 -) => { - //avg txn is 1min till confirmed - let transactionInfo; - for (let i = 0; i < maxTries; i++) { - transactionInfo = await tronWebInstance.trx.getUnconfirmedTransactionInfo(txId); - console.log({ transactionInfo }); - if (transactionInfo && transactionInfo.receipt) { - return transactionInfo; - } - await timer(waitIntervalMs); - } - throw new Error("Transaction not found or timeout reached"); -}; - -//TODO: Add type for result -export const estimateEnergy = async ( - tronWebInstance: any, - contractAddress: string, - functionSelector: string, - option: Record, - paramater: { type: string; value: string }[], - issuerAddress: string -) => { - // console.log("estimateEnergy", contractAddress, functionSelector, option, paramater, issuerAddress); - const data = await tronWebInstance.transactionBuilder.triggerConstantContract( - contractAddress, //contract address - functionSelector, //function name - option, // options - paramater, //parameters - issuerAddress //issuerAddress - ); - - return data; -}; - -//TODO: Add type for result -export const safeGasEstimates = async (tronWebInstance: any, args: any[][]): Promise => { - const safeGasEstimates = await Promise.all( - args.map((i: any) => - //@ts-expect-error - estimateEnergy(tronWebInstance, ...i) - .then((c) => { - return c; - }) - .catch((error) => { - console.error(`estimateEnergy failed`, error); - return undefined; - }) - ) - ); - return safeGasEstimates.sort((a, b) => a?.energy_used - b?.energy_used); -}; - -export const getDeadline = (deadlineInMinutes: number = 20): number => { - const currentTimestamp = Math.floor(Date.now() / 1000); - const bufferTime = deadlineInMinutes * 60; - return Math.floor(currentTimestamp + bufferTime); -}; - -export const getRouterFunctionSelectors = (route: string[]): IRouterFunctionSelector[] => { - const routeHasTron = route.some((address) => address === "TRON"); - if (routeHasTron) { - const token0IsTron = route[0] === "TRON"; - - if (token0IsTron) { - return [ - "swapExactETHForTokens(uint256,address[],address,uint256)", - "swapETHForExactTokens(uint256,address[],address,uint256)", - "swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)", - ]; - } else { - return [ - "swapExactTokensForETH(uint256,uint256,address[],address,uint256)", - "swapTokensForExactETH(uint256,uint256,address[],address,uint256)", - "swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)", - ]; - } - } else { - return [ - "swapExactTokensForTokens(uint256,uint256,address[],address,uint256)", - "swapTokensForExactTokens(uint256,uint256,address[],address,uint256)", - "swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)", - ]; - } -}; - -//TODO: clean this up!! -export const getArgsForSwap = ( - functionSelector: IRouterFunctionSelector, - amountIn: string, - amountOut: string, - amountInMax: string, - amountOutMin: string, - route: string[], - to: string, - deadline: number, - issuerAddress: string -) => { - const cleanedRoute = route.map((address) => getValidTokenAddress(address)); - - switch (functionSelector) { - case "swapETHForExactTokens(uint256,address[],address,uint256)": - return [ - ROUTER_CONTRACT, - functionSelector, - { callValue: amountIn }, - [ - { type: "uint256", value: amountOut }, - { type: "address[]", value: cleanedRoute }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - issuerAddress, - ]; - case "swapExactETHForTokens(uint256,address[],address,uint256)": - return [ - ROUTER_CONTRACT, - functionSelector, - { callValue: amountIn }, - [ - { type: "uint256", value: amountOutMin }, - { type: "address[]", value: cleanedRoute }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - issuerAddress, - ]; - case "swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)": - return [ - ROUTER_CONTRACT, - functionSelector, - { callValue: amountIn }, - [ - { type: "uint256", value: amountOutMin }, - { type: "address[]", value: cleanedRoute }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - issuerAddress, - ]; - case "swapExactTokensForETH(uint256,uint256,address[],address,uint256)": - return [ - ROUTER_CONTRACT, - functionSelector, - {}, - [ - { type: "uint256", value: amountIn }, - { type: "uint256", value: amountOutMin }, - { type: "address[]", value: cleanedRoute }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - issuerAddress, - ]; - case "swapTokensForExactETH(uint256,uint256,address[],address,uint256)": - return [ - ROUTER_CONTRACT, - functionSelector, - {}, - [ - { type: "uint256", value: amountOut }, - { type: "uint256", value: amountInMax }, - { type: "address[]", value: cleanedRoute }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - issuerAddress, - ]; - case "swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)": - return [ - ROUTER_CONTRACT, - functionSelector, - {}, - [ - { type: "uint256", value: amountIn }, - { type: "uint256", value: amountOutMin }, - { type: "address[]", value: cleanedRoute }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - issuerAddress, - ]; - case "swapExactTokensForTokens(uint256,uint256,address[],address,uint256)": - return [ - ROUTER_CONTRACT, - functionSelector, - {}, - [ - { type: "uint256", value: amountIn }, - { type: "uint256", value: amountOutMin }, - { type: "address[]", value: cleanedRoute }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - issuerAddress, - ]; - case "swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)": - return [ - ROUTER_CONTRACT, - functionSelector, - {}, - [ - { type: "uint256", value: amountIn }, - { type: "uint256", value: amountOutMin }, - { type: "address[]", value: cleanedRoute }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - issuerAddress, - ]; - case "swapTokensForExactTokens(uint256,uint256,address[],address,uint256)": - return [ - ROUTER_CONTRACT, - functionSelector, - {}, - [ - { type: "uint256", value: amountOut }, - { type: "uint256", value: amountInMax }, - { type: "address[]", value: cleanedRoute }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - issuerAddress, - ]; - - default: - throw new Error("Invalid function selector"); - } -}; - -export const getLiquidityFunctionSelector = ( - token0: IToken, - token1: IToken -): IRouterLiquidityFunctionSelector => { - if (token0.symbol === "TRX" || token1.symbol === "TRX") { - return "addLiquidityETH(address,uint256,uint256,uint256,address,uint256)"; - } - return "addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)"; -}; - -export const getArgsForAddLiquidity = ( - functionSelector: IRouterLiquidityFunctionSelector, - token0Address: string, - token1Address: string, - amount0Desired: string, - amount1Desired: string, - amount0Min: string, - amount1Min: string, - to: string, //same as issuerAddress - deadline: number -): any[] => { - switch (functionSelector) { - case "addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)": - return [ - ROUTER_CONTRACT, - functionSelector, - {}, - [ - { type: "address", value: token0Address }, - { type: "address", value: token1Address }, - { type: "uint256", value: amount0Desired }, - { type: "uint256", value: amount1Desired }, - { type: "uint256", value: amount0Min }, - { type: "uint256", value: amount1Min }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - to, - ]; - case "addLiquidityETH(address,uint256,uint256,uint256,address,uint256)": - const tokenAddress = token0Address === "TRON" ? token1Address : token0Address; - const tokenAmount = token0Address === "TRON" ? amount1Desired : amount0Desired; - const tokenMinAmount = token0Address === "TRON" ? amount1Min : amount0Min; - const ethAmount = token0Address === "TRON" ? amount0Desired : amount1Desired; - const ethMinAmount = token0Address === "TRON" ? amount0Min : amount1Min; - return [ - ROUTER_CONTRACT, - functionSelector, - { callValue: ethAmount }, - [ - { type: "address", value: tokenAddress }, - { type: "uint256", value: tokenAmount }, - { type: "uint256", value: tokenMinAmount }, - { type: "uint256", value: ethMinAmount }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - to, - ]; - - default: - throw new Error("Invalid function selector"); - } -}; - -export const getRemoveLiquidityFunctionSelector = ( - token0: IToken, - token1: IToken -): IRouterRemoveLiquidityFunctionSelector[] => { - if (token0.symbol === "TRX" || token1.symbol === "TRX") { - return [ - "removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)", - "removeLiquidityETHSupportingFeeOnTransferTokens(address,uint256,uint256,uint256,address,uint256)", - ]; - } - return ["removeLiquidity(address,address,uint256,uint256,uint256,address,uint256)"]; -}; - -export const getArgsForRemoveLiquidity = ( - functionSelector: IRouterRemoveLiquidityFunctionSelector, - token0Address: string, - token1Address: string, - lpToRemove: string, - amountToken0Min: string, - amountToken1Min: string, - to: string, //same as issuerAddress - deadline: number -) => { - switch (functionSelector) { - case "removeLiquidity(address,address,uint256,uint256,uint256,address,uint256)": - return [ - ROUTER_CONTRACT, - functionSelector, - {}, - [ - { type: "address", value: token0Address }, - { type: "address", value: token1Address }, - { type: "uint256", value: lpToRemove }, - { type: "uint256", value: amountToken0Min }, - { type: "uint256", value: amountToken1Min }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - to, - ]; - case "removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)": - const tokenAddress = token0Address === "TRON" ? token1Address : token0Address; - const tokenMinAmount = token0Address === "TRON" ? amountToken1Min : amountToken0Min; - const ethMinAmount = token0Address === "TRON" ? amountToken0Min : amountToken1Min; - return [ - ROUTER_CONTRACT, - functionSelector, - {}, - [ - { type: "address", value: tokenAddress }, - { type: "uint256", value: lpToRemove }, - { type: "uint256", value: tokenMinAmount }, - { type: "uint256", value: ethMinAmount }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - to, - ]; - case "removeLiquidityETHSupportingFeeOnTransferTokens(address,uint256,uint256,uint256,address,uint256)": - const _tokenAddress = token0Address === "TRON" ? token1Address : token0Address; - const _tokenMinAmount = token0Address === "TRON" ? amountToken1Min : amountToken0Min; - const _ethMinAmount = token0Address === "TRON" ? amountToken0Min : amountToken1Min; - return [ - ROUTER_CONTRACT, - functionSelector, - {}, - [ - { type: "address", value: _tokenAddress }, - { type: "uint256", value: lpToRemove }, - { type: "uint256", value: _tokenMinAmount }, - { type: "uint256", value: _ethMinAmount }, - { type: "address", value: to }, - { type: "uint256", value: deadline }, - ], - to, - ]; - } -}; - -export const cleanArgs = (args: any[], feeLimit?: string | number) => { - let _args = args; - if (_args?.[2] && _args?.[2]?._isConstant === true) { - delete _args[2]._isConstant; - } - if (feeLimit) { - _args[2].feeLimit = feeLimit; - } - - return _args; -}; diff --git a/apps/tron/src/utils/token-search-helpers.ts b/apps/tron/src/utils/token-search-helpers.ts deleted file mode 100644 index 56dfe4210b..0000000000 --- a/apps/tron/src/utils/token-search-helpers.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { IToken } from "src/types/token-type"; - -const alwaysTrue = () => true; - -export function createTokenFilterFunction(search: string): (tokens: T) => boolean { - // const isValidAddress = isAddress(search) - - // if (isValidAddress) { - // } - // if ((search.startsWith("0x") && search.length > 65) || search == "0x1::aptos_coin::AptosCoin") { - // return (t: T) => search.toLowerCase() === t.address.toLowerCase(); - // } - - const lowerSearchParts = search - .toLowerCase() - .split(/\s+/) - .filter((s) => s.length > 0); - - if (lowerSearchParts.length === 0) return alwaysTrue; - - const matchesSearch = (s: string): boolean => { - const sParts = s - .toLowerCase() - .split(/\s+/) - .filter((s) => s.length > 0); - - return lowerSearchParts.every( - (p) => p.length === 0 || sParts.some((sp) => sp.startsWith(p) || sp.endsWith(p)) - ); - }; - - return ({ name, symbol }: T): boolean => - Boolean((symbol && matchesSearch(symbol)) || (name && matchesSearch(name))); -} - -export function filterTokens(tokens: T[], search: string): T[] { - return tokens.filter(createTokenFilterFunction(search)); -} - -export const tokenComparator = () => { - return (tokenA: IToken, tokenB: IToken): number => { - if (tokenA.symbol && tokenB.symbol) { - return tokenA.symbol.toLowerCase() < tokenB.symbol.toLowerCase() ? -1 : 1; - } else { - return tokenA.symbol ? -1 : tokenB.symbol ? -1 : 0; - } - }; -}; - -export function getSortedTokensByQuery(tokens: IToken[] | undefined, searchQuery: string): IToken[] { - if (!tokens) { - return []; - } - - if (searchQuery === "") { - return tokens; - } - - const symbolMatch = searchQuery - .toLowerCase() - .split(/\s+/) - .filter((s) => s.length > 0); - - if (symbolMatch.length > 1) { - return tokens; - } - - const exactMatches: IToken[] = []; - const symbolSubstrings: IToken[] = []; - const rest: IToken[] = []; - - // sort tokens by exact match -> subtring on symbol match -> rest - tokens.map((token) => { - if (token.symbol?.toLowerCase() === symbolMatch[0]) { - return exactMatches.push(token); - } else if (token.symbol?.toLowerCase().startsWith(searchQuery.toLowerCase().trim())) { - return symbolSubstrings.push(token); - } else { - return rest.push(token); - } - }); - - return [...exactMatches, ...symbolSubstrings, ...rest]; -} diff --git a/apps/tron/src/utils/tronscan-helpers.ts b/apps/tron/src/utils/tronscan-helpers.ts deleted file mode 100644 index cbeef69b49..0000000000 --- a/apps/tron/src/utils/tronscan-helpers.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { IS_TESTNET } from "src/constants/is-testnet"; - -export const getTronscanAddressLink = (address: string) => { - if (IS_TESTNET) { - return `https://shasta.tronscan.org/#/address/${address}`; - } else { - return `https://tronscan.org/#/address/${address}`; - } -}; - -export const getTronscanTxnLink = (txnHash: string) => { - if (IS_TESTNET) { - return `https://shasta.tronscan.org/#/transaction/${txnHash}`; - } else { - return `https://tronscan.org/#/transaction/${txnHash}`; - } -}; diff --git a/apps/tron/tsconfig.json b/apps/tron/tsconfig.json index 6b99f56a08..44cf5dc322 100644 --- a/apps/tron/tsconfig.json +++ b/apps/tron/tsconfig.json @@ -3,6 +3,9 @@ "baseUrl": ".", "target": "ESNext", "lib": ["DOM", "DOM.Iterable", "ESNext"], + "paths": { + "~tron/*": ["src/app/*"], + }, "allowJs": true, "skipLibCheck": true, "strict": true, diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json index f26cb394a6..a913253245 100644 --- a/apps/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -4,7 +4,8 @@ "target": "ESNext", "lib": ["DOM", "DOM.Iterable", "ESNext"], "paths": { - "~aptos/*": ["src/app/(non-evm)/aptos/*"] + "~aptos/*": ["src/app/(non-evm)/aptos/*"], + "~tron/*": ["src/app/(non-evm)/tron/*"] }, "allowJs": true, "skipLibCheck": true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 54badeeb09..9508f75f84 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -391,6 +391,9 @@ importers: '@sushiswap/nextjs-config': specifier: workspace:* version: link:../../config/nextjs + '@sushiswap/notifications': + specifier: workspace:* + version: link:../../packages/notifications '@sushiswap/react-query': specifier: workspace:* version: link:../../packages/react-query From 8ab4b0847953a356142b95a2bebe2b0745a3a67f Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Wed, 28 Aug 2024 23:16:35 +0000 Subject: [PATCH 03/46] feat: move tron app to web --- apps/tron/src/app/layout.tsx | 72 --------------- apps/web/package.json | 7 +- .../_common/constants/abis/factory-abi.ts | 0 .../tron}/_common/constants/abis/pair-abi.ts | 0 .../_common/constants/abis/router-abi.ts | 0 .../tron}/_common/constants/abis/trc20-abi.ts | 0 .../_common/constants/abis/tron-multicall.ts | 0 .../_common/constants/abis/wrapped-trx-abi.ts | 0 .../tron}/_common/constants/contracts.ts | 0 .../tron}/_common/constants/icon-size.ts | 0 .../tron}/_common/constants/is-testnet.ts | 0 .../tron}/_common/constants/max-uint256.ts | 0 .../tron}/_common/constants/pair-decimals.ts | 0 .../tron}/_common/constants/token-list.tsx | 0 .../_common/lib/bitquery/bitquery-endpoint.ts | 0 .../_common/lib/bitquery/bitquery-headers.ts | 0 .../_common/lib/bitquery/bitquery-options.ts | 0 .../lib/bitquery/queries/getAllPools.ts | 0 .../lib/bitquery/queries/getReserves.ts | 0 .../lib/bitquery/queries/getTokenInfo.ts | 0 .../bitquery/queries/getTransfersToPairs.ts | 0 .../lib/bitquery/queries/getTronInUSDT.ts | 0 .../tron}/_common/lib/hooks/useAllowance.ts | 0 .../tron}/_common/lib/hooks/useAmountsOut.ts | 0 .../_common/lib/hooks/useCustomTokens.ts | 0 .../tron}/_common/lib/hooks/useIsContract.ts | 0 .../tron}/_common/lib/hooks/useMyPositions.ts | 0 .../_common/lib/hooks/useNativeBalance.ts | 0 .../_common/lib/hooks/usePairContract.ts | 0 .../_common/lib/hooks/usePoolOwnership.tsx | 0 .../tron}/_common/lib/hooks/usePools.ts | 0 .../tron}/_common/lib/hooks/usePriceImpact.ts | 0 .../tron}/_common/lib/hooks/useReserves.ts | 0 .../tron}/_common/lib/hooks/useRoutes.ts | 12 ++- .../_common/lib/hooks/useSortedTokenList.ts | 0 .../tron}/_common/lib/hooks/useStablePrice.ts | 0 .../_common/lib/hooks/useTokenBalance.ts | 0 .../tron}/_common/lib/hooks/useTokenInfo.ts | 0 .../tron}/_common/lib/hooks/useTotalSupply.ts | 0 .../tron}/_common/lib/hooks/useTronWeb.ts | 0 .../_common/lib/hooks/useWalletAdapters.ts | 0 .../tron}/_common/lib/utils/formatters.ts | 0 .../_common/lib/utils/getAllPairAddresses.ts | 0 .../tron}/_common/lib/utils/getTokenData.ts | 0 .../tron}/_common/lib/utils/getTronPrice.ts | 0 .../tron}/_common/lib/utils/helpers.ts | 0 .../_common/lib/utils/token-search-helpers.ts | 0 .../_common/lib/utils/tronscan-helpers.ts | 0 .../_common/lib/utils/warning-severity.ts | 0 .../providers/edge-config-provider.tsx | 0 .../providers/query-client-provider.tsx | 0 .../tron}/_common/types/get-pools-type.ts | 0 .../tron}/_common/types/pricing-types.ts | 0 .../_common/types/router-selector-type.ts | 0 .../tron}/_common/types/token-type.ts | 0 .../tron}/_common/types/tronweb.d.ts | 0 .../tron}/_common/ui/General/Icon.tsx | 0 .../tron}/_common/ui/General/Title.tsx | 0 .../_common/ui/General/TokenListSelect.tsx | 0 .../tron}/_common/ui/Input/Search.tsx | 0 .../tron}/_common/ui/Input/TokenInput.tsx | 0 .../tron}/_common/ui/Pools/Add/AddButton.tsx | 0 .../_common/ui/Pools/Add/AmountInToken0.tsx | 0 .../_common/ui/Pools/Add/AmountIntToken1.tsx | 0 .../_common/ui/Pools/Add/DepositForm.tsx | 0 .../tron}/_common/ui/Pools/Add/Plus.tsx | 0 .../tron}/_common/ui/Pools/Add/Rate.tsx | 0 .../_common/ui/Pools/Add/ReviewAddDialog.tsx | 0 .../ui/Pools/Add/ReviewAddDialogTrigger.tsx | 0 .../_common/ui/Pools/Add/SelectTokensForm.tsx | 0 .../tron}/_common/ui/Pools/BackButton.tsx | 0 .../_common/ui/Pools/Manage/AddSection.tsx | 0 .../tron}/_common/ui/Pools/Manage/Manage.tsx | 0 .../_common/ui/Pools/Manage/RemoveSection.tsx | 0 .../ui/Pools/PoolDetails/LiquidityItem.tsx | 0 .../ui/Pools/PoolDetails/PoolHeader.tsx | 0 .../ui/Pools/PoolDetails/PoolLiquidity.tsx | 0 .../ui/Pools/PoolPosition/PoolPosition.tsx | 0 .../ui/Pools/PoolRewards/PoolRewards.tsx | 0 .../tron}/_common/ui/Pools/PoolSearchBar.tsx | 0 .../ui/Pools/PoolsTable/PoolAprCell.tsx | 0 .../ui/Pools/PoolsTable/PoolColumns.tsx | 0 .../ui/Pools/PoolsTable/PoolNameCell.tsx | 0 .../ui/Pools/PoolsTable/PoolReservesCell.tsx | 0 .../ui/Pools/PoolsTable/PoolTvlCell.tsx | 0 .../ui/Pools/PoolsTable/PoolsTable.tsx | 0 .../tron}/_common/ui/Pools/PoolsView.tsx | 0 .../Pools/PositionsTable/PositionColumns.tsx | 0 .../Pools/PositionsTable/PositionNameCell.tsx | 0 .../Pools/PositionsTable/PositionSizeCell.tsx | 0 .../Pools/PositionsTable/PositionTvlCell.tsx | 0 .../Pools/PositionsTable/PositionsTable.tsx | 0 .../ui/Pools/Remove/MinimumReceive.tsx | 0 .../_common/ui/Pools/Remove/RemoveButton.tsx | 0 .../_common/ui/Pools/Remove/RemoveInput.tsx | 0 .../ui/Pools/Remove/RemoveLiquidity.tsx | 0 .../tron}/_common/ui/Pools/ReserveHelper.tsx | 0 .../tron}/_common/ui/Shared/ApproveToken.tsx | 0 .../_common/ui/Shared/DollarAmountDisplay.tsx | 0 .../_common/ui/Shared/TokenBalanceDisplay.tsx | 0 .../tron}/_common/ui/Swap/AmountIn.tsx | 0 .../tron}/_common/ui/Swap/AmountOut.tsx | 0 .../_common/ui/Swap/ReviewSwapDialog.tsx | 0 .../ui/Swap/ReviewSwapDialogTrigger.tsx | 0 .../tron}/_common/ui/Swap/SwapButton.tsx | 0 .../_common/ui/Swap/SwapRoutesDialog.tsx | 0 .../tron}/_common/ui/Swap/SwapStats.tsx | 0 .../_common/ui/Swap/SwitchSwapDirection.tsx | 0 .../tron}/_common/ui/Swap/SwitchSwapType.tsx | 0 .../ui/WalletConnector/DefaultView.tsx | 0 .../ui/WalletConnector/SettingsView.tsx | 0 .../ui/WalletConnector/WalletConnector.tsx | 0 .../ui/WalletConnector/WalletListView.tsx | 0 .../tron}/api/pools/get-reserves/route.ts | 0 .../tron}/api/pools/my-positions/route.ts | 0 .../app/(non-evm)/tron}/api/pools/route.ts | 0 .../app/(non-evm)/tron}/api/pricing/route.ts | 0 .../(non-evm)/tron}/api/token-info/route.ts | 0 .../src/app/(non-evm)/tron}/global-error.tsx | 0 .../src/app/(non-evm)/tron}/header.tsx | 0 apps/web/src/app/(non-evm)/tron/layout.tsx | 71 ++++++++++++++- .../src/app/(non-evm)/tron}/loading.tsx | 0 apps/web/src/app/(non-evm)/tron/page.tsx | 10 --- .../(non-evm)/tron}/pool/[poolId]/layout.tsx | 0 .../(non-evm)/tron}/pool/[poolId]/page.tsx | 0 .../tron}/pool/[poolId]/remove-provider.tsx | 0 .../app/(non-evm)/tron}/pool/add/layout.tsx | 0 .../src/app/(non-evm)/tron}/pool/add/page.tsx | 0 .../src/app/(non-evm)/tron}/pool/layout.tsx | 0 .../src/app/(non-evm)/tron}/pool/page.tsx | 0 .../(non-evm)/tron}/pool/pool-provider.tsx | 0 .../src/app/(non-evm)/tron}/providers.tsx | 0 .../src/app/(non-evm)/tron}/swap/layout.tsx | 0 .../src/app/(non-evm)/tron}/swap/page.tsx | 0 .../app/(non-evm)/tron}/swap/providers.tsx | 0 .../(non-evm)/tron}/swap/swap-provider.tsx | 0 .../src/app/(non-evm)/tron}/trackers.tsx | 0 package.json | 3 +- patches/swarm-js@0.1.42.patch | 14 +++ pnpm-lock.yaml | 90 +++++++++++-------- 140 files changed, 151 insertions(+), 128 deletions(-) delete mode 100644 apps/tron/src/app/layout.tsx rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/constants/abis/factory-abi.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/constants/abis/pair-abi.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/constants/abis/router-abi.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/constants/abis/trc20-abi.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/constants/abis/tron-multicall.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/constants/abis/wrapped-trx-abi.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/constants/contracts.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/constants/icon-size.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/constants/is-testnet.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/constants/max-uint256.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/constants/pair-decimals.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/constants/token-list.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/bitquery/bitquery-endpoint.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/bitquery/bitquery-headers.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/bitquery/bitquery-options.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/bitquery/queries/getAllPools.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/bitquery/queries/getReserves.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/bitquery/queries/getTokenInfo.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/bitquery/queries/getTransfersToPairs.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/bitquery/queries/getTronInUSDT.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useAllowance.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useAmountsOut.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useCustomTokens.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useIsContract.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useMyPositions.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useNativeBalance.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/usePairContract.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/usePoolOwnership.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/usePools.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/usePriceImpact.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useReserves.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useRoutes.ts (93%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useSortedTokenList.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useStablePrice.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useTokenBalance.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useTokenInfo.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useTotalSupply.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useTronWeb.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/hooks/useWalletAdapters.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/utils/formatters.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/utils/getAllPairAddresses.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/utils/getTokenData.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/utils/getTronPrice.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/utils/helpers.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/utils/token-search-helpers.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/utils/tronscan-helpers.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/lib/utils/warning-severity.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/providers/edge-config-provider.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/providers/query-client-provider.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/types/get-pools-type.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/types/pricing-types.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/types/router-selector-type.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/types/token-type.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/types/tronweb.d.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/General/Icon.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/General/Title.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/General/TokenListSelect.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Input/Search.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Input/TokenInput.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Add/AddButton.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Add/AmountInToken0.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Add/AmountIntToken1.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Add/DepositForm.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Add/Plus.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Add/Rate.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Add/ReviewAddDialog.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Add/SelectTokensForm.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/BackButton.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Manage/AddSection.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Manage/Manage.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Manage/RemoveSection.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PoolDetails/LiquidityItem.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PoolDetails/PoolHeader.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PoolPosition/PoolPosition.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PoolRewards/PoolRewards.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PoolSearchBar.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PoolsTable/PoolAprCell.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PoolsTable/PoolColumns.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PoolsTable/PoolNameCell.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PoolsTable/PoolReservesCell.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PoolsTable/PoolTvlCell.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PoolsTable/PoolsTable.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PoolsView.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PositionsTable/PositionColumns.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PositionsTable/PositionNameCell.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PositionsTable/PositionSizeCell.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PositionsTable/PositionTvlCell.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/PositionsTable/PositionsTable.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Remove/MinimumReceive.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Remove/RemoveButton.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Remove/RemoveInput.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/Remove/RemoveLiquidity.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Pools/ReserveHelper.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Shared/ApproveToken.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Shared/DollarAmountDisplay.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Shared/TokenBalanceDisplay.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Swap/AmountIn.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Swap/AmountOut.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Swap/ReviewSwapDialog.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Swap/ReviewSwapDialogTrigger.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Swap/SwapButton.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Swap/SwapRoutesDialog.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Swap/SwapStats.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Swap/SwitchSwapDirection.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/Swap/SwitchSwapType.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/WalletConnector/DefaultView.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/WalletConnector/SettingsView.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/WalletConnector/WalletConnector.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/_common/ui/WalletConnector/WalletListView.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/api/pools/get-reserves/route.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/api/pools/my-positions/route.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/api/pools/route.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/api/pricing/route.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/api/token-info/route.ts (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/global-error.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/header.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/loading.tsx (100%) delete mode 100644 apps/web/src/app/(non-evm)/tron/page.tsx rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/pool/[poolId]/layout.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/pool/[poolId]/page.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/pool/[poolId]/remove-provider.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/pool/add/layout.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/pool/add/page.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/pool/layout.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/pool/page.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/pool/pool-provider.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/providers.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/swap/layout.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/swap/page.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/swap/providers.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/swap/swap-provider.tsx (100%) rename apps/{tron/src/app => web/src/app/(non-evm)/tron}/trackers.tsx (100%) create mode 100644 patches/swarm-js@0.1.42.patch diff --git a/apps/tron/src/app/layout.tsx b/apps/tron/src/app/layout.tsx deleted file mode 100644 index 28f1fc8384..0000000000 --- a/apps/tron/src/app/layout.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import '@sushiswap/ui/index.css' - -import type { Metadata } from 'next' -import { Inter, Roboto_Mono } from 'next/font/google' -import React from 'react' -import { Header } from './header' -import { Providers } from './providers' -import { Trackers } from './trackers' - -const inter = Inter({ - subsets: ['latin'], - display: 'swap', - variable: '--font-inter', -}) - -const roboto_mono = Roboto_Mono({ - subsets: ['latin'], - display: 'swap', - variable: '--font-roboto-mono', -}) - -export const metadata: Metadata = { - title: { - default: 'Sushi 🍣', - template: '%s | Sushi 🍣', - }, - description: - 'A Decentralised Finance (DeFi) app with features such as swap, cross chain swap, streaming, vesting, and permissionless market making for liquidity providers.', -} - -export default function RootLayout({ - children, -}: { children: React.ReactNode }) { - return ( - // - - - - - - - - -
    - -
    - {children} - - -
    - - - ) -} diff --git a/apps/web/package.json b/apps/web/package.json index 76ad7cf8d4..d8984a5eef 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -100,7 +100,12 @@ "tiny-invariant": "1.3.1", "viem": "2.21.4", "wagmi": "2.12.10", - "zod": "3.23.8" + "zod": "3.23.8", + "tronweb": "^5.3.2", + "@tronweb3/tronwallet-abstract-adapter": "^1.1.6", + "@tronweb3/tronwallet-adapter-react-hooks": "^1.1.7", + "@tronweb3/tronwallet-adapter-react-ui": "^1.1.8", + "@tronweb3/tronwallet-adapters": "^1.2.1" }, "devDependencies": { "@0xsquid/squid-types": "0.1.78", diff --git a/apps/tron/src/app/_common/constants/abis/factory-abi.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/factory-abi.ts similarity index 100% rename from apps/tron/src/app/_common/constants/abis/factory-abi.ts rename to apps/web/src/app/(non-evm)/tron/_common/constants/abis/factory-abi.ts diff --git a/apps/tron/src/app/_common/constants/abis/pair-abi.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/pair-abi.ts similarity index 100% rename from apps/tron/src/app/_common/constants/abis/pair-abi.ts rename to apps/web/src/app/(non-evm)/tron/_common/constants/abis/pair-abi.ts diff --git a/apps/tron/src/app/_common/constants/abis/router-abi.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/router-abi.ts similarity index 100% rename from apps/tron/src/app/_common/constants/abis/router-abi.ts rename to apps/web/src/app/(non-evm)/tron/_common/constants/abis/router-abi.ts diff --git a/apps/tron/src/app/_common/constants/abis/trc20-abi.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/trc20-abi.ts similarity index 100% rename from apps/tron/src/app/_common/constants/abis/trc20-abi.ts rename to apps/web/src/app/(non-evm)/tron/_common/constants/abis/trc20-abi.ts diff --git a/apps/tron/src/app/_common/constants/abis/tron-multicall.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/tron-multicall.ts similarity index 100% rename from apps/tron/src/app/_common/constants/abis/tron-multicall.ts rename to apps/web/src/app/(non-evm)/tron/_common/constants/abis/tron-multicall.ts diff --git a/apps/tron/src/app/_common/constants/abis/wrapped-trx-abi.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/wrapped-trx-abi.ts similarity index 100% rename from apps/tron/src/app/_common/constants/abis/wrapped-trx-abi.ts rename to apps/web/src/app/(non-evm)/tron/_common/constants/abis/wrapped-trx-abi.ts diff --git a/apps/tron/src/app/_common/constants/contracts.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/contracts.ts similarity index 100% rename from apps/tron/src/app/_common/constants/contracts.ts rename to apps/web/src/app/(non-evm)/tron/_common/constants/contracts.ts diff --git a/apps/tron/src/app/_common/constants/icon-size.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/icon-size.ts similarity index 100% rename from apps/tron/src/app/_common/constants/icon-size.ts rename to apps/web/src/app/(non-evm)/tron/_common/constants/icon-size.ts diff --git a/apps/tron/src/app/_common/constants/is-testnet.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/is-testnet.ts similarity index 100% rename from apps/tron/src/app/_common/constants/is-testnet.ts rename to apps/web/src/app/(non-evm)/tron/_common/constants/is-testnet.ts diff --git a/apps/tron/src/app/_common/constants/max-uint256.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/max-uint256.ts similarity index 100% rename from apps/tron/src/app/_common/constants/max-uint256.ts rename to apps/web/src/app/(non-evm)/tron/_common/constants/max-uint256.ts diff --git a/apps/tron/src/app/_common/constants/pair-decimals.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/pair-decimals.ts similarity index 100% rename from apps/tron/src/app/_common/constants/pair-decimals.ts rename to apps/web/src/app/(non-evm)/tron/_common/constants/pair-decimals.ts diff --git a/apps/tron/src/app/_common/constants/token-list.tsx b/apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx similarity index 100% rename from apps/tron/src/app/_common/constants/token-list.tsx rename to apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx diff --git a/apps/tron/src/app/_common/lib/bitquery/bitquery-endpoint.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/bitquery-endpoint.ts similarity index 100% rename from apps/tron/src/app/_common/lib/bitquery/bitquery-endpoint.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/bitquery-endpoint.ts diff --git a/apps/tron/src/app/_common/lib/bitquery/bitquery-headers.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/bitquery-headers.ts similarity index 100% rename from apps/tron/src/app/_common/lib/bitquery/bitquery-headers.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/bitquery-headers.ts diff --git a/apps/tron/src/app/_common/lib/bitquery/bitquery-options.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/bitquery-options.ts similarity index 100% rename from apps/tron/src/app/_common/lib/bitquery/bitquery-options.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/bitquery-options.ts diff --git a/apps/tron/src/app/_common/lib/bitquery/queries/getAllPools.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/queries/getAllPools.ts similarity index 100% rename from apps/tron/src/app/_common/lib/bitquery/queries/getAllPools.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/queries/getAllPools.ts diff --git a/apps/tron/src/app/_common/lib/bitquery/queries/getReserves.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/queries/getReserves.ts similarity index 100% rename from apps/tron/src/app/_common/lib/bitquery/queries/getReserves.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/queries/getReserves.ts diff --git a/apps/tron/src/app/_common/lib/bitquery/queries/getTokenInfo.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/queries/getTokenInfo.ts similarity index 100% rename from apps/tron/src/app/_common/lib/bitquery/queries/getTokenInfo.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/queries/getTokenInfo.ts diff --git a/apps/tron/src/app/_common/lib/bitquery/queries/getTransfersToPairs.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/queries/getTransfersToPairs.ts similarity index 100% rename from apps/tron/src/app/_common/lib/bitquery/queries/getTransfersToPairs.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/queries/getTransfersToPairs.ts diff --git a/apps/tron/src/app/_common/lib/bitquery/queries/getTronInUSDT.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/queries/getTronInUSDT.ts similarity index 100% rename from apps/tron/src/app/_common/lib/bitquery/queries/getTronInUSDT.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/bitquery/queries/getTronInUSDT.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useAllowance.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAllowance.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useAllowance.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAllowance.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useAmountsOut.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useAmountsOut.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useCustomTokens.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useCustomTokens.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useCustomTokens.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useCustomTokens.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useIsContract.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useIsContract.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useIsContract.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useIsContract.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useMyPositions.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useMyPositions.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useMyPositions.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useMyPositions.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useNativeBalance.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useNativeBalance.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useNativeBalance.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useNativeBalance.ts diff --git a/apps/tron/src/app/_common/lib/hooks/usePairContract.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePairContract.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/usePairContract.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePairContract.ts diff --git a/apps/tron/src/app/_common/lib/hooks/usePoolOwnership.tsx b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePoolOwnership.tsx similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/usePoolOwnership.tsx rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePoolOwnership.tsx diff --git a/apps/tron/src/app/_common/lib/hooks/usePools.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/usePools.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts diff --git a/apps/tron/src/app/_common/lib/hooks/usePriceImpact.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePriceImpact.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/usePriceImpact.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePriceImpact.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useReserves.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useReserves.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useReserves.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useReserves.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useRoutes.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useRoutes.ts similarity index 93% rename from apps/tron/src/app/_common/lib/hooks/useRoutes.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useRoutes.ts index 1758aa4189..5daa13e126 100644 --- a/apps/tron/src/app/_common/lib/hooks/useRoutes.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useRoutes.ts @@ -1,5 +1,5 @@ import { useQuery } from '@tanstack/react-query' -import { ethers } from 'ethers' +import { decodeAbiParameters } from 'viem/utils' import { TRON_MULTICALL_ABI } from '~tron/_common/constants/abis/tron-multicall' import { FACTORY_CONTRACT, @@ -86,11 +86,15 @@ export const useRoutes = ({ const _pairs: string[] = [] for (let i = 0; i < returnData.length; i++) { - const pairAddress = ethers.utils.defaultAbiCoder.decode( - ['address'], + const pairAddress = decodeAbiParameters( + [ + { + type: 'address', + }, + ], returnData[i], ) - _pairs.push(getBase58Address(pairAddress?.[0] as string)) + _pairs.push(getBase58Address(pairAddress?.[0])) } //using multicall, check if there is a direct pair (index 0), if not check if there is a pair with intermediate token (index 1 or 2) diff --git a/apps/tron/src/app/_common/lib/hooks/useSortedTokenList.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useSortedTokenList.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useSortedTokenList.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useSortedTokenList.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useStablePrice.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useStablePrice.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useStablePrice.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useStablePrice.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useTokenBalance.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenBalance.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useTokenBalance.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenBalance.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useTokenInfo.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useTokenInfo.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useTotalSupply.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTotalSupply.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useTotalSupply.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTotalSupply.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useTronWeb.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTronWeb.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useTronWeb.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTronWeb.ts diff --git a/apps/tron/src/app/_common/lib/hooks/useWalletAdapters.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useWalletAdapters.ts similarity index 100% rename from apps/tron/src/app/_common/lib/hooks/useWalletAdapters.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useWalletAdapters.ts diff --git a/apps/tron/src/app/_common/lib/utils/formatters.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/formatters.ts similarity index 100% rename from apps/tron/src/app/_common/lib/utils/formatters.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/utils/formatters.ts diff --git a/apps/tron/src/app/_common/lib/utils/getAllPairAddresses.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getAllPairAddresses.ts similarity index 100% rename from apps/tron/src/app/_common/lib/utils/getAllPairAddresses.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/utils/getAllPairAddresses.ts diff --git a/apps/tron/src/app/_common/lib/utils/getTokenData.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getTokenData.ts similarity index 100% rename from apps/tron/src/app/_common/lib/utils/getTokenData.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/utils/getTokenData.ts diff --git a/apps/tron/src/app/_common/lib/utils/getTronPrice.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getTronPrice.ts similarity index 100% rename from apps/tron/src/app/_common/lib/utils/getTronPrice.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/utils/getTronPrice.ts diff --git a/apps/tron/src/app/_common/lib/utils/helpers.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/helpers.ts similarity index 100% rename from apps/tron/src/app/_common/lib/utils/helpers.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/utils/helpers.ts diff --git a/apps/tron/src/app/_common/lib/utils/token-search-helpers.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/token-search-helpers.ts similarity index 100% rename from apps/tron/src/app/_common/lib/utils/token-search-helpers.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/utils/token-search-helpers.ts diff --git a/apps/tron/src/app/_common/lib/utils/tronscan-helpers.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/tronscan-helpers.ts similarity index 100% rename from apps/tron/src/app/_common/lib/utils/tronscan-helpers.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/utils/tronscan-helpers.ts diff --git a/apps/tron/src/app/_common/lib/utils/warning-severity.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/warning-severity.ts similarity index 100% rename from apps/tron/src/app/_common/lib/utils/warning-severity.ts rename to apps/web/src/app/(non-evm)/tron/_common/lib/utils/warning-severity.ts diff --git a/apps/tron/src/app/_common/providers/edge-config-provider.tsx b/apps/web/src/app/(non-evm)/tron/_common/providers/edge-config-provider.tsx similarity index 100% rename from apps/tron/src/app/_common/providers/edge-config-provider.tsx rename to apps/web/src/app/(non-evm)/tron/_common/providers/edge-config-provider.tsx diff --git a/apps/tron/src/app/_common/providers/query-client-provider.tsx b/apps/web/src/app/(non-evm)/tron/_common/providers/query-client-provider.tsx similarity index 100% rename from apps/tron/src/app/_common/providers/query-client-provider.tsx rename to apps/web/src/app/(non-evm)/tron/_common/providers/query-client-provider.tsx diff --git a/apps/tron/src/app/_common/types/get-pools-type.ts b/apps/web/src/app/(non-evm)/tron/_common/types/get-pools-type.ts similarity index 100% rename from apps/tron/src/app/_common/types/get-pools-type.ts rename to apps/web/src/app/(non-evm)/tron/_common/types/get-pools-type.ts diff --git a/apps/tron/src/app/_common/types/pricing-types.ts b/apps/web/src/app/(non-evm)/tron/_common/types/pricing-types.ts similarity index 100% rename from apps/tron/src/app/_common/types/pricing-types.ts rename to apps/web/src/app/(non-evm)/tron/_common/types/pricing-types.ts diff --git a/apps/tron/src/app/_common/types/router-selector-type.ts b/apps/web/src/app/(non-evm)/tron/_common/types/router-selector-type.ts similarity index 100% rename from apps/tron/src/app/_common/types/router-selector-type.ts rename to apps/web/src/app/(non-evm)/tron/_common/types/router-selector-type.ts diff --git a/apps/tron/src/app/_common/types/token-type.ts b/apps/web/src/app/(non-evm)/tron/_common/types/token-type.ts similarity index 100% rename from apps/tron/src/app/_common/types/token-type.ts rename to apps/web/src/app/(non-evm)/tron/_common/types/token-type.ts diff --git a/apps/tron/src/app/_common/types/tronweb.d.ts b/apps/web/src/app/(non-evm)/tron/_common/types/tronweb.d.ts similarity index 100% rename from apps/tron/src/app/_common/types/tronweb.d.ts rename to apps/web/src/app/(non-evm)/tron/_common/types/tronweb.d.ts diff --git a/apps/tron/src/app/_common/ui/General/Icon.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/General/Icon.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx diff --git a/apps/tron/src/app/_common/ui/General/Title.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/General/Title.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/General/Title.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/General/Title.tsx diff --git a/apps/tron/src/app/_common/ui/General/TokenListSelect.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/General/TokenListSelect.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx diff --git a/apps/tron/src/app/_common/ui/Input/Search.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Input/Search.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Input/Search.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Input/Search.tsx diff --git a/apps/tron/src/app/_common/ui/Input/TokenInput.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Input/TokenInput.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Add/AddButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Add/AddButton.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Add/AmountInToken0.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Add/AmountInToken0.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Add/AmountIntToken1.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Add/AmountIntToken1.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Add/DepositForm.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/DepositForm.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Add/DepositForm.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/DepositForm.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Add/Plus.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Plus.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Add/Plus.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Plus.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Add/Rate.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Add/Rate.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Add/ReviewAddDialog.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Add/ReviewAddDialog.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Add/SelectTokensForm.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Add/SelectTokensForm.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/BackButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/BackButton.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/BackButton.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/BackButton.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Manage/AddSection.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/AddSection.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Manage/AddSection.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/AddSection.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Manage/Manage.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/Manage.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Manage/Manage.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/Manage.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Manage/RemoveSection.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/RemoveSection.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Manage/RemoveSection.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/RemoveSection.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PoolDetails/LiquidityItem.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/LiquidityItem.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PoolDetails/LiquidityItem.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/LiquidityItem.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PoolDetails/PoolHeader.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PoolDetails/PoolHeader.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PoolPosition/PoolPosition.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PoolPosition/PoolPosition.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PoolRewards/PoolRewards.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolRewards/PoolRewards.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PoolRewards/PoolRewards.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolRewards/PoolRewards.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PoolSearchBar.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolSearchBar.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PoolSearchBar.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolSearchBar.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolAprCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolAprCell.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolAprCell.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolAprCell.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolColumns.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolColumns.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolColumns.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolColumns.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolNameCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolNameCell.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolNameCell.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolNameCell.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolReservesCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolReservesCell.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolReservesCell.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolReservesCell.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolTvlCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolTvlCell.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolTvlCell.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolTvlCell.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolsTable.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PoolsTable/PoolsTable.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PoolsView.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsView.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PoolsView.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsView.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionColumns.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionColumns.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionColumns.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionColumns.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionNameCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionNameCell.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionNameCell.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionNameCell.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionSizeCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionSizeCell.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionSizeCell.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionSizeCell.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionTvlCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionTvlCell.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionTvlCell.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionTvlCell.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionsTable.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionsTable.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/PositionsTable/PositionsTable.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionsTable.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Remove/MinimumReceive.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Remove/MinimumReceive.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Remove/RemoveButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Remove/RemoveButton.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Remove/RemoveInput.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Remove/RemoveInput.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/Remove/RemoveLiquidity.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveLiquidity.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/Remove/RemoveLiquidity.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveLiquidity.tsx diff --git a/apps/tron/src/app/_common/ui/Pools/ReserveHelper.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Pools/ReserveHelper.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx diff --git a/apps/tron/src/app/_common/ui/Shared/ApproveToken.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Shared/ApproveToken.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Shared/ApproveToken.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Shared/ApproveToken.tsx diff --git a/apps/tron/src/app/_common/ui/Shared/DollarAmountDisplay.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Shared/DollarAmountDisplay.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Shared/DollarAmountDisplay.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Shared/DollarAmountDisplay.tsx diff --git a/apps/tron/src/app/_common/ui/Shared/TokenBalanceDisplay.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Shared/TokenBalanceDisplay.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Shared/TokenBalanceDisplay.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Shared/TokenBalanceDisplay.tsx diff --git a/apps/tron/src/app/_common/ui/Swap/AmountIn.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Swap/AmountIn.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx diff --git a/apps/tron/src/app/_common/ui/Swap/AmountOut.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Swap/AmountOut.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx diff --git a/apps/tron/src/app/_common/ui/Swap/ReviewSwapDialog.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Swap/ReviewSwapDialog.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx diff --git a/apps/tron/src/app/_common/ui/Swap/ReviewSwapDialogTrigger.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Swap/ReviewSwapDialogTrigger.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx diff --git a/apps/tron/src/app/_common/ui/Swap/SwapButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapButton.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Swap/SwapButton.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapButton.tsx diff --git a/apps/tron/src/app/_common/ui/Swap/SwapRoutesDialog.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapRoutesDialog.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Swap/SwapRoutesDialog.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapRoutesDialog.tsx diff --git a/apps/tron/src/app/_common/ui/Swap/SwapStats.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapStats.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Swap/SwapStats.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapStats.tsx diff --git a/apps/tron/src/app/_common/ui/Swap/SwitchSwapDirection.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Swap/SwitchSwapDirection.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx diff --git a/apps/tron/src/app/_common/ui/Swap/SwitchSwapType.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapType.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/Swap/SwitchSwapType.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapType.tsx diff --git a/apps/tron/src/app/_common/ui/WalletConnector/DefaultView.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/DefaultView.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/WalletConnector/DefaultView.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/DefaultView.tsx diff --git a/apps/tron/src/app/_common/ui/WalletConnector/SettingsView.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/SettingsView.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/WalletConnector/SettingsView.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/SettingsView.tsx diff --git a/apps/tron/src/app/_common/ui/WalletConnector/WalletConnector.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/WalletConnector.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/WalletConnector/WalletConnector.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/WalletConnector.tsx diff --git a/apps/tron/src/app/_common/ui/WalletConnector/WalletListView.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/WalletListView.tsx similarity index 100% rename from apps/tron/src/app/_common/ui/WalletConnector/WalletListView.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/WalletListView.tsx diff --git a/apps/tron/src/app/api/pools/get-reserves/route.ts b/apps/web/src/app/(non-evm)/tron/api/pools/get-reserves/route.ts similarity index 100% rename from apps/tron/src/app/api/pools/get-reserves/route.ts rename to apps/web/src/app/(non-evm)/tron/api/pools/get-reserves/route.ts diff --git a/apps/tron/src/app/api/pools/my-positions/route.ts b/apps/web/src/app/(non-evm)/tron/api/pools/my-positions/route.ts similarity index 100% rename from apps/tron/src/app/api/pools/my-positions/route.ts rename to apps/web/src/app/(non-evm)/tron/api/pools/my-positions/route.ts diff --git a/apps/tron/src/app/api/pools/route.ts b/apps/web/src/app/(non-evm)/tron/api/pools/route.ts similarity index 100% rename from apps/tron/src/app/api/pools/route.ts rename to apps/web/src/app/(non-evm)/tron/api/pools/route.ts diff --git a/apps/tron/src/app/api/pricing/route.ts b/apps/web/src/app/(non-evm)/tron/api/pricing/route.ts similarity index 100% rename from apps/tron/src/app/api/pricing/route.ts rename to apps/web/src/app/(non-evm)/tron/api/pricing/route.ts diff --git a/apps/tron/src/app/api/token-info/route.ts b/apps/web/src/app/(non-evm)/tron/api/token-info/route.ts similarity index 100% rename from apps/tron/src/app/api/token-info/route.ts rename to apps/web/src/app/(non-evm)/tron/api/token-info/route.ts diff --git a/apps/tron/src/app/global-error.tsx b/apps/web/src/app/(non-evm)/tron/global-error.tsx similarity index 100% rename from apps/tron/src/app/global-error.tsx rename to apps/web/src/app/(non-evm)/tron/global-error.tsx diff --git a/apps/tron/src/app/header.tsx b/apps/web/src/app/(non-evm)/tron/header.tsx similarity index 100% rename from apps/tron/src/app/header.tsx rename to apps/web/src/app/(non-evm)/tron/header.tsx diff --git a/apps/web/src/app/(non-evm)/tron/layout.tsx b/apps/web/src/app/(non-evm)/tron/layout.tsx index 060472a153..28f1fc8384 100644 --- a/apps/web/src/app/(non-evm)/tron/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/layout.tsx @@ -1,9 +1,72 @@ -import { Metadata } from 'next' +import '@sushiswap/ui/index.css' + +import type { Metadata } from 'next' +import { Inter, Roboto_Mono } from 'next/font/google' +import React from 'react' +import { Header } from './header' +import { Providers } from './providers' +import { Trackers } from './trackers' + +const inter = Inter({ + subsets: ['latin'], + display: 'swap', + variable: '--font-inter', +}) + +const roboto_mono = Roboto_Mono({ + subsets: ['latin'], + display: 'swap', + variable: '--font-roboto-mono', +}) export const metadata: Metadata = { - title: 'SushiSwap | Tron', + title: { + default: 'Sushi 🍣', + template: '%s | Sushi 🍣', + }, + description: + 'A Decentralised Finance (DeFi) app with features such as swap, cross chain swap, streaming, vesting, and permissionless market making for liquidity providers.', } -export default function Layout({ children }: { children: React.ReactNode }) { - return
    {children}
    +export default function RootLayout({ + children, +}: { children: React.ReactNode }) { + return ( + // + + + + + + + + +
    + +
    + {children} + + +
    + + + ) } diff --git a/apps/tron/src/app/loading.tsx b/apps/web/src/app/(non-evm)/tron/loading.tsx similarity index 100% rename from apps/tron/src/app/loading.tsx rename to apps/web/src/app/(non-evm)/tron/loading.tsx diff --git a/apps/web/src/app/(non-evm)/tron/page.tsx b/apps/web/src/app/(non-evm)/tron/page.tsx deleted file mode 100644 index 2e0f6e4364..0000000000 --- a/apps/web/src/app/(non-evm)/tron/page.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { Container } from '@sushiswap/ui' -import React from 'react' - -export default function Page() { - return ( - -

    Tron

    -
    - ) -} diff --git a/apps/tron/src/app/pool/[poolId]/layout.tsx b/apps/web/src/app/(non-evm)/tron/pool/[poolId]/layout.tsx similarity index 100% rename from apps/tron/src/app/pool/[poolId]/layout.tsx rename to apps/web/src/app/(non-evm)/tron/pool/[poolId]/layout.tsx diff --git a/apps/tron/src/app/pool/[poolId]/page.tsx b/apps/web/src/app/(non-evm)/tron/pool/[poolId]/page.tsx similarity index 100% rename from apps/tron/src/app/pool/[poolId]/page.tsx rename to apps/web/src/app/(non-evm)/tron/pool/[poolId]/page.tsx diff --git a/apps/tron/src/app/pool/[poolId]/remove-provider.tsx b/apps/web/src/app/(non-evm)/tron/pool/[poolId]/remove-provider.tsx similarity index 100% rename from apps/tron/src/app/pool/[poolId]/remove-provider.tsx rename to apps/web/src/app/(non-evm)/tron/pool/[poolId]/remove-provider.tsx diff --git a/apps/tron/src/app/pool/add/layout.tsx b/apps/web/src/app/(non-evm)/tron/pool/add/layout.tsx similarity index 100% rename from apps/tron/src/app/pool/add/layout.tsx rename to apps/web/src/app/(non-evm)/tron/pool/add/layout.tsx diff --git a/apps/tron/src/app/pool/add/page.tsx b/apps/web/src/app/(non-evm)/tron/pool/add/page.tsx similarity index 100% rename from apps/tron/src/app/pool/add/page.tsx rename to apps/web/src/app/(non-evm)/tron/pool/add/page.tsx diff --git a/apps/tron/src/app/pool/layout.tsx b/apps/web/src/app/(non-evm)/tron/pool/layout.tsx similarity index 100% rename from apps/tron/src/app/pool/layout.tsx rename to apps/web/src/app/(non-evm)/tron/pool/layout.tsx diff --git a/apps/tron/src/app/pool/page.tsx b/apps/web/src/app/(non-evm)/tron/pool/page.tsx similarity index 100% rename from apps/tron/src/app/pool/page.tsx rename to apps/web/src/app/(non-evm)/tron/pool/page.tsx diff --git a/apps/tron/src/app/pool/pool-provider.tsx b/apps/web/src/app/(non-evm)/tron/pool/pool-provider.tsx similarity index 100% rename from apps/tron/src/app/pool/pool-provider.tsx rename to apps/web/src/app/(non-evm)/tron/pool/pool-provider.tsx diff --git a/apps/tron/src/app/providers.tsx b/apps/web/src/app/(non-evm)/tron/providers.tsx similarity index 100% rename from apps/tron/src/app/providers.tsx rename to apps/web/src/app/(non-evm)/tron/providers.tsx diff --git a/apps/tron/src/app/swap/layout.tsx b/apps/web/src/app/(non-evm)/tron/swap/layout.tsx similarity index 100% rename from apps/tron/src/app/swap/layout.tsx rename to apps/web/src/app/(non-evm)/tron/swap/layout.tsx diff --git a/apps/tron/src/app/swap/page.tsx b/apps/web/src/app/(non-evm)/tron/swap/page.tsx similarity index 100% rename from apps/tron/src/app/swap/page.tsx rename to apps/web/src/app/(non-evm)/tron/swap/page.tsx diff --git a/apps/tron/src/app/swap/providers.tsx b/apps/web/src/app/(non-evm)/tron/swap/providers.tsx similarity index 100% rename from apps/tron/src/app/swap/providers.tsx rename to apps/web/src/app/(non-evm)/tron/swap/providers.tsx diff --git a/apps/tron/src/app/swap/swap-provider.tsx b/apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx similarity index 100% rename from apps/tron/src/app/swap/swap-provider.tsx rename to apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx diff --git a/apps/tron/src/app/trackers.tsx b/apps/web/src/app/(non-evm)/tron/trackers.tsx similarity index 100% rename from apps/tron/src/app/trackers.tsx rename to apps/web/src/app/(non-evm)/tron/trackers.tsx diff --git a/package.json b/package.json index 37b1f1dc60..549a864814 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,8 @@ "@rainbow-me/rainbowkit@2.1.3": "patches/@rainbow-me__rainbowkit@2.1.3.patch", "@aptos-labs/aptos-client@0.1.0": "patches/@aptos-labs__aptos-client@0.1.0.patch", "@msafe/aptos-wallet-adapter@1.1.3": "patches/@msafe__aptos-wallet-adapter@1.1.3.patch", - "@walletconnect/logger@2.1.2": "patches/@walletconnect__logger@2.1.2.patch" + "@walletconnect/logger@2.1.2": "patches/@walletconnect__logger@2.1.2.patch", + "swarm-js@0.1.42": "patches/swarm-js@0.1.42.patch" } } } diff --git a/patches/swarm-js@0.1.42.patch b/patches/swarm-js@0.1.42.patch new file mode 100644 index 0000000000..a0123af1b5 --- /dev/null +++ b/patches/swarm-js@0.1.42.patch @@ -0,0 +1,14 @@ +diff --git a/package.json b/package.json +index 6a37782739e88700467b7e583c15c8e89980c27e..e8b910fb572ac424855daf9bc1bb6048b01ecce9 100644 +--- a/package.json ++++ b/package.json +@@ -2,8 +2,7 @@ + "name": "swarm-js", + "version": "0.1.42", + "description": "Swarm tools for JavaScript.", +- "main": "lib/api-node.js", +- "browser": "lib/api-browser.js", ++ "main": "lib/api-browser.js", + "scripts": { + "build": "npm run babel", + "babel": "babel src --out-dir=lib", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9508f75f84..ec5e1c61f1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,6 +24,9 @@ patchedDependencies: '@walletconnect/logger@2.1.2': hash: rvv5xppc7nrkuugnnppsvoyepa path: patches/@walletconnect__logger@2.1.2.patch + swarm-js@0.1.42: + hash: 2sabagotzgj5qrte5szyhjypv4 + path: patches/swarm-js@0.1.42.patch importers: @@ -426,7 +429,7 @@ importers: version: 1.1.8(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@tronweb3/tronwallet-adapters': specifier: ^1.2.1 - version: 1.2.2(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) + version: 1.2.2(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) '@vercel/analytics': specifier: 1.3.1 version: 1.3.1(next@14.2.3(@babel/core@7.24.4)(@opentelemetry/api@1.9.0)(@playwright/test@1.45.0)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0) @@ -647,6 +650,18 @@ importers: '@tanstack/react-table': specifier: 8.9.1 version: 8.9.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@tronweb3/tronwallet-abstract-adapter': + specifier: ^1.1.6 + version: 1.1.6 + '@tronweb3/tronwallet-adapter-react-hooks': + specifier: ^1.1.7 + version: 1.1.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@tronweb3/tronwallet-adapter-react-ui': + specifier: ^1.1.8 + version: 1.1.8(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@tronweb3/tronwallet-adapters': + specifier: ^1.2.1 + version: 1.2.2(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) '@tryghost/content-api': specifier: 1.11.17 version: 1.11.17 @@ -776,6 +791,9 @@ importers: tiny-invariant: specifier: 1.3.1 version: 1.3.1 + tronweb: + specifier: ^5.3.2 + version: 5.3.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) viem: specifier: 2.21.4 version: 2.21.4(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) @@ -33669,11 +33687,11 @@ snapshots: dependencies: '@tronweb3/tronwallet-abstract-adapter': 1.1.6 - '@tronweb3/tronwallet-adapter-walletconnect@2.0.0(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8)': + '@tronweb3/tronwallet-adapter-walletconnect@2.0.0(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8)': dependencies: '@tronweb3/tronwallet-abstract-adapter': 1.1.6 - '@tronweb3/walletconnect-tron': 3.0.0(@types/react@18.2.14)(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10) - '@wagmi/core': 1.4.13(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) + '@tronweb3/walletconnect-tron': 3.0.0(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10) + '@wagmi/core': 1.4.13(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) '@walletconnect/sign-client': 2.16.1(@upstash/redis@1.22.1)(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@walletconnect/types': 2.14.0(@upstash/redis@1.22.1) viem: 0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) @@ -33700,14 +33718,14 @@ snapshots: - utf-8-validate - zod - '@tronweb3/tronwallet-adapters@1.2.2(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8)': + '@tronweb3/tronwallet-adapters@1.2.2(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8)': dependencies: '@tronweb3/tronwallet-adapter-bitkeep': 1.1.1(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) '@tronweb3/tronwallet-adapter-ledger': 1.1.8 '@tronweb3/tronwallet-adapter-okxwallet': 1.0.3 '@tronweb3/tronwallet-adapter-tokenpocket': 1.0.3 '@tronweb3/tronwallet-adapter-tronlink': 1.1.9 - '@tronweb3/tronwallet-adapter-walletconnect': 2.0.0(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) + '@tronweb3/tronwallet-adapter-walletconnect': 2.0.0(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -33731,7 +33749,7 @@ snapshots: - utf-8-validate - zod - '@tronweb3/walletconnect-tron@3.0.0(@types/react@18.2.14)(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)': + '@tronweb3/walletconnect-tron@3.0.0(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/modal': 2.6.2(@types/react@18.2.14)(react@18.2.0) '@walletconnect/sign-client': 2.16.1(@upstash/redis@1.22.1)(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -35165,15 +35183,15 @@ snapshots: optionalDependencies: typescript: 5.5.4 - '@wagmi/connectors@3.1.11(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8)': + '@wagmi/connectors@3.1.11(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8)': dependencies: '@coinbase/wallet-sdk': 3.9.3 '@safe-global/safe-apps-provider': 0.18.3(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) '@safe-global/safe-apps-sdk': 8.1.0(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) - '@walletconnect/ethereum-provider': 2.11.0(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10) + '@walletconnect/ethereum-provider': 2.11.0(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10) '@walletconnect/legacy-provider': 2.0.0(encoding@0.1.13) '@walletconnect/modal': 2.6.2(@types/react@18.2.14)(react@18.2.0) - '@walletconnect/utils': 2.11.0 + '@walletconnect/utils': 2.11.0(@upstash/redis@1.22.1) abitype: 0.8.7(typescript@5.5.4)(zod@3.23.8) eventemitter3: 4.0.7 viem: 0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) @@ -35348,9 +35366,9 @@ snapshots: - utf-8-validate - zod - '@wagmi/core@1.4.13(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8)': + '@wagmi/core@1.4.13(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8)': dependencies: - '@wagmi/connectors': 3.1.11(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) + '@wagmi/connectors': 3.1.11(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) abitype: 0.8.7(typescript@5.5.4)(zod@3.23.8) eventemitter3: 4.0.7 viem: 0.3.50(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) @@ -35428,7 +35446,7 @@ snapshots: dependencies: '@wallet-standard/base': 1.0.1 - '@walletconnect/core@2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': + '@walletconnect/core@2.11.0(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/heartbeat': 1.2.1 '@walletconnect/jsonrpc-provider': 1.0.13 @@ -35437,12 +35455,12 @@ snapshots: '@walletconnect/jsonrpc-ws-connection': 1.0.14(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@walletconnect/keyvaluestorage': 1.1.1(@upstash/redis@1.22.1) '@walletconnect/logger': 2.1.2(patch_hash=rvv5xppc7nrkuugnnppsvoyepa) - '@walletconnect/relay-api': 1.0.10 + '@walletconnect/relay-api': 1.0.11 '@walletconnect/relay-auth': 1.0.4 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.11.0 - '@walletconnect/utils': 2.11.0 + '@walletconnect/types': 2.11.0(@upstash/redis@1.22.1) + '@walletconnect/utils': 2.11.0(@upstash/redis@1.22.1) events: 3.3.0 isomorphic-unfetch: 3.1.0(encoding@0.1.13) lodash.isequal: 4.5.0 @@ -35556,17 +35574,17 @@ snapshots: dependencies: tslib: 1.14.1 - '@walletconnect/ethereum-provider@2.11.0(@types/react@18.2.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10)': + '@walletconnect/ethereum-provider@2.11.0(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.8(encoding@0.1.13) '@walletconnect/jsonrpc-provider': 1.0.14 '@walletconnect/jsonrpc-types': 1.0.4 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/modal': 2.6.2(@types/react@18.2.14)(react@18.2.0) - '@walletconnect/sign-client': 2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@walletconnect/types': 2.11.0 - '@walletconnect/universal-provider': 2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@walletconnect/utils': 2.11.0 + '@walletconnect/sign-client': 2.11.0(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@walletconnect/types': 2.11.0(@upstash/redis@1.22.1) + '@walletconnect/universal-provider': 2.11.0(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@walletconnect/utils': 2.11.0(@upstash/redis@1.22.1) events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -35840,16 +35858,16 @@ snapshots: dependencies: tslib: 1.14.1 - '@walletconnect/sign-client@2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': + '@walletconnect/sign-client@2.11.0(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': dependencies: - '@walletconnect/core': 2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@walletconnect/core': 2.11.0(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.1 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.1.2(patch_hash=rvv5xppc7nrkuugnnppsvoyepa) '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.11.0 - '@walletconnect/utils': 2.11.0 + '@walletconnect/types': 2.11.0(@upstash/redis@1.22.1) + '@walletconnect/utils': 2.11.0(@upstash/redis@1.22.1) events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -35930,7 +35948,7 @@ snapshots: dependencies: tslib: 1.14.1 - '@walletconnect/types@2.11.0': + '@walletconnect/types@2.11.0(@upstash/redis@1.22.1)': dependencies: '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.1 @@ -35999,16 +36017,16 @@ snapshots: - '@vercel/kv' - supports-color - '@walletconnect/universal-provider@2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': + '@walletconnect/universal-provider@2.11.0(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.8(encoding@0.1.13) '@walletconnect/jsonrpc-provider': 1.0.13 '@walletconnect/jsonrpc-types': 1.0.4 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.1.2(patch_hash=rvv5xppc7nrkuugnnppsvoyepa) - '@walletconnect/sign-client': 2.11.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@walletconnect/types': 2.11.0 - '@walletconnect/utils': 2.11.0 + '@walletconnect/sign-client': 2.11.0(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@walletconnect/types': 2.11.0(@upstash/redis@1.22.1) + '@walletconnect/utils': 2.11.0(@upstash/redis@1.22.1) events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -36086,17 +36104,17 @@ snapshots: - supports-color - utf-8-validate - '@walletconnect/utils@2.11.0': + '@walletconnect/utils@2.11.0(@upstash/redis@1.22.1)': dependencies: '@stablelib/chacha20poly1305': 1.0.1 '@stablelib/hkdf': 1.0.1 '@stablelib/random': 1.0.2 '@stablelib/sha256': 1.0.1 '@stablelib/x25519': 1.0.3 - '@walletconnect/relay-api': 1.0.10 + '@walletconnect/relay-api': 1.0.11 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.11.0 + '@walletconnect/types': 2.11.0(@upstash/redis@1.22.1) '@walletconnect/window-getters': 1.0.1 '@walletconnect/window-metadata': 1.0.1 detect-browser: 5.3.0 @@ -51216,7 +51234,7 @@ snapshots: picocolors: 1.0.0 stable: 0.1.8 - swarm-js@0.1.42(bufferutil@4.0.8)(utf-8-validate@5.0.10): + swarm-js@0.1.42(patch_hash=2sabagotzgj5qrte5szyhjypv4)(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: bluebird: 3.7.2 buffer: 5.7.1 @@ -53031,7 +53049,7 @@ snapshots: dependencies: '@types/node': 12.20.55 got: 12.1.0 - swarm-js: 0.1.42(bufferutil@4.0.8)(utf-8-validate@5.0.10) + swarm-js: 0.1.42(patch_hash=2sabagotzgj5qrte5szyhjypv4)(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - supports-color @@ -53041,7 +53059,7 @@ snapshots: dependencies: '@types/node': 12.20.55 got: 9.6.0 - swarm-js: 0.1.42(bufferutil@4.0.8)(utf-8-validate@5.0.10) + swarm-js: 0.1.42(patch_hash=2sabagotzgj5qrte5szyhjypv4)(bufferutil@4.0.8)(utf-8-validate@5.0.10) underscore: 1.9.1 transitivePeerDependencies: - bufferutil From ad97a76b95c84d5d7ac054fcb428d87ed4f469d3 Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Wed, 28 Aug 2024 23:18:58 +0000 Subject: [PATCH 04/46] chore: delete the tron app --- apps/tron/.env.example | 4 --- apps/tron/.eslintrc.js | 4 --- apps/tron/README.md | 22 ------------ apps/tron/next.config.mjs | 36 ------------------- apps/tron/package.json | 68 ------------------------------------ apps/tron/postcss.config.js | 6 ---- apps/tron/tailwind.config.js | 23 ------------ apps/tron/tsconfig.json | 29 --------------- apps/tron/turbo.json | 46 ------------------------ apps/web/.env.example | 5 +++ 10 files changed, 5 insertions(+), 238 deletions(-) delete mode 100644 apps/tron/.env.example delete mode 100644 apps/tron/.eslintrc.js delete mode 100644 apps/tron/README.md delete mode 100644 apps/tron/next.config.mjs delete mode 100644 apps/tron/package.json delete mode 100644 apps/tron/postcss.config.js delete mode 100644 apps/tron/tailwind.config.js delete mode 100644 apps/tron/tsconfig.json delete mode 100644 apps/tron/turbo.json diff --git a/apps/tron/.env.example b/apps/tron/.env.example deleted file mode 100644 index a8c0aae186..0000000000 --- a/apps/tron/.env.example +++ /dev/null @@ -1,4 +0,0 @@ -NEXT_TELEMETRY_DISABLED=1 -NEXT_PUBLIC_TRON_PRO_API_KEY='' -BITQUERY_API_KEY='' -BITQUERY_BEARER_TOKEN='' \ No newline at end of file diff --git a/apps/tron/.eslintrc.js b/apps/tron/.eslintrc.js deleted file mode 100644 index a3daeaa1ab..0000000000 --- a/apps/tron/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - // extends: ['sushi/next'], - extends: 'next/core-web-vitals', -} diff --git a/apps/tron/README.md b/apps/tron/README.md deleted file mode 100644 index c7e6a371ea..0000000000 --- a/apps/tron/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Tron - -Tron application - -## Quickstart - -```sh -cp .env.example .env -cp .env.test .env.test.local -``` - -## Development - -```sh -pnpm exec turbo run dev --filter tron -``` - -## Build - -```sh -pnpm exec turbo run build --filter tron -``` \ No newline at end of file diff --git a/apps/tron/next.config.mjs b/apps/tron/next.config.mjs deleted file mode 100644 index 19eb5099c8..0000000000 --- a/apps/tron/next.config.mjs +++ /dev/null @@ -1,36 +0,0 @@ -import defaultNextConfig from "@sushiswap/nextjs-config"; - -/** @type {import('next').NextConfig} */ -const nextConfig = { - ...defaultNextConfig, - logging: { - fetches: { - fullUrl: true, - }, - }, - transpilePackages: ["@sushiswap/ui"], - images: { - remotePatterns: [ - { - protocol: "https", - hostname: "static.tronscan.org", - port: "", - pathname: "**", - }, - ], - }, - async redirects() { - return [ - { - source: "/", - permanent: true, - destination: "/swap", - }, - ]; - }, - async rewrites() { - return []; - }, -}; - -export default nextConfig; diff --git a/apps/tron/package.json b/apps/tron/package.json deleted file mode 100644 index a738b49cfc..0000000000 --- a/apps/tron/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "@sushiswap/tron", - "version": "0.0.0", - "private": true, - "scripts": { - "build": "next build", - "check": "tsc --pretty --noEmit", - "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next && rm -rf .swc", - "dev": "next dev", - "lint": "TIMING=1 next lint", - "lint:fix": "TIMING=1 next lint --fix", - "start": "next start" - }, - "dependencies": { - "@headlessui/react": "1.7.7", - "@heroicons/react": "2.0.13", - "@radix-ui/react-slot": "1.0.2", - "@sentry/nextjs": "7.101.1", - "@sushiswap/hooks": "workspace:*", - "@sushiswap/nextjs-config": "workspace:*", - "@sushiswap/react-query": "workspace:*", - "@sushiswap/tailwindcss-config": "workspace:*", - "@sushiswap/ui": "workspace:*", - "@sushiswap/notifications": "workspace:*", - "@tanstack/react-query": "5.51.16", - "@tanstack/react-query-devtools": "4.28.0", - "@tanstack/react-query-persist-client": "4.28.0", - "@tanstack/react-table": "8.9.1", - "@vercel/analytics": "1.3.1", - "@vercel/edge-config": "1.2.0", - "@tronweb3/tronwallet-abstract-adapter": "^1.1.6", - "@tronweb3/tronwallet-adapter-react-hooks": "^1.1.7", - "@tronweb3/tronwallet-adapter-react-ui": "^1.1.8", - "@tronweb3/tronwallet-adapters": "^1.2.1", - "ethers": "^5.7.2", - "lodash.once": "4.1.1", - "next": "14.2.3", - "next-themes": "0.2.1", - "react": "18.2.0", - "react-dom": "18.2.0", - "react-infinite-scroll-component": "6.1.0", - "react-slider": "2.0.4", - "react-virtualized-auto-sizer": "1.0.7", - "sharp": "0.32.6", - "sushi": "workspace:*", - "tiny-invariant": "1.3.1", - "zod": "3.23.8", - "tronweb": "^5.3.2" - }, - "devDependencies": { - "@next/eslint-plugin-next": "14.2.3", - "@sushiswap/typescript-config": "workspace:*", - "@tsconfig/next": "2.0.1", - "@types/lodash.once": "4.1.9", - "@types/node": "20", - "@types/react": "18.2.14", - "@types/react-dom": "18.2.6", - "@types/react-slider": "1.3.1", - "@types/react-virtualized-auto-sizer": "1.0.1", - "autoprefixer": "10.4.14", - "eslint-config-next": "14.2.3", - "eslint-config-sushi": "workspace:*", - "postcss": "8.4.23", - "tailwindcss": "3.3.2", - "typescript": "5.5.4", - "unimported": "1.30.0" - } -} diff --git a/apps/tron/postcss.config.js b/apps/tron/postcss.config.js deleted file mode 100644 index 33ad091d26..0000000000 --- a/apps/tron/postcss.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -} diff --git a/apps/tron/tailwind.config.js b/apps/tron/tailwind.config.js deleted file mode 100644 index 0ec1d5e5f6..0000000000 --- a/apps/tron/tailwind.config.js +++ /dev/null @@ -1,23 +0,0 @@ -import sharedConfig from '@sushiswap/tailwindcss-config' - -// @ts-check -/** @type {import('tailwindcss').Config} */ -const tailwindConfig = { - darkMode: 'class', - presets: [sharedConfig], - theme: { - extend: { - display: ['group-hover'], - visibility: ['group-hover'], - keyframes: { - dash: { - to: { - 'stroke-dashoffset': '0', - }, - }, - }, - }, - }, -} - -export default tailwindConfig diff --git a/apps/tron/tsconfig.json b/apps/tron/tsconfig.json deleted file mode 100644 index 44cf5dc322..0000000000 --- a/apps/tron/tsconfig.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": ".", - "target": "ESNext", - "lib": ["DOM", "DOM.Iterable", "ESNext"], - "paths": { - "~tron/*": ["src/app/*"], - }, - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "plugins": [ - { - "name": "next" - } - ] - }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"] -} diff --git a/apps/tron/turbo.json b/apps/tron/turbo.json deleted file mode 100644 index affdd7c31d..0000000000 --- a/apps/tron/turbo.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "extends": ["//"], - "tasks": { - "build": { - "inputs": [ - "public", - "src/**", - "package.json", - "next.config.mjs", - "postcss.config.js", - "sentry.client.config.ts", - "sentry.edge.config.ts", - "sentry.server.config.ts", - "tailwind.config.js", - "tsconfig.json", - ".env.production.local", - ".env.local", - ".env.production", - ".env" - ], - "outputs": [".next/**", "!.next/cache/**"], - "dependsOn": ["^build"] - }, - "check": { - "dependsOn": ["^build"], - "cache": false - }, - "dev": { - "dependsOn": ["^build"], - "cache": false, - "persistent": true, - "inputs": [ - "$TURBO_DEFAULT$", - ".env.development.local", - ".env.local", - ".env.development", - ".env" - ] - }, - "test": { - "inputs": ["test/**", ".env.test.local", ".env.test", ".env"], - "outputs": ["test-results/**"], - "dependsOn": ["build"] - } - } -} diff --git a/apps/web/.env.example b/apps/web/.env.example index d14d60ab3b..5f2aba125e 100644 --- a/apps/web/.env.example +++ b/apps/web/.env.example @@ -14,3 +14,8 @@ DRPC_ID= SUSHI_DATA_API_HOST= NEXT_PUBLIC_SUSHI_DATA_API_HOST= + +# Tron +NEXT_PUBLIC_TRON_PRO_API_KEY='' +BITQUERY_API_KEY='' +BITQUERY_BEARER_TOKEN='' \ No newline at end of file From b6402186cec37ebd18f46fa0cc5cfb07b7676582 Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Wed, 28 Aug 2024 23:32:26 +0000 Subject: [PATCH 05/46] chore: cleanup --- apps/web/package.json | 12 +- apps/web/src/app/(cms)/lib/strapi/article.ts | 111 ------------------ .../src/app/(cms)/lib/strapi/articleMeta.ts | 37 ------ .../src/app/(cms)/lib/strapi/articleSlugs.ts | 33 ------ apps/web/src/app/(cms)/lib/strapi/image.ts | 33 ------ .../src/app/(cms)/lib/strapi/moreArticles.ts | 27 ----- .../app/(cms)/lib/strapi/previewPostBySlug.ts | 31 ----- apps/web/src/lib/redis.ts | 9 -- 8 files changed, 1 insertion(+), 292 deletions(-) delete mode 100644 apps/web/src/app/(cms)/lib/strapi/article.ts delete mode 100644 apps/web/src/app/(cms)/lib/strapi/articleMeta.ts delete mode 100644 apps/web/src/app/(cms)/lib/strapi/articleSlugs.ts delete mode 100644 apps/web/src/app/(cms)/lib/strapi/image.ts delete mode 100644 apps/web/src/app/(cms)/lib/strapi/moreArticles.ts delete mode 100644 apps/web/src/app/(cms)/lib/strapi/previewPostBySlug.ts delete mode 100644 apps/web/src/lib/redis.ts diff --git a/apps/web/package.json b/apps/web/package.json index d8984a5eef..84b2eb6f0c 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -15,12 +15,8 @@ "test": "npx playwright test -c test/playwright.config.ts" }, "dependencies": { - "@aptos-labs/wallet-adapter-ant-design": "2.2.0", "@aptos-labs/wallet-adapter-core": "3.10.0", "@aptos-labs/wallet-adapter-react": "2.3.1", - "@aptstats/aptos-wallet-framework": "^0.0.6", - "@aptstats/safepal-wallet-extension": "^0.0.3", - "@blocto/aptos-wallet-adapter-plugin": "^0.2.9", "@cloudinary/url-gen": "1.11.2", "@covalenthq/client-sdk": "2.0.2", "@headlessui/react": "1.7.7", @@ -53,7 +49,6 @@ "@sushiswap/ui": "workspace:*", "@tanstack/react-query": "5.51.16", "@tanstack/react-query-devtools": "4.28.0", - "@tanstack/react-query-persist-client": "4.28.0", "@tanstack/react-table": "8.9.1", "@tryghost/content-api": "1.11.17", "@upstash/ratelimit": "0.4.4", @@ -71,7 +66,6 @@ "echarts-for-react": "3.0.2", "fewcha-plugin-wallet-adapter": "^0.1.3", "framer-motion": "7.10.3", - "ioredis": "5.3.2", "lodash.frompairs": "^4.0.1", "lodash.maxby": "^4.6.0", "lodash.once": "4.1.1", @@ -89,11 +83,9 @@ "react-dropzone": "14.2.3", "react-hook-form": "7.41.2", "react-infinite-scroll-component": "6.1.0", - "react-slider": "2.0.4", "react-toastify": "9.1.3", "react-virtualized-auto-sizer": "1.0.7", "react-window": "1.8.7", - "sharp": "0.32.6", "strapi-sdk-js": "2.3.3", "sushi": "workspace:*", "swr": "2.1.5", @@ -126,7 +118,6 @@ "@types/node": "22", "@types/react": "18.2.14", "@types/react-dom": "18.2.6", - "@types/react-slider": "1.3.1", "@types/react-virtualized-auto-sizer": "1.0.1", "@types/react-window": "1.8.5", "@types/tryghost__content-api": "1.3.12", @@ -138,7 +129,6 @@ "schema-dts": "^1.1.2", "tailwindcss": "3.3.2", "tsx": "^4.16.5", - "typescript": "5.4.5", - "unimported": "1.30.0" + "typescript": "5.4.5" } } diff --git a/apps/web/src/app/(cms)/lib/strapi/article.ts b/apps/web/src/app/(cms)/lib/strapi/article.ts deleted file mode 100644 index 9bb74fd725..0000000000 --- a/apps/web/src/app/(cms)/lib/strapi/article.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { PaginationByOffset, PaginationByPage } from 'strapi-sdk-js' -import { z } from 'zod' -import { imageSchema } from './image' -import { strapi } from './strapi' - -export const articleSchema = z.array( - z - .object({ - id: z.number(), - attributes: z.object({ - title: z.string(), - description: z.string(), - ghostSlug: z.string(), - slug: z.string(), - updatedAt: z.string(), - publishedAt: z.string(), - categories: z.object({ - data: z.array( - z.object({ - id: z.number(), - attributes: z.object({ - name: z.string(), - description: z.string(), - slug: z.string(), - }), - }), - ), - }), - cover: imageSchema, - authors: z.object({ - data: z.array( - z.object({ - attributes: z.object({ - name: z.string(), - email: z.string(), - handle: z.string(), - avatar: imageSchema, - }), - }), - ), - }), - }), - }) - .transform((data) => ({ - id: data.id, - title: data.attributes.title, - description: data.attributes.description, - ghostSlug: data.attributes.ghostSlug, - slug: data.attributes.slug, - updatedAt: data.attributes.updatedAt, - publishedAt: data.attributes.publishedAt, - categories: data.attributes.categories.data.map((category) => ({ - id: category.id, - name: category.attributes.name, - description: category.attributes.description, - slug: category.attributes.slug, - })), - cover: data.attributes.cover, - authors: data.attributes.authors.data.map((author) => ({ - name: author.attributes.name, - email: author.attributes.email, - handle: author.attributes.handle, - avatar: author.attributes.avatar, - })), - })), -) - -export type Article = z.infer[number] - -export async function getArticle({ slug }: { slug: string }) { - const { data } = await strapi.find('articles', { - populate: ['categories', 'cover', 'authors', 'authors.avatar'], - filters: { - slug: { - $eq: slug, - }, - }, - }) - - const parsed = articleSchema.parse(data)[0] || null - - return parsed -} - -interface GetArticlesOptions { - filters?: Record - pagination?: PaginationByPage | PaginationByOffset -} - -export async function getArticles({ - pagination, - filters, -}: GetArticlesOptions = {}) { - const { data } = await strapi.find('articles', { - populate: ['categories', 'cover', 'authors', 'authors.avatar'], - pagination, - filters: { - ...filters, - articleTypes: { - type: { - $eq: 'blog', - }, - }, - }, - sort: 'publishedAt:desc', - }) - - const parsed = articleSchema.parse(data) - - return parsed -} diff --git a/apps/web/src/app/(cms)/lib/strapi/articleMeta.ts b/apps/web/src/app/(cms)/lib/strapi/articleMeta.ts deleted file mode 100644 index 1e8619b2b9..0000000000 --- a/apps/web/src/app/(cms)/lib/strapi/articleMeta.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { z } from 'zod' -import { strapi } from './strapi' - -const schema = z - .object({ - pagination: z.object({ - total: z.number(), - }), - }) - .transform((data) => data.pagination) - -export type ArticleMeta = z.infer - -interface GetArticleMetaOptions { - filters?: Record -} - -export async function getArticleMeta({ filters }: GetArticleMetaOptions = {}) { - const { meta } = await strapi.find('articles', { - filters: { - ...filters, - articleTypes: { - type: { - $eq: 'blog', - }, - }, - }, - pagination: { - start: 0, - limit: 1, - }, - }) - - const parsed = schema.parse(meta) - - return parsed -} diff --git a/apps/web/src/app/(cms)/lib/strapi/articleSlugs.ts b/apps/web/src/app/(cms)/lib/strapi/articleSlugs.ts deleted file mode 100644 index 114805781a..0000000000 --- a/apps/web/src/app/(cms)/lib/strapi/articleSlugs.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { z } from 'zod' -import { strapi } from './strapi' - -const schema = z.array( - z - .object({ - attributes: z.object({ - slug: z.string(), - }), - }) - .transform((data) => data.attributes.slug), -) - -export async function getArticleSlugs() { - const { data } = await strapi.find('articles', { - fields: ['slug'], - filters: { - articleTypes: { - type: { - $eq: 'blog', - }, - }, - }, - pagination: { - start: 0, - limit: 10000, - }, - }) - - const parsed = schema.parse(data) - - return parsed -} diff --git a/apps/web/src/app/(cms)/lib/strapi/image.ts b/apps/web/src/app/(cms)/lib/strapi/image.ts deleted file mode 100644 index 5d3ef0d6de..0000000000 --- a/apps/web/src/app/(cms)/lib/strapi/image.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { z } from 'zod' - -export const imageSchema = z - .object({ - data: z.object({ - id: z.number(), - attributes: z.object({ - name: z.string(), - alternativeText: z - .string() - .nullable() - .transform((value) => value ?? ''), - caption: z - .string() - .nullable() - .transform((value) => value ?? ''), - width: z.number(), - height: z.number(), - formats: z.object({ - thumbnail: z.object({ - url: z.string(), - width: z.number(), - height: z.number(), - }), - }), - mime: z.string(), - url: z.string(), - hash: z.string(), - provider_metadata: z.object({ public_id: z.string() }), - }), - }), - }) - .transform((data) => data.data.attributes) diff --git a/apps/web/src/app/(cms)/lib/strapi/moreArticles.ts b/apps/web/src/app/(cms)/lib/strapi/moreArticles.ts deleted file mode 100644 index ca762315b0..0000000000 --- a/apps/web/src/app/(cms)/lib/strapi/moreArticles.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { articleSchema } from './article' -import { strapi } from './strapi' - -export async function getMoreArticles(slug: string) { - const { data: moreArticles } = await strapi.find('articles', { - populate: ['categories', 'cover', 'authors', 'authors.avatar'], - filters: { - slug: { - $ne: slug, - }, - articleTypes: { - type: { - $eq: 'blog', - }, - }, - }, - pagination: { - start: 0, - limit: 2, - }, - sort: 'publishedAt:desc', - }) - - const moreArticlesParsed = articleSchema.parse(moreArticles) - - return moreArticlesParsed -} diff --git a/apps/web/src/app/(cms)/lib/strapi/previewPostBySlug.ts b/apps/web/src/app/(cms)/lib/strapi/previewPostBySlug.ts deleted file mode 100644 index 3545e1676a..0000000000 --- a/apps/web/src/app/(cms)/lib/strapi/previewPostBySlug.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { z } from 'zod' -import { strapi } from './strapi' - -const schema = z.array( - z - .object({ - attributes: z.object({ - slug: z.string(), - }), - }) - .transform((data) => data.attributes), -) - -export async function getPreviewPostBySlug(slug: string) { - const { data } = await strapi.find('articles', { - fields: ['slug'], - filters: { - slug: { - $eq: slug, - }, - }, - pagination: { - start: 0, - limit: 1, - }, - }) - - const parsed = schema.parse(data)[0] - - return parsed ? parsed : null -} diff --git a/apps/web/src/lib/redis.ts b/apps/web/src/lib/redis.ts deleted file mode 100644 index ca1d56d685..0000000000 --- a/apps/web/src/lib/redis.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Redis } from 'ioredis' - -const redisUrl = process.env['REDIS_URL'] - -if (!redisUrl) throw new Error('REDIS_URL is required') - -const redis = new Redis(redisUrl) - -export default redis From 9c407d050e2af2a33bb9e3fd7d2b4cb9e0aed0b4 Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Sun, 1 Sep 2024 14:06:47 +0000 Subject: [PATCH 06/46] fix(tron): images, layout --- .../tron/_common/ui/General/Icon.tsx | 1 + apps/web/src/app/(non-evm)/tron/header.tsx | 4 +- apps/web/src/app/(non-evm)/tron/layout.tsx | 64 +- config/nextjs/index.js | 2 +- pnpm-lock.yaml | 6259 +---------------- 5 files changed, 21 insertions(+), 6309 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx index 7b7bfbbc82..37cf412d93 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx @@ -13,6 +13,7 @@ export const Icon = ({ currency, height = 40, width = 40 }: IconProps) => { <> {currency?.logoURI ? ( src} src={currency?.logoURI} alt="" className="rounded-full" diff --git a/apps/web/src/app/(non-evm)/tron/header.tsx b/apps/web/src/app/(non-evm)/tron/header.tsx index d451b30ffa..7dd2c5e384 100644 --- a/apps/web/src/app/(non-evm)/tron/header.tsx +++ b/apps/web/src/app/(non-evm)/tron/header.tsx @@ -12,13 +12,13 @@ import { WalletConnector } from '~tron/_common/ui/WalletConnector/WalletConnecto const nagivationElements: NavigationElement[] = [ { title: 'Swap', - href: '/aptos/swap', + href: '/tron/swap', show: 'everywhere', type: NavigationElementType.Single, }, { title: 'Pool', - href: '/aptos/pool', + href: '/tron/pool', show: 'everywhere', type: NavigationElementType.Single, }, diff --git a/apps/web/src/app/(non-evm)/tron/layout.tsx b/apps/web/src/app/(non-evm)/tron/layout.tsx index 28f1fc8384..30c2634d1c 100644 --- a/apps/web/src/app/(non-evm)/tron/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/layout.tsx @@ -1,72 +1,16 @@ import '@sushiswap/ui/index.css' -import type { Metadata } from 'next' -import { Inter, Roboto_Mono } from 'next/font/google' import React from 'react' import { Header } from './header' import { Providers } from './providers' -import { Trackers } from './trackers' - -const inter = Inter({ - subsets: ['latin'], - display: 'swap', - variable: '--font-inter', -}) - -const roboto_mono = Roboto_Mono({ - subsets: ['latin'], - display: 'swap', - variable: '--font-roboto-mono', -}) - -export const metadata: Metadata = { - title: { - default: 'Sushi 🍣', - template: '%s | Sushi 🍣', - }, - description: - 'A Decentralised Finance (DeFi) app with features such as swap, cross chain swap, streaming, vesting, and permissionless market making for liquidity providers.', -} export default function RootLayout({ children, }: { children: React.ReactNode }) { return ( - // - - - - - - - - -
    - -
    - {children} - - -
    - - + +
    + {children} + ) } diff --git a/config/nextjs/index.js b/config/nextjs/index.js index ec086789cd..2e3ae64942 100644 --- a/config/nextjs/index.js +++ b/config/nextjs/index.js @@ -27,7 +27,7 @@ const defaultNextConfig = { images: { loader: 'cloudinary', path: 'https://res.cloudinary.com/sushi-cdn/image/fetch/', - domains: ['cdn.sushi.com'], + domains: ['cdn.sushi.com', "static.tronscan.org"], }, eslint: { dirs: [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ec5e1c61f1..a64beecee7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -374,180 +374,14 @@ importers: specifier: 4.3.9 version: 4.3.9(@types/node@22.1.0)(less@4.2.0)(terser@5.30.3) - apps/tron: - dependencies: - '@headlessui/react': - specifier: 1.7.7 - version: 1.7.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@heroicons/react': - specifier: 2.0.13 - version: 2.0.13(react@18.2.0) - '@radix-ui/react-slot': - specifier: 1.0.2 - version: 1.0.2(@types/react@18.2.14)(react@18.2.0) - '@sentry/nextjs': - specifier: 7.101.1 - version: 7.101.1(encoding@0.1.13)(next@14.2.3(@babel/core@7.24.4)(@opentelemetry/api@1.9.0)(@playwright/test@1.45.0)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)(webpack@5.91.0) - '@sushiswap/hooks': - specifier: workspace:* - version: link:../../packages/hooks - '@sushiswap/nextjs-config': - specifier: workspace:* - version: link:../../config/nextjs - '@sushiswap/notifications': - specifier: workspace:* - version: link:../../packages/notifications - '@sushiswap/react-query': - specifier: workspace:* - version: link:../../packages/react-query - '@sushiswap/tailwindcss-config': - specifier: workspace:* - version: link:../../config/tailwindcss - '@sushiswap/ui': - specifier: workspace:* - version: link:../../packages/ui - '@tanstack/react-query': - specifier: 5.51.16 - version: 5.51.16(react@18.2.0) - '@tanstack/react-query-devtools': - specifier: 4.28.0 - version: 4.28.0(@tanstack/react-query@5.51.16(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@tanstack/react-query-persist-client': - specifier: 4.28.0 - version: 4.28.0(@tanstack/react-query@5.51.16(react@18.2.0)) - '@tanstack/react-table': - specifier: 8.9.1 - version: 8.9.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@tronweb3/tronwallet-abstract-adapter': - specifier: ^1.1.6 - version: 1.1.6 - '@tronweb3/tronwallet-adapter-react-hooks': - specifier: ^1.1.7 - version: 1.1.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@tronweb3/tronwallet-adapter-react-ui': - specifier: ^1.1.8 - version: 1.1.8(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@tronweb3/tronwallet-adapters': - specifier: ^1.2.1 - version: 1.2.2(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8) - '@vercel/analytics': - specifier: 1.3.1 - version: 1.3.1(next@14.2.3(@babel/core@7.24.4)(@opentelemetry/api@1.9.0)(@playwright/test@1.45.0)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0) - '@vercel/edge-config': - specifier: 1.2.0 - version: 1.2.0(@opentelemetry/api@1.9.0) - ethers: - specifier: ^5.7.2 - version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) - lodash.once: - specifier: 4.1.1 - version: 4.1.1 - next: - specifier: 14.2.3 - version: 14.2.3(@babel/core@7.24.4)(@opentelemetry/api@1.9.0)(@playwright/test@1.45.0)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - next-themes: - specifier: 0.2.1 - version: 0.2.1(next@14.2.3(@babel/core@7.24.4)(@opentelemetry/api@1.9.0)(@playwright/test@1.45.0)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: - specifier: 18.2.0 - version: 18.2.0 - react-dom: - specifier: 18.2.0 - version: 18.2.0(react@18.2.0) - react-infinite-scroll-component: - specifier: 6.1.0 - version: 6.1.0(react@18.2.0) - react-slider: - specifier: 2.0.4 - version: 2.0.4(react@18.2.0) - react-virtualized-auto-sizer: - specifier: 1.0.7 - version: 1.0.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - sharp: - specifier: 0.32.6 - version: 0.32.6 - sushi: - specifier: workspace:* - version: link:../../packages/sushi - tiny-invariant: - specifier: 1.3.1 - version: 1.3.1 - tronweb: - specifier: ^5.3.2 - version: 5.3.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) - zod: - specifier: 3.23.8 - version: 3.23.8 - devDependencies: - '@next/eslint-plugin-next': - specifier: 14.2.3 - version: 14.2.3 - '@sushiswap/typescript-config': - specifier: workspace:* - version: link:../../config/typescript - '@tsconfig/next': - specifier: 2.0.1 - version: 2.0.1 - '@types/lodash.once': - specifier: 4.1.9 - version: 4.1.9 - '@types/node': - specifier: '20' - version: 20.14.14 - '@types/react': - specifier: 18.2.14 - version: 18.2.14 - '@types/react-dom': - specifier: 18.2.6 - version: 18.2.6 - '@types/react-slider': - specifier: 1.3.1 - version: 1.3.1 - '@types/react-virtualized-auto-sizer': - specifier: 1.0.1 - version: 1.0.1 - autoprefixer: - specifier: 10.4.14 - version: 10.4.14(postcss@8.4.23) - eslint-config-next: - specifier: 14.2.3 - version: 14.2.3(eslint@8.57.0)(typescript@5.5.4) - eslint-config-sushi: - specifier: workspace:* - version: link:../../config/eslint - postcss: - specifier: 8.4.23 - version: 8.4.23 - tailwindcss: - specifier: 3.3.2 - version: 3.3.2(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4)) - typescript: - specifier: 5.5.4 - version: 5.5.4 - unimported: - specifier: 1.30.0 - version: 1.30.0(eslint@8.57.0) - apps/web: dependencies: - '@aptos-labs/wallet-adapter-ant-design': - specifier: 2.2.0 - version: 2.2.0(@aptos-labs/ts-sdk@1.27.0)(aptos@1.21.0)(date-fns@2.30.0)(moment@2.29.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@aptos-labs/wallet-adapter-core': specifier: 3.10.0 version: 3.10.0(@aptos-labs/ts-sdk@1.27.0)(aptos@1.21.0) '@aptos-labs/wallet-adapter-react': specifier: 2.3.1 version: 2.3.1(@aptos-labs/ts-sdk@1.27.0)(aptos@1.21.0)(react@18.2.0) - '@aptstats/aptos-wallet-framework': - specifier: ^0.0.6 - version: 0.0.6(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4))(@types/babel__core@7.20.5)(aptos@1.21.0)(bufferutil@4.0.8)(eslint@8.57.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(type-fest@4.18.3)(typescript@5.5.4)(utf-8-validate@5.0.10)(vue-template-compiler@2.7.16) - '@aptstats/safepal-wallet-extension': - specifier: ^0.0.3 - version: 0.0.3(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4))(@types/babel__core@7.20.5)(aptos@1.21.0)(bufferutil@4.0.8)(eslint@8.57.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(type-fest@4.18.3)(typescript@5.5.4)(utf-8-validate@5.0.10)(vue-template-compiler@2.7.16) - '@blocto/aptos-wallet-adapter-plugin': - specifier: ^0.2.9 - version: 0.2.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@cloudinary/url-gen': specifier: 1.11.2 version: 1.11.2 @@ -644,9 +478,6 @@ importers: '@tanstack/react-query-devtools': specifier: 4.28.0 version: 4.28.0(@tanstack/react-query@5.51.16(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@tanstack/react-query-persist-client': - specifier: 4.28.0 - version: 4.28.0(@tanstack/react-query@5.51.16(react@18.2.0)) '@tanstack/react-table': specifier: 8.9.1 version: 8.9.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -710,9 +541,6 @@ importers: framer-motion: specifier: 7.10.3 version: 7.10.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - ioredis: - specifier: 5.3.2 - version: 5.3.2 lodash.frompairs: specifier: ^4.0.1 version: 4.0.1 @@ -764,9 +592,6 @@ importers: react-infinite-scroll-component: specifier: 6.1.0 version: 6.1.0(react@18.2.0) - react-slider: - specifier: 2.0.4 - version: 2.0.4(react@18.2.0) react-toastify: specifier: 9.1.3 version: 9.1.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -776,9 +601,6 @@ importers: react-window: specifier: 1.8.7 version: 1.8.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - sharp: - specifier: 0.32.6 - version: 0.32.6 strapi-sdk-js: specifier: 2.3.3 version: 2.3.3 @@ -858,9 +680,6 @@ importers: '@types/react-dom': specifier: 18.2.6 version: 18.2.6 - '@types/react-slider': - specifier: 1.3.1 - version: 1.3.1 '@types/react-virtualized-auto-sizer': specifier: 1.0.1 version: 1.0.1 @@ -897,9 +716,6 @@ importers: typescript: specifier: 5.5.4 version: 5.5.4 - unimported: - specifier: 1.30.0 - version: 1.30.0(eslint@8.57.0) config/eslint: dependencies: @@ -2077,36 +1893,6 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@ant-design/colors@7.0.2': - resolution: {integrity: sha512-7KJkhTiPiLHSu+LmMJnehfJ6242OCxSlR3xHVBecYxnMW8MS/878NXct1GqYARyL59fyeFdKRxXTfvR9SnDgJg==} - - '@ant-design/cssinjs@1.20.0': - resolution: {integrity: sha512-uG3iWzJxgNkADdZmc6W0Ci3iQAUOvLMcM8SnnmWq3r6JeocACft4ChnY/YWvI2Y+rG/68QBla/O+udke1yH3vg==} - peerDependencies: - react: '>=16.0.0' - react-dom: '>=16.0.0' - - '@ant-design/icons-svg@4.4.2': - resolution: {integrity: sha512-vHbT+zJEVzllwP+CM+ul7reTEfBR0vgxFe7+lREAsAA7YGsYpboiq2sQNeQeRvh09GfQgs/GyFEvZpJ9cLXpXA==} - - '@ant-design/icons@5.3.7': - resolution: {integrity: sha512-bCPXTAg66f5bdccM4TT21SQBDO1Ek2gho9h3nO9DAKXJP4sq+5VBjrQMSxMVXSB3HyEz+cUbHQ5+6ogxCOpaew==} - engines: {node: '>=8'} - peerDependencies: - react: '>=16.0.0' - react-dom: '>=16.0.0' - - '@ant-design/react-slick@1.1.2': - resolution: {integrity: sha512-EzlvzE6xQUBrZuuhSAFTdsr4P2bBBHGZwKFemEfq8gIGyIQCxalYfZW/T2ORbtQx5rU69o+WycP3exY/7T1hGA==} - peerDependencies: - react: '>=16.9.0' - - '@apideck/better-ajv-errors@0.3.6': - resolution: {integrity: sha512-P+ZygBLZtkp0qqOAJJVX4oX/sFo5JR3eBWwwuqHHhK0GIgQOKWrAfiAaWX0aArHkRWHMuggFEgAZNxVPwPZYaA==} - engines: {node: '>=10'} - peerDependencies: - ajv: '>=8' - '@aptos-connect/wallet-adapter-plugin@1.0.1': resolution: {integrity: sha512-yrnzO9gWMPqhgV0hz3Qv9XP98hefX/V7Pcj911SLM3NWktc+mL/5CW6BKz4VKcqnhewotd2Tek43VDZTSHKoeQ==} peerDependencies: @@ -2136,18 +1922,10 @@ packages: resolution: {integrity: sha512-6kljJFRsTLXCvgkNhBoOLhVyo7rmih+8+XAtdeciIXkZYwzwVS3TFPLMqBUO2HcY6gYtQQRmTG52R5ihyi/bXA==} hasBin: true - '@aptos-labs/aptos-client@0.0.2': - resolution: {integrity: sha512-FgKZb5zDPz8MmAcVxXzYhxP6OkzuIPoDRJp48YJ8+vrZ9EOZ35HaWGN2M3u+GPdnFE9mODFqkxw3azh3kHGZjQ==} - engines: {node: '>=15.10.0'} - '@aptos-labs/aptos-client@0.1.0': resolution: {integrity: sha512-q3s6pPq8H2buGp+tPuIRInWsYOuhSEwuNJPwd2YnsiID3YSLihn2ug39ktDJAcSOprUcp7Nid8WK7hKqnUmSdA==} engines: {node: '>=15.10.0'} - '@aptos-labs/ts-sdk@0.0.3': - resolution: {integrity: sha512-1qVcKAMToLI+EOrw0kQvL9/yyXZ7iU4/NIpvFokIWK6DNe3ExSu+SebwFc0jAqyy/kvMWht8FBF2hnmW2G1pyA==} - engines: {node: '>=11.0.0'} - '@aptos-labs/ts-sdk@1.14.0': resolution: {integrity: sha512-k1xaQSIdi6NTgIEwGG2xoPHnwkKFARsJjWnYBnp0OIz4LX2rDy/BiLSYeXDmLu8ku7SxyydNpTVimHlCOY4FEw==} engines: {node: '>=11.0.0'} @@ -2156,12 +1934,6 @@ packages: resolution: {integrity: sha512-LsQpkrVEXGLaDFSLXvvU0+1X27kTlGBiy1rZqfcaW2hARN9m/Bc/AjztxXKeEXS/D7QmEJAeB6RS7CLM8aqC3w==} engines: {node: '>=11.0.0'} - '@aptos-labs/wallet-adapter-ant-design@2.2.0': - resolution: {integrity: sha512-1Vbf8ukgfOblbzEB8bsN5GIjfT3XWJS4e1YIDRR09b2hhFqroYJAPhuuLuDWn//ZNgR6Q0TxJmvTzUzwj2DaOQ==} - peerDependencies: - react: ^18 - react-dom: ^18 - '@aptos-labs/wallet-adapter-core@0.1.7': resolution: {integrity: sha512-g3HvX31kuFT5HqEe9Vh0ZgV1u0Otsfx54yeAwL7RO8CioBVBjYELhMsOYz0BOjecmAKhQ14G60VU8MqDyzYkIA==} @@ -2171,11 +1943,6 @@ packages: '@aptos-labs/wallet-adapter-core@2.2.0': resolution: {integrity: sha512-JL0zTXXoSQba1EDGqY5yTJxZVKMKwgMKZNA1JyV54s5loWzE2tinwg002EB+ONodkVmMhKbWnajCFFOgvgk+NQ==} - '@aptos-labs/wallet-adapter-core@2.6.0': - resolution: {integrity: sha512-GVnjnwzW/dnEW1ceHUB6vj9u37Hth38oIngc4ERdXf9cl9BlXut4e0bLHCUrbHGOtF7rx1NuDVwYH7GYsh6vSQ==} - peerDependencies: - aptos: ^1.19.0 - '@aptos-labs/wallet-adapter-core@3.10.0': resolution: {integrity: sha512-dKbSao2bexRzxf9UjcbTj4XIm29YT7R4X7BNZOB1g1jxW3Cc6VLilyWWb+mO9napsjMLv+NhAyF0q9ipJ2TKQQ==} peerDependencies: @@ -2208,25 +1975,6 @@ packages: '@aptos-labs/ts-sdk': ^1.17.0 '@wallet-standard/core': ^1.0.3 - '@aptstats/aptos-wallet-framework@0.0.2': - resolution: {integrity: sha512-HcagZHjKPGopDcs51XSfj2AX8yVaUONixjbGOOX+ydeBkMPFOoiDFeGXCVa3MklNncap1VGE+F/izND5gUDs3A==} - peerDependencies: - aptos: ^1.3.16 - react: ^18.X.X || 17.X.X - react-dom: ^18.X.X || 17.X.X - - '@aptstats/aptos-wallet-framework@0.0.6': - resolution: {integrity: sha512-EU9W6jygRksRCoke+zoue6+md1Q4kTrQHHyKzBf0gypVHidhEnwqZbdW45po80flkdIyfiX2Z+WLWOaKREqWOg==} - peerDependencies: - aptos: ^1.3.16 - react: ^18.X.X || 17.X.X - react-dom: ^18.X.X || 17.X.X - - '@aptstats/safepal-wallet-extension@0.0.3': - resolution: {integrity: sha512-th27vQG9EqmO6yopGIdbEBSAdTAXMmitPA8Ria0Oq21LX4m6gb2Wl/XYXLLJ/ULW+WSolpkVwPu+Zldo9yU4xw==} - peerDependencies: - aptos: ^1.3.16 - '@artilleryio/int-commons@2.0.4': resolution: {integrity: sha512-pi4hkKhpT7pyydH7GxZGWnYM+a2fM1WysCDlKsH7UJTy2xqlqmujd5iY+G/74NHsxQUxd8osAHFu+bnkbjMinw==} @@ -2702,12 +2450,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-proposal-decorators@7.24.1': - resolution: {integrity: sha512-zPEvzFijn+hRvJuX2Vu3KbEBN39LN3f7tW3MQO2LsIs57B26KU+kUc82BdAktS1VCM6libzh45eKGI65lg0cpA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-proposal-export-default-from@7.24.1': resolution: {integrity: sha512-+0hrgGGV3xyYIjOrD/bUZk/iUwOIGuoANfRfVg1cPhYBxF+TIXSEcc42DqzBICmWsnAQ+SfKedY0bj8QD+LuMg==} engines: {node: '>=6.9.0'} @@ -2749,26 +2491,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-proposal-private-methods@7.18.6': - resolution: {integrity: sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==} - engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead. - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2': resolution: {integrity: sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-proposal-private-property-in-object@7.21.11': - resolution: {integrity: sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==} - engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead. - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-async-generators@7.8.4': resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: @@ -2790,12 +2518,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-decorators@7.24.1': - resolution: {integrity: sha512-05RJdO/cCrtVWuAaSn1tS3bH8jbsJa/Y1uD186u6J4C/1mnHFxseeuWpsqr9anvo7TUulev7tm7GDwRV+VuhDw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-dynamic-import@7.8.3': resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==} peerDependencies: @@ -3380,24 +3102,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-constant-elements@7.24.1': - resolution: {integrity: sha512-QXp1U9x0R7tkiGB0FOk8o74jhnap0FlZ5gNkRIWdG3eP+SvMFg118e1zaWewDzgABb106QSKpVsD3Wgd8t6ifA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-display-name@7.24.1': resolution: {integrity: sha512-mvoQg2f9p2qlpDQRBC7M3c3XTr0k7cp/0+kFKKO/7Gtu0LSw16eKB+Fabe2bDT/UpsyasTBBkAnbdsLrkD5XMw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-jsx-development@7.22.5': - resolution: {integrity: sha512-bDhuzwWMuInwCYeDeMzyi7TaBgRQei6DqxhbyniL7/VG4RSS7HtSL2QbY4eESy1KJqlWt8g3xeEBGPuo+XqC8A==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-jsx-self@7.22.5': resolution: {integrity: sha512-nTh2ogNUtxbiSbxaT4Ds6aXnXEipHweN9YRgOX/oNXdf0cCrGn/+2LozFa3lnPV5D90MkjhgckCPBrsoSc1a7g==} engines: {node: '>=6.9.0'} @@ -3428,12 +3138,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-react-pure-annotations@7.24.1': - resolution: {integrity: sha512-+pWEAaDJvSm9aFvJNpLiM2+ktl2Sn2U5DdyiWdZBxmLc6+xGt88dvFqsHiAiDS+8WqUwbDfkKz9jRxK3M0k+kA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-regenerator@7.22.10': resolution: {integrity: sha512-F28b1mDt8KcT5bUyJc/U9nwzw6cV+UmTeRlXYIl2TNqMMJif0Jeey9/RQ3C4NOd2zp0/TRsDns9ttj2L523rsw==} engines: {node: '>=6.9.0'} @@ -3607,12 +3311,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 - '@babel/preset-react@7.24.1': - resolution: {integrity: sha512-eFa8up2/8cZXLIpkafhaADTXSnl7IsUFCYenRWrARBz0/qZwcT0RBXpys0LJU4+WfPoF2ZG6ew6s2V6izMCwRA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/preset-typescript@7.22.5': resolution: {integrity: sha512-YbPaal9LxztSGhmndR46FmAbkJ/1fAsw293tSU+I5E5h+cnJ3d4GTwyUgGYmOXJYdGA+uNePle4qbaRzj2NISQ==} engines: {node: '>=6.9.0'} @@ -3737,17 +3435,6 @@ packages: '@bitget-wallet/web3-sdk@0.0.8': resolution: {integrity: sha512-WFk6URUxTCukKrU3YpTdWTCScrj6/wwd/0O7eSANeQl1KDbDs+yj/fAkN1Wy6ebI3NMcW6sqN9mrmfwz53dPMQ==} - '@blocto/aptos-wallet-adapter-plugin@0.2.9': - resolution: {integrity: sha512-0hPdNa+AknlTKQPYZ1m2FwqwGVXZqoPr12ai5+M9McNN+H+J2aY7ujPxI74e991MXh7Ah4zsdOeHI0LDWhxU+g==} - - '@blocto/sdk@0.10.2': - resolution: {integrity: sha512-9gCIUKA7/7/hMHaa5n94+OYU/3tHd6vmBgTgv4o2h3z9SFueQXAJMO4aBggH9+EldgHQDI6wHsnvytEt9AWb6g==} - peerDependencies: - aptos: ^1.3.14 - peerDependenciesMeta: - aptos: - optional: true - '@blocto/sdk@0.10.3': resolution: {integrity: sha512-9Ot5R3YULaX8IIRGyVYXhoGC01H+kaXCqwfLWzUSKciNYT2GxiF547LEAnT1a7e5HMrJdqjQ+94OsS32fHmq9A==} peerDependencies: @@ -3887,103 +3574,6 @@ packages: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} - '@csstools/normalize.css@12.1.1': - resolution: {integrity: sha512-YAYeJ+Xqh7fUou1d1j9XHl44BmsuThiTr4iNrgCQ3J27IbhXsxXDGZ1cXv8Qvs99d4rBbLiSKy3+WZiet32PcQ==} - - '@csstools/postcss-cascade-layers@1.1.1': - resolution: {integrity: sha512-+KdYrpKC5TgomQr2DlZF4lDEpHcoxnj5IGddYYfBWJAKfj1JtuHUIqMa+E1pJJ+z3kvDViWMqyqPlG4Ja7amQA==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - '@csstools/postcss-color-function@1.1.1': - resolution: {integrity: sha512-Bc0f62WmHdtRDjf5f3e2STwRAl89N2CLb+9iAwzrv4L2hncrbDwnQD9PCq0gtAt7pOI2leIV08HIBUd4jxD8cw==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - '@csstools/postcss-font-format-keywords@1.0.1': - resolution: {integrity: sha512-ZgrlzuUAjXIOc2JueK0X5sZDjCtgimVp/O5CEqTcs5ShWBa6smhWYbS0x5cVc/+rycTDbjjzoP0KTDnUneZGOg==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - '@csstools/postcss-hwb-function@1.0.2': - resolution: {integrity: sha512-YHdEru4o3Rsbjmu6vHy4UKOXZD+Rn2zmkAmLRfPet6+Jz4Ojw8cbWxe1n42VaXQhD3CQUXXTooIy8OkVbUcL+w==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - '@csstools/postcss-ic-unit@1.0.1': - resolution: {integrity: sha512-Ot1rcwRAaRHNKC9tAqoqNZhjdYBzKk1POgWfhN4uCOE47ebGcLRqXjKkApVDpjifL6u2/55ekkpnFcp+s/OZUw==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - '@csstools/postcss-is-pseudo-class@2.0.7': - resolution: {integrity: sha512-7JPeVVZHd+jxYdULl87lvjgvWldYu+Bc62s9vD/ED6/QTGjy0jy0US/f6BG53sVMTBJ1lzKZFpYmofBN9eaRiA==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - '@csstools/postcss-nested-calc@1.0.0': - resolution: {integrity: sha512-JCsQsw1wjYwv1bJmgjKSoZNvf7R6+wuHDAbi5f/7MbFhl2d/+v+TvBTU4BJH3G1X1H87dHl0mh6TfYogbT/dJQ==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - '@csstools/postcss-normalize-display-values@1.0.1': - resolution: {integrity: sha512-jcOanIbv55OFKQ3sYeFD/T0Ti7AMXc9nM1hZWu8m/2722gOTxFg7xYu4RDLJLeZmPUVQlGzo4jhzvTUq3x4ZUw==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - '@csstools/postcss-oklab-function@1.1.1': - resolution: {integrity: sha512-nJpJgsdA3dA9y5pgyb/UfEzE7W5Ka7u0CX0/HIMVBNWzWemdcTH3XwANECU6anWv/ao4vVNLTMxhiPNZsTK6iA==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - '@csstools/postcss-progressive-custom-properties@1.3.0': - resolution: {integrity: sha512-ASA9W1aIy5ygskZYuWams4BzafD12ULvSypmaLJT2jvQ8G0M3I8PRQhC0h7mG0Z3LI05+agZjqSR9+K9yaQQjA==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.3 - - '@csstools/postcss-stepped-value-functions@1.0.1': - resolution: {integrity: sha512-dz0LNoo3ijpTOQqEJLY8nyaapl6umbmDcgj4AD0lgVQ572b2eqA1iGZYTTWhrcrHztWDDRAX2DGYyw2VBjvCvQ==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - '@csstools/postcss-text-decoration-shorthand@1.0.0': - resolution: {integrity: sha512-c1XwKJ2eMIWrzQenN0XbcfzckOLLJiczqy+YvfGmzoVXd7pT9FfObiSEfzs84bpE/VqfpEuAZ9tCRbZkZxxbdw==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - '@csstools/postcss-trigonometric-functions@1.0.2': - resolution: {integrity: sha512-woKaLO///4bb+zZC2s80l+7cm07M7268MsyG3M0ActXXEFi6SuhvriQYcb58iiKGbjwwIU7n45iRLEHypB47Og==} - engines: {node: ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - '@csstools/postcss-unset-value@1.0.2': - resolution: {integrity: sha512-c8J4roPBILnelAsdLr4XOAR/GsTm0GJi4XpcfvoWk3U6KiTCqiFYc63KhRMQQX35jYMp4Ao8Ij9+IZRgMfJp1g==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - '@csstools/selector-specificity@2.2.0': - resolution: {integrity: sha512-+OJ9konv95ClSTOJCmMZqpd5+YGsB2S+x6w3E1oaM8UuR5j8nTNHYSz8c9BEPGDOCMQYIEEGlVPj/VY64iTbGw==} - engines: {node: ^14 || ^16 || >=18} - peerDependencies: - postcss-selector-parser: ^6.0.10 - - '@ctrl/tinycolor@3.6.1': - resolution: {integrity: sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==} - engines: {node: '>=10'} - '@defi.org/web3-candies@5.0.0': resolution: {integrity: sha512-I5CZ2rESrDo9rV63yrSVS1ILbkCTSC5AeR9rmPtE+ovmOcrPFRcf2xKlPSjKU2FE3vzzb7kB/IEbRACW85C9zg==} @@ -4080,9 +3670,6 @@ packages: resolution: {integrity: sha512-0dEVyRLM/lG4gp1R/Ik5bfPl/1wX00xFwd5KcNH602tzBa09oF7pbTKETEhR1GjZ75K6OJnYFu8II2dyMhONMw==} engines: {node: '>=16'} - '@emotion/hash@0.8.0': - resolution: {integrity: sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==} - '@emotion/hash@0.9.1': resolution: {integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==} @@ -4098,9 +3685,6 @@ packages: '@emotion/memoize@0.8.1': resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} - '@emotion/unitless@0.7.5': - resolution: {integrity: sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==} - '@emotion/unitless@0.8.1': resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} @@ -5107,27 +4691,10 @@ packages: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} - '@jest/console@27.5.1': - resolution: {integrity: sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - - '@jest/console@28.1.3': - resolution: {integrity: sha512-QPAkP5EwKdK/bxIr6C1I4Vs0rm2nHiANzj/Z5X2JQkrZo6IqvC4ldZ9K95tF0HdidhA8Bo6egxSzUFPYKcEXLw==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - '@jest/console@29.7.0': resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jest/core@27.5.1': - resolution: {integrity: sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - '@jest/core@29.7.0': resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5141,10 +4708,6 @@ packages: resolution: {integrity: sha512-4QqS3LY5PBmTRHj9sAg1HLoPzqAI0uOX6wI/TRqHIcOxlFidy6YEmCQJk6FSZjNLGCeubDMfmkWL+qaLKhSGQA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jest/environment@27.5.1': - resolution: {integrity: sha512-/WQjhPJe3/ghaol/4Bq480JKXV/Rfw8nQdN7f41fM8VDHLcxKXou6QyXAh3EFr9/bVG3x74z1NWDkP87EiY8gA==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - '@jest/environment@29.7.0': resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5157,31 +4720,14 @@ packages: resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jest/fake-timers@27.5.1': - resolution: {integrity: sha512-/aPowoolwa07k7/oM3aASneNeBGCmGQsc3ugN4u6s4C/+s5M64MFo/+djTdiwcbQlRfFElGuDXWzaWj6QgKObQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - '@jest/fake-timers@29.7.0': resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jest/globals@27.5.1': - resolution: {integrity: sha512-ZEJNB41OBQQgGzgyInAv0UUfDDj3upmHydjieSxFvTRuZElrx7tXg/uVQ5hYVEwiXs3+aMsAeEc9X7xiSKCm4Q==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - '@jest/globals@29.7.0': resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jest/reporters@27.5.1': - resolution: {integrity: sha512-cPXh9hWIlVJMQkVk84aIvXuBB4uQQmFqZiacloFuGiP3ah1sbCxCosidXFDfqG8+6fO1oR2dTJTlsOy4VFmUfw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - '@jest/reporters@29.7.0': resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5191,46 +4737,22 @@ packages: node-notifier: optional: true - '@jest/schemas@28.1.3': - resolution: {integrity: sha512-/l/VWsdt/aBXgjshLWOFyFt3IVdYypu5y2Wn2rOO1un6nkqIn8SLXzgIMYXFyYsRWDyF5EthmKJMIdJvk08grg==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - '@jest/schemas@29.6.3': resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jest/source-map@27.5.1': - resolution: {integrity: sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - '@jest/source-map@29.6.3': resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jest/test-result@27.5.1': - resolution: {integrity: sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - - '@jest/test-result@28.1.3': - resolution: {integrity: sha512-kZAkxnSE+FqE8YjW8gNuoVkkC9I7S1qmenl8sGcDOLropASP+BkcGKwhXoyqQuGOGeYY0y/ixjrd/iERpEXHNg==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - '@jest/test-result@29.7.0': resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jest/test-sequencer@27.5.1': - resolution: {integrity: sha512-LCheJF7WB2+9JuCS7VB/EmGIdQuhtqjRNI9A43idHv3E4KltCTsPsLxvdaubFHSYwY/fNjMWjl6vNRhDiN7vpQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - '@jest/test-sequencer@29.7.0': resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jest/transform@27.5.1': - resolution: {integrity: sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - '@jest/transform@29.7.0': resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5239,14 +4761,6 @@ packages: resolution: {integrity: sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==} engines: {node: '>= 10.14.2'} - '@jest/types@27.5.1': - resolution: {integrity: sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - - '@jest/types@28.1.3': - resolution: {integrity: sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - '@jest/types@29.6.3': resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5314,12 +4828,6 @@ packages: '@juggle/resize-observer@3.4.0': resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==} - '@kwsites/file-exists@1.1.1': - resolution: {integrity: sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==} - - '@kwsites/promise-deferred@1.1.1': - resolution: {integrity: sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==} - '@layerzerolabs/scan-client@0.0.6': resolution: {integrity: sha512-K6Dpktj8bsPK/bE4DjgPclWn/mOZm/zm6lwRaaZvPkfPhmLQx43j5voBod9hqT2hSh26lC7ZkFAb+8aVUpPISQ==} peerDependencies: @@ -5349,9 +4857,6 @@ packages: '@ledgerhq/logs@6.12.0': resolution: {integrity: sha512-ExDoj1QV5eC6TEbMdLUMMk9cfvNKhhv5gXol4SmULRVCx/3iyCPhJ74nsb3S0Vb+/f+XujBEj3vQn5+cwS0fNA==} - '@leichtgewicht/ip-codec@2.0.5': - resolution: {integrity: sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==} - '@lit-labs/react@1.2.1': resolution: {integrity: sha512-DiZdJYFU0tBbdQkfwwRSwYyI/mcWkg3sWesKRsHUd4G+NekTmmeq9fzsurvcKTNVa0comNljwtg4Hvi1ds3V+A==} @@ -5681,9 +5186,6 @@ packages: '@noble/curves@1.5.0': resolution: {integrity: sha512-J5EKamIHnKPyClwVrzmaf5wSdQXgdHcPZIZLu3bwnbeCx8/7NPK5q2ZBWF+5FvYGByjiQQsJYX6jfgB2wDPn3A==} - '@noble/hashes@1.1.3': - resolution: {integrity: sha512-CE0FCR57H2acVI5UOzIGSSIYxZ6v/HOhDR0Ro9VLyhnzLwx0o8W1mmgaqlEUx4049qJDlIBRztv5k+MM8vbO3A==} - '@noble/hashes@1.2.0': resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==} @@ -6494,32 +5996,6 @@ packages: engines: {node: '>=18'} hasBin: true - '@pmmmwh/react-refresh-webpack-plugin@0.5.13': - resolution: {integrity: sha512-odZVYXly+JwzYri9rKqqUAk0cY6zLpv4dxoKinhoJNShV36Gpxf+CyDIILJ4tYsJ1ZxIWs233Y39iVnynvDA/g==} - engines: {node: '>= 10.13'} - peerDependencies: - '@types/webpack': 4.x || 5.x - react-refresh: '>=0.10.0 <1.0.0' - sockjs-client: ^1.4.0 - type-fest: '>=0.17.0 <5.0.0' - webpack: '>=4.43.0 <6.0.0' - webpack-dev-server: 3.x || 4.x || 5.x - webpack-hot-middleware: 2.x - webpack-plugin-serve: 0.x || 1.x - peerDependenciesMeta: - '@types/webpack': - optional: true - sockjs-client: - optional: true - type-fest: - optional: true - webpack-dev-server: - optional: true - webpack-hot-middleware: - optional: true - webpack-plugin-serve: - optional: true - '@polka/url@1.0.0-next.25': resolution: {integrity: sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==} @@ -7243,54 +6719,6 @@ packages: viem: 2.x wagmi: ^2.9.0 - '@rc-component/async-validator@5.0.3': - resolution: {integrity: sha512-eN5chKrc0ANerXjLJuoqh/YJpor0u4T1bgaph5BPh42cJ2afDihaHJ2Mh3Up3XIFk05EfKG4nIQxbqC6y2eM4Q==} - engines: {node: '>=14.x'} - - '@rc-component/color-picker@1.5.3': - resolution: {integrity: sha512-+tGGH3nLmYXTalVe0L8hSZNs73VTP5ueSHwUlDC77KKRaN7G4DS4wcpG5DTDzdcV/Yas+rzA6UGgIyzd8fS4cw==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - '@rc-component/context@1.4.0': - resolution: {integrity: sha512-kFcNxg9oLRMoL3qki0OMxK+7g5mypjgaaJp/pkOis/6rVxma9nJBF/8kCIuTYHUQNr0ii7MxqE33wirPZLJQ2w==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - '@rc-component/mini-decimal@1.1.0': - resolution: {integrity: sha512-jS4E7T9Li2GuYwI6PyiVXmxTiM6b07rlD9Ge8uGZSCz3WlzcG5ZK7g5bbuKNeZ9pgUuPK/5guV781ujdVpm4HQ==} - engines: {node: '>=8.x'} - - '@rc-component/mutate-observer@1.1.0': - resolution: {integrity: sha512-QjrOsDXQusNwGZPf4/qRQasg7UFEj06XiCJ8iuiq/Io7CrHrgVi6Uuetw60WAMG1799v+aM8kyc+1L/GBbHSlw==} - engines: {node: '>=8.x'} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - '@rc-component/portal@1.1.2': - resolution: {integrity: sha512-6f813C0IsasTZms08kfA8kPAGxbbkYToa8ALaiDIGGECU4i9hj8Plgbx0sNJDrey3EtHO30hmdaxtT0138xZcg==} - engines: {node: '>=8.x'} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - '@rc-component/tour@1.14.2': - resolution: {integrity: sha512-A75DZ8LVvahBIvxooj3Gvf2sxe+CGOkmzPNX7ek0i0AJHyKZ1HXe5ieIGo3m0FMdZfVOlbCJ952Duq8VKAHk6g==} - engines: {node: '>=8.x'} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - '@rc-component/trigger@2.1.1': - resolution: {integrity: sha512-UjHkedkgtEcgQu87w1VuWug1idoDJV7VUt0swxHXRcmei2uu1AuUzGBPEUlmOmXGJ+YtTgZfVLi7kuAUKoZTMA==} - engines: {node: '>=8.x'} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - '@react-hook/event@1.2.6': resolution: {integrity: sha512-JUL5IluaOdn5w5Afpe/puPa1rj8X6udMlQ9dt4hvMuKmTrBS1Ya6sb4sVgvfe2eU4yDuOfAhik8xhbcCekbg9Q==} peerDependencies: @@ -7504,17 +6932,6 @@ packages: '@rise-wallet/wallet-adapter@0.1.2': resolution: {integrity: sha512-x32ocKBKQ6uBDhnRcChYzcSrjLxHfjLGuHn/A2vgks+qKl5sGAqMymmYNEtlV4y5z5mBdYMSDVBHnCHBmUolBQ==} - '@rollup/plugin-babel@5.3.1': - resolution: {integrity: sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==} - engines: {node: '>= 10.0.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@types/babel__core': ^7.1.9 - rollup: ^1.20.0||^2.0.0 - peerDependenciesMeta: - '@types/babel__core': - optional: true - '@rollup/plugin-commonjs@24.0.0': resolution: {integrity: sha512-0w0wyykzdyRRPHOb0cQt14mIBLujfAv6GgP6g8nvg/iBxEm112t3YPPq+Buqe2+imvElTka+bjNlJ/gB56TD8g==} engines: {node: '>=14.0.0'} @@ -7533,23 +6950,6 @@ packages: rollup: optional: true - '@rollup/plugin-node-resolve@11.2.1': - resolution: {integrity: sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==} - engines: {node: '>= 10.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0 - - '@rollup/plugin-replace@2.4.2': - resolution: {integrity: sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==} - peerDependencies: - rollup: ^1.20.0 || ^2.0.0 - - '@rollup/pluginutils@3.1.0': - resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} - engines: {node: '>= 8.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0 - '@rollup/pluginutils@4.2.1': resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} engines: {node: '>= 8.0.0'} @@ -7599,9 +6999,6 @@ packages: '@scure/bip32@1.4.0': resolution: {integrity: sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==} - '@scure/bip39@1.1.0': - resolution: {integrity: sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w==} - '@scure/bip39@1.1.1': resolution: {integrity: sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==} @@ -7621,10 +7018,6 @@ packages: resolution: {integrity: sha512-lqq8BYbbs9KTlDuyB5NjdZB6P/llqQs32KUgaCQ/k5DFB4Zf56+BFHXObnMHxwx375X1uixtnEphagWZa+nsLQ==} engines: {node: '>=14.18'} - '@sentry-internal/feedback@7.101.1': - resolution: {integrity: sha512-fOKDMVvLX+FuJHJszKBvRg1m7+fd4hchqRnZ9DDfitT6P5Ppl0gbEt/LStqu8Wq5M0tna+hpdwHlVEt7gZVKzw==} - engines: {node: '>=12'} - '@sentry-internal/feedback@7.110.0': resolution: {integrity: sha512-hrfWa3WkSOiBO5Srcr1j4kuGOlbsQic+REpLOofllVIs56DOo9+Aj9svxT+dcvZERv/nlFSV/E0BfGy9g08IEg==} engines: {node: '>=12'} @@ -7633,10 +7026,6 @@ packages: resolution: {integrity: sha512-YyJ6SzpTonixvguAg0H9vkEp7Jq8ZeVY8M4n47ClR0+TtaAUp04ZhcJpHKF7PwBIAzc7DRr2XP112tmWgiVEcg==} engines: {node: '>=14.18'} - '@sentry-internal/replay-canvas@7.101.1': - resolution: {integrity: sha512-09l6nD+lxWvwkpXLlIZuzj/z79Llbo6mcH33TJvxrUTjAqSGF/i3Pd5bTLWro9atippOyQgIV/yTGG4Bc5FhyQ==} - engines: {node: '>=12'} - '@sentry-internal/replay-canvas@7.110.0': resolution: {integrity: sha512-SNa+AfyfX+vc6Xw0pIfDsa5Qnc9cpexU6M2D19gadtVhmep7qoFBuhBVZrSv6BtdCxvrb5EyYsHYGfjQdIDcvg==} engines: {node: '>=12'} @@ -7649,10 +7038,6 @@ packages: resolution: {integrity: sha512-DJ1jF/Pab0FH4SeCvSGCnGAu/s0wJvhBWM5VjQp7Jjmcfunp+R3vJibqU8gAVZU1nYRLaqprLdIXrSyP2Km8nQ==} engines: {node: '>=14.18'} - '@sentry-internal/tracing@7.101.1': - resolution: {integrity: sha512-ihjWG8x4x0ozx6t+EHoXLKbsPrgzYLCpeBLWyS+M6n3hn6cmHM76c8nZw3ldhUQi5UYL3LFC/JZ50b4oSxtlrg==} - engines: {node: '>=8'} - '@sentry-internal/tracing@7.110.0': resolution: {integrity: sha512-IIHHa9e/mE7uOMJfNELI8adyoELxOy6u6TNCn5t6fphmq84w8FTc9adXkG/FY2AQpglkIvlILojfMROFB2aaAQ==} engines: {node: '>=8'} @@ -7661,10 +7046,6 @@ packages: resolution: {integrity: sha512-4mhEwYTK00bIb5Y9UWIELVUfru587Vaeg0DQGswv4aIRHIiMKLyNqCEejaaybQ/fNChIZOKmvyqXk430YVd7Qg==} engines: {node: '>= 14'} - '@sentry/browser@7.101.1': - resolution: {integrity: sha512-+rIFoWPdO29AHVYsAwq8QEl2Ihv17Xh9Bt2aPFvLTGDA0caHjnx98g2jSOvLIOah6HI7Nwp3Njg2zBEzDtHkNw==} - engines: {node: '>=8'} - '@sentry/browser@7.110.0': resolution: {integrity: sha512-gIxedVm6ZgkjQfgCDgLWJgAsolq6OxV8hQ2j1+RaDL2RngvelFo/vlX5f2sD6EbjVp77Cri8u5GkMJF+v4p84g==} engines: {node: '>=8'} @@ -7732,10 +7113,6 @@ packages: resolution: {integrity: sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==} engines: {node: '>=6'} - '@sentry/core@7.101.1': - resolution: {integrity: sha512-XSmXXeYT1d4O14eDF3OXPJFUgaN2qYEeIGUztqPX9nBs9/ij8y/kZOayFqlIMnfGvjOUM+63sy/2xDBOpFn6ug==} - engines: {node: '>=8'} - '@sentry/core@7.110.0': resolution: {integrity: sha512-g4suCQO94mZsKVaAbyD1zLFC5YSuBQCIPHXx9fdgtfoPib7BWjWWePkllkrvsKAv4u8Oq05RfnKOhOMRHpOKqg==} engines: {node: '>=8'} @@ -7748,10 +7125,6 @@ packages: resolution: {integrity: sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==} engines: {node: '>=6'} - '@sentry/integrations@7.101.1': - resolution: {integrity: sha512-0kk6773Lg2Pa1cUmK1VtxaLLAmpIXcT3qYPlYxRXZQJEUpGcjZZ704V7i8SFLhJSsHkXrL/sAGSyM1p+NDF+QA==} - engines: {node: '>=8'} - '@sentry/integrations@7.110.0': resolution: {integrity: sha512-cWpEGMTyX1XO4jb0NXMh1thkkiSajM5ydE/ceAdxmG9V7gv7E1pREK8P1NeVvzvjZ67z+uVWYbgYwXxd4eqZ/A==} engines: {node: '>=8'} @@ -7760,17 +7133,6 @@ packages: resolution: {integrity: sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==} engines: {node: '>=6'} - '@sentry/nextjs@7.101.1': - resolution: {integrity: sha512-qIT0jByxaAbbmX5Gl//M9+d+Pi1znk9aWoIGZyakpK+seGQ3D+UjrznxxmwvjcqQgVpbo0SJSq+3yQv7eAh2Tg==} - engines: {node: '>=8'} - peerDependencies: - next: ^10.0.8 || ^11.0 || ^12.0 || ^13.0 || ^14.0 - react: 16.x || 17.x || 18.x - webpack: '>= 4.0.0' - peerDependenciesMeta: - webpack: - optional: true - '@sentry/nextjs@7.110.0': resolution: {integrity: sha512-6CGDtgo2aoAG3r1L7bJIZiW/ySpj4E7fvl92DxTgcxsT2sh9nLuj2s1XrU6n1T6HgaW1kUSjGazhH7GURYwRAg==} engines: {node: '>=8'} @@ -7796,10 +7158,6 @@ packages: resolution: {integrity: sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==} engines: {node: '>=6'} - '@sentry/node@7.101.1': - resolution: {integrity: sha512-iXSxUT6Zbt/KUY0+fRcW5II6Tgp2zdTfhBW+fQuDt/UUZt7Ypvb+6n4U2oom3LJfttmD7mdjQuT4+vsNImDjTQ==} - engines: {node: '>=8'} - '@sentry/node@7.110.0': resolution: {integrity: sha512-YPfweCSzo/omnx5q1xOEZfI8Em3jnPqj7OM4ObXmoSKEK+kM1oUF3BTRzw5BJOaOCSTBFY1RAsGyfVIyrwxWnA==} engines: {node: '>=8'} @@ -7818,12 +7176,6 @@ packages: '@opentelemetry/sdk-trace-base': ^1.25.1 '@opentelemetry/semantic-conventions': ^1.25.1 - '@sentry/react@7.101.1': - resolution: {integrity: sha512-CwaBXntX2e3XHZQZVuv/tcfm5H+UHcS6aVChGfUiBHIBi2JpAqdnLdQIFGTkE8BSnKyolKgIsnvIU3BQ//QTig==} - engines: {node: '>=8'} - peerDependencies: - react: 15.x || 16.x || 17.x || 18.x - '@sentry/react@7.110.0': resolution: {integrity: sha512-ryfA2QR41PV+kP3g0lGvpDZ+OkuxSdj2nTjCqPeZKHsK45GYvDMlWkukdHbwrx8ulkbAcWEjPmuZZzHspyieNw==} engines: {node: '>=8'} @@ -7836,10 +7188,6 @@ packages: peerDependencies: react: ^16.14.0 || 17.x || 18.x || 19.x - '@sentry/replay@7.101.1': - resolution: {integrity: sha512-l4jmj2Rf/myzk3TA83PdMiomassG8okdBh1b2Hp1+ycBRVZFDmsR81gKPvnefSXwGwGNGKEmp6Q2bdGzekpp3Q==} - engines: {node: '>=12'} - '@sentry/replay@7.110.0': resolution: {integrity: sha512-EEpGPf3iBJjWejvoxKLVMnLtLNwPTUxHJV1oxUkbcSi3B/tG5hW7LArYDjAcvkfa4VmA8JLCwj2vYU5MQ8tj6g==} engines: {node: '>=12'} @@ -7852,10 +7200,6 @@ packages: resolution: {integrity: sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==} engines: {node: '>=6'} - '@sentry/types@7.101.1': - resolution: {integrity: sha512-bwtkQvrCZ6JGc7vqX7TEAKBgkbQFORt84FFS3JQQb8G3efTt9fZd2ReY4buteKQdlALl8h1QWVngTLmI+kyUuw==} - engines: {node: '>=8'} - '@sentry/types@7.110.0': resolution: {integrity: sha512-DqYBLyE8thC5P5MuPn+sj8tL60nCd/f5cerFFPcudn5nJ4Zs1eI6lKlwwyHYTEu5c4KFjCB0qql6kXfwAHmTyA==} engines: {node: '>=8'} @@ -7868,10 +7212,6 @@ packages: resolution: {integrity: sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==} engines: {node: '>=6'} - '@sentry/utils@7.101.1': - resolution: {integrity: sha512-Nrg0nrEI3nrOCd9SLJ/WGzxS5KMQE4cryLOvrDcHJRWpsSyGBF1hLLerk84Nsw/0myMsn7zTYU+xoq7idNsX5A==} - engines: {node: '>=8'} - '@sentry/utils@7.110.0': resolution: {integrity: sha512-VBsdLLN+5tf73fhf/Cm7JIsUJ6y9DkJj8h4I6Mxx0rszrvOyH6S5px40K+V4jdLBzMEvVinC7q2Cbf1YM18BSw==} engines: {node: '>=8'} @@ -7880,10 +7220,6 @@ packages: resolution: {integrity: sha512-PxV0v9VbGWH9zP37P5w2msLUFDr287nYjoY2XVF+RSolyiTs1CQNI5ZMUO3o4MsSac/dpXxjyrZXQd72t/jRYA==} engines: {node: '>=14.18'} - '@sentry/vercel-edge@7.101.1': - resolution: {integrity: sha512-xs6Xq910CR9rWHCYJEoEbfIfH60Oce+09NQTS5h3R/SOmrrAv4/mmZyblhunIS8TJqABeGRtEPKt1lOqO20O/A==} - engines: {node: '>=8'} - '@sentry/vercel-edge@7.110.0': resolution: {integrity: sha512-LlABtVxIS0jnINVs9i7FDYpUqyz5ZWHIfgmePyQjHKN3KBLXWDQnuNdVr4bRdqdx4A5yjRZm66sPTYc5YMgOmg==} engines: {node: '>=8'} @@ -7914,9 +7250,6 @@ packages: '@sideway/pinpoint@2.0.0': resolution: {integrity: sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==} - '@sinclair/typebox@0.24.51': - resolution: {integrity: sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==} - '@sinclair/typebox@0.25.24': resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==} @@ -7931,18 +7264,12 @@ packages: resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} engines: {node: '>=10'} - '@sinonjs/commons@1.8.6': - resolution: {integrity: sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==} - '@sinonjs/commons@3.0.0': resolution: {integrity: sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==} '@sinonjs/fake-timers@10.3.0': resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} - '@sinonjs/fake-timers@8.1.0': - resolution: {integrity: sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg==} - '@smithy/abort-controller@2.0.4': resolution: {integrity: sha512-3+3/xRQ0K/NFVtKSiTGsUa3muZnVaBmHrLNgxwoBLZO9rNhwZtjjjf7pFJ6aoucoul/c/w3xobRkgi8F9MWX8Q==} engines: {node: '>=14.0.0'} @@ -8559,71 +7886,12 @@ packages: '@storybook/types@7.6.17': resolution: {integrity: sha512-GRY0xEJQ0PrL7DY2qCNUdIfUOE0Gsue6N+GBJw9ku1IUDFLJRDOF+4Dx2BvYcVCPI5XPqdWKlEyZdMdKjiQN7Q==} - '@surma/rollup-plugin-off-main-thread@2.2.3': - resolution: {integrity: sha512-lR8q/9W7hZpMWweNiAKU7NQerBnzQQLvi8qnTDU/fxItPhtZVMbPV3lbCwjhIlNBe9Bbr5V+KHshvWmVSG9cxQ==} - '@sushiswap/chainlink-token-list@0.1.0': resolution: {integrity: sha512-OQwr4BIYbF3FlMKYMslYhjGXXzdsduW+CfSTq86tUQZm9okJG4fKBmyA8ZYkZ+oW8dTDRuI5LGGidUYVQUFH7A==} '@sushiswap/default-token-list@43.3.0': resolution: {integrity: sha512-2GLpiBO0FoxKvbbXnKQjHRgzePJHmHzAzLLR25lpMqvJ80UNjtcbQ4BCbEfxuxt6d0Gdu+/RwqzfuzWBeUPvsw==} - '@svgr/babel-plugin-add-jsx-attribute@5.4.0': - resolution: {integrity: sha512-ZFf2gs/8/6B8PnSofI0inYXr2SDNTDScPXhN7k5EqD4aZ3gi6u+rbmZHVB8IM3wDyx8ntKACZbtXSm7oZGRqVg==} - engines: {node: '>=10'} - - '@svgr/babel-plugin-remove-jsx-attribute@5.4.0': - resolution: {integrity: sha512-yaS4o2PgUtwLFGTKbsiAy6D0o3ugcUhWK0Z45umJ66EPWunAz9fuFw2gJuje6wqQvQWOTJvIahUwndOXb7QCPg==} - engines: {node: '>=10'} - - '@svgr/babel-plugin-remove-jsx-empty-expression@5.0.1': - resolution: {integrity: sha512-LA72+88A11ND/yFIMzyuLRSMJ+tRKeYKeQ+mR3DcAZ5I4h5CPWN9AHyUzJbWSYp/u2u0xhmgOe0+E41+GjEueA==} - engines: {node: '>=10'} - - '@svgr/babel-plugin-replace-jsx-attribute-value@5.0.1': - resolution: {integrity: sha512-PoiE6ZD2Eiy5mK+fjHqwGOS+IXX0wq/YDtNyIgOrc6ejFnxN4b13pRpiIPbtPwHEc+NT2KCjteAcq33/F1Y9KQ==} - engines: {node: '>=10'} - - '@svgr/babel-plugin-svg-dynamic-title@5.4.0': - resolution: {integrity: sha512-zSOZH8PdZOpuG1ZVx/cLVePB2ibo3WPpqo7gFIjLV9a0QsuQAzJiwwqmuEdTaW2pegyBE17Uu15mOgOcgabQZg==} - engines: {node: '>=10'} - - '@svgr/babel-plugin-svg-em-dimensions@5.4.0': - resolution: {integrity: sha512-cPzDbDA5oT/sPXDCUYoVXEmm3VIoAWAPT6mSPTJNbQaBNUuEKVKyGH93oDY4e42PYHRW67N5alJx/eEol20abw==} - engines: {node: '>=10'} - - '@svgr/babel-plugin-transform-react-native-svg@5.4.0': - resolution: {integrity: sha512-3eYP/SaopZ41GHwXma7Rmxcv9uRslRDTY1estspeB1w1ueZWd/tPlMfEOoccYpEMZU3jD4OU7YitnXcF5hLW2Q==} - engines: {node: '>=10'} - - '@svgr/babel-plugin-transform-svg-component@5.5.0': - resolution: {integrity: sha512-q4jSH1UUvbrsOtlo/tKcgSeiCHRSBdXoIoqX1pgcKK/aU3JD27wmMKwGtpB8qRYUYoyXvfGxUVKchLuR5pB3rQ==} - engines: {node: '>=10'} - - '@svgr/babel-preset@5.5.0': - resolution: {integrity: sha512-4FiXBjvQ+z2j7yASeGPEi8VD/5rrGQk4Xrq3EdJmoZgz/tpqChpo5hgXDvmEauwtvOc52q8ghhZK4Oy7qph4ig==} - engines: {node: '>=10'} - - '@svgr/core@5.5.0': - resolution: {integrity: sha512-q52VOcsJPvV3jO1wkPtzTuKlvX7Y3xIcWRpCMtBF3MrteZJtBfQw/+u0B1BHy5ColpQc1/YVTrPEtSYIMNZlrQ==} - engines: {node: '>=10'} - - '@svgr/hast-util-to-babel-ast@5.5.0': - resolution: {integrity: sha512-cAaR/CAiZRB8GP32N+1jocovUtvlj0+e65TB50/6Lcime+EA49m/8l+P2ko+XPJ4dw3xaPS3jOL4F2X4KWxoeQ==} - engines: {node: '>=10'} - - '@svgr/plugin-jsx@5.5.0': - resolution: {integrity: sha512-V/wVh33j12hGh05IDg8GpIUXbjAPnTdPTKuP4VNLggnwaHMPNQNae2pRnyTAILWCQdz5GyMqtO488g7CKM8CBA==} - engines: {node: '>=10'} - - '@svgr/plugin-svgo@5.5.0': - resolution: {integrity: sha512-r5swKk46GuQl4RrVejVwpeeJaydoxkdwkM1mBKOgJLBUJPGaLci6ylg/IjhrRsREKDkr4kbMWdgOtbXEh0fyLQ==} - engines: {node: '>=10'} - - '@svgr/webpack@5.5.0': - resolution: {integrity: sha512-DOBOK255wfQxguUta2INKkzPj6AIS6iafZYiYmHn6W3pHlycSRRlvWKCfLDG10fXfLWqE3DJHgRUOyJYmARa7g==} - engines: {node: '>=10'} - '@swc/core-darwin-arm64@1.4.2': resolution: {integrity: sha512-1uSdAn1MRK5C1m/TvLZ2RDvr0zLvochgrZ2xL+lRzugLlCTlSA+Q4TWtrZaOz+vnnFVliCpw7c7qu0JouhgQIw==} engines: {node: '>=10'} @@ -8736,18 +8004,12 @@ packages: resolution: {integrity: sha512-rKH8LjZiszWEvmi01NR72QWZ8m4xmXre0OOwlRGnjU01Eqz/QnN+cqpty2PJ0efHblq09+KilvyR7lsbzmXVEw==} engines: {node: '>=12'} - '@tanstack/query-core@4.27.0': - resolution: {integrity: sha512-sm+QncWaPmM73IPwFlmWSKPqjdTXZeFf/7aEmWh00z7yl2FjqophPt0dE1EHW9P1giMC5rMviv7OUbSDmWzXXA==} - '@tanstack/query-core@4.36.1': resolution: {integrity: sha512-DJSilV5+ytBP1FbFcEJovv4rnnm/CokuVvrBEtW/Va9DvuJ3HksbXUJEpI0aV1KtuL4ZoO9AVE6PyNLzF7tLeA==} '@tanstack/query-core@5.51.16': resolution: {integrity: sha512-zfV+WAtBGm1dUIbL0w/x8qTqVLKU1/Bo1p19J9LF02MmIc4FxzMImMXhFzYJQl5Hx8Wit6RiQ4tB/DvN8y9zaQ==} - '@tanstack/query-persist-client-core@4.27.0': - resolution: {integrity: sha512-A+dPA7zG0MJOMDeBc/2WcKXW4wV2JMkeBVydobPW9G02M4q0yAj7vI+7SmM2dFuXyIvxXp4KulCywN6abRKDSQ==} - '@tanstack/react-query-devtools@4.28.0': resolution: {integrity: sha512-1SnoMw1CWn8FdPEIHvlAzmMBX3heXJo11fyBtt+FzYAHj5yFC8P67Kpgi0HpLkY7SLnd6QK/7qFkpeH4AQbgZg==} peerDependencies: @@ -8755,11 +8017,6 @@ packages: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - '@tanstack/react-query-persist-client@4.28.0': - resolution: {integrity: sha512-xNpi3YdPOQIyYkKhByYDqTlyCeqICWFhV5PWkoVxYfzlRK6HYX4s+9Int407jEvhBz9cGC4OaL7rd6bynCFrYg==} - peerDependencies: - '@tanstack/react-query': 4.28.0 - '@tanstack/react-query@4.36.1': resolution: {integrity: sha512-y7ySVHFyyQblPl3J3eQBWpXZkliroki3ARnBKsdJchlgt7yJLRDUcf4B8soufgiYt3pEQIkBWBx1N9/ZPIeUWw==} peerDependencies: @@ -8794,10 +8051,6 @@ packages: hardhat: ^2.10.2 tenderly: ^0.0.3 - '@tootallnate/once@1.1.2': - resolution: {integrity: sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==} - engines: {node: '>= 6'} - '@tootallnate/once@2.0.0': resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} engines: {node: '>= 10'} @@ -8860,10 +8113,6 @@ packages: '@tryghost/content-api@1.11.17': resolution: {integrity: sha512-n4hWUzrVYevZioJCyaSoWt9SaDajbjrLQ20/A6p34OO3G/VvrV2hWZPW78L8TPtPjLacXspIdS7XX5b85goUkA==} - '@trysound/sax@0.2.0': - resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} - engines: {node: '>=10.13.0'} - '@ts-morph/common@0.11.1': resolution: {integrity: sha512-7hWZS0NRpEsNV8vWJzg7FEz6V8MaLNeJOmwmghqUXTpzk16V1LLZhdo+4QvE/+zv4cVci0OviuJFnqhEfoV3+g==} @@ -8968,9 +8217,6 @@ packages: '@types/body-parser@1.19.2': resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} - '@types/bonjour@3.5.13': - resolution: {integrity: sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ==} - '@types/btoa-lite@1.0.0': resolution: {integrity: sha512-wJsiX1tosQ+J5+bY5LrSahHxr2wT+uME5UDwdN1kg4frt40euqA+wzECkmq4t5QbveHiJepfdThgQrPw6KiSlg==} @@ -8995,9 +8241,6 @@ packages: '@types/concat-stream@2.0.0': resolution: {integrity: sha512-t3YCerNM7NTVjLuICZo5gYAXYoDvpuuTceCcFQWcDQz26kxUR5uIWolxbIR5jRNIXpMqhOpW/b8imCR1LEmuJw==} - '@types/connect-history-api-fallback@1.5.4': - resolution: {integrity: sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw==} - '@types/connect@3.4.35': resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} @@ -9142,9 +8385,6 @@ packages: '@types/estree-jsx@1.0.1': resolution: {integrity: sha512-sHyakZlAezNFxmYRo0fopDZW+XvK6ipeZkkp5EAOLjdPfZp8VjZBJ67vSRI99RSCAoqXVmXOHS4fnWoxpuGQtQ==} - '@types/estree@0.0.39': - resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} - '@types/estree@0.0.51': resolution: {integrity: sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==} @@ -9190,9 +8430,6 @@ packages: '@types/hast@2.3.5': resolution: {integrity: sha512-SvQi0L/lNpThgPoleH53cdjB3y9zpLlVjRbqB3rH8hx1jiRSBGAhyjV3H+URFjNVRqt2EdYNrbZE5IsGlNfpRg==} - '@types/html-minifier-terser@6.1.0': - resolution: {integrity: sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg==} - '@types/http-assert@1.5.5': resolution: {integrity: sha512-4+tE/lwdAahgZT1g30Jkdm9PzFRde0xwxBNUyRsCitRvCQB90iuA2uJYdUnhnANRcqGXaWOGY4FEoxeElNAK2g==} @@ -9202,9 +8439,6 @@ packages: '@types/http-errors@2.0.1': resolution: {integrity: sha512-/K3ds8TRAfBvi5vfjuz8y6+GiAYBZ0x4tXv1Av6CWBWn0IlADc+ZX9pMq7oU0fNQPnBwIZl3rmeLp6SBApbxSQ==} - '@types/http-proxy@1.17.14': - resolution: {integrity: sha512-SSrD0c1OQzlFX7pGu1eXxSEjemej64aaNPRhhVYUGqXh0BtldAAx37MG8btcumvpgKyZp1F5Gn3JkktdxiFv6w==} - '@types/is-ci@3.0.0': resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} @@ -9328,9 +8562,6 @@ packages: '@types/node-fetch@2.6.4': resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==} - '@types/node-forge@1.3.11': - resolution: {integrity: sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==} - '@types/node@10.17.60': resolution: {integrity: sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==} @@ -9388,9 +8619,6 @@ packages: '@types/prop-types@15.7.5': resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} - '@types/q@1.5.8': - resolution: {integrity: sha512-hroOstUScF6zhIi+5+x0dzqrHA1EJi+Irri6b1fxolMTqqHIV/Cg77EtnQcZqZCu8hR3mX2BzIxN4/GzI68Kfw==} - '@types/qs@6.9.15': resolution: {integrity: sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==} @@ -9412,9 +8640,6 @@ packages: '@types/react-reconciler@0.28.8': resolution: {integrity: sha512-SN9c4kxXZonFhbX4hJrZy37yw9e7EIxcpHCxQv5JUS18wDE5ovkQKlqQEkufdJCCMfuI9BnjUJvhYeJ9x5Ra7g==} - '@types/react-slider@1.3.1': - resolution: {integrity: sha512-4X2yK7RyCIy643YCFL+bc6XNmcnBtt8n88uuyihvcn5G7Lut23eNQU3q3KmwF7MWIfKfsW5NxCjw0SeDZRtgaA==} - '@types/react-virtualized-auto-sizer@1.0.1': resolution: {integrity: sha512-GH8sAnBEM5GV9LTeiz56r4ZhMOUSrP43tAQNSRVxNexDjcNKLCEtnxusAItg1owFUFE6k0NslV26gqVClVvong==} @@ -9430,15 +8655,9 @@ packages: '@types/resolve@0.0.8': resolution: {integrity: sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==} - '@types/resolve@1.17.1': - resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} - '@types/responselike@1.0.0': resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} - '@types/retry@0.12.0': - resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} - '@types/scheduler@0.16.3': resolution: {integrity: sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==} @@ -9460,9 +8679,6 @@ packages: '@types/send@0.17.1': resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} - '@types/serve-index@1.9.4': - resolution: {integrity: sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug==} - '@types/serve-static@1.15.2': resolution: {integrity: sha512-J2LqtvFYCzaj8pVYKw8klQXrLLk7TBZmQ4ShlcdkELFKGwGMfevMLneMMRkMgZxotOD9wg497LpC7O8PcvAmfw==} @@ -9478,9 +8694,6 @@ packages: '@types/sinonjs__fake-timers@8.1.2': resolution: {integrity: sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==} - '@types/sockjs@0.3.36': - resolution: {integrity: sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==} - '@types/stack-utils@2.0.1': resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} @@ -9532,26 +8745,12 @@ packages: '@types/yargs@15.0.19': resolution: {integrity: sha512-2XUaGVmyQjgyAZldf0D0c14vvo/yv0MhQBSTJcejMMaitsn3nxCB6TmH4G0ZQf+uxROOa9mpanoSm8h6SG/1ZA==} - '@types/yargs@16.0.9': - resolution: {integrity: sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==} - '@types/yargs@17.0.24': resolution: {integrity: sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==} '@types/zrender@4.0.6': resolution: {integrity: sha512-1jZ9bJn2BsfmYFPBHtl5o3uV+ILejAtGrDcYSpT4qaVKEI/0YY+arw3XHU04Ebd8Nca3SQ7uNcLaqiL+tTFVMg==} - '@typescript-eslint/eslint-plugin@5.62.0': - resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/eslint-plugin@6.7.5': resolution: {integrity: sha512-JhtAwTRhOUcP96D0Y6KYnwig/MRQbOoLGXTON2+LlyB/N35SP9j1boai2zzwXb7ypKELXMx3DVk9UTaEq1vHEw==} engines: {node: ^16.0.0 || >=18.0.0} @@ -9563,22 +8762,6 @@ packages: typescript: optional: true - '@typescript-eslint/experimental-utils@5.62.0': - resolution: {integrity: sha512-RTXpeB3eMkpoclG3ZHft6vG/Z30azNHuqY6wKPBHlVMZFuEvrtlEDe8gMqDb+SO+9hjC/pLekeSCryf9vMZlCw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - - '@typescript-eslint/parser@5.62.0': - resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/parser@6.7.5': resolution: {integrity: sha512-bIZVSGx2UME/lmhLcjdVc7ePBwn7CLqKarUBL4me1C5feOd663liTGjMBGVcGr+BhnSLeP4SgwdvNnnkbIdkCw==} engines: {node: ^16.0.0 || >=18.0.0} @@ -9597,16 +8780,6 @@ packages: resolution: {integrity: sha512-GAlk3eQIwWOJeb9F7MKQ6Jbah/vx1zETSDw8likab/eFcqkjSD7BI75SDAeC5N2L0MmConMoPvTsmkrg71+B1A==} engines: {node: ^16.0.0 || >=18.0.0} - '@typescript-eslint/type-utils@5.62.0': - resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: '*' - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/type-utils@6.7.5': resolution: {integrity: sha512-Gs0qos5wqxnQrvpYv+pf3XfcRXW6jiAn9zE/K+DlmYf6FcpxeNYN0AIETaPR7rHO4K2UY+D0CIbDP9Ut0U4m1g==} engines: {node: ^16.0.0 || >=18.0.0} @@ -10310,9 +9483,6 @@ packages: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} - acorn-globals@6.0.0: - resolution: {integrity: sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==} - acorn-globals@7.0.1: resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==} @@ -10421,11 +9591,6 @@ packages: peerDependencies: ajv: ^6.9.1 - ajv-keywords@5.1.0: - resolution: {integrity: sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==} - peerDependencies: - ajv: ^8.8.2 - ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} @@ -10474,11 +9639,6 @@ packages: ansi-fragments@0.2.1: resolution: {integrity: sha512-DykbNHxuXQwUDRv5ibc2b0x7uw7wmwOGLBUd5RmaQ5z8Lhx19vwvKV+FAsM5rEA6dEcHxX+/Ad5s9eF2k2bB+w==} - ansi-html-community@0.0.8: - resolution: {integrity: sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==} - engines: {'0': node >= 0.8.0} - hasBin: true - ansi-regex@2.1.1: resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==} engines: {node: '>=0.10.0'} @@ -10522,12 +9682,6 @@ packages: ansicolors@0.3.2: resolution: {integrity: sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==} - antd@5.17.0: - resolution: {integrity: sha512-jrzMIcaTJIy12/GJ2PfgchgZGuAlDodlaOKd05/TxEtFilRHnv8oaf0qfqNGG3slvvuy4J/57xn21jM4cLl7Hw==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - antlr4@4.7.1: resolution: {integrity: sha512-haHyTW7Y9joE5MVs37P2lNYfU2RWBLfcRDD8OWldcdZm5TiCE91B5Xl1oWSwiDUSd4rlExpt2pu1fksYQjRBYQ==} @@ -10636,9 +9790,6 @@ packages: resolution: {integrity: sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==} engines: {node: '>= 0.4'} - array-tree-filter@2.1.0: - resolution: {integrity: sha512-4ROwICNlNw/Hqa9v+rk5h22KjmzB1JGTMVKP2AKJBOCgb0yL0ASf0+YvCcLNNwquOHNX48jkeZIJ3a+oOQqKcw==} - array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} @@ -10882,9 +10033,6 @@ packages: axobject-query@4.0.0: resolution: {integrity: sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==} - b4a@1.6.4: - resolution: {integrity: sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==} - babel-code-frame@6.26.0: resolution: {integrity: sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==} @@ -10935,25 +10083,12 @@ packages: babel-helpers@6.24.1: resolution: {integrity: sha512-n7pFrqQm44TCYvrCDb0MqabAF+JUBq+ijBvNMUxpkLjJaAu32faIexewMumrH5KLLJ1HDyT0PTEqRyAe/GwwuQ==} - babel-jest@27.5.1: - resolution: {integrity: sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - peerDependencies: - '@babel/core': ^7.8.0 - babel-jest@29.7.0: resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 - babel-loader@8.3.0: - resolution: {integrity: sha512-H8SvsMF+m9t15HNLMipppzkC+Y2Yq+v3SonZyU70RBL/h1gxPkH08Ot8pEE9Z4Kd+czyWJClmFS8qzIP9OZ04Q==} - engines: {node: '>= 8.9'} - peerDependencies: - '@babel/core': ^7.0.0 - webpack: '>=2' - babel-messages@6.23.0: resolution: {integrity: sha512-Bl3ZiA+LjqaMtNYopA9TYE9HP1tQ+E5dLxE0XrAzcIJeK2UqF0/EaqXwBn9esd4UmTfEab+P+UYQ1GnioFIb/w==} @@ -10964,10 +10099,6 @@ packages: resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} engines: {node: '>=8'} - babel-plugin-jest-hoist@27.5.1: - resolution: {integrity: sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - babel-plugin-jest-hoist@29.6.3: resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -10976,11 +10107,6 @@ packages: resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==} engines: {node: '>=10', npm: '>=6'} - babel-plugin-named-asset-import@0.3.8: - resolution: {integrity: sha512-WXiAc++qo7XcJ1ZnTYGtLxmBCVbddAml3CEXgWaBzNzLNoxtQ8AiGEFDMOhot9XjTCQbvP5E77Fj9Gk924f00Q==} - peerDependencies: - '@babel/core': ^7.1.0 - babel-plugin-polyfill-corejs2@0.4.10: resolution: {integrity: sha512-rpIuu//y5OX6jVU+a5BCn1R5RSZYWAl2Nar76iwaOdycqb6JPxediskWFMMl7stfwNJR4b7eiQvh5fB5TEQJTQ==} peerDependencies: @@ -11095,9 +10221,6 @@ packages: babel-plugin-transform-flow-enums@0.0.2: resolution: {integrity: sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ==} - babel-plugin-transform-react-remove-prop-types@0.4.24: - resolution: {integrity: sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA==} - babel-plugin-transform-regenerator@6.26.0: resolution: {integrity: sha512-LS+dBkUGlNR15/5WHKe/8Neawx663qttS6AGqoOUhICc9d1KciBvtrQSuc0PI+CxQ2Q/S1aKuJ+u64GtLdcEZg==} @@ -11112,21 +10235,12 @@ packages: babel-preset-env@1.7.0: resolution: {integrity: sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==} - babel-preset-jest@27.5.1: - resolution: {integrity: sha512-Nptf2FzlPCWYuJg41HBqXVT8ym6bXOevuCTbhxlUpjwtysGaIWFvDEjp4y+G7fl13FgOdjs7P/DmErqH7da0Ag==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - peerDependencies: - '@babel/core': ^7.0.0 - babel-preset-jest@29.6.3: resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.0.0 - babel-preset-react-app@10.0.1: - resolution: {integrity: sha512-b0D9IZ1WhhCWkrTXyFuIIgqGzSkRIH5D5AmB0bXbzYAB1OBAwHcUeyWW2LorutLWF5btNo/N7r/cIdmvvKJlYg==} - babel-register@6.26.0: resolution: {integrity: sha512-veliHlHX06wjaeY8xNITbveXSiI+ASFnOqvne/LaIJIqOWi2Ogmj91KOugEz/hoh/fwMhXNBJPCv8Xaz5CyM4A==} @@ -11176,9 +10290,6 @@ packages: resolution: {integrity: sha512-QHX8HLlncOLpy54mh+k/sWIFd0ThmRqwe9ZjELybGZK+tZ8rUb9VO0saKJUROTbE+KhzDUT7xziGpGrW8Kmd+g==} engines: {node: '>=10.0.0'} - batch@0.6.1: - resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} - bcrypt-pbkdf@1.0.2: resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==} @@ -11199,10 +10310,6 @@ packages: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} engines: {node: '>=4'} - bfj@7.1.0: - resolution: {integrity: sha512-I6MMLkn+anzNdCUp9hMRyui1HaNEUCco50lxbvNS4+EyXg8lN3nJ48PjPWtbH8UVS9CuMoaKE9U2V3l29DaRQw==} - engines: {node: '>= 8.0.0'} - big-integer@1.6.51: resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==} engines: {node: '>=0.6'} @@ -11269,9 +10376,6 @@ packages: resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - bonjour-service@1.2.1: - resolution: {integrity: sha512-oSzCS2zV14bh2kji6vNe7vrpJYCHGvcZnlffFQ1MEoX/WOeQ/teD8SYWKR942OI3INjq8OMNJlbPK5LLLUxFDw==} - boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} @@ -11322,9 +10426,6 @@ packages: browser-or-node@1.3.0: resolution: {integrity: sha512-0F2z/VSnLbmEeBcUrSuDH5l0HxTXdQQzLjkmBR4cYfvg1zJrKSlmIZFqyFR8oX0NrwPhy3c3HQ6i3OxMbew4Tg==} - browser-process-hrtime@1.0.0: - resolution: {integrity: sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==} - browser-stdout@1.3.1: resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} @@ -11516,9 +10617,6 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - camel-case@4.1.2: - resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==} - camelcase-css@2.0.1: resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} engines: {node: '>= 6'} @@ -11546,9 +10644,6 @@ packages: camelize@1.0.1: resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} - caniuse-api@3.0.0: - resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} - caniuse-lite@1.0.30001611: resolution: {integrity: sha512-19NuN1/3PjA3QI8Eki55N8my4LzfkMCRLgCVfrl/slbSAchQfV0+GwjPrK3rq37As4UCLlM/DHajbKkAqbv92Q==} @@ -11559,10 +10654,6 @@ packages: resolution: {integrity: sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==} hasBin: true - case-sensitive-paths-webpack-plugin@2.4.0: - resolution: {integrity: sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==} - engines: {node: '>=4'} - caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} @@ -11613,10 +10704,6 @@ packages: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} - char-regex@2.0.1: - resolution: {integrity: sha512-oSvEeo6ZUD7NepqAat3RqoucZ5SeqLJgOvVIwkafu6IP3V0pO38s/ypdVUmDDK6qIIHNlYHJAKX9E7R7HoKElw==} - engines: {node: '>=12.20'} - char-spinner@1.0.1: resolution: {integrity: sha512-acv43vqJ0+N0rD+Uw3pDHSxP30FHrywu2NO6/wBaHChJIizpDeBUd6NjqhNhy9LGaEAhZAXn46QzmlAvIWd16g==} @@ -11653,9 +10740,6 @@ packages: check-error@1.0.3: resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} - check-types@11.2.3: - resolution: {integrity: sha512-+67P1GkJRaxQD6PKK0Et9DhwQB+vGg3PM5+aavopCpZT1lj9jeqfvpgTLAWErNj8qApkkmXlu/Ug74kmhagkXg==} - checkpoint-store@1.1.0: resolution: {integrity: sha512-J/NdY2WvIx654cc6LWSq/IYFFCUf75fFTgwzFnmbqyORH4MwgiQCgswLLKBGzmsyTI5V7i5bp/So6sMbDWhedg==} @@ -11735,13 +10819,6 @@ packages: classnames@2.3.2: resolution: {integrity: sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==} - classnames@2.5.1: - resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==} - - clean-css@5.3.3: - resolution: {integrity: sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==} - engines: {node: '>= 10.0'} - clean-regexp@1.0.0: resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==} engines: {node: '>=4'} @@ -11857,10 +10934,6 @@ packages: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} - coa@2.0.2: - resolution: {integrity: sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==} - engines: {node: '>= 4.0'} - code-block-writer@10.1.1: resolution: {integrity: sha512-67ueh2IRGst/51p0n6FvPrnRjAGHY5F8xdjkgrYE7DDzpJe6qA07RYQ9VcoUeo5ATOjSOiWpSL3SWBRRbempMw==} @@ -11891,20 +10964,10 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - color-string@1.9.1: - resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==} - color-support@1.1.3: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} hasBin: true - color@4.2.3: - resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==} - engines: {node: '>=12.5.0'} - - colord@2.9.3: - resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} - colorette@1.4.0: resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} @@ -11962,18 +11025,10 @@ packages: resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} engines: {node: '>= 10'} - commander@8.3.0: - resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} - engines: {node: '>= 12'} - commander@9.5.0: resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} engines: {node: ^12.20.0 || >=14} - common-tags@1.8.2: - resolution: {integrity: sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==} - engines: {node: '>=4.0.0'} - commondir@1.0.1: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} @@ -11992,9 +11047,6 @@ packages: resolution: {integrity: sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==} engines: {node: '>= 0.8.0'} - compute-scroll-into-view@3.1.0: - resolution: {integrity: sha512-rj8l8pD4bJ1nx+dAkMhV1xB5RuZEyVysfxJqB1pRchh1KVvwOv9b7CGB8ZfjTImVv2oF+sYMUkMZq6Na5Ftmbg==} - computeds@0.0.1: resolution: {integrity: sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==} @@ -12009,13 +11061,6 @@ packages: resolution: {integrity: sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==} engines: {'0': node >= 6.0} - confusing-browser-globals@1.0.11: - resolution: {integrity: sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==} - - connect-history-api-fallback@2.0.0: - resolution: {integrity: sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==} - engines: {node: '>=0.8'} - connect@3.7.0: resolution: {integrity: sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==} engines: {node: '>= 0.10.0'} @@ -12108,9 +11153,6 @@ packages: resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==} deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. - core-js@3.38.0: - resolution: {integrity: sha512-XPpwqEodRljce9KswjZShh95qJ1URisBeKCjUdq27YdenkslVe7OO0ZJhlYXAChW7OhXaRLl8AAba7IBfoIHug==} - core-util-is@1.0.2: resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} @@ -12125,10 +11167,6 @@ packages: resolution: {integrity: sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==} engines: {node: '>=4'} - cosmiconfig@6.0.0: - resolution: {integrity: sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==} - engines: {node: '>=8'} - cosmiconfig@7.1.0: resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==} engines: {node: '>=10'} @@ -12213,30 +11251,10 @@ packages: resolution: {integrity: sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==} engines: {node: '>=8'} - css-blank-pseudo@3.0.3: - resolution: {integrity: sha512-VS90XWtsHGqoM0t4KpH053c4ehxZ2E6HtGI7x68YFV0pTo/QmkV/YFA+NnlvK8guxZVNWGQhVNJGC39Q8XF4OQ==} - engines: {node: ^12 || ^14 || >=16} - hasBin: true - peerDependencies: - postcss: ^8.4 - css-color-keywords@1.0.0: resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} engines: {node: '>=4'} - css-declaration-sorter@6.4.1: - resolution: {integrity: sha512-rtdthzxKuyq6IzqX6jEcIzQF/YqccluefyCYheovBOLhFT/drQA9zj/UbRAa9J7C0o6EG6u3E6g+vKkay7/k3g==} - engines: {node: ^10 || ^12 || >=14} - peerDependencies: - postcss: ^8.0.9 - - css-has-pseudo@3.0.4: - resolution: {integrity: sha512-Vse0xpR1K9MNlp2j5w1pgWIJtm1a8qS0JwS9goFYcImjlHEmywP9VUF05aGBXzGpDJF86QXk4L0ypBmwPhGArw==} - engines: {node: ^12 || ^14 || >=16} - hasBin: true - peerDependencies: - postcss: ^8.4 - css-loader@6.8.1: resolution: {integrity: sha512-xDAXtEVGlD0gJ07iclwWVkLoZOpEvAWaSyf6W18S2pOC//K8+qUDIx8IIT3D+HjnmkJPQeesOPv5aiUaJsCM2g==} engines: {node: '>= 12.13.0'} @@ -12246,103 +11264,28 @@ packages: css-mediaquery@0.1.2: resolution: {integrity: sha512-COtn4EROW5dBGlE/4PiKnh6rZpAPxDeFLaEEwt4i10jpDMFt2EhQGS79QmmrO+iKCHv0PU/HrOWEhijFd1x99Q==} - css-minimizer-webpack-plugin@3.4.1: - resolution: {integrity: sha512-1u6D71zeIfgngN2XNRJefc/hY7Ybsxd74Jm4qngIXyUEk7fss3VUzuHxLAq/R8NAba4QU9OUSaMZlbpRc7bM4Q==} - engines: {node: '>= 12.13.0'} - peerDependencies: - '@parcel/css': '*' - clean-css: '*' - csso: '*' - esbuild: '*' - webpack: ^5.0.0 - peerDependenciesMeta: - '@parcel/css': - optional: true - clean-css: - optional: true - csso: - optional: true - esbuild: - optional: true - - css-prefers-color-scheme@6.0.3: - resolution: {integrity: sha512-4BqMbZksRkJQx2zAjrokiGMd07RqOa2IxIrrN10lyBe9xhn9DEvjUK79J6jkeiv9D9hQFXKb6g1jwU62jziJZA==} - engines: {node: ^12 || ^14 || >=16} - hasBin: true - peerDependencies: - postcss: ^8.4 - - css-select-base-adapter@0.1.1: - resolution: {integrity: sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==} - - css-select@2.1.0: - resolution: {integrity: sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==} - - css-select@4.3.0: - resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} - css-select@5.1.0: resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} css-to-react-native@3.2.0: resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} - css-tree@1.0.0-alpha.37: - resolution: {integrity: sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==} - engines: {node: '>=8.0.0'} - - css-tree@1.1.3: - resolution: {integrity: sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==} - engines: {node: '>=8.0.0'} - css-tree@2.3.1: resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} - css-what@3.4.2: - resolution: {integrity: sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==} - engines: {node: '>= 6'} - css-what@6.1.0: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} - cssdb@7.11.2: - resolution: {integrity: sha512-lhQ32TFkc1X4eTefGfYPvgovRSzIMofHkigfH8nWtyRL4XJLsRhJFreRvEgKzept7x1rjBuy3J/MurXLaFxW/A==} - cssesc@3.0.0: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} hasBin: true - cssnano-preset-default@5.2.14: - resolution: {integrity: sha512-t0SFesj/ZV2OTylqQVOrFgEh5uanxbO6ZAdeCrNsUQ6fVuXwYTxJPNAGvGTxHbD68ldIJNec7PyYZDBrfDQ+6A==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - cssnano-utils@3.1.0: - resolution: {integrity: sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - cssnano@5.1.15: - resolution: {integrity: sha512-j+BKgDcLDQA+eDifLx0EO4XSA56b7uut3BQFH+wbSaSTuGLuiyTa/wbRYthUXX8LC9mLg+WWKe8h+qJuwTAbHw==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - csso@4.2.0: - resolution: {integrity: sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==} - engines: {node: '>=8.0.0'} - cssom@0.3.8: resolution: {integrity: sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==} - cssom@0.4.4: - resolution: {integrity: sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==} - cssom@0.5.0: resolution: {integrity: sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==} @@ -12507,10 +11450,6 @@ packages: resolution: {integrity: sha512-a9l6T1qqDogvvnw0nKlfZzqsyikEBZBClF39V3TFoKhDtGBqHu2HkuomJc02j5zft8zrUaXEuoicLeW54RkzPg==} engines: {node: '>= 14'} - data-urls@2.0.0: - resolution: {integrity: sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==} - engines: {node: '>=10'} - data-urls@3.0.2: resolution: {integrity: sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==} engines: {node: '>=12'} @@ -12540,9 +11479,6 @@ packages: date-fns@3.3.1: resolution: {integrity: sha512-y8e109LYGgoQDveiEBD3DYXKba1jWf5BA8YU1FL5Tvm0BTdEfy54WLCwnuYWZNnzzvALy/QQ4Hov+Q9RVRv+Zw==} - dayjs@1.11.10: - resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} - dayjs@1.11.11: resolution: {integrity: sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==} @@ -12642,9 +11578,6 @@ packages: dedent-js@1.0.1: resolution: {integrity: sha512-OUepMozQULMLUmhxS95Vudo0jb0UchLimi3+pQ2plj61Fcy8axbP9hbiD4Sz6DPqn6XG3kfmziVfQ1rSys5AJQ==} - dedent@0.7.0: - resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} - dedent@1.5.1: resolution: {integrity: sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==} peerDependencies: @@ -12690,10 +11623,6 @@ packages: resolution: {integrity: sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==} engines: {node: '>=14.16'} - default-gateway@6.0.3: - resolution: {integrity: sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==} - engines: {node: '>= 10'} - defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} @@ -12853,18 +11782,10 @@ packages: detect-node-es@1.1.0: resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==} - detect-node@2.1.0: - resolution: {integrity: sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==} - detect-package-manager@2.0.1: resolution: {integrity: sha512-j/lJHyoLlWi6G1LDdLgvUtz60Zo5GEj+sVYtTVXnYLDPuzgC3llMxonXym9zIwhhUII8vjdw0LXxavpLqTbl1A==} engines: {node: '>=12'} - detect-port-alt@1.1.6: - resolution: {integrity: sha512-5tQykt+LqfJFBEYaDITx7S7cR7mJ/zQmLXZ2qt5w04ainYZw6tBf9dBunMjVeVOdYVRUzUOE4HkY5J7+uttb5Q==} - engines: {node: '>= 4.2.1'} - hasBin: true - detect-port@1.5.1: resolution: {integrity: sha512-aBzdj76lueB6uUst5iAs7+0H/oOjqI5D16XUWxlWMIMROhcM0rfsNVk93zTngq1dDNpoXRr++Sus7ETAExppAQ==} hasBin: true @@ -12913,10 +11834,6 @@ packages: didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} - diff-sequences@27.5.1: - resolution: {integrity: sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -12953,10 +11870,6 @@ packages: dlv@1.1.3: resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} - dns-packet@5.6.1: - resolution: {integrity: sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==} - engines: {node: '>=6'} - docker-modem@1.0.9: resolution: {integrity: sha512-lVjqCSCIAUDZPAZIeyM125HXfNvOmYYInciphNrLrylUtKyW66meAjSPXWchKVzoIYZx69TPnAepVSSkeawoIw==} engines: {node: '>= 0.8'} @@ -12985,56 +11898,26 @@ packages: resolution: {integrity: sha512-065fsvu5dB0o4+ENtLjZILvXMClDNH/yA9H6L8nsdcNiz9l0Hzpn7aQaCOPYXxqyzq4CRPOdwkFXUjDOXfRGbg==} hasBin: true - dom-converter@0.2.0: - resolution: {integrity: sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA==} - - dom-serializer@0.2.2: - resolution: {integrity: sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==} - - dom-serializer@1.4.1: - resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==} - dom-serializer@2.0.0: resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} dom-walk@0.1.2: resolution: {integrity: sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==} - domelementtype@1.3.1: - resolution: {integrity: sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==} - domelementtype@2.3.0: resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} - domexception@2.0.1: - resolution: {integrity: sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==} - engines: {node: '>=8'} - deprecated: Use your platform's native DOMException instead - domexception@4.0.0: resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==} engines: {node: '>=12'} - domhandler@4.3.1: - resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} - engines: {node: '>= 4'} - domhandler@5.0.3: resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} engines: {node: '>= 4'} - domutils@1.7.0: - resolution: {integrity: sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==} - - domutils@2.8.0: - resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} - domutils@3.1.0: resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==} - dot-case@3.0.4: - resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} - dotenv-cli@6.0.0: resolution: {integrity: sha512-qXlCOi3UMDhCWFKe0yq5sg3X+pJAz+RQDiFN38AMSbUrnY3uZshSfDJUAge951OS7J9gwLZGfsBlWRSOYz/TRg==} hasBin: true @@ -13043,17 +11926,10 @@ packages: resolution: {integrity: sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==} engines: {node: '>=12'} - dotenv-expand@5.1.0: - resolution: {integrity: sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==} - dotenv-expand@8.0.3: resolution: {integrity: sha512-SErOMvge0ZUyWd5B0NXMQlDkN+8r+HhVUsxgOO7IoPDOdDRD2JjExpN6y3KnFR66jsJMwSn1pqIivhU5rcJiNg==} engines: {node: '>=12'} - dotenv@10.0.0: - resolution: {integrity: sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==} - engines: {node: '>=10'} - dotenv@14.3.2: resolution: {integrity: sha512-vwEppIphpFdvaMCaHfCEv9IgwcxMljMw2TnAQBB4VWPvzXQLTb82jwmdOKzlEVUL3gNFT4l4TPKO+Bn+sqcrVQ==} engines: {node: '>=12'} @@ -13225,18 +12101,10 @@ packages: elliptic@6.5.7: resolution: {integrity: sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==} - emittery@0.10.2: - resolution: {integrity: sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw==} - engines: {node: '>=12'} - emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} - emittery@0.8.1: - resolution: {integrity: sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==} - engines: {node: '>=10'} - emoji-regex@10.2.1: resolution: {integrity: sha512-97g6QgOk8zlDRdgq1WxwgTMgEWGVAQvB5Fdpgc1MkNy56la5SKP9GsMXKDOdqwn90/41a8yPwIGk1Y6WVbeMQA==} @@ -13295,9 +12163,6 @@ packages: ensure-posix-path@1.1.1: resolution: {integrity: sha512-VWU0/zXzVbeJNXvME/5EmLuEj2TauvoaTz6aFYK1Z92JCBlDlZ3Gu0tuGR42kpW1754ywTs+QB0g5TP0oj9Zaw==} - entities@2.2.0: - resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} - entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} @@ -13614,16 +12479,6 @@ packages: peerDependencies: eslint: '>=7.0.0' - eslint-config-react-app@7.0.1: - resolution: {integrity: sha512-K6rNzvkIeHaTd8m/QEh1Zko0KI7BACWkkneSs6s9cKZC/J27X3eZR6Upt1jkmZ/4FK+XUOPPxMEN7+lbUXfSlA==} - engines: {node: '>=14.0.0'} - peerDependencies: - eslint: ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - eslint-config-turbo@2.0.5: resolution: {integrity: sha512-iE/oD0ZBM6OQFbS/bKnc3UtqhMmJ1IEfqTQ0qCY1CauHm7gj85aRRX/1ydDYKLpu0RupBqzVPybsWxPif9rsig==} peerDependencies: @@ -13678,14 +12533,6 @@ packages: peerDependencies: eslint: '>=4.19.1' - eslint-plugin-flowtype@8.0.3: - resolution: {integrity: sha512-dX8l6qUL6O+fYPtpNRideCFSpmWOUVx5QcaGLVqe/vlDiBSe4vYljDWDETwnyFzpl7By/WVIu6rcrniCgH9BqQ==} - engines: {node: '>=12.0.0'} - peerDependencies: - '@babel/plugin-syntax-flow': ^7.14.5 - '@babel/plugin-transform-react-jsx': ^7.14.9 - eslint: ^8.1.0 - eslint-plugin-import@2.28.1: resolution: {integrity: sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==} engines: {node: '>=4'} @@ -13696,19 +12543,6 @@ packages: '@typescript-eslint/parser': optional: true - eslint-plugin-jest@25.7.0: - resolution: {integrity: sha512-PWLUEXeeF7C9QGKqvdSbzLOiLTx+bno7/HC9eefePfEb257QFHg7ye3dh80AZVkaa/RQsBB1Q/ORQvg2X7F0NQ==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - peerDependencies: - '@typescript-eslint/eslint-plugin': ^4.0.0 || ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - jest: '*' - peerDependenciesMeta: - '@typescript-eslint/eslint-plugin': - optional: true - jest: - optional: true - eslint-plugin-jest@27.4.2: resolution: {integrity: sha512-3Nfvv3wbq2+PZlRTf2oaAWXWwbdBejFRBR2O8tAO67o+P8zno+QGbcDYaAXODlreXVg+9gvWhKKmG2rgfb8GEg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -13771,12 +12605,6 @@ packages: peerDependencies: eslint: '>=6' - eslint-plugin-testing-library@5.11.1: - resolution: {integrity: sha512-5eX9e1Kc2PqVRed3taaLnAAqPZGEX75C+M/rXzUAI3wIg/ZxzUm1OVAwfe/O+vE+6YXOLetSe9g5GKD2ecXipw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6'} - peerDependencies: - eslint: ^7.5.0 || ^8.0.0 - eslint-plugin-testing-library@6.1.0: resolution: {integrity: sha512-r7kE+az3tbp8vyRwfyAGZ6V/xw+XvdWFPicIo6jbOPZoossOFDeHizARqPGV6gEkyF8hyCFhhH3mlQOGS3N5Sg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6'} @@ -13825,13 +12653,6 @@ packages: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint-webpack-plugin@3.2.0: - resolution: {integrity: sha512-avrKcGncpPbPSUHX6B3stNGzkKFto3eL+DKM4+VyMrVnhPc3vRczVlCq3uhuFOdRvDHTVXuzwk1ZKUrqDQHQ9w==} - engines: {node: '>= 12.13.0'} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - webpack: ^5.0.0 - eslint@5.16.0: resolution: {integrity: sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==} engines: {node: ^6.14.0 || ^8.10.0 || >=9.10.0} @@ -13855,11 +12676,6 @@ packages: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - esprima@1.2.2: - resolution: {integrity: sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==} - engines: {node: '>=0.4.0'} - hasBin: true - esprima@2.7.3: resolution: {integrity: sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==} engines: {node: '>=0.10.0'} @@ -13900,9 +12716,6 @@ packages: estree-util-visit@1.2.1: resolution: {integrity: sha512-xbgqcrkIVbIG+lI/gzbvd9SGTJL4zqJKBFttUl5pP27KhAjtMKbX/mQXJ7qgyXpMgVy/zvpm0xoQQaGL8OloOw==} - estree-walker@1.0.1: - resolution: {integrity: sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==} - estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} @@ -14142,14 +12955,6 @@ packages: resolution: {integrity: sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==} engines: {node: '>=0.10.0'} - expand-template@2.0.3: - resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} - engines: {node: '>=6'} - - expect@27.5.1: - resolution: {integrity: sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - expect@29.7.0: resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -14218,9 +13023,6 @@ packages: fast-diff@1.3.0: resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - fast-fifo@1.3.2: - resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==} - fast-glob@3.3.1: resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} engines: {node: '>=8.6.0'} @@ -14268,10 +13070,6 @@ packages: fault@2.0.1: resolution: {integrity: sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==} - faye-websocket@0.11.4: - resolution: {integrity: sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==} - engines: {node: '>=0.8.0'} - fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} @@ -14299,12 +13097,6 @@ packages: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} - file-loader@6.2.0: - resolution: {integrity: sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==} - engines: {node: '>= 10.13.0'} - peerDependencies: - webpack: ^4.0.0 || ^5.0.0 - file-selector@0.6.0: resolution: {integrity: sha512-QlZ5yJC0VxHxQQsQhXvBaC7VRJ2uaxTf+Tfpu4Z/OcVQJVpZO+DGU0rkoVW5ce2SccxugvpBJoMvUs59iILYdw==} engines: {node: '>= 12'} @@ -14318,10 +13110,6 @@ packages: filelist@1.0.4: resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} - filesize@8.0.7: - resolution: {integrity: sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ==} - engines: {node: '>= 0.4.0'} - filing-cabinet@4.1.6: resolution: {integrity: sha512-C+HZbuQTER36sKzGtUhrAPAoK6+/PrrUhYDBQEh3kBRdsyEhkLbp1ML8S0+6e6gCUrUlid+XmubxJrhvL2g/Zw==} engines: {node: '>=14'} @@ -14423,10 +13211,6 @@ packages: flow-enums-runtime@0.0.6: resolution: {integrity: sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw==} - flow-parser@0.156.0: - resolution: {integrity: sha512-OCE3oIixhOttaV4ahIGtxf9XfaDdxujiTnXuHu+0dvDVVDiSDJlQpgCWdDKqP0OHfFnxQKrjMamArDAXtrBtZw==} - engines: {node: '>=0.4.0'} - flow-parser@0.206.0: resolution: {integrity: sha512-HVzoK3r6Vsg+lKvlIZzaWNBVai+FXTX1wdYhz/wVlH13tb/gOdLXmlTqy6odmTBhT5UoWUbq0k8263Qhr9d88w==} engines: {node: '>=0.4.0'} @@ -14435,11 +13219,6 @@ packages: resolution: {integrity: sha512-RW1Dh6BuT14DA7+gtNRKzgzvG3GTPdrceHCi4ddZ9VFGQ9HtO5L8wzxMGsor7XtInIrbWZZCSak0oxnBF7tApw==} engines: {node: '>=0.4.0'} - flow-remove-types@2.156.0: - resolution: {integrity: sha512-ivU28S1ycaVo5anxlXdIVlrmqLD81JWFADa6oUjyoQg0va4zSyZCp5OYco74VZi7nm42O/yTNv1Y5Byc7bJF1Q==} - engines: {node: '>=4'} - hasBin: true - flow-stoplight@1.0.0: resolution: {integrity: sha512-rDjbZUKpN8OYhB0IE/vY/I8UWO/602IIJEU/76Tv4LvYnwHCk0BCsvz4eRr9n+FQcri7L5cyaXOo0+/Kh4HisA==} @@ -14482,20 +13261,6 @@ packages: forever-agent@0.6.1: resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} - fork-ts-checker-webpack-plugin@6.5.3: - resolution: {integrity: sha512-SbH/l9ikmMWycd5puHJKTkZJKddF4iRLyW3DeZ08HTI7NGyLS38MXd/KGgeWumQO7YNQbW2u/NtPT2YowbPaGQ==} - engines: {node: '>=10', yarn: '>=1.0.0'} - peerDependencies: - eslint: '>= 6' - typescript: 5.5.4 - vue-template-compiler: '*' - webpack: '>= 4' - peerDependenciesMeta: - eslint: - optional: true - vue-template-compiler: - optional: true - form-data-encoder@1.7.1: resolution: {integrity: sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg==} @@ -14589,9 +13354,6 @@ packages: resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} engines: {node: '>= 8'} - fs-monkey@1.0.6: - resolution: {integrity: sha512-b1FMfwetIKymC0eioW7mTywihSQE4oLzQn1dB6rZB5fx/3NpNEdAWeCSMB+60/AeT0TCXsxzAlcYVEFCTAksWg==} - fs-readdir-recursive@1.1.0: resolution: {integrity: sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==} @@ -14763,9 +13525,6 @@ packages: git-hooks-list@3.1.0: resolution: {integrity: sha512-LF8VeHeR7v+wAbXqfgRlTSX/1BJR9Q1vEMR8JAz1cEg6GX07+zyj3sAdDvYjj/xnlIfVuGgj4qBei1K3hKH+PA==} - github-from-package@0.0.0: - resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} - github-slugger@1.5.0: resolution: {integrity: sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==} @@ -14929,9 +13688,6 @@ packages: h3@1.10.0: resolution: {integrity: sha512-Tw1kcIC+AeimwRmviiObaD5EB430Yt+lTgOxLJxNr96Vd/fGRu04EF7aKfOAcpwKCI+U2JlbxOLhycD86p3Ciw==} - handle-thing@2.0.1: - resolution: {integrity: sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==} - handlebars@4.7.8: resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} engines: {node: '>=0.4.7'} @@ -15006,9 +13762,6 @@ packages: typescript: optional: true - harmony-reflect@1.6.2: - resolution: {integrity: sha512-HIp/n38R9kQjDEziXyDTuW3vvoxxyxjxFzXLrBr18uB47GnSt+G9D29fqrpM5ZkspMcPICud3XsBJQ4Y2URg8g==} - has-ansi@2.0.0: resolution: {integrity: sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==} engines: {node: '>=0.10.0'} @@ -15151,10 +13904,6 @@ packages: resolution: {integrity: sha512-ycURW7oUxE2sNiPVw1HVEFsW+ecOpJ5zaj7eC0RlwhibhRBod20muUN8qu/gzx956YrLolVvs1MTXwKgC2rVEg==} engines: {node: '>=0.10.0'} - hoopy@0.1.4: - resolution: {integrity: sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ==} - engines: {node: '>= 6.0.0'} - hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} @@ -15162,50 +13911,20 @@ packages: resolution: {integrity: sha512-XH8iezBSZgVw2jegu96pUfF1Zv0VZ/iXjb7L5yE3F7mn7/bdhf4qeniXjO0wQWeefe433rhOsazNKLxM+XMI9w==} engines: {node: '>=6.0.0'} - hpack.js@2.1.6: - resolution: {integrity: sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==} - hpagent@0.1.2: resolution: {integrity: sha512-ePqFXHtSQWAFXYmj+JtOTHr84iNrII4/QRlAAPPE+zqnKy4xJo7Ie1Y4kC7AdB+LxLxSTTzBMASsEcy0q8YyvQ==} - html-encoding-sniffer@2.0.1: - resolution: {integrity: sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==} - engines: {node: '>=10'} - html-encoding-sniffer@3.0.0: resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==} engines: {node: '>=12'} - html-entities@2.5.2: - resolution: {integrity: sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==} - html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} - html-minifier-terser@6.1.0: - resolution: {integrity: sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw==} - engines: {node: '>=12'} - hasBin: true - html-tags@3.3.1: resolution: {integrity: sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==} engines: {node: '>=8'} - html-webpack-plugin@5.6.0: - resolution: {integrity: sha512-iwaY4wzbe48AfKLZ/Cc8k0L+FKG6oSNRaZ8x5A/T/IVDGyXcbHncM9TdDa93wn0FsSm82FhTKW7f3vS61thXAw==} - engines: {node: '>=10.13.0'} - peerDependencies: - '@rspack/core': 0.x || 1.x - webpack: ^5.20.0 - peerDependenciesMeta: - '@rspack/core': - optional: true - webpack: - optional: true - - htmlparser2@6.1.0: - resolution: {integrity: sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==} - htmlparser2@8.0.2: resolution: {integrity: sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==} @@ -15216,17 +13935,10 @@ packages: http-cache-semantics@4.1.1: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} - http-deceiver@1.2.7: - resolution: {integrity: sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==} - http-errors@1.4.0: resolution: {integrity: sha512-oLjPqve1tuOl5aRhv8GK5eHpqP1C9fb+Ol+XTLjKfLltE44zdDbEdjPSbU7Ch5rSNsVFqZn97SrMmZLdu1/YMw==} engines: {node: '>= 0.6'} - http-errors@1.6.3: - resolution: {integrity: sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==} - engines: {node: '>= 0.6'} - http-errors@1.7.3: resolution: {integrity: sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==} engines: {node: '>= 0.6'} @@ -15241,10 +13953,6 @@ packages: http-parser-js@0.5.8: resolution: {integrity: sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==} - http-proxy-agent@4.0.1: - resolution: {integrity: sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==} - engines: {node: '>= 6'} - http-proxy-agent@5.0.0: resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} engines: {node: '>= 6'} @@ -15253,15 +13961,6 @@ packages: resolution: {integrity: sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==} engines: {node: '>= 14'} - http-proxy-middleware@2.0.6: - resolution: {integrity: sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==} - engines: {node: '>=12.0.0'} - peerDependencies: - '@types/express': ^4.17.13 - peerDependenciesMeta: - '@types/express': - optional: true - http-proxy@1.18.1: resolution: {integrity: sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==} engines: {node: '>=8.0.0'} @@ -15352,16 +14051,9 @@ packages: idb-keyval@6.2.1: resolution: {integrity: sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg==} - idb@7.1.1: - resolution: {integrity: sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==} - idb@8.0.0: resolution: {integrity: sha512-l//qvlAKGmQO31Qn7xdzagVPPaHTxXx199MhrAFuVBTPqydcPYBWjkrbv4Y0ktB+GmWOiwHl237UUOrLmQxLvw==} - identity-obj-proxy@3.0.0: - resolution: {integrity: sha512-00n6YnVHKrinT9t0d9+5yZC6UBNJANpYEQvL2LlX6Ab9lnmxzIRcEmTPuyGScvl1+jKuCICX1Z0Ab1pPKKdikA==} - engines: {node: '>=4'} - idna-uts46-hx@2.3.1: resolution: {integrity: sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==} engines: {node: '>=4.0.0'} @@ -15449,9 +14141,6 @@ packages: inherits@2.0.1: resolution: {integrity: sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==} - inherits@2.0.3: - resolution: {integrity: sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==} - inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -15509,10 +14198,6 @@ packages: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - iron-webcrypto@1.0.0: resolution: {integrity: sha512-anOK1Mktt8U1Xi7fCM3RELTuYbnFikQY5VtrDj7kPgpejV7d43tWKhzgioO0zpkazLEL/j/iayRqnJhrGfqUsg==} @@ -15550,9 +14235,6 @@ packages: is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - is-arrayish@0.3.2: - resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} - is-async-function@2.0.0: resolution: {integrity: sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==} engines: {node: '>= 0.4'} @@ -15720,9 +14402,6 @@ packages: is-map@2.0.2: resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} - is-module@1.0.0: - resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} - is-nan@1.3.2: resolution: {integrity: sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==} engines: {node: '>= 0.4'} @@ -15767,10 +14446,6 @@ packages: resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} engines: {node: '>=8'} - is-plain-obj@3.0.0: - resolution: {integrity: sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==} - engines: {node: '>=10'} - is-plain-obj@4.1.0: resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} engines: {node: '>=12'} @@ -15807,10 +14482,6 @@ packages: is-relative-path@1.0.2: resolution: {integrity: sha512-i1h+y50g+0hRbBD+dbnInl3JlJ702aar58snAeX+MxBAPvzXGej7sYoPMhlnykabt0ZzCJNBEyzMlekuQZN7fA==} - is-root@2.1.0: - resolution: {integrity: sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg==} - engines: {node: '>=6'} - is-set@2.0.2: resolution: {integrity: sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==} @@ -16002,32 +14673,14 @@ packages: engines: {node: '>=8'} hasBin: true - jest-changed-files@27.5.1: - resolution: {integrity: sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-changed-files@29.7.0: resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-circus@27.5.1: - resolution: {integrity: sha512-D95R7x5UtlMA5iBYsOHFFbMD/GVA4R/Kdq15f7xYWUfWHBto9NYRsOvnSauTgdF+ogCpJ4tyKOXhUifxS65gdw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-circus@29.7.0: resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-cli@27.5.1: - resolution: {integrity: sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - jest-cli@29.7.0: resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -16038,15 +14691,6 @@ packages: node-notifier: optional: true - jest-config@27.5.1: - resolution: {integrity: sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - peerDependencies: - ts-node: '>=9.0.0' - peerDependenciesMeta: - ts-node: - optional: true - jest-config@29.7.0: resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -16059,34 +14703,18 @@ packages: ts-node: optional: true - jest-diff@27.5.1: - resolution: {integrity: sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-diff@29.7.0: resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-docblock@27.5.1: - resolution: {integrity: sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-docblock@29.7.0: resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-each@27.5.1: - resolution: {integrity: sha512-1Ff6p+FbhT/bXQnEouYy00bkNSY7OUpfIcmdl8vZ31A1UUaurOLPA8a8BbJOF2RDUElwJhmeaV7LnagI+5UwNQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-each@29.7.0: resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-environment-jsdom@27.5.1: - resolution: {integrity: sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-environment-jsdom@29.7.0: resolution: {integrity: sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -16096,66 +14724,30 @@ packages: canvas: optional: true - jest-environment-node@27.5.1: - resolution: {integrity: sha512-Jt4ZUnxdOsTGwSRAfKEnE6BcwsSPNOijjwifq5sDFSA2kesnXTvNqKHYgM0hDq3549Uf/KzdXNYn4wMZJPlFLw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-environment-node@29.7.0: resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-get-type@27.5.1: - resolution: {integrity: sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-get-type@29.6.3: resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-haste-map@27.5.1: - resolution: {integrity: sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-haste-map@29.7.0: resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-jasmine2@27.5.1: - resolution: {integrity: sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - - jest-leak-detector@27.5.1: - resolution: {integrity: sha512-POXfWAMvfU6WMUXftV4HolnJfnPOGEu10fscNCA76KBpRRhcMN2c8d3iT2pxQS3HLbA+5X4sOUPzYO2NUyIlHQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-leak-detector@29.7.0: resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-matcher-utils@27.5.1: - resolution: {integrity: sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-matcher-utils@29.7.0: resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-message-util@27.5.1: - resolution: {integrity: sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - - jest-message-util@28.1.3: - resolution: {integrity: sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - jest-message-util@29.7.0: resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-mock@27.5.1: - resolution: {integrity: sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-mock@29.7.0: resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -16169,126 +14761,50 @@ packages: jest-resolve: optional: true - jest-regex-util@27.5.1: - resolution: {integrity: sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - - jest-regex-util@28.0.2: - resolution: {integrity: sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - jest-regex-util@29.6.3: resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-resolve-dependencies@27.5.1: - resolution: {integrity: sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-resolve-dependencies@29.7.0: resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-resolve@27.5.1: - resolution: {integrity: sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-resolve@29.7.0: resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-runner@27.5.1: - resolution: {integrity: sha512-g4NPsM4mFCOwFKXO4p/H/kWGdJp9V8kURY2lX8Me2drgXqG7rrZAx5kv+5H7wtt/cdFIjhqYx1HrlqWHaOvDaQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-runner@29.7.0: resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-runtime@27.5.1: - resolution: {integrity: sha512-o7gxw3Gf+H2IGt8fv0RiyE1+r83FJBRruoA+FXrlHw6xEyBsU8ugA6IPfTdVyA0w8HClpbK+DGJxH59UrNMx8A==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-runtime@29.7.0: resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-serializer@27.5.1: - resolution: {integrity: sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - - jest-snapshot@27.5.1: - resolution: {integrity: sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-snapshot@29.7.0: resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-util@27.5.1: - resolution: {integrity: sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - - jest-util@28.1.3: - resolution: {integrity: sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - jest-util@29.7.0: resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-validate@27.5.1: - resolution: {integrity: sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - jest-validate@29.7.0: resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-watch-typeahead@1.1.0: - resolution: {integrity: sha512-Va5nLSJTN7YFtC2jd+7wsoe1pNe5K4ShLux/E5iHEwlB9AxaxmggY7to9KUqKojhaJw3aXqt5WAb4jGPOolpEw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - jest: ^27.0.0 || ^28.0.0 - - jest-watcher@27.5.1: - resolution: {integrity: sha512-z676SuD6Z8o8qbmEGhoEUFOM1+jfEiL3DXHK/xgEiG2EyNYfFG60jluWcupY6dATjfEsKQuibReS1djInQnoVw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - - jest-watcher@28.1.3: - resolution: {integrity: sha512-t4qcqj9hze+jviFPUN3YAtAEeFnr/azITXQEMARf5cMwKY2SMBRnCQTXLixTl20OR6mLh9KLMrgVJgJISym+1g==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - jest-watcher@29.7.0: resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest-worker@26.6.2: - resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} - engines: {node: '>= 10.13.0'} - jest-worker@27.5.1: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} - jest-worker@28.1.3: - resolution: {integrity: sha512-CqRA220YV/6jCo8VWvAt1KKx6eek1VIHMPeLEbpcfSfkEeWyBNppynM/o6q+Wmw+sOhos2ml34wZbSX3G13//g==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - jest-worker@29.7.0: resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jest@27.5.1: - resolution: {integrity: sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - jest@29.7.0: resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -16376,15 +14892,6 @@ packages: peerDependencies: '@babel/preset-env': ^7.1.6 - jsdom@16.7.0: - resolution: {integrity: sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==} - engines: {node: '>=10'} - peerDependencies: - canvas: ^2.5.0 - peerDependenciesMeta: - canvas: - optional: true - jsdom@20.0.3: resolution: {integrity: sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==} engines: {node: '>=14'} @@ -16476,9 +14983,6 @@ packages: json-to-graphql-query@2.2.5: resolution: {integrity: sha512-5Nom9inkIMrtY992LMBBG1Zaekrc10JaRhyZgprwHBVMDtRgllTvzl0oBbg13wJsVZoSoFNNMaeIVQs0P04vsA==} - json2mq@0.2.0: - resolution: {integrity: sha512-SzoRg7ux5DWTII9J2qkrZrqV1gt+rTaoufMxEzXbS26Uid0NwaJd123HcoB80TgubEppxxIGdNxCx50fEoEWQA==} - json5@0.5.1: resolution: {integrity: sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==} hasBin: true @@ -16515,13 +15019,6 @@ packages: resolution: {integrity: sha512-zBfiUPM5nD0YZSBT/o/fbCUlCcepMIdP0CJZxM1+KgA4f2T206f6VAg9e7mX35+KlMaIc5qXW34f3BnwJ3w+RA==} engines: {node: '>=12.0.0'} - jsonpath@1.1.1: - resolution: {integrity: sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==} - - jsonpointer@5.0.1: - resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} - engines: {node: '>=0.10.0'} - jsonschema@1.4.1: resolution: {integrity: sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==} @@ -16590,10 +15087,6 @@ packages: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} - klona@2.0.6: - resolution: {integrity: sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==} - engines: {node: '>= 8'} - konva@9.3.6: resolution: {integrity: sha512-dqR8EbcM0hjuilZCBP6xauQ5V3kH3m9kBcsDkqPypQuRgsXbcXUrxqYxhNbdvKZpYNW8Amq94jAD/C0NY3qfBQ==} @@ -16603,9 +15096,6 @@ packages: language-tags@1.0.5: resolution: {integrity: sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==} - launch-editor@2.6.1: - resolution: {integrity: sha512-eB/uXmFVpY4zezmGp5XtU21kwo7GBbKB+EQ+UZeWtGb9yAM5xt/Evk+lYH3eRNAtId+ej4u7TYPFZ07w4s7rRw==} - lazy-universal-dotenv@4.0.0: resolution: {integrity: sha512-aXpZJRnTkpK6gQ/z4nk+ZBLd/Qdp118cvPruLSIQzQNRhKwEcdXCOzXuF55VDqIiuAaY3UGZ10DJtvZzDcvsxg==} engines: {node: '>=14.0.0'} @@ -16762,10 +15252,6 @@ packages: resolution: {integrity: sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==} engines: {node: '>=8.9.0'} - loader-utils@3.2.1: - resolution: {integrity: sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==} - engines: {node: '>= 12.13.0'} - local-pkg@0.4.3: resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} engines: {node: '>=14'} @@ -16867,9 +15353,6 @@ packages: lodash.union@4.6.0: resolution: {integrity: sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==} - lodash.uniq@4.5.0: - resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} - lodash.uniqby@4.7.0: resolution: {integrity: sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==} @@ -16977,9 +15460,6 @@ packages: peerDependencies: react: ^16.5.1 || ^17.0.0 || ^18.0.0 - magic-string@0.25.9: - resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==} - magic-string@0.27.0: resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==} engines: {node: '>=12'} @@ -17119,15 +15599,9 @@ packages: mdast-util-to-string@3.2.0: resolution: {integrity: sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==} - mdn-data@2.0.14: - resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==} - mdn-data@2.0.30: resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} - mdn-data@2.0.4: - resolution: {integrity: sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==} - media-query-parser@2.0.2: resolution: {integrity: sha512-1N4qp+jE0pL5Xv4uEcwVUhIkwdUO3S/9gML90nqKA7v7FcOS5vUtatfzok9S9U1EJU8dHWlcv95WLnKmmxZI9w==} @@ -17142,10 +15616,6 @@ packages: resolution: {integrity: sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==} engines: {node: '>=6'} - memfs@3.5.3: - resolution: {integrity: sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==} - engines: {node: '>= 4.0.0'} - memoize-one@5.2.1: resolution: {integrity: sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==} @@ -17427,12 +15897,6 @@ packages: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} - mini-css-extract-plugin@2.9.0: - resolution: {integrity: sha512-Zs1YsZVfemekSZG+44vBsYTLQORkPMwnlv+aehcxK/NLKC+EGhDB39/YePYYqx/sTk6NnYpuqikhSn7+JIevTA==} - engines: {node: '>= 12.13.0'} - peerDependencies: - webpack: ^5.0.0 - mini-svg-data-uri@1.4.4: resolution: {integrity: sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==} hasBin: true @@ -17627,10 +16091,6 @@ packages: resolution: {integrity: sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==} deprecated: This module has been superseded by the multiformats module - multicast-dns@7.2.5: - resolution: {integrity: sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==} - hasBin: true - multicodec@0.5.7: resolution: {integrity: sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA==} deprecated: This module has been superseded by the multiformats module @@ -17694,12 +16154,6 @@ packages: nanotimer@0.3.14: resolution: {integrity: sha512-NpKXdP6ZLwZcODvDeyfoDBVoncbrgvC12txO3F4l9BxMycQjZD29AnasGAy7uSi3dcsTGnGn6/zzvQRwbjS4uw==} - napi-build-utils@1.0.2: - resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} - - natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} - natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -17767,10 +16221,6 @@ packages: resolution: {integrity: sha512-WDD0bdg9mbq6F4mRxEYcPWwfA1vxd0mrvKOyxI7Xj/atfRHVeutzuWByG//jfm4uPzp0y4Kj051EORCBSQMycw==} engines: {node: '>=12.0.0'} - node-abi@3.47.0: - resolution: {integrity: sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==} - engines: {node: '>=10'} - node-abort-controller@3.1.1: resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==} @@ -17780,9 +16230,6 @@ packages: node-addon-api@5.1.0: resolution: {integrity: sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==} - node-addon-api@6.1.0: - resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==} - node-addon-api@7.0.0: resolution: {integrity: sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==} @@ -17856,10 +16303,6 @@ packages: node-int64@0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} - node-modules-regexp@1.0.0: - resolution: {integrity: sha512-JMaRS9L4wSRIR+6PTVEikTrq/lMGEZR43a48ETeilY0Q0iMwVnccMFrUM1k+tNzmYuIU0Vh710bCUqHX+/+ctQ==} - engines: {node: '>=0.10.0'} - node-releases@2.0.13: resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} @@ -17926,9 +16369,6 @@ packages: npmlog@5.0.1: resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - nth-check@1.0.2: - resolution: {integrity: sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==} - nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} @@ -18040,9 +16480,6 @@ packages: oboe@2.1.5: resolution: {integrity: sha512-zRFWiF+FoicxEs3jNI/WYUrVEgA7DeET/InK0XQuudGHRg8iIob3cNPrJTKaz4004uaA9Pbe+Dwa8iluhjLZWA==} - obuf@1.1.2: - resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==} - octokit@2.1.0: resolution: {integrity: sha512-Pxi6uKTjBRZWgAwsw1NgHdRlL+QASCN35OYS7X79o7PtBME0CLXEroZmPtEwlWZbPTP+iDbEy2wCbSOgm0uGIQ==} engines: {node: '>= 14'} @@ -18213,10 +16650,6 @@ packages: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} engines: {node: '>=10'} - p-retry@4.6.2: - resolution: {integrity: sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==} - engines: {node: '>=8'} - p-try@1.0.0: resolution: {integrity: sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==} engines: {node: '>=4'} @@ -18242,9 +16675,6 @@ packages: pako@1.0.11: resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} - param-case@3.0.4: - resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} - parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -18292,9 +16722,6 @@ packages: parse5-htmlparser2-tree-adapter@7.0.0: resolution: {integrity: sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==} - parse5@6.0.1: - resolution: {integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==} - parse5@7.1.2: resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} @@ -18428,9 +16855,6 @@ packages: resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} engines: {node: '>=4'} - picocolors@0.2.1: - resolution: {integrity: sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==} - picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -18472,10 +16896,6 @@ packages: resolution: {integrity: sha512-dMACeu63HtRLmCG8VKdy4cShCPKaYDR4youZqoSWLxl5Gu99HUw8bw75thbPv9Nip+H+QYX8o3ZJbTdVZZ2TVg==} hasBin: true - pirates@3.0.2: - resolution: {integrity: sha512-c5CgUJq6H2k6MJz72Ak1F5sN9n9wlSlJyEnwvpm9/y3WB4E3pHBDT2c6PEiS1vyJvq2bUxUAIu0EGf8Cx4Ic7Q==} - engines: {node: '>= 4'} - pirates@4.0.6: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} @@ -18495,10 +16915,6 @@ packages: pkg-types@1.0.3: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} - pkg-up@3.1.0: - resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} - engines: {node: '>=8'} - playwright-core@1.41.0: resolution: {integrity: sha512-UGKASUhXmvqm2Lxa1fNr8sFwAtqjpgBRr9jQ7XBI8Rn5uFiEowGUGwrruUQsVPIom4bk7Lt+oLGpXobnXzrBIw==} engines: {node: '>=16'} @@ -18550,177 +16966,18 @@ packages: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} - postcss-attribute-case-insensitive@5.0.2: - resolution: {integrity: sha512-XIidXV8fDr0kKt28vqki84fRK8VW8eTuIa4PChv2MqKuT6C9UjmSKzen6KaWhWEoYvwxFCa7n/tC1SZ3tyq4SQ==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - postcss-browser-comments@4.0.0: - resolution: {integrity: sha512-X9X9/WN3KIvY9+hNERUqX9gncsgBA25XaeR+jshHz2j8+sYyHktHw1JdKuMjeLpGktXidqDhA7b/qm1mrBDmgg==} - engines: {node: '>=8'} - peerDependencies: - browserslist: '>=4' - postcss: '>=8' - - postcss-calc@8.2.4: - resolution: {integrity: sha512-SmWMSJmB8MRnnULldx0lQIyhSNvuDl9HfrZkaqqE/WHAhToYsAvDq+yAsA/kIyINDszOp3Rh0GFoNuH5Ypsm3Q==} - peerDependencies: - postcss: ^8.2.2 - - postcss-clamp@4.1.0: - resolution: {integrity: sha512-ry4b1Llo/9zz+PKC+030KUnPITTJAHeOwjfAyyB60eT0AorGLdzp52s31OsPRHRf8NchkgFoG2y6fCfn1IV1Ow==} - engines: {node: '>=7.6.0'} - peerDependencies: - postcss: ^8.4.6 - - postcss-color-functional-notation@4.2.4: - resolution: {integrity: sha512-2yrTAUZUab9s6CpxkxC4rVgFEVaR6/2Pipvi6qcgvnYiVqZcbDHEoBDhrXzyb7Efh2CCfHQNtcqWcIruDTIUeg==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - postcss-color-hex-alpha@8.0.4: - resolution: {integrity: sha512-nLo2DCRC9eE4w2JmuKgVA3fGL3d01kGq752pVALF68qpGLmx2Qrk91QTKkdUqqp45T1K1XV8IhQpcu1hoAQflQ==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.4 - - postcss-color-rebeccapurple@7.1.1: - resolution: {integrity: sha512-pGxkuVEInwLHgkNxUc4sdg4g3py7zUeCQ9sMfwyHAT+Ezk8a4OaaVZ8lIY5+oNqA/BXXgLyXv0+5wHP68R79hg==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - postcss-colormin@5.3.1: - resolution: {integrity: sha512-UsWQG0AqTFQmpBegeLLc1+c3jIqBNB0zlDGRWR+dQ3pRKJL1oeMzyqmH3o2PIfn9MBdNrVPWhDbT769LxCTLJQ==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-convert-values@5.1.3: - resolution: {integrity: sha512-82pC1xkJZtcJEfiLw6UXnXVXScgtBrjlO5CBmuDQc+dlb88ZYheFsjTn40+zBVi3DkfF7iezO0nJUPLcJK3pvA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-custom-media@8.0.2: - resolution: {integrity: sha512-7yi25vDAoHAkbhAzX9dHx2yc6ntS4jQvejrNcC+csQJAXjj15e7VcWfMgLqBNAbOvqi5uIa9huOVwdHbf+sKqg==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.3 - - postcss-custom-properties@12.1.11: - resolution: {integrity: sha512-0IDJYhgU8xDv1KY6+VgUwuQkVtmYzRwu+dMjnmdMafXYv86SWqfxkc7qdDvWS38vsjaEtv8e0vGOUQrAiMBLpQ==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - postcss-custom-selectors@6.0.3: - resolution: {integrity: sha512-fgVkmyiWDwmD3JbpCmB45SvvlCD6z9CG6Ie6Iere22W5aHea6oWa7EM2bpnv2Fj3I94L3VbtvX9KqwSi5aFzSg==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.3 - - postcss-dir-pseudo-class@6.0.5: - resolution: {integrity: sha512-eqn4m70P031PF7ZQIvSgy9RSJ5uI2171O/OO/zcRNYpJbvaeKFUlar1aJ7rmgiQtbm0FSPsRewjpdS0Oew7MPA==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - postcss-discard-comments@5.1.2: - resolution: {integrity: sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-discard-duplicates@5.1.0: - resolution: {integrity: sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-discard-empty@5.1.1: - resolution: {integrity: sha512-zPz4WljiSuLWsI0ir4Mcnr4qQQ5e1Ukc3i7UfE2XcrwKK2LIPIqE5jxMRxO6GbI3cv//ztXDsXwEWT3BHOGh3A==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-discard-overridden@5.1.0: - resolution: {integrity: sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-double-position-gradients@3.1.2: - resolution: {integrity: sha512-GX+FuE/uBR6eskOK+4vkXgT6pDkexLokPaz/AbJna9s5Kzp/yl488pKPjhy0obB475ovfT1Wv8ho7U/cHNaRgQ==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - postcss-env-function@4.0.6: - resolution: {integrity: sha512-kpA6FsLra+NqcFnL81TnsU+Z7orGtDTxcOhl6pwXeEq1yFPpRMkCDpHhrz8CFQDr/Wfm0jLiNQ1OsGGPjlqPwA==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.4 - - postcss-flexbugs-fixes@5.0.2: - resolution: {integrity: sha512-18f9voByak7bTktR2QgDveglpn9DTbBWPUzSOe9g0N4WR/2eSt6Vrcbf0hmspvMI6YWGywz6B9f7jzpFNJJgnQ==} - peerDependencies: - postcss: ^8.1.4 - - postcss-focus-visible@6.0.4: - resolution: {integrity: sha512-QcKuUU/dgNsstIK6HELFRT5Y3lbrMLEOwG+A4s5cA+fx3A3y/JTq3X9LaOj3OC3ALH0XqyrgQIgey/MIZ8Wczw==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.4 - - postcss-focus-within@5.0.4: - resolution: {integrity: sha512-vvjDN++C0mu8jz4af5d52CB184ogg/sSxAFS+oUJQq2SuCe7T5U2iIsVJtsCp2d6R4j0jr5+q3rPkBVZkXD9fQ==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.4 - - postcss-font-variant@5.0.0: - resolution: {integrity: sha512-1fmkBaCALD72CK2a9i468mA/+tr9/1cBxRRMXOUaZqO43oWPR5imcyPjXwuv7PXbCid4ndlP5zWhidQVVa3hmA==} - peerDependencies: - postcss: ^8.1.0 - - postcss-gap-properties@3.0.5: - resolution: {integrity: sha512-IuE6gKSdoUNcvkGIqdtjtcMtZIFyXZhmFd5RUlg97iVEvp1BZKV5ngsAjCjrVy+14uhGBQl9tzmi1Qwq4kqVOg==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - postcss-image-set-function@4.0.7: - resolution: {integrity: sha512-9T2r9rsvYzm5ndsBE8WgtrMlIT7VbtTfE7b3BQnudUqnBcBo7L758oc+o+pdj/dUV0l5wjwSdjeOH2DZtfv8qw==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - postcss-import@15.1.0: resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} engines: {node: '>=14.0.0'} peerDependencies: postcss: ^8.0.0 - postcss-initial@4.0.1: - resolution: {integrity: sha512-0ueD7rPqX8Pn1xJIjay0AZeIuDoF+V+VvMt/uOnn+4ezUKhZM/NokDeP6DwMNyIoYByuN/94IQnt5FEkaN59xQ==} - peerDependencies: - postcss: ^8.0.0 - postcss-js@4.0.1: resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} engines: {node: ^12 || ^14 || >= 16} peerDependencies: postcss: ^8.4.21 - postcss-lab-function@4.2.1: - resolution: {integrity: sha512-xuXll4isR03CrQsmxyz92LJB2xX9n+pZJ5jE9JgcnmsCammLyKdlzrBin+25dy6wIjfhJpKBAN80gsTlCgRk2w==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - postcss-load-config@4.0.1: resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} engines: {node: '>= 14'} @@ -18733,13 +16990,6 @@ packages: ts-node: optional: true - postcss-loader@6.2.1: - resolution: {integrity: sha512-WbbYpmAaKcux/P66bZ40bpWsBucjx/TTgVVzRZ9yUO8yQfVBlameJ0ZGVaPfH64hNSBh63a+ICP5nqOpBA0w+Q==} - engines: {node: '>= 12.13.0'} - peerDependencies: - postcss: ^7.0.0 || ^8.0.1 - webpack: ^5.0.0 - postcss-loader@7.3.3: resolution: {integrity: sha512-YgO/yhtevGO/vJePCQmTxiaEwER94LABZN0ZMT4A0vsak9TpO+RvKRs7EmJ8peIlB9xfXCsS7M8LjqncsUZ5HA==} engines: {node: '>= 14.15.0'} @@ -18747,54 +16997,6 @@ packages: postcss: ^7.0.0 || ^8.0.1 webpack: ^5.0.0 - postcss-logical@5.0.4: - resolution: {integrity: sha512-RHXxplCeLh9VjinvMrZONq7im4wjWGlRJAqmAVLXyZaXwfDWP73/oq4NdIp+OZwhQUMj0zjqDfM5Fj7qby+B4g==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.4 - - postcss-media-minmax@5.0.0: - resolution: {integrity: sha512-yDUvFf9QdFZTuCUg0g0uNSHVlJ5X1lSzDZjPSFaiCWvjgsvu8vEVxtahPrLMinIDEEGnx6cBe6iqdx5YWz08wQ==} - engines: {node: '>=10.0.0'} - peerDependencies: - postcss: ^8.1.0 - - postcss-merge-longhand@5.1.7: - resolution: {integrity: sha512-YCI9gZB+PLNskrK0BB3/2OzPnGhPkBEwmwhfYk1ilBHYVAZB7/tkTHFBAnCrvBBOmeYyMYw3DMjT55SyxMBzjQ==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-merge-rules@5.1.4: - resolution: {integrity: sha512-0R2IuYpgU93y9lhVbO/OylTtKMVcHb67zjWIfCiKR9rWL3GUk1677LAqD/BcHizukdZEjT8Ru3oHRoAYoJy44g==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-minify-font-values@5.1.0: - resolution: {integrity: sha512-el3mYTgx13ZAPPirSVsHqFzl+BBBDrXvbySvPGFnQcTI4iNslrPaFq4muTkLZmKlGk4gyFAYUBMH30+HurREyA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-minify-gradients@5.1.1: - resolution: {integrity: sha512-VGvXMTpCEo4qHTNSa9A0a3D+dxGFZCYwR6Jokk+/3oB6flu2/PnPXAh2x7x52EkY5xlIHLm+Le8tJxe/7TNhzw==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-minify-params@5.1.4: - resolution: {integrity: sha512-+mePA3MgdmVmv6g+30rn57USjOGSAyuxUmkfiWpzalZ8aiBkdPYjXWtHuwJGm1v5Ojy0Z0LaSYhHaLJQB0P8Jw==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-minify-selectors@5.2.1: - resolution: {integrity: sha512-nPJu7OjZJTsVUmPdm2TcaiohIwxP+v8ha9NehQ2ye9szv4orirRU3SDdtUmKH+10nzn0bAyOXZ0UEr7OpvLehg==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - postcss-modules-extract-imports@3.0.0: resolution: {integrity: sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==} engines: {node: ^10 || ^12 || >= 14} @@ -18825,137 +17027,6 @@ packages: peerDependencies: postcss: ^8.2.14 - postcss-nesting@10.2.0: - resolution: {integrity: sha512-EwMkYchxiDiKUhlJGzWsD9b2zvq/r2SSubcRrgP+jujMXFzqvANLt16lJANC+5uZ6hjI7lpRmI6O8JIl+8l1KA==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - postcss-normalize-charset@5.1.0: - resolution: {integrity: sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-display-values@5.1.0: - resolution: {integrity: sha512-WP4KIM4o2dazQXWmFaqMmcvsKmhdINFblgSeRgn8BJ6vxaMyaJkwAzpPpuvSIoG/rmX3M+IrRZEz2H0glrQNEA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-positions@5.1.1: - resolution: {integrity: sha512-6UpCb0G4eofTCQLFVuI3EVNZzBNPiIKcA1AKVka+31fTVySphr3VUgAIULBhxZkKgwLImhzMR2Bw1ORK+37INg==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-repeat-style@5.1.1: - resolution: {integrity: sha512-mFpLspGWkQtBcWIRFLmewo8aC3ImN2i/J3v8YCFUwDnPu3Xz4rLohDO26lGjwNsQxB3YF0KKRwspGzE2JEuS0g==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-string@5.1.0: - resolution: {integrity: sha512-oYiIJOf4T9T1N4i+abeIc7Vgm/xPCGih4bZz5Nm0/ARVJ7K6xrDlLwvwqOydvyL3RHNf8qZk6vo3aatiw/go3w==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-timing-functions@5.1.0: - resolution: {integrity: sha512-DOEkzJ4SAXv5xkHl0Wa9cZLF3WCBhF3o1SKVxKQAa+0pYKlueTpCgvkFAHfk+Y64ezX9+nITGrDZeVGgITJXjg==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-unicode@5.1.1: - resolution: {integrity: sha512-qnCL5jzkNUmKVhZoENp1mJiGNPcsJCs1aaRmURmeJGES23Z/ajaln+EPTD+rBeNkSryI+2WTdW+lwcVdOikrpA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-url@5.1.0: - resolution: {integrity: sha512-5upGeDO+PVthOxSmds43ZeMeZfKH+/DKgGRD7TElkkyS46JXAUhMzIKiCa7BabPeIy3AQcTkXwVVN7DbqsiCew==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize-whitespace@5.1.1: - resolution: {integrity: sha512-83ZJ4t3NUDETIHTa3uEg6asWjSBYL5EdkVB0sDncx9ERzOKBVJIUeDO9RyA9Zwtig8El1d79HBp0JEi8wvGQnA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-normalize@10.0.1: - resolution: {integrity: sha512-+5w18/rDev5mqERcG3W5GZNMJa1eoYYNGo8gB7tEwaos0ajk3ZXAI4mHGcNT47NE+ZnZD1pEpUOFLvltIwmeJA==} - engines: {node: '>= 12'} - peerDependencies: - browserslist: '>= 4' - postcss: '>= 8' - - postcss-opacity-percentage@1.1.3: - resolution: {integrity: sha512-An6Ba4pHBiDtyVpSLymUUERMo2cU7s+Obz6BTrS+gxkbnSBNKSuD0AVUc+CpBMrpVPKKfoVz0WQCX+Tnst0i4A==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - postcss-ordered-values@5.1.3: - resolution: {integrity: sha512-9UO79VUhPwEkzbb3RNpqqghc6lcYej1aveQteWY+4POIwlqkYE21HKWaLDF6lWNuqCobEAyTovVhtI32Rbv2RQ==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-overflow-shorthand@3.0.4: - resolution: {integrity: sha512-otYl/ylHK8Y9bcBnPLo3foYFLL6a6Ak+3EQBPOTR7luMYCOsiVTUk1iLvNf6tVPNGXcoL9Hoz37kpfriRIFb4A==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - postcss-page-break@3.0.4: - resolution: {integrity: sha512-1JGu8oCjVXLa9q9rFTo4MbeeA5FMe00/9C7lN4va606Rdb+HkxXtXsmEDrIraQ11fGz/WvKWa8gMuCKkrXpTsQ==} - peerDependencies: - postcss: ^8 - - postcss-place@7.0.5: - resolution: {integrity: sha512-wR8igaZROA6Z4pv0d+bvVrvGY4GVHihBCBQieXFY3kuSuMyOmEnnfFzHl/tQuqHZkfkIVBEbDvYcFfHmpSet9g==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - postcss-preset-env@7.8.3: - resolution: {integrity: sha512-T1LgRm5uEVFSEF83vHZJV2z19lHg4yJuZ6gXZZkqVsqv63nlr6zabMH3l4Pc01FQCyfWVrh2GaUeCVy9Po+Aag==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - postcss-pseudo-class-any-link@7.1.6: - resolution: {integrity: sha512-9sCtZkO6f/5ML9WcTLcIyV1yz9D1rf0tWc+ulKcvV30s0iZKS/ONyETvoWsr6vnrmW+X+KmuK3gV/w5EWnT37w==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - - postcss-reduce-initial@5.1.2: - resolution: {integrity: sha512-dE/y2XRaqAi6OvjzD22pjTUQ8eOfc6m/natGHgKFBK9DxFmIm69YmaRVQrGgFlEfc1HePIurY0TmDeROK05rIg==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-reduce-transforms@5.1.0: - resolution: {integrity: sha512-2fbdbmgir5AvpW9RLtdONx1QoYG2/EtqpNQbFASDlixBbAYuTcJ0dECwlqNqH7VbaUnEnh8SrxOe2sRIn24XyQ==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-replace-overflow-wrap@4.0.0: - resolution: {integrity: sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw==} - peerDependencies: - postcss: ^8.0.3 - - postcss-selector-not@6.0.1: - resolution: {integrity: sha512-1i9affjAe9xu/y9uqWH+tD4r6/hDaXJruk8xn2x1vzxC2U3J3LKO3zJW4CyxlNhA56pADJ/djpEwpH1RClI2rQ==} - engines: {node: ^12 || ^14 || >=16} - peerDependencies: - postcss: ^8.2 - postcss-selector-parser@6.0.10: resolution: {integrity: sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==} engines: {node: '>=4'} @@ -18964,18 +17035,6 @@ packages: resolution: {integrity: sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==} engines: {node: '>=4'} - postcss-svgo@5.1.0: - resolution: {integrity: sha512-D75KsH1zm5ZrHyxPakAxJWtkyXew5qwS70v56exwvw542d9CRtTo78K0WeFxZB4G7JXKKMbEZtZayTGdIky/eA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - postcss-unique-selectors@5.1.1: - resolution: {integrity: sha512-5JiODlELrz8L2HwxfPnhOWZYWDxVHWL83ufOv84NrcgipI7TaeRsatAhK4Tr2/ZiYldpK/wBvw5BD3qfaK96GA==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} @@ -18985,10 +17044,6 @@ packages: peerDependencies: postcss: ^8.2.9 - postcss@7.0.39: - resolution: {integrity: sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==} - engines: {node: '>=6.0.0'} - postcss@8.4.23: resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==} engines: {node: ^10 || ^12 || >=14} @@ -19034,11 +17089,6 @@ packages: preact@10.17.0: resolution: {integrity: sha512-SNsI8cbaCcUS5tbv9nlXuCfIXnJ9ysBMWk0WnB6UWwcVA3qZ2O6FxqDFECMAMttvLQcW/HaNZUe2BLidyvrVYw==} - prebuild-install@7.1.1: - resolution: {integrity: sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==} - engines: {node: '>=10'} - hasBin: true - precinct@11.0.5: resolution: {integrity: sha512-oHSWLC8cL/0znFhvln26D14KfCQFFn4KOLSw6hmLhd+LQ2SKt9Ljm89but76Pc7flM9Ty1TnXyrA2u16MfRV3w==} engines: {node: ^14.14.0 || >=16.0.0} @@ -19095,21 +17145,10 @@ packages: resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==} engines: {node: '>=6'} - pretty-error@4.0.0: - resolution: {integrity: sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw==} - pretty-format@26.6.2: resolution: {integrity: sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==} engines: {node: '>= 10'} - pretty-format@27.5.1: - resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - - pretty-format@28.1.3: - resolution: {integrity: sha512-8gFb/To0OmxHR9+ZTb14Df2vNxdGCX8g1xWGUTqUw5TiZvcQf5sHKObd5UcPyLLyowNwDAMTF3XWOG1B6mxl1Q==} - engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} - pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -19339,9 +17378,6 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - queue-tick@1.0.1: - resolution: {integrity: sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==} - queue@6.0.2: resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} @@ -19362,9 +17398,6 @@ packages: radix3@1.1.0: resolution: {integrity: sha512-pNsHDxbGORSvuSScqNJ+3Km6QAVqk8CfsCBIEoDgpqLrkD2f3QM4I7d1ozJJ172OmIcoUcerZaNWqtLkRXTV3A==} - raf@3.4.1: - resolution: {integrity: sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==} - ramda@0.29.0: resolution: {integrity: sha512-BBea6L67bYLtdbOqfp8f58fPMqEwx0doL+pAi8TZyp2YWz8R9G8z9x75CZI8W+ftqhFHCpEX2cRnUUXK130iKA==} @@ -19394,242 +17427,10 @@ packages: resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} engines: {node: '>= 0.8'} - rc-cascader@3.25.0: - resolution: {integrity: sha512-mBY6/CykOvzAYnIye0rpt5JkMAXJaX8zZawOwSndbKuFakYE+leqBQWIZoN9HIgAptPpTi2Aty3RvbaBmk8SKQ==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-checkbox@3.2.0: - resolution: {integrity: sha512-8inzw4y9dAhZmv/Ydl59Qdy5tdp9CKg4oPVcRigi+ga/yKPZS5m5SyyQPtYSgbcqHRYOdUhiPSeKfktc76du1A==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-collapse@3.7.3: - resolution: {integrity: sha512-60FJcdTRn0X5sELF18TANwtVi7FtModq649H11mYF1jh83DniMoM4MqY627sEKRCTm4+WXfGDcB7hY5oW6xhyw==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-dialog@9.4.0: - resolution: {integrity: sha512-AScCexaLACvf8KZRqCPz12BJ8olszXOS4lKlkMyzDQHS1m0zj1KZMYgmMCh39ee0Dcv8kyrj8mTqxuLyhH+QuQ==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-drawer@7.1.0: - resolution: {integrity: sha512-nBE1rF5iZvpavoyqhSSz2mk/yANltA7g3aF0U45xkx381n3we/RKs9cJfNKp9mSWCedOKWt9FLEwZDaAaOGn2w==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-dropdown@4.2.0: - resolution: {integrity: sha512-odM8Ove+gSh0zU27DUj5cG1gNKg7mLWBYzB5E4nNLrLwBmYEgYP43vHKDGOVZcJSVElQBI0+jTQgjnq0NfLjng==} - peerDependencies: - react: '>=16.11.0' - react-dom: '>=16.11.0' - - rc-field-form@2.0.1: - resolution: {integrity: sha512-3WK/POHBcfMFKrzScrkmgMIXqoVQ0KgVwcVnej/ukwuQG4ZHCJaTi2KhM+tWTK4WODBXbmjKg5pKHj2IVmSg4A==} - engines: {node: '>=8.x'} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-image@7.6.0: - resolution: {integrity: sha512-tL3Rvd1sS+frZQ01i+tkeUPaOeFz2iG9/scAt/Cfs0hyCRVA/w0Pu1J/JxIX8blalvmHE0bZQRYdOmRAzWu4Hg==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-input-number@9.0.0: - resolution: {integrity: sha512-RfcDBDdWFFetouWFXBA+WPEC8LzBXyngr9b+yTLVIygfFu7HiLRGn/s/v9wwno94X7KFvnb28FNynMGj9XJlDQ==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-input@1.4.5: - resolution: {integrity: sha512-AjzykhwnwYTRSwwgCu70CGKBIAv6bP2nqnFptnNTprph/TF1BAs0Qxl91mie/BR6n827WIJB6ZjaRf9iiMwAfw==} - peerDependencies: - react: '>=16.0.0' - react-dom: '>=16.0.0' - - rc-mentions@2.11.1: - resolution: {integrity: sha512-upb4AK1SRFql7qGnbLEvJqLMugVVIyjmwBJW9L0eLoN9po4JmJZaBzmKA4089fNtsU8k6l/tdZiVafyooeKnLw==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-menu@9.13.0: - resolution: {integrity: sha512-1l8ooCB3HcYJKCltC/s7OxRKRjgymdl9htrCeGZcXNaMct0RxZRK6OPV3lPhVksIvAGMgzPd54ClpZ5J4b8cZA==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-motion@2.9.0: - resolution: {integrity: sha512-XIU2+xLkdIr1/h6ohPZXyPBMvOmuyFZQ/T0xnawz+Rh+gh4FINcnZmMT5UTIj6hgI0VLDjTaPeRd+smJeSPqiQ==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-notification@5.4.0: - resolution: {integrity: sha512-li19y9RoYJciF3WRFvD+DvWS70jdL8Fr+Gfb/OshK+iY6iTkwzoigmSIp76/kWh5tF5i/i9im12X3nsF85GYdA==} - engines: {node: '>=8.x'} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-overflow@1.3.2: - resolution: {integrity: sha512-nsUm78jkYAoPygDAcGZeC2VwIg/IBGSodtOY3pMof4W3M9qRJgqaDYm03ZayHlde3I6ipliAxbN0RUcGf5KOzw==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-pagination@4.0.4: - resolution: {integrity: sha512-GGrLT4NgG6wgJpT/hHIpL9nELv27A1XbSZzECIuQBQTVSf4xGKxWr6I/jhpRPauYEWEbWVw22ObG6tJQqwJqWQ==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-picker@4.5.0: - resolution: {integrity: sha512-suqz9bzuhBQlf7u+bZd1bJLPzhXpk12w6AjQ9BTPTiFwexVZgUKViG1KNLyfFvW6tCUZZK0HmCCX7JAyM+JnCg==} - engines: {node: '>=8.x'} - peerDependencies: - date-fns: '>= 2.x' - dayjs: '>= 1.x' - luxon: '>= 3.x' - moment: '>= 2.x' - react: '>=16.9.0' - react-dom: '>=16.9.0' - peerDependenciesMeta: - date-fns: - optional: true - dayjs: - optional: true - luxon: - optional: true - moment: - optional: true - - rc-progress@4.0.0: - resolution: {integrity: sha512-oofVMMafOCokIUIBnZLNcOZFsABaUw8PPrf1/y0ZBvKZNpOiu5h4AO9vv11Sw0p4Hb3D0yGWuEattcQGtNJ/aw==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-rate@2.12.0: - resolution: {integrity: sha512-g092v5iZCdVzbjdn28FzvWebK2IutoVoiTeqoLTj9WM7SjA/gOJIw5/JFZMRyJYYVe1jLAU2UhAfstIpCNRozg==} - engines: {node: '>=8.x'} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-resize-observer@1.4.0: - resolution: {integrity: sha512-PnMVyRid9JLxFavTjeDXEXo65HCRqbmLBw9xX9gfC4BZiSzbLXKzW3jPz+J0P71pLbD5tBMTT+mkstV5gD0c9Q==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-segmented@2.3.0: - resolution: {integrity: sha512-I3FtM5Smua/ESXutFfb8gJ8ZPcvFR+qUgeeGFQHBOvRiRKyAk4aBE5nfqrxXx+h8/vn60DQjOt6i4RNtrbOobg==} - peerDependencies: - react: '>=16.0.0' - react-dom: '>=16.0.0' - - rc-select@14.13.3: - resolution: {integrity: sha512-AMEfdE40RhlqahMGN3Q7OKVd1txNph0zIn2Xpvn0ZJiUYafCsqoGv+Rj6v1umgm8ZOEAJ3LefnkznAYNMMzACg==} - engines: {node: '>=8.x'} - peerDependencies: - react: '*' - react-dom: '*' - - rc-slider@10.6.2: - resolution: {integrity: sha512-FjkoFjyvUQWcBo1F3RgSglky3ar0+qHLM41PlFVYB4Bj3RD8E/Mv7kqMouLFBU+3aFglMzzctAIWRwajEuueSw==} - engines: {node: '>=8.x'} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-steps@6.0.1: - resolution: {integrity: sha512-lKHL+Sny0SeHkQKKDJlAjV5oZ8DwCdS2hFhAkIjuQt1/pB81M0cA0ErVFdHq9+jmPmFw1vJB2F5NBzFXLJxV+g==} - engines: {node: '>=8.x'} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-switch@4.1.0: - resolution: {integrity: sha512-TI8ufP2Az9oEbvyCeVE4+90PDSljGyuwix3fV58p7HV2o4wBnVToEyomJRVyTaZeqNPAp+vqeo4Wnj5u0ZZQBg==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-table@7.45.5: - resolution: {integrity: sha512-R5sOfToOk7CalSkebZpqM8lkKWOJR7uXPGEhjjTSoj5egyHBwMxaACoPj2oI+6qLSll9yZrG5K+8HTN57b2Ahg==} - engines: {node: '>=8.x'} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-tabs@15.0.0: - resolution: {integrity: sha512-7m541VcEiJSpHZmosMZNMIhemxtIN+f0WDhZNyXQ1/cZ40aaWsknlbj0FH6HryLoKEQvBnCI89hgQuT7MBSOBA==} - engines: {node: '>=8.x'} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-textarea@1.6.3: - resolution: {integrity: sha512-8k7+8Y2GJ/cQLiClFMg8kUXOOdvcFQrnGeSchOvI2ZMIVvX5a3zQpLxoODL0HTrvU63fPkRmMuqaEcOF9dQemA==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-tooltip@6.2.0: - resolution: {integrity: sha512-iS/3iOAvtDh9GIx1ulY7EFUXUtktFccNLsARo3NPgLf0QW9oT0w3dA9cYWlhqAKmD+uriEwdWz1kH0Qs4zk2Aw==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-tree-select@5.20.0: - resolution: {integrity: sha512-zFtkHx5/6PnXSi3oSbBSFbIPiJJQdpSU3qz/joLe75URgvxmTHi989O8MtMgpwyZwrCMOJpGi6L1uy+13uzZPw==} - peerDependencies: - react: '*' - react-dom: '*' - - rc-tree@5.8.7: - resolution: {integrity: sha512-cpsIQZ4nNYwpj6cqPRt52e/69URuNdgQF9wZ10InmEf8W3+i0A41OVmZWwHuX9gegQSqj+DPmaDkZFKQZ+ZV1w==} - engines: {node: '>=10.x'} - peerDependencies: - react: '*' - react-dom: '*' - - rc-upload@4.5.2: - resolution: {integrity: sha512-QO3ne77DwnAPKFn0bA5qJM81QBjQi0e0NHdkvpFyY73Bea2NfITiotqJqVjHgeYPOJu5lLVR32TNGP084aSoXA==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-util@5.39.3: - resolution: {integrity: sha512-j9wOELkLQ8gC/NkUg3qg9mHZcJf+5mYYv40JrDHqnaf8VSycji4pCf7kJ5fdTXQPDIF0vr5zpb/T2HdrMs9rWA==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - - rc-virtual-list@3.12.0: - resolution: {integrity: sha512-43+/lr7bImpvEwTFw1FTYwSg42VHzRgO5PiCEEUROj8D2+M2SCvANqGIa9QyhoFLVQtc+2QXvgTB7VPGG7oOoQ==} - engines: {node: '>=8.x'} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - rc@1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true - react-app-polyfill@3.0.0: - resolution: {integrity: sha512-sZ41cxiU5llIB003yxxQBYrARBqe0repqPTTYBTmMqTz9szeBbE37BehCE891NZsmdZqqP+xWKdT3eo3vOzN8w==} - engines: {node: '>=14'} - react-colorful@5.6.1: resolution: {integrity: sha512-1exovf0uGTGyq5mXQT0zgQ80uvj2PCwvF8zY1RN9/vbJVSjSo3fsB/4L3ObbF7u70NduSiK4xu4Y6q1MHoUGEw==} peerDependencies: @@ -19648,16 +17449,6 @@ packages: date-fns: ^2.28.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dev-utils@12.0.1: - resolution: {integrity: sha512-84Ivxmr17KjUupyqzFode6xKhjwuEJDROWKJy/BthkL7Wn6NJ8h4WE6k/exAv6ImS+0oZLRRW5j/aINMHyeGeQ==} - engines: {node: '>=14'} - peerDependencies: - typescript: 5.5.4 - webpack: '>=4' - peerDependenciesMeta: - typescript: - optional: true - react-devtools-core@4.28.5: resolution: {integrity: sha512-cq/o30z9W2Wb4rzBefjv5fBalHU0rJGZCHAkf/RHSBWSSYwh8PlQTqqOJmgIIbBtpj27T6FIPXeomIjZtCNVqA==} @@ -19693,9 +17484,6 @@ packages: peerDependencies: react: '>=16.13.1' - react-error-overlay@6.0.11: - resolution: {integrity: sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg==} - react-fast-compare@3.2.2: resolution: {integrity: sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==} @@ -19784,10 +17572,6 @@ packages: peerDependencies: react: ^18.0.0 - react-refresh@0.11.0: - resolution: {integrity: sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A==} - engines: {node: '>=0.10.0'} - react-refresh@0.14.0: resolution: {integrity: sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==} engines: {node: '>=0.10.0'} @@ -19844,28 +17628,11 @@ packages: peerDependencies: react: '>=16.8.0' - react-scripts@5.0.1: - resolution: {integrity: sha512-8VAmEm/ZAwQzJ+GOMLbBsTdDKOpuZh7RPs0UymvBR2vRk4iZWCskjbFnxqjrzoIvlNNRZ3QJFx6/qDSi6zSnaQ==} - engines: {node: '>=14.0.0'} - hasBin: true - peerDependencies: - eslint: '*' - react: '>= 16' - typescript: 5.5.4 - peerDependenciesMeta: - typescript: - optional: true - react-shallow-renderer@16.15.0: resolution: {integrity: sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==} peerDependencies: react: ^16.0.0 || ^17.0.0 || ^18.0.0 - react-slider@2.0.4: - resolution: {integrity: sha512-sWwQD01n6v+MbeLCYthJGZPc0kzOyhQHyd0bSo0edg+IAxTVQmj3Oy4SBK65eX6gNwS9meUn6Z5sIBUVmwAd9g==} - peerDependencies: - react: ^16 || ^17 || ^18 - react-spring@9.6.1: resolution: {integrity: sha512-BeP80R4SLb1bZHW/Q62nECoScHw/fH+jzGkD7dc892HNGa+lbGIJXURc6U7N8JfZ8peEO46nPxR57aUMuYzquQ==} peerDependencies: @@ -20113,10 +17880,6 @@ packages: reinterval@1.1.0: resolution: {integrity: sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ==} - relateurl@0.2.7: - resolution: {integrity: sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==} - engines: {node: '>= 0.10'} - remark-external-links@8.0.0: resolution: {integrity: sha512-5vPSX0kHoSsqtdftSHhIYofVINC8qmp0nctkeU9YoJwV3YfiBRiI6cbFRJ0oI/1F9xS+bopXG0m2KS8VFscuKA==} @@ -20141,9 +17904,6 @@ packages: remove-accents@0.4.2: resolution: {integrity: sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA==} - renderkid@3.0.0: - resolution: {integrity: sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg==} - repeat-element@1.1.4: resolution: {integrity: sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==} engines: {node: '>=0.10.0'} @@ -20249,18 +18009,6 @@ packages: resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - resolve-url-loader@4.0.0: - resolution: {integrity: sha512-05VEMczVREcbtT7Bz+C+96eUO5HDNvdthIiMB34t7FcF8ehcu4wC0sSgPUubs3XW2Q3CNLJk/BJrCU9wVRymiA==} - engines: {node: '>=8.9'} - peerDependencies: - rework: 1.0.1 - rework-visit: 1.0.0 - peerDependenciesMeta: - rework: - optional: true - rework-visit: - optional: true - resolve-url-loader@5.0.0: resolution: {integrity: sha512-uZtduh8/8srhBoMx//5bwqjQ+rfYOUq8zC9NrMUGtjBiGTtFJM42s58/36+hTqeqINcnYe08Nj3LkK9lW4N8Xg==} engines: {node: '>=12'} @@ -20269,10 +18017,6 @@ packages: resolution: {integrity: sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==} deprecated: https://github.com/lydell/resolve-url#deprecated - resolve.exports@1.1.1: - resolution: {integrity: sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ==} - engines: {node: '>=10'} - resolve.exports@2.0.2: resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} engines: {node: '>=10'} @@ -20319,10 +18063,6 @@ packages: retimer@3.0.0: resolution: {integrity: sha512-WKE0j11Pa0ZJI5YIk0nflGI7SQsfl2ljihVy7ogh7DeQSeYAUi0ubZ/yEueGtDfUPk6GH5LRw1hBdLq4IwUBWA==} - retry@0.13.1: - resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} - engines: {node: '>= 4'} - reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -20351,12 +18091,6 @@ packages: robust-predicates@3.0.2: resolution: {integrity: sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==} - rollup-plugin-terser@7.0.2: - resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} - deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser - peerDependencies: - rollup: ^2.0.0 - rollup-plugin-visualizer@5.12.0: resolution: {integrity: sha512-8/NU9jXcHRs7Nnj07PF2o4gjxmm9lXIrZ8r175bT9dK8qoLlvKTwRMArRCMgpMGlq8CTLugRvEmyMeMXIU2pNQ==} engines: {node: '>=14'} @@ -20460,28 +18194,6 @@ packages: safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - sanitize.css@13.0.0: - resolution: {integrity: sha512-ZRwKbh/eQ6w9vmTjkuG0Ioi3HBwPFce0O+v//ve+aOq1oeCy7jMV2qzzAlpsNuqpqCBjjriM1lbtZbF/Q8jVyA==} - - sass-loader@12.6.0: - resolution: {integrity: sha512-oLTaH0YCtX4cfnJZxKSLAyglED0naiYfNG1iXfU5w1LNZ+ukoA5DtyDIN5zmKVZwYNJP4KRc5Y3hkWga+7tYfA==} - engines: {node: '>= 12.13.0'} - peerDependencies: - fibers: '>= 3.1.0' - node-sass: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 - sass: ^1.3.0 - sass-embedded: '*' - webpack: ^5.0.0 - peerDependenciesMeta: - fibers: - optional: true - node-sass: - optional: true - sass: - optional: true - sass-embedded: - optional: true - sass-loader@13.3.2: resolution: {integrity: sha512-CQbKl57kdEv+KDLquhC+gE3pXt74LEAzm+tzywcA0/aHZuub8wTErbjAoNI57rPUWRYRNC5WUnNl8eGJNbDdwg==} engines: {node: '>= 14.15.0'} @@ -20509,16 +18221,9 @@ packages: sax@1.2.1: resolution: {integrity: sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==} - sax@1.2.4: - resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==} - sax@1.3.0: resolution: {integrity: sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==} - saxes@5.0.1: - resolution: {integrity: sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==} - engines: {node: '>=10'} - saxes@6.0.0: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} @@ -20544,25 +18249,10 @@ packages: peerDependencies: typescript: 5.5.4 - schema-utils@2.7.0: - resolution: {integrity: sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==} - engines: {node: '>= 8.9.0'} - - schema-utils@2.7.1: - resolution: {integrity: sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==} - engines: {node: '>= 8.9.0'} - schema-utils@3.3.0: resolution: {integrity: sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==} engines: {node: '>= 10.13.0'} - schema-utils@4.2.0: - resolution: {integrity: sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==} - engines: {node: '>= 12.13.0'} - - scroll-into-view-if-needed@3.1.0: - resolution: {integrity: sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==} - scrypt-js@2.0.4: resolution: {integrity: sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==} @@ -20586,13 +18276,6 @@ packages: seedrandom@3.0.5: resolution: {integrity: sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==} - select-hose@2.0.0: - resolution: {integrity: sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==} - - selfsigned@2.4.1: - resolution: {integrity: sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==} - engines: {node: '>=10'} - semaphore@1.1.0: resolution: {integrity: sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==} engines: {node: '>=0.8.0'} @@ -20636,9 +18319,6 @@ packages: resolution: {integrity: sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==} engines: {node: '>=0.10.0'} - serialize-javascript@4.0.0: - resolution: {integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==} - serialize-javascript@6.0.0: resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} @@ -20648,10 +18328,6 @@ packages: serve-handler@6.1.5: resolution: {integrity: sha512-ijPFle6Hwe8zfmBxJdE+5fta53fdIY0lHISJvuikXB3VYFafRjMRpOffSPvCYsbKyBA7pvy9oYr/BT1O3EArlg==} - serve-index@1.9.1: - resolution: {integrity: sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==} - engines: {node: '>= 0.8.0'} - serve-static@1.15.0: resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} engines: {node: '>= 0.8.0'} @@ -20693,9 +18369,6 @@ packages: setimmediate@1.0.5: resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} - setprototypeof@1.1.0: - resolution: {integrity: sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==} - setprototypeof@1.1.1: resolution: {integrity: sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==} @@ -20719,10 +18392,6 @@ packages: shallowequal@1.1.0: resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - sharp@0.32.6: - resolution: {integrity: sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==} - engines: {node: '>=14.15.0'} - shebang-command@1.2.0: resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} engines: {node: '>=0.10.0'} @@ -20777,15 +18446,6 @@ packages: simple-get@2.8.2: resolution: {integrity: sha512-Ijd/rV5o+mSBBs4F/x9oDPtTx9Zb6X9brmnXvMW4J7IR15ngi9q5xxqWBKU744jTZiaXtxaPL7uHG6vtN8kUkw==} - simple-get@4.0.1: - resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} - - simple-git@3.19.1: - resolution: {integrity: sha512-Ck+rcjVaE1HotraRAS8u/+xgTvToTuoMkT9/l9lvuP5jftwnYUp6DwuJzsKErHgfyRk8IB8pqGHWEbM3tLgV1w==} - - simple-swizzle@0.2.2: - resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} - simple-update-notifier@2.0.0: resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==} engines: {node: '>=10'} @@ -20856,9 +18516,6 @@ packages: socketio-wildcard@2.0.0: resolution: {integrity: sha512-Bf3ioZq15Z2yhFLDasRvbYitg82rwm+5AuER5kQvEQHhNFf4R4K5o/h57nEpN7A59T9FyRtTj34HZfMWAruw/A==} - sockjs@0.3.24: - resolution: {integrity: sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==} - socks-proxy-agent@8.0.2: resolution: {integrity: sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==} engines: {node: '>= 14'} @@ -20904,9 +18561,6 @@ packages: resolution: {integrity: sha512-XSQ+lY9bAYA8ZsoChcEoPlgcSMaheziEp1beox1JVxy1SV4F2jSq9+h2rJ+3mC/Dhu9Ius1DLnInD5AWcsDXZw==} hasBin: true - source-list-map@2.0.1: - resolution: {integrity: sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==} - source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} @@ -20915,12 +18569,6 @@ packages: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} - source-map-loader@3.0.2: - resolution: {integrity: sha512-BokxPoLjyl3iOrgkWaakaxqnelAJSS+0V+De0kKIq6lyWrXuiPgYTGp6z3iHmqljKAaLXwZa+ctD8GccRJeVvg==} - engines: {node: '>= 12.13.0'} - peerDependencies: - webpack: ^5.0.0 - source-map-resolve@0.5.3: resolution: {integrity: sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==} deprecated: See https://github.com/lydell/source-map-resolve#deprecated @@ -20968,10 +18616,6 @@ packages: resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} engines: {node: '>= 8'} - sourcemap-codec@1.4.8: - resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} - deprecated: Please use @jridgewell/sourcemap-codec instead - space-separated-tokens@1.1.5: resolution: {integrity: sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==} @@ -20990,13 +18634,6 @@ packages: spdx-license-ids@3.0.13: resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} - spdy-transport@3.0.0: - resolution: {integrity: sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==} - - spdy@4.0.2: - resolution: {integrity: sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==} - engines: {node: '>=6.0.0'} - split-ca@1.0.1: resolution: {integrity: sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ==} @@ -21033,10 +18670,6 @@ packages: engines: {node: '>=0.10.0'} hasBin: true - stable@0.1.8: - resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} - deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility' - stack-utils@2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} engines: {node: '>=10'} @@ -21063,9 +18696,6 @@ packages: stat-mode@0.3.0: resolution: {integrity: sha512-QjMLR0A3WwFY2aZdV0okfFEJB5TRjkggXZjxP3A1RsWsNHNu3YPv8btmtc6iCFZ0Rul3FE93OYogvhOUClU+ng==} - static-eval@2.0.2: - resolution: {integrity: sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==} - static-extend@0.1.2: resolution: {integrity: sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==} engines: {node: '>=0.10.0'} @@ -21120,9 +18750,6 @@ packages: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} - streamx@2.15.1: - resolution: {integrity: sha512-fQMzy2O/Q47rgwErk/eGeLu/roaFWV0jVsogDmrszM9uIw8L5OA+t+V93MgYlufNptfjmYR1tOMWhei/Eh7TQA==} - strict-uri-encode@1.1.0: resolution: {integrity: sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==} engines: {node: '>=0.10.0'} @@ -21131,9 +18758,6 @@ packages: resolution: {integrity: sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==} engines: {node: '>=4'} - string-convert@0.2.1: - resolution: {integrity: sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A==} - string-format@2.0.0: resolution: {integrity: sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==} @@ -21141,17 +18765,10 @@ packages: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} engines: {node: '>=10'} - string-length@5.0.1: - resolution: {integrity: sha512-9Ep08KAMUn0OadnVaBuRdE2l615CQ508kr0XMadjClfYpdCyvrbFp6Taebo8yyxokQ4viUd/xPPUA4FGgUa0ow==} - engines: {node: '>=12.20'} - string-length@6.0.0: resolution: {integrity: sha512-1U361pxZHEQ+FeSjzqRpV+cu2vTzYeWeafXFLykiFlv4Vc0n3njgU8HrMbyik5uwm77naWMuVG8fhEF+Ovb1Kg==} engines: {node: '>=16'} - string-natural-compare@3.0.1: - resolution: {integrity: sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==} - string-similarity-js@2.1.4: resolution: {integrity: sha512-uApODZNjCHGYROzDSAdCmAHf60L/pMDHnP/yk6TAbvGg7JSPZlSto/ceCI7hZEqzc53/juU2aOJFkM2yUVTMTA==} @@ -21247,10 +18864,6 @@ packages: resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} engines: {node: '>=8'} - strip-comments@2.0.1: - resolution: {integrity: sha512-ZprKx+bBLXv067WTCALv8SSz5l2+XhpYCsVtSqlMnkAXMWDq+/ekVbl1ghqP9rUHTzv6sm/DwCOiYutU/yp1fw==} - engines: {node: '>=10'} - strip-final-newline@2.0.0: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} @@ -21307,15 +18920,6 @@ packages: babel-plugin-macros: optional: true - stylehacks@5.1.1: - resolution: {integrity: sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw==} - engines: {node: ^10 || ^12 || >=14.0} - peerDependencies: - postcss: ^8.2.15 - - stylis@4.2.0: - resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==} - stylis@4.3.2: resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} @@ -21402,20 +19006,6 @@ packages: resolution: {integrity: sha512-N7m1YnoXtRf5wya5Gyx3TWuTddI4nAyayyIWFojiWV5IayDYNV5i2mRp/7qNGol4DtxEYxljmrbgp1HM6hUbmQ==} engines: {node: '>=16'} - svg-parser@2.0.4: - resolution: {integrity: sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==} - - svgo@1.3.2: - resolution: {integrity: sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==} - engines: {node: '>=4.0.0'} - deprecated: This SVGO version is no longer supported. Upgrade to v2.x.x. - hasBin: true - - svgo@2.8.0: - resolution: {integrity: sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==} - engines: {node: '>=10.13.0'} - hasBin: true - swarm-js@0.1.42: resolution: {integrity: sha512-BV7c/dVlA3R6ya1lMlSSNPLYrntt0LUq4YMgy3iwpCIc6rZnS5W2wUoctarZ5pXlpKtxDDf9hNziEkcfrxdhqQ==} @@ -21470,10 +19060,6 @@ packages: engines: {node: '>=14.0.0'} hasBin: true - tapable@1.1.3: - resolution: {integrity: sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==} - engines: {node: '>=6'} - tapable@2.2.1: resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} engines: {node: '>=6'} @@ -21491,9 +19077,6 @@ packages: tar-fs@2.1.1: resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==} - tar-fs@3.0.4: - resolution: {integrity: sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==} - tar-stream@1.6.2: resolution: {integrity: sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==} engines: {node: '>= 0.8.0'} @@ -21502,9 +19085,6 @@ packages: resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} engines: {node: '>=6'} - tar-stream@3.1.6: - resolution: {integrity: sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==} - tar@4.4.18: resolution: {integrity: sha512-ZuOtqqmkV9RE1+4odd+MhBpibmCxNP6PJhH/h2OqNuotTX7/XHPZQJv2pKvWMplFH9SIZZhitehh6vBH6LO8Pg==} engines: {node: '>=4.5'} @@ -21535,10 +19115,6 @@ packages: resolution: {integrity: sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==} engines: {node: '>=6.0.0'} - tempy@0.6.0: - resolution: {integrity: sha512-G13vtMYPT/J8A4X2SjdtBTphZlrp1gKv6hZiOjw14RCWg6GbHuQBGtjlx75xLbYV/wEc0D7G5K4rxKP/cXk8Bw==} - engines: {node: '>=10'} - tempy@1.0.1: resolution: {integrity: sha512-biM9brNqxSc04Ee71hzFbryD11nX7VPhQQY32AdDmjFvodsRFz/3ufeoTZ6uYkRFfGo188tENcASNs3vTdsM0w==} engines: {node: '>=10'} @@ -21558,10 +19134,6 @@ packages: resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} engines: {node: '>=8'} - terminal-link@2.1.1: - resolution: {integrity: sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==} - engines: {node: '>=8'} - terser-webpack-plugin@5.3.10: resolution: {integrity: sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==} engines: {node: '>= 10.13.0'} @@ -21625,26 +19197,16 @@ packages: throat@5.0.0: resolution: {integrity: sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==} - throat@6.0.2: - resolution: {integrity: sha512-WKexMoJj3vEuK0yFEapj8y64V0A6xcuPuK9Gt1d0R+dzCSJc0lHqQytAbSB4cDAK0dWh4T0E2ETkoLE2WZ41OQ==} - throttle-debounce@2.3.0: resolution: {integrity: sha512-H7oLPV0P7+jgvrk+6mwwwBDmxTaxnu9HMXmloNLXwnNO0ZxZ31Orah2n8lU1eMPvsaowP2CX+USCgyovXfdOFQ==} engines: {node: '>=8'} - throttle-debounce@5.0.0: - resolution: {integrity: sha512-2iQTSgkkc1Zyk0MeVrt/3BvuOXYPl/R8Z0U2xxo9rjwNciaHDG3R+Lm6dh4EeUci49DanvBnuqI6jshoQQRGEg==} - engines: {node: '>=12.22'} - through2@2.0.5: resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} - thunky@1.1.0: - resolution: {integrity: sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==} - time-span@4.0.0: resolution: {integrity: sha512-MyqZCTGLDZ77u4k+jqg4UlrzPTPZ49NDlaekU6uuFaJLzPIN1woaRXCbGeqOfxwc3Y37ZROGAJ614Rdv7Olt+g==} engines: {node: '>=10'} @@ -21762,10 +19324,6 @@ packages: tr46@1.0.1: resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} - tr46@2.1.0: - resolution: {integrity: sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==} - engines: {node: '>=8'} - tr46@3.0.0: resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==} engines: {node: '>=12'} @@ -21791,9 +19349,6 @@ packages: try-require@1.2.1: resolution: {integrity: sha512-aMzrGUIA/R2LwUgvsOusx+GTy8ERyNjpBzbWgS1Qx4oTFlXCMxY3PyyXbPE1pvrvK/CXpO+BBREEqrTkNroC+A==} - tryer@1.0.1: - resolution: {integrity: sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==} - ts-api-utils@1.0.3: resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} engines: {node: '>=16.13.0'} @@ -22162,9 +19717,6 @@ packages: uncrypto@0.1.3: resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} - underscore@1.12.1: - resolution: {integrity: sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==} - underscore@1.9.1: resolution: {integrity: sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==} @@ -22214,11 +19766,6 @@ packages: unified@10.1.2: resolution: {integrity: sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==} - unimported@1.30.0: - resolution: {integrity: sha512-4/NKy/a8kEFu6tDbY/CTiaqtIBR1LeI5RWDzfLlKX2ipMfNMbTyEVjxiGCWq8EByI8rvH+Y2+IEaPU8n7U141g==} - engines: {node: '>=14.0.0'} - hasBin: true - union-value@1.0.1: resolution: {integrity: sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==} engines: {node: '>=0.10.0'} @@ -22296,9 +19843,6 @@ packages: unplugin@1.5.0: resolution: {integrity: sha512-9ZdRwbh/4gcm1JTOkp9lAkIDrtOyOxgHmY7cjuwI8L/2RTikMcVG25GsZwNAgRuap3iDw2jeq7eoqtAsz5rW3A==} - unquote@1.1.1: - resolution: {integrity: sha512-vRCqFv6UhXpWxZPyGDh/F3ZpNv8/qo7w6iufLpQg9aKnQ71qM4B5KiI7Mia9COcjEhrO9LueHpMYjYzsWH3OIg==} - unset-value@1.0.0: resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==} engines: {node: '>=0.10.0'} @@ -22352,10 +19896,6 @@ packages: resolution: {integrity: sha512-4luGP9LMYszMRZwsvyUd9MrxgEGZdZuZgpVQHEEX0lCYFESasVRvZd0EYpCkOIbJKHMuv0LskpXc/8Un+MJzEQ==} hasBin: true - upath@1.2.0: - resolution: {integrity: sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==} - engines: {node: '>=4'} - update-browserslist-db@1.0.11: resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true @@ -22458,18 +19998,12 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - util.promisify@1.0.1: - resolution: {integrity: sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==} - util.promisify@1.1.2: resolution: {integrity: sha512-PBdZ03m1kBnQ5cjjO0ZvJMJS+QsbyIcFwi4hY4U76OQsCO9JrOYjbCFgIF76ccFg9xnJo7ZHPkqyj1GqmdS7MA==} util@0.12.5: resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} - utila@0.4.0: - resolution: {integrity: sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA==} - utils-merge@1.0.1: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} @@ -22515,10 +20049,6 @@ packages: v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - v8-to-istanbul@8.1.1: - resolution: {integrity: sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w==} - engines: {node: '>=10.12.0'} - v8-to-istanbul@9.1.0: resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} engines: {node: '>=10.12.0'} @@ -22653,23 +20183,12 @@ packages: webdriverio: optional: true - vlq@0.2.3: - resolution: {integrity: sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==} - vlq@1.0.1: resolution: {integrity: sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==} vue-template-compiler@2.7.16: resolution: {integrity: sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==} - w3c-hr-time@1.0.2: - resolution: {integrity: sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==} - deprecated: Use your platform's native performance.now() and performance.timeOrigin. - - w3c-xmlserializer@2.0.0: - resolution: {integrity: sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==} - engines: {node: '>=10'} - w3c-xmlserializer@4.0.0: resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==} engines: {node: '>=14'} @@ -22705,9 +20224,6 @@ packages: resolution: {integrity: sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==} engines: {node: '>=10.13.0'} - wbuf@1.7.3: - resolution: {integrity: sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==} - wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} @@ -22916,14 +20432,6 @@ packages: webidl-conversions@4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} - webidl-conversions@5.0.0: - resolution: {integrity: sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==} - engines: {node: '>=8'} - - webidl-conversions@6.1.0: - resolution: {integrity: sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==} - engines: {node: '>=10.4'} - webidl-conversions@7.0.0: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} @@ -22933,38 +20441,6 @@ packages: engines: {node: '>= 10.13.0'} hasBin: true - webpack-dev-middleware@5.3.4: - resolution: {integrity: sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q==} - engines: {node: '>= 12.13.0'} - peerDependencies: - webpack: ^4.0.0 || ^5.0.0 - - webpack-dev-server@4.15.2: - resolution: {integrity: sha512-0XavAZbNJ5sDrCbkpWL8mia0o5WPOd2YGtxrEiZkBK9FjLppIUK2TgxK6qGD2P3hUXTJNNPVibrerKcx5WkR1g==} - engines: {node: '>= 12.13.0'} - hasBin: true - peerDependencies: - webpack: ^4.37.0 || ^5.0.0 - webpack-cli: '*' - peerDependenciesMeta: - webpack: - optional: true - webpack-cli: - optional: true - - webpack-manifest-plugin@4.1.1: - resolution: {integrity: sha512-YXUAwxtfKIJIKkhg03MKuiFAD72PlrqCiwdwO4VEXdRO5V0ORCNwaOwAZawPZalCbmH9kBDmXnNeQOw+BIEiow==} - engines: {node: '>=12.22.0'} - peerDependencies: - webpack: ^4.44.2 || ^5.47.0 - - webpack-sources@1.4.3: - resolution: {integrity: sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==} - - webpack-sources@2.3.1: - resolution: {integrity: sha512-y9EI9AO42JjEcrTJFOYmVywVZdKVUfOvDUPsJea5GIr1JOEGFVqwlY2K098fFoIjOkDzHn2AjRvM8dsBZu+gCA==} - engines: {node: '>=10.13.0'} - webpack-sources@3.2.3: resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} engines: {node: '>=10.13.0'} @@ -22982,21 +20458,10 @@ packages: webpack-cli: optional: true - websocket-driver@0.7.4: - resolution: {integrity: sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==} - engines: {node: '>=0.8.0'} - - websocket-extensions@0.1.4: - resolution: {integrity: sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==} - engines: {node: '>=0.8.0'} - websocket@1.0.32: resolution: {integrity: sha512-i4yhcllSP4wrpoPMU2N0TQ/q0O94LRG/eUQjEAamRltjQ1oT1PFFKOG4i877OlJgCG8rw6LrrowJp+TYCEWF7Q==} engines: {node: '>=4.0.0'} - whatwg-encoding@1.0.5: - resolution: {integrity: sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==} - whatwg-encoding@2.0.0: resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==} engines: {node: '>=12'} @@ -23010,9 +20475,6 @@ packages: whatwg-fetch@3.6.20: resolution: {integrity: sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==} - whatwg-mimetype@2.3.0: - resolution: {integrity: sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==} - whatwg-mimetype@3.0.0: resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} engines: {node: '>=12'} @@ -23027,10 +20489,6 @@ packages: whatwg-url@7.1.0: resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} - whatwg-url@8.7.0: - resolution: {integrity: sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==} - engines: {node: '>=10'} - which-boxed-primitive@1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} @@ -23103,62 +20561,6 @@ packages: resolution: {integrity: sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==} engines: {node: '>=8.0.0'} - workbox-background-sync@6.6.0: - resolution: {integrity: sha512-jkf4ZdgOJxC9u2vztxLuPT/UjlH7m/nWRQ/MgGL0v8BJHoZdVGJd18Kck+a0e55wGXdqyHO+4IQTk0685g4MUw==} - - workbox-broadcast-update@6.6.0: - resolution: {integrity: sha512-nm+v6QmrIFaB/yokJmQ/93qIJ7n72NICxIwQwe5xsZiV2aI93MGGyEyzOzDPVz5THEr5rC3FJSsO3346cId64Q==} - - workbox-build@6.6.0: - resolution: {integrity: sha512-Tjf+gBwOTuGyZwMz2Nk/B13Fuyeo0Q84W++bebbVsfr9iLkDSo6j6PST8tET9HYA58mlRXwlMGpyWO8ETJiXdQ==} - engines: {node: '>=10.0.0'} - - workbox-cacheable-response@6.6.0: - resolution: {integrity: sha512-JfhJUSQDwsF1Xv3EV1vWzSsCOZn4mQ38bWEBR3LdvOxSPgB65gAM6cS2CX8rkkKHRgiLrN7Wxoyu+TuH67kHrw==} - deprecated: workbox-background-sync@6.6.0 - - workbox-core@6.6.0: - resolution: {integrity: sha512-GDtFRF7Yg3DD859PMbPAYPeJyg5gJYXuBQAC+wyrWuuXgpfoOrIQIvFRZnQ7+czTIQjIr1DhLEGFzZanAT/3bQ==} - - workbox-expiration@6.6.0: - resolution: {integrity: sha512-baplYXcDHbe8vAo7GYvyAmlS4f6998Jff513L4XvlzAOxcl8F620O91guoJ5EOf5qeXG4cGdNZHkkVAPouFCpw==} - - workbox-google-analytics@6.6.0: - resolution: {integrity: sha512-p4DJa6OldXWd6M9zRl0H6vB9lkrmqYFkRQ2xEiNdBFp9U0LhsGO7hsBscVEyH9H2/3eZZt8c97NB2FD9U2NJ+Q==} - - workbox-navigation-preload@6.6.0: - resolution: {integrity: sha512-utNEWG+uOfXdaZmvhshrh7KzhDu/1iMHyQOV6Aqup8Mm78D286ugu5k9MFD9SzBT5TcwgwSORVvInaXWbvKz9Q==} - - workbox-precaching@6.6.0: - resolution: {integrity: sha512-eYu/7MqtRZN1IDttl/UQcSZFkHP7dnvr/X3Vn6Iw6OsPMruQHiVjjomDFCNtd8k2RdjLs0xiz9nq+t3YVBcWPw==} - - workbox-range-requests@6.6.0: - resolution: {integrity: sha512-V3aICz5fLGq5DpSYEU8LxeXvsT//mRWzKrfBOIxzIdQnV/Wj7R+LyJVTczi4CQ4NwKhAaBVaSujI1cEjXW+hTw==} - - workbox-recipes@6.6.0: - resolution: {integrity: sha512-TFi3kTgYw73t5tg73yPVqQC8QQjxJSeqjXRO4ouE/CeypmP2O/xqmB/ZFBBQazLTPxILUQ0b8aeh0IuxVn9a6A==} - - workbox-routing@6.6.0: - resolution: {integrity: sha512-x8gdN7VDBiLC03izAZRfU+WKUXJnbqt6PG9Uh0XuPRzJPpZGLKce/FkOX95dWHRpOHWLEq8RXzjW0O+POSkKvw==} - - workbox-strategies@6.6.0: - resolution: {integrity: sha512-eC07XGuINAKUWDnZeIPdRdVja4JQtTuc35TZ8SwMb1ztjp7Ddq2CJ4yqLvWzFWGlYI7CG/YGqaETntTxBGdKgQ==} - - workbox-streams@6.6.0: - resolution: {integrity: sha512-rfMJLVvwuED09CnH1RnIep7L9+mj4ufkTyDPVaXPKlhi9+0czCu+SJggWCIFbPpJaAZmp2iyVGLqS3RUmY3fxg==} - - workbox-sw@6.6.0: - resolution: {integrity: sha512-R2IkwDokbtHUE4Kus8pKO5+VkPHD2oqTgl+XJwh4zbF1HyjAbgNmK/FneZHVU7p03XUt9ICfuGDYISWG9qV/CQ==} - - workbox-webpack-plugin@6.6.0: - resolution: {integrity: sha512-xNZIZHalboZU66Wa7x1YkjIqEy1gTR+zPM+kjrYJzqN7iurYZBctBLISyScjhkJKYuRrZUP0iqViZTh8rS0+3A==} - engines: {node: '>=10.0.0'} - peerDependencies: - webpack: ^4.4.0 || ^5.9.0 - - workbox-window@6.6.0: - resolution: {integrity: sha512-L4N9+vka17d16geaJXXRjENLFldvkWy7JyGxElRD0JvBxvFEd8LOhr+uXCcar/NzAmIBRv9EZ+M+Qr4mOoBITw==} - workerpool@6.2.1: resolution: {integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==} @@ -23188,9 +20590,6 @@ packages: write-file-atomic@2.4.3: resolution: {integrity: sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==} - write-file-atomic@3.0.3: - resolution: {integrity: sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==} - write-file-atomic@4.0.2: resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -23336,9 +20735,6 @@ packages: xhr@2.6.0: resolution: {integrity: sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==} - xml-name-validator@3.0.0: - resolution: {integrity: sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==} - xml-name-validator@4.0.0: resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} engines: {node: '>=12'} @@ -23582,50 +20978,6 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@ant-design/colors@7.0.2': - dependencies: - '@ctrl/tinycolor': 3.6.1 - - '@ant-design/cssinjs@1.20.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@babel/runtime': 7.24.5 - '@emotion/hash': 0.8.0 - '@emotion/unitless': 0.7.5 - classnames: 2.3.2 - csstype: 3.1.3 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - stylis: 4.2.0 - - '@ant-design/icons-svg@4.4.2': {} - - '@ant-design/icons@5.3.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@ant-design/colors': 7.0.2 - '@ant-design/icons-svg': 4.4.2 - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - '@ant-design/react-slick@1.1.2(react@18.2.0)': - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - json2mq: 0.2.0 - react: 18.2.0 - resize-observer-polyfill: 1.5.1 - throttle-debounce: 5.0.0 - - '@apideck/better-ajv-errors@0.3.6(ajv@8.12.0)': - dependencies: - ajv: 8.12.0 - json-schema: 0.4.0 - jsonpointer: 5.0.1 - leven: 3.1.0 - '@aptos-connect/wallet-adapter-plugin@1.0.1(@aptos-labs/ts-sdk@1.27.0)(@aptos-labs/wallet-standard@0.1.0(@aptos-labs/ts-sdk@1.27.0)(@wallet-standard/core@1.0.3))(aptos@1.21.0)': dependencies: '@aptos-connect/wallet-api': 0.1.1(@aptos-labs/ts-sdk@1.27.0)(@aptos-labs/wallet-standard@0.1.0(@aptos-labs/ts-sdk@1.27.0)(@wallet-standard/core@1.0.3))(aptos@1.21.0) @@ -23657,13 +21009,6 @@ snapshots: '@aptos-labs/aptos-cli@0.2.0': {} - '@aptos-labs/aptos-client@0.0.2': - dependencies: - axios: 0.27.2(debug@4.3.4) - got: 11.8.6 - transitivePeerDependencies: - - debug - '@aptos-labs/aptos-client@0.1.0(patch_hash=t5ob2d47ycxvxflm53kwwzv4kq)': dependencies: axios: 1.6.2 @@ -23671,17 +21016,6 @@ snapshots: transitivePeerDependencies: - debug - '@aptos-labs/ts-sdk@0.0.3': - dependencies: - '@aptos-labs/aptos-client': 0.0.2 - '@noble/curves': 1.4.0 - '@noble/hashes': 1.1.3 - '@scure/bip39': 1.1.0 - form-data: 4.0.0 - tweetnacl: 1.0.3 - transitivePeerDependencies: - - debug - '@aptos-labs/ts-sdk@1.14.0': dependencies: '@aptos-labs/aptos-cli': 0.1.2 @@ -23711,20 +21045,6 @@ snapshots: transitivePeerDependencies: - debug - '@aptos-labs/wallet-adapter-ant-design@2.2.0(@aptos-labs/ts-sdk@1.27.0)(aptos@1.21.0)(date-fns@2.30.0)(moment@2.29.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@aptos-labs/wallet-adapter-react': 2.3.1(@aptos-labs/ts-sdk@1.27.0)(aptos@1.21.0)(react@18.2.0) - antd: 5.17.0(date-fns@2.30.0)(moment@2.29.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - transitivePeerDependencies: - - '@aptos-labs/ts-sdk' - - aptos - - date-fns - - debug - - luxon - - moment - '@aptos-labs/wallet-adapter-core@0.1.7': dependencies: aptos: 1.21.0 @@ -23750,16 +21070,6 @@ snapshots: transitivePeerDependencies: - debug - '@aptos-labs/wallet-adapter-core@2.6.0(aptos@1.21.0)': - dependencies: - '@aptos-labs/ts-sdk': 0.0.3 - aptos: 1.21.0 - buffer: 6.0.3 - eventemitter3: 4.0.7 - tweetnacl: 1.0.3 - transitivePeerDependencies: - - debug - '@aptos-labs/wallet-adapter-core@3.10.0(@aptos-labs/ts-sdk@1.27.0)(aptos@1.21.0)': dependencies: '@aptos-labs/ts-sdk': 1.27.0 @@ -23816,137 +21126,6 @@ snapshots: '@aptos-labs/ts-sdk': 1.27.0 '@wallet-standard/core': 1.0.3 - '@aptstats/aptos-wallet-framework@0.0.2(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4))(@types/babel__core@7.20.5)(aptos@1.21.0)(bufferutil@4.0.8)(eslint@8.57.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(type-fest@4.18.3)(typescript@5.5.4)(utf-8-validate@5.0.10)(vue-template-compiler@2.7.16)': - dependencies: - aptos: 1.21.0 - eventemitter3: 4.0.7 - js-sha3: 0.8.0 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - react-scripts: 5.0.1(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.57.0)(react@18.2.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(type-fest@4.18.3)(typescript@5.5.4)(utf-8-validate@5.0.10)(vue-template-compiler@2.7.16) - transitivePeerDependencies: - - '@babel/plugin-syntax-flow' - - '@babel/plugin-transform-react-jsx' - - '@parcel/css' - - '@rspack/core' - - '@swc/core' - - '@types/babel__core' - - '@types/webpack' - - bufferutil - - canvas - - clean-css - - csso - - debug - - esbuild - - eslint - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - fibers - - node-notifier - - node-sass - - rework - - rework-visit - - sass - - sass-embedded - - sockjs-client - - supports-color - - ts-node - - type-fest - - typescript - - uglify-js - - utf-8-validate - - vue-template-compiler - - webpack-cli - - webpack-hot-middleware - - webpack-plugin-serve - - '@aptstats/aptos-wallet-framework@0.0.6(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4))(@types/babel__core@7.20.5)(aptos@1.21.0)(bufferutil@4.0.8)(eslint@8.57.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(type-fest@4.18.3)(typescript@5.5.4)(utf-8-validate@5.0.10)(vue-template-compiler@2.7.16)': - dependencies: - aptos: 1.21.0 - eventemitter3: 4.0.7 - js-sha3: 0.8.0 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - react-scripts: 5.0.1(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.57.0)(react@18.2.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(type-fest@4.18.3)(typescript@5.5.4)(utf-8-validate@5.0.10)(vue-template-compiler@2.7.16) - transitivePeerDependencies: - - '@babel/plugin-syntax-flow' - - '@babel/plugin-transform-react-jsx' - - '@parcel/css' - - '@rspack/core' - - '@swc/core' - - '@types/babel__core' - - '@types/webpack' - - bufferutil - - canvas - - clean-css - - csso - - debug - - esbuild - - eslint - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - fibers - - node-notifier - - node-sass - - rework - - rework-visit - - sass - - sass-embedded - - sockjs-client - - supports-color - - ts-node - - type-fest - - typescript - - uglify-js - - utf-8-validate - - vue-template-compiler - - webpack-cli - - webpack-hot-middleware - - webpack-plugin-serve - - '@aptstats/safepal-wallet-extension@0.0.3(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4))(@types/babel__core@7.20.5)(aptos@1.21.0)(bufferutil@4.0.8)(eslint@8.57.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(type-fest@4.18.3)(typescript@5.5.4)(utf-8-validate@5.0.10)(vue-template-compiler@2.7.16)': - dependencies: - '@aptstats/aptos-wallet-framework': 0.0.2(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4))(@types/babel__core@7.20.5)(aptos@1.21.0)(bufferutil@4.0.8)(eslint@8.57.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(type-fest@4.18.3)(typescript@5.5.4)(utf-8-validate@5.0.10)(vue-template-compiler@2.7.16) - aptos: 1.21.0 - eventemitter3: 4.0.7 - transitivePeerDependencies: - - '@babel/plugin-syntax-flow' - - '@babel/plugin-transform-react-jsx' - - '@parcel/css' - - '@rspack/core' - - '@swc/core' - - '@types/babel__core' - - '@types/webpack' - - bufferutil - - canvas - - clean-css - - csso - - debug - - esbuild - - eslint - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - fibers - - node-notifier - - node-sass - - react - - react-dom - - rework - - rework-visit - - sass - - sass-embedded - - sockjs-client - - supports-color - - ts-node - - type-fest - - typescript - - uglify-js - - utf-8-validate - - vue-template-compiler - - webpack-cli - - webpack-hot-middleware - - webpack-plugin-serve - '@artilleryio/int-commons@2.0.4': dependencies: async: 2.6.4 @@ -24575,14 +21754,6 @@ snapshots: eslint-visitor-keys: 2.1.0 semver: 6.3.1 - '@babel/eslint-parser@7.22.15(@babel/core@7.24.4)(eslint@8.57.0)': - dependencies: - '@babel/core': 7.24.4 - '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 - eslint: 8.57.0 - eslint-visitor-keys: 2.1.0 - semver: 6.3.1 - '@babel/generator@7.23.0': dependencies: '@babel/types': 7.23.0 @@ -24752,15 +21923,6 @@ snapshots: '@babel/helper-split-export-declaration': 7.22.6 '@babel/helper-validator-identifier': 7.22.20 - '@babel/helper-module-transforms@7.23.0(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.22.15 - '@babel/helper-simple-access': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.20 - '@babel/helper-module-transforms@7.23.3(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -24952,13 +22114,6 @@ snapshots: '@babel/helper-create-class-features-plugin': 7.22.10(@babel/core@7.24.4) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-proposal-decorators@7.24.1(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-create-class-features-plugin': 7.24.4(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-decorators': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-proposal-export-default-from@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -25012,12 +22167,6 @@ snapshots: '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.4) - '@babel/plugin-proposal-private-methods@7.18.6(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-create-class-features-plugin': 7.24.4(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.23.2)': dependencies: '@babel/core': 7.23.2 @@ -25026,14 +22175,6 @@ snapshots: dependencies: '@babel/core': 7.24.4 - '@babel/plugin-proposal-private-property-in-object@7.21.11(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.24.4(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.24.4) - '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.22.10)': dependencies: '@babel/core': 7.22.10 @@ -25063,6 +22204,7 @@ snapshots: dependencies: '@babel/core': 7.24.4 '@babel/helper-plugin-utils': 7.22.5 + optional: true '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.22.10)': dependencies: @@ -25089,11 +22231,6 @@ snapshots: '@babel/core': 7.24.4 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-decorators@7.24.1(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.23.2)': dependencies: '@babel/core': 7.23.2 @@ -25184,11 +22321,6 @@ snapshots: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-jsx@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -25314,11 +22446,6 @@ snapshots: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-typescript@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -25627,13 +22754,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-simple-access': 7.22.5 - '@babel/plugin-transform-modules-commonjs@7.22.5(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-module-transforms': 7.23.0(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-simple-access': 7.22.5 - '@babel/plugin-transform-modules-commonjs@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -25818,21 +22938,11 @@ snapshots: '@babel/core': 7.24.4 '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-transform-react-constant-elements@7.24.1(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-transform-react-display-name@7.24.1(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-transform-react-jsx-development@7.22.5(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/plugin-transform-react-jsx': 7.23.4(@babel/core@7.24.4) - '@babel/plugin-transform-react-jsx-self@7.22.5(@babel/core@7.23.2)': dependencies: '@babel/core': 7.23.2 @@ -25862,12 +22972,6 @@ snapshots: '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.4) '@babel/types': 7.24.0 - '@babel/plugin-transform-react-pure-annotations@7.24.1(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-transform-regenerator@7.22.10(@babel/core@7.23.2)': dependencies: '@babel/core': 7.23.2 @@ -25962,14 +23066,6 @@ snapshots: '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-typescript@7.22.10(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.22.10(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.24.4) - '@babel/plugin-transform-typescript@7.24.4(@babel/core@7.24.4)': dependencies: '@babel/core': 7.24.4 @@ -26218,16 +23314,6 @@ snapshots: '@babel/types': 7.23.0 esutils: 2.0.3 - '@babel/preset-react@7.24.1(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/helper-validator-option': 7.23.5 - '@babel/plugin-transform-react-display-name': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-react-jsx': 7.23.4(@babel/core@7.24.4) - '@babel/plugin-transform-react-jsx-development': 7.22.5(@babel/core@7.24.4) - '@babel/plugin-transform-react-pure-annotations': 7.24.1(@babel/core@7.24.4) - '@babel/preset-typescript@7.22.5(@babel/core@7.23.2)': dependencies: '@babel/core': 7.23.2 @@ -26237,15 +23323,6 @@ snapshots: '@babel/plugin-transform-modules-commonjs': 7.22.5(@babel/core@7.23.2) '@babel/plugin-transform-typescript': 7.22.10(@babel/core@7.23.2) - '@babel/preset-typescript@7.22.5(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-validator-option': 7.22.15 - '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.24.4) - '@babel/plugin-transform-modules-commonjs': 7.22.5(@babel/core@7.24.4) - '@babel/plugin-transform-typescript': 7.22.10(@babel/core@7.24.4) - '@babel/register@7.22.5(@babel/core@7.23.2)': dependencies: '@babel/core': 7.23.2 @@ -26384,28 +23461,6 @@ snapshots: - encoding - utf-8-validate - '@blocto/aptos-wallet-adapter-plugin@0.2.9(bufferutil@4.0.8)(utf-8-validate@5.0.10)': - dependencies: - '@aptos-labs/wallet-adapter-core': 2.6.0(aptos@1.21.0) - '@blocto/sdk': 0.10.2(aptos@1.21.0)(bufferutil@4.0.8)(utf-8-validate@5.0.10) - aptos: 1.21.0 - transitivePeerDependencies: - - bufferutil - - debug - - utf-8-validate - - '@blocto/sdk@0.10.2(aptos@1.21.0)(bufferutil@4.0.8)(utf-8-validate@5.0.10)': - dependencies: - buffer: 6.0.3 - eip1193-provider: 1.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) - js-sha3: 0.8.0 - optionalDependencies: - aptos: 1.21.0 - transitivePeerDependencies: - - bufferutil - - debug - - utf-8-validate - '@blocto/sdk@0.10.3(aptos@1.21.0)(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: buffer: 6.0.3 @@ -26738,88 +23793,6 @@ snapshots: dependencies: '@jridgewell/trace-mapping': 0.3.9 - '@csstools/normalize.css@12.1.1': {} - - '@csstools/postcss-cascade-layers@1.1.1(postcss@8.4.23)': - dependencies: - '@csstools/selector-specificity': 2.2.0(postcss-selector-parser@6.0.13) - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - - '@csstools/postcss-color-function@1.1.1(postcss@8.4.23)': - dependencies: - '@csstools/postcss-progressive-custom-properties': 1.3.0(postcss@8.4.23) - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - '@csstools/postcss-font-format-keywords@1.0.1(postcss@8.4.23)': - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - '@csstools/postcss-hwb-function@1.0.2(postcss@8.4.23)': - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - '@csstools/postcss-ic-unit@1.0.1(postcss@8.4.23)': - dependencies: - '@csstools/postcss-progressive-custom-properties': 1.3.0(postcss@8.4.23) - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - '@csstools/postcss-is-pseudo-class@2.0.7(postcss@8.4.23)': - dependencies: - '@csstools/selector-specificity': 2.2.0(postcss-selector-parser@6.0.13) - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - - '@csstools/postcss-nested-calc@1.0.0(postcss@8.4.23)': - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - '@csstools/postcss-normalize-display-values@1.0.1(postcss@8.4.23)': - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - '@csstools/postcss-oklab-function@1.1.1(postcss@8.4.23)': - dependencies: - '@csstools/postcss-progressive-custom-properties': 1.3.0(postcss@8.4.23) - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - '@csstools/postcss-progressive-custom-properties@1.3.0(postcss@8.4.23)': - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - '@csstools/postcss-stepped-value-functions@1.0.1(postcss@8.4.23)': - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - '@csstools/postcss-text-decoration-shorthand@1.0.0(postcss@8.4.23)': - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - '@csstools/postcss-trigonometric-functions@1.0.2(postcss@8.4.23)': - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - '@csstools/postcss-unset-value@1.0.2(postcss@8.4.23)': - dependencies: - postcss: 8.4.23 - - '@csstools/selector-specificity@2.2.0(postcss-selector-parser@6.0.13)': - dependencies: - postcss-selector-parser: 6.0.13 - - '@ctrl/tinycolor@3.6.1': {} - '@defi.org/web3-candies@5.0.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': dependencies: bignumber.js: 9.1.1 @@ -26890,8 +23863,6 @@ snapshots: dependencies: '@edge-runtime/primitives': 4.1.0 - '@emotion/hash@0.8.0': {} - '@emotion/hash@0.9.1': {} '@emotion/is-prop-valid@0.8.8': @@ -26908,8 +23879,6 @@ snapshots: '@emotion/memoize@0.8.1': {} - '@emotion/unitless@0.7.5': {} - '@emotion/unitless@0.8.1': {} '@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@18.2.0)': @@ -27830,24 +24799,6 @@ snapshots: '@istanbuljs/schema@0.1.3': {} - '@jest/console@27.5.1': - dependencies: - '@jest/types': 27.5.1 - '@types/node': 22.1.0 - chalk: 4.1.2 - jest-message-util: 27.5.1 - jest-util: 27.5.1 - slash: 3.0.0 - - '@jest/console@28.1.3': - dependencies: - '@jest/types': 28.1.3 - '@types/node': 22.1.0 - chalk: 4.1.2 - jest-message-util: 28.1.3 - jest-util: 28.1.3 - slash: 3.0.0 - '@jest/console@29.7.0': dependencies: '@jest/types': 29.6.3 @@ -27857,43 +24808,6 @@ snapshots: jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10)': - dependencies: - '@jest/console': 27.5.1 - '@jest/reporters': 27.5.1 - '@jest/test-result': 27.5.1 - '@jest/transform': 27.5.1 - '@jest/types': 27.5.1 - '@types/node': 22.1.0 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - emittery: 0.8.1 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-changed-files: 27.5.1 - jest-config: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10) - jest-haste-map: 27.5.1 - jest-message-util: 27.5.1 - jest-regex-util: 27.5.1 - jest-resolve: 27.5.1 - jest-resolve-dependencies: 27.5.1 - jest-runner: 27.5.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) - jest-runtime: 27.5.1 - jest-snapshot: 27.5.1 - jest-util: 27.5.1 - jest-validate: 27.5.1 - jest-watcher: 27.5.1 - micromatch: 4.0.5 - rimraf: 3.0.2 - slash: 3.0.0 - strip-ansi: 6.0.1 - transitivePeerDependencies: - - bufferutil - - canvas - - supports-color - - ts-node - - utf-8-validate - '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))': dependencies: '@jest/console': 29.7.0 @@ -27933,13 +24847,6 @@ snapshots: dependencies: '@jest/types': 29.6.3 - '@jest/environment@27.5.1': - dependencies: - '@jest/fake-timers': 27.5.1 - '@jest/types': 27.5.1 - '@types/node': 22.1.0 - jest-mock: 27.5.1 - '@jest/environment@29.7.0': dependencies: '@jest/fake-timers': 29.7.0 @@ -27958,15 +24865,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@jest/fake-timers@27.5.1': - dependencies: - '@jest/types': 27.5.1 - '@sinonjs/fake-timers': 8.1.0 - '@types/node': 22.1.0 - jest-message-util: 27.5.1 - jest-mock: 27.5.1 - jest-util: 27.5.1 - '@jest/fake-timers@29.7.0': dependencies: '@jest/types': 29.6.3 @@ -27976,12 +24874,6 @@ snapshots: jest-mock: 29.7.0 jest-util: 29.7.0 - '@jest/globals@27.5.1': - dependencies: - '@jest/environment': 27.5.1 - '@jest/types': 27.5.1 - expect: 27.5.1 - '@jest/globals@29.7.0': dependencies: '@jest/environment': 29.7.0 @@ -27991,36 +24883,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@jest/reporters@27.5.1': - dependencies: - '@bcoe/v8-coverage': 0.2.3 - '@jest/console': 27.5.1 - '@jest/test-result': 27.5.1 - '@jest/transform': 27.5.1 - '@jest/types': 27.5.1 - '@types/node': 22.1.0 - chalk: 4.1.2 - collect-v8-coverage: 1.0.2 - exit: 0.1.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - istanbul-lib-coverage: 3.2.0 - istanbul-lib-instrument: 5.2.1 - istanbul-lib-report: 3.0.1 - istanbul-lib-source-maps: 4.0.1 - istanbul-reports: 3.1.6 - jest-haste-map: 27.5.1 - jest-resolve: 27.5.1 - jest-util: 27.5.1 - jest-worker: 27.5.1 - slash: 3.0.0 - source-map: 0.6.1 - string-length: 4.0.2 - terminal-link: 2.1.1 - v8-to-istanbul: 8.1.1 - transitivePeerDependencies: - - supports-color - '@jest/reporters@29.7.0': dependencies: '@bcoe/v8-coverage': 0.2.3 @@ -28050,40 +24912,16 @@ snapshots: transitivePeerDependencies: - supports-color - '@jest/schemas@28.1.3': - dependencies: - '@sinclair/typebox': 0.24.51 - '@jest/schemas@29.6.3': dependencies: '@sinclair/typebox': 0.27.8 - '@jest/source-map@27.5.1': - dependencies: - callsites: 3.1.0 - graceful-fs: 4.2.11 - source-map: 0.6.1 - '@jest/source-map@29.6.3': dependencies: '@jridgewell/trace-mapping': 0.3.19 callsites: 3.1.0 graceful-fs: 4.2.11 - '@jest/test-result@27.5.1': - dependencies: - '@jest/console': 27.5.1 - '@jest/types': 27.5.1 - '@types/istanbul-lib-coverage': 2.0.6 - collect-v8-coverage: 1.0.2 - - '@jest/test-result@28.1.3': - dependencies: - '@jest/console': 28.1.3 - '@jest/types': 28.1.3 - '@types/istanbul-lib-coverage': 2.0.6 - collect-v8-coverage: 1.0.2 - '@jest/test-result@29.7.0': dependencies: '@jest/console': 29.7.0 @@ -28091,15 +24929,6 @@ snapshots: '@types/istanbul-lib-coverage': 2.0.4 collect-v8-coverage: 1.0.2 - '@jest/test-sequencer@27.5.1': - dependencies: - '@jest/test-result': 27.5.1 - graceful-fs: 4.2.11 - jest-haste-map: 27.5.1 - jest-runtime: 27.5.1 - transitivePeerDependencies: - - supports-color - '@jest/test-sequencer@29.7.0': dependencies: '@jest/test-result': 29.7.0 @@ -28107,26 +24936,6 @@ snapshots: jest-haste-map: 29.7.0 slash: 3.0.0 - '@jest/transform@27.5.1': - dependencies: - '@babel/core': 7.24.4 - '@jest/types': 27.5.1 - babel-plugin-istanbul: 6.1.1 - chalk: 4.1.2 - convert-source-map: 1.9.0 - fast-json-stable-stringify: 2.1.0 - graceful-fs: 4.2.11 - jest-haste-map: 27.5.1 - jest-regex-util: 27.5.1 - jest-util: 27.5.1 - micromatch: 4.0.5 - pirates: 4.0.6 - slash: 3.0.0 - source-map: 0.6.1 - write-file-atomic: 3.0.3 - transitivePeerDependencies: - - supports-color - '@jest/transform@29.7.0': dependencies: '@babel/core': 7.23.2 @@ -28155,23 +24964,6 @@ snapshots: '@types/yargs': 15.0.19 chalk: 4.1.2 - '@jest/types@27.5.1': - dependencies: - '@types/istanbul-lib-coverage': 2.0.6 - '@types/istanbul-reports': 3.0.4 - '@types/node': 22.1.0 - '@types/yargs': 16.0.9 - chalk: 4.1.2 - - '@jest/types@28.1.3': - dependencies: - '@jest/schemas': 28.1.3 - '@types/istanbul-lib-coverage': 2.0.6 - '@types/istanbul-reports': 3.0.4 - '@types/node': 22.1.0 - '@types/yargs': 17.0.24 - chalk: 4.1.2 - '@jest/types@29.6.3': dependencies: '@jest/schemas': 29.6.3 @@ -28255,14 +25047,6 @@ snapshots: '@juggle/resize-observer@3.4.0': {} - '@kwsites/file-exists@1.1.1': - dependencies: - debug: 4.3.4(supports-color@8.1.1) - transitivePeerDependencies: - - supports-color - - '@kwsites/promise-deferred@1.1.1': {} - '@layerzerolabs/scan-client@0.0.6(axios@1.6.8)': dependencies: axios: 1.6.8 @@ -28309,8 +25093,6 @@ snapshots: '@ledgerhq/logs@6.12.0': {} - '@leichtgewicht/ip-codec@2.0.5': {} - '@lit-labs/react@1.2.1': {} '@lit-labs/ssr-dom-shim@1.1.1': {} @@ -28877,8 +25659,6 @@ snapshots: dependencies: '@noble/hashes': 1.4.0 - '@noble/hashes@1.1.3': {} - '@noble/hashes@1.2.0': {} '@noble/hashes@1.3.0': {} @@ -30022,21 +26802,6 @@ snapshots: dependencies: playwright: 1.45.0 - '@pmmmwh/react-refresh-webpack-plugin@0.5.13(react-refresh@0.11.0)(type-fest@4.18.3)(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.91.0))(webpack@5.91.0)': - dependencies: - ansi-html-community: 0.0.8 - core-js-pure: 3.37.0 - error-stack-parser: 2.1.4 - html-entities: 2.5.2 - loader-utils: 2.0.4 - react-refresh: 0.11.0 - schema-utils: 3.3.0 - source-map: 0.7.4 - webpack: 5.91.0 - optionalDependencies: - type-fest: 4.18.3 - webpack-dev-server: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.91.0) - '@polka/url@1.0.0-next.25': {} '@pontem/wallet-adapter-plugin@0.2.1': @@ -30880,67 +27645,6 @@ snapshots: transitivePeerDependencies: - '@types/react' - '@rc-component/async-validator@5.0.3': - dependencies: - '@babel/runtime': 7.24.5 - - '@rc-component/color-picker@1.5.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@babel/runtime': 7.24.5 - '@ctrl/tinycolor': 3.6.1 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - '@rc-component/context@1.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@babel/runtime': 7.24.5 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - '@rc-component/mini-decimal@1.1.0': - dependencies: - '@babel/runtime': 7.24.5 - - '@rc-component/mutate-observer@1.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - '@rc-component/portal@1.1.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - '@rc-component/tour@1.14.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/portal': 1.1.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@rc-component/trigger': 2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - '@rc-component/trigger@2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/portal': 1.1.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - classnames: 2.3.2 - rc-motion: 2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-resize-observer: 1.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - '@react-hook/event@1.2.6(react@18.2.0)': dependencies: react: 18.2.0 @@ -31371,15 +28075,6 @@ snapshots: transitivePeerDependencies: - debug - '@rollup/plugin-babel@5.3.1(@babel/core@7.24.4)(@types/babel__core@7.20.5)(rollup@2.78.0)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-module-imports': 7.24.3 - '@rollup/pluginutils': 3.1.0(rollup@2.78.0) - rollup: 2.78.0 - optionalDependencies: - '@types/babel__core': 7.20.5 - '@rollup/plugin-commonjs@24.0.0(rollup@2.78.0)': dependencies: '@rollup/pluginutils': 5.0.4(rollup@2.78.0) @@ -31402,29 +28097,6 @@ snapshots: optionalDependencies: rollup: 3.29.4 - '@rollup/plugin-node-resolve@11.2.1(rollup@2.78.0)': - dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.78.0) - '@types/resolve': 1.17.1 - builtin-modules: 3.3.0 - deepmerge: 4.3.1 - is-module: 1.0.0 - resolve: 1.22.8 - rollup: 2.78.0 - - '@rollup/plugin-replace@2.4.2(rollup@2.78.0)': - dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.78.0) - magic-string: 0.25.9 - rollup: 2.78.0 - - '@rollup/pluginutils@3.1.0(rollup@2.78.0)': - dependencies: - '@types/estree': 0.0.39 - estree-walker: 1.0.1 - picomatch: 2.3.1 - rollup: 2.78.0 - '@rollup/pluginutils@4.2.1': dependencies: estree-walker: 2.0.2 @@ -31521,11 +28193,6 @@ snapshots: '@noble/hashes': 1.4.0 '@scure/base': 1.1.6 - '@scure/bip39@1.1.0': - dependencies: - '@noble/hashes': 1.1.3 - '@scure/base': 1.1.8 - '@scure/bip39@1.1.1': dependencies: '@noble/hashes': 1.2.0 @@ -31557,12 +28224,6 @@ snapshots: '@sentry/types': 8.13.0 '@sentry/utils': 8.13.0 - '@sentry-internal/feedback@7.101.1': - dependencies: - '@sentry/core': 7.101.1 - '@sentry/types': 7.101.1 - '@sentry/utils': 7.101.1 - '@sentry-internal/feedback@7.110.0': dependencies: '@sentry/core': 7.110.0 @@ -31575,13 +28236,6 @@ snapshots: '@sentry/types': 8.13.0 '@sentry/utils': 8.13.0 - '@sentry-internal/replay-canvas@7.101.1': - dependencies: - '@sentry/core': 7.101.1 - '@sentry/replay': 7.101.1 - '@sentry/types': 7.101.1 - '@sentry/utils': 7.101.1 - '@sentry-internal/replay-canvas@7.110.0': dependencies: '@sentry/core': 7.110.0 @@ -31603,12 +28257,6 @@ snapshots: '@sentry/types': 8.13.0 '@sentry/utils': 8.13.0 - '@sentry-internal/tracing@7.101.1': - dependencies: - '@sentry/core': 7.101.1 - '@sentry/types': 7.101.1 - '@sentry/utils': 7.101.1 - '@sentry-internal/tracing@7.110.0': dependencies: '@sentry/core': 7.110.0 @@ -31617,16 +28265,6 @@ snapshots: '@sentry/babel-plugin-component-annotate@2.20.1': {} - '@sentry/browser@7.101.1': - dependencies: - '@sentry-internal/feedback': 7.101.1 - '@sentry-internal/replay-canvas': 7.101.1 - '@sentry-internal/tracing': 7.101.1 - '@sentry/core': 7.101.1 - '@sentry/replay': 7.101.1 - '@sentry/types': 7.101.1 - '@sentry/utils': 7.101.1 - '@sentry/browser@7.110.0': dependencies: '@sentry-internal/feedback': 7.110.0 @@ -31721,11 +28359,6 @@ snapshots: '@sentry/utils': 5.30.0 tslib: 1.14.1 - '@sentry/core@7.101.1': - dependencies: - '@sentry/types': 7.101.1 - '@sentry/utils': 7.101.1 - '@sentry/core@7.110.0': dependencies: '@sentry/types': 7.110.0 @@ -31742,13 +28375,6 @@ snapshots: '@sentry/utils': 5.30.0 tslib: 1.14.1 - '@sentry/integrations@7.101.1': - dependencies: - '@sentry/core': 7.101.1 - '@sentry/types': 7.101.1 - '@sentry/utils': 7.101.1 - localforage: 1.10.0 - '@sentry/integrations@7.110.0': dependencies: '@sentry/core': 7.110.0 @@ -31762,29 +28388,6 @@ snapshots: '@sentry/types': 5.30.0 tslib: 1.14.1 - '@sentry/nextjs@7.101.1(encoding@0.1.13)(next@14.2.3(@babel/core@7.24.4)(@opentelemetry/api@1.9.0)(@playwright/test@1.45.0)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)(webpack@5.91.0)': - dependencies: - '@rollup/plugin-commonjs': 24.0.0(rollup@2.78.0) - '@sentry/core': 7.101.1 - '@sentry/integrations': 7.101.1 - '@sentry/node': 7.101.1 - '@sentry/react': 7.101.1(react@18.2.0) - '@sentry/types': 7.101.1 - '@sentry/utils': 7.101.1 - '@sentry/vercel-edge': 7.101.1 - '@sentry/webpack-plugin': 1.21.0(encoding@0.1.13) - chalk: 3.0.0 - next: 14.2.3(@babel/core@7.24.4)(@opentelemetry/api@1.9.0)(@playwright/test@1.45.0)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - resolve: 1.22.8 - rollup: 2.78.0 - stacktrace-parser: 0.1.10 - optionalDependencies: - webpack: 5.91.0 - transitivePeerDependencies: - - encoding - - supports-color - '@sentry/nextjs@7.110.0(encoding@0.1.13)(next@14.2.3(@babel/core@7.24.4)(@opentelemetry/api@1.9.0)(@playwright/test@1.45.0)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)(webpack@5.91.0)': dependencies: '@rollup/plugin-commonjs': 24.0.0(rollup@2.78.0) @@ -31851,13 +28454,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@sentry/node@7.101.1': - dependencies: - '@sentry-internal/tracing': 7.101.1 - '@sentry/core': 7.101.1 - '@sentry/types': 7.101.1 - '@sentry/utils': 7.101.1 - '@sentry/node@7.110.0': dependencies: '@sentry-internal/tracing': 7.110.0 @@ -31910,15 +28506,6 @@ snapshots: '@sentry/types': 8.13.0 '@sentry/utils': 8.13.0 - '@sentry/react@7.101.1(react@18.2.0)': - dependencies: - '@sentry/browser': 7.101.1 - '@sentry/core': 7.101.1 - '@sentry/types': 7.101.1 - '@sentry/utils': 7.101.1 - hoist-non-react-statics: 3.3.2 - react: 18.2.0 - '@sentry/react@7.110.0(react@18.2.0)': dependencies: '@sentry/browser': 7.110.0 @@ -31937,13 +28524,6 @@ snapshots: hoist-non-react-statics: 3.3.2 react: 18.2.0 - '@sentry/replay@7.101.1': - dependencies: - '@sentry-internal/tracing': 7.101.1 - '@sentry/core': 7.101.1 - '@sentry/types': 7.101.1 - '@sentry/utils': 7.101.1 - '@sentry/replay@7.110.0': dependencies: '@sentry-internal/tracing': 7.110.0 @@ -31961,8 +28541,6 @@ snapshots: '@sentry/types@5.30.0': {} - '@sentry/types@7.101.1': {} - '@sentry/types@7.110.0': {} '@sentry/types@8.13.0': {} @@ -31972,10 +28550,6 @@ snapshots: '@sentry/types': 5.30.0 tslib: 1.14.1 - '@sentry/utils@7.101.1': - dependencies: - '@sentry/types': 7.101.1 - '@sentry/utils@7.110.0': dependencies: '@sentry/types': 7.110.0 @@ -31984,13 +28558,6 @@ snapshots: dependencies: '@sentry/types': 8.13.0 - '@sentry/vercel-edge@7.101.1': - dependencies: - '@sentry-internal/tracing': 7.101.1 - '@sentry/core': 7.101.1 - '@sentry/types': 7.101.1 - '@sentry/utils': 7.101.1 - '@sentry/vercel-edge@7.110.0': dependencies: '@sentry-internal/tracing': 7.110.0 @@ -32034,8 +28601,6 @@ snapshots: '@sideway/pinpoint@2.0.0': {} - '@sinclair/typebox@0.24.51': {} - '@sinclair/typebox@0.25.24': {} '@sinclair/typebox@0.27.8': {} @@ -32045,10 +28610,6 @@ snapshots: '@sindresorhus/is@4.6.0': {} - '@sinonjs/commons@1.8.6': - dependencies: - type-detect: 4.0.8 - '@sinonjs/commons@3.0.0': dependencies: type-detect: 4.0.8 @@ -32057,10 +28618,6 @@ snapshots: dependencies: '@sinonjs/commons': 3.0.0 - '@sinonjs/fake-timers@8.1.0': - dependencies: - '@sinonjs/commons': 1.8.6 - '@smithy/abort-controller@2.0.4': dependencies: '@smithy/types': 2.2.1 @@ -33389,84 +29946,10 @@ snapshots: '@types/express': 4.17.17 file-system-cache: 2.3.0 - '@surma/rollup-plugin-off-main-thread@2.2.3': - dependencies: - ejs: 3.1.9 - json5: 2.2.3 - magic-string: 0.25.9 - string.prototype.matchall: 4.0.8 - '@sushiswap/chainlink-token-list@0.1.0': {} '@sushiswap/default-token-list@43.3.0': {} - '@svgr/babel-plugin-add-jsx-attribute@5.4.0': {} - - '@svgr/babel-plugin-remove-jsx-attribute@5.4.0': {} - - '@svgr/babel-plugin-remove-jsx-empty-expression@5.0.1': {} - - '@svgr/babel-plugin-replace-jsx-attribute-value@5.0.1': {} - - '@svgr/babel-plugin-svg-dynamic-title@5.4.0': {} - - '@svgr/babel-plugin-svg-em-dimensions@5.4.0': {} - - '@svgr/babel-plugin-transform-react-native-svg@5.4.0': {} - - '@svgr/babel-plugin-transform-svg-component@5.5.0': {} - - '@svgr/babel-preset@5.5.0': - dependencies: - '@svgr/babel-plugin-add-jsx-attribute': 5.4.0 - '@svgr/babel-plugin-remove-jsx-attribute': 5.4.0 - '@svgr/babel-plugin-remove-jsx-empty-expression': 5.0.1 - '@svgr/babel-plugin-replace-jsx-attribute-value': 5.0.1 - '@svgr/babel-plugin-svg-dynamic-title': 5.4.0 - '@svgr/babel-plugin-svg-em-dimensions': 5.4.0 - '@svgr/babel-plugin-transform-react-native-svg': 5.4.0 - '@svgr/babel-plugin-transform-svg-component': 5.5.0 - - '@svgr/core@5.5.0': - dependencies: - '@svgr/plugin-jsx': 5.5.0 - camelcase: 6.3.0 - cosmiconfig: 7.1.0 - transitivePeerDependencies: - - supports-color - - '@svgr/hast-util-to-babel-ast@5.5.0': - dependencies: - '@babel/types': 7.24.0 - - '@svgr/plugin-jsx@5.5.0': - dependencies: - '@babel/core': 7.24.4 - '@svgr/babel-preset': 5.5.0 - '@svgr/hast-util-to-babel-ast': 5.5.0 - svg-parser: 2.0.4 - transitivePeerDependencies: - - supports-color - - '@svgr/plugin-svgo@5.5.0': - dependencies: - cosmiconfig: 7.1.0 - deepmerge: 4.3.1 - svgo: 1.3.2 - - '@svgr/webpack@5.5.0': - dependencies: - '@babel/core': 7.24.4 - '@babel/plugin-transform-react-constant-elements': 7.24.1(@babel/core@7.24.4) - '@babel/preset-env': 7.24.4(@babel/core@7.24.4) - '@babel/preset-react': 7.24.1(@babel/core@7.24.4) - '@svgr/core': 5.5.0 - '@svgr/plugin-jsx': 5.5.0 - '@svgr/plugin-svgo': 5.5.0 - loader-utils: 2.0.4 - transitivePeerDependencies: - - supports-color - '@swc/core-darwin-arm64@1.4.2': optional: true @@ -33564,16 +30047,10 @@ snapshots: dependencies: remove-accents: 0.4.2 - '@tanstack/query-core@4.27.0': {} - '@tanstack/query-core@4.36.1': {} '@tanstack/query-core@5.51.16': {} - '@tanstack/query-persist-client-core@4.27.0': - dependencies: - '@tanstack/query-core': 4.27.0 - '@tanstack/react-query-devtools@4.28.0(@tanstack/react-query@5.51.16(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: '@tanstack/match-sorter-utils': 8.8.4 @@ -33583,11 +30060,6 @@ snapshots: superjson: 1.13.1 use-sync-external-store: 1.2.0(react@18.2.0) - '@tanstack/react-query-persist-client@4.28.0(@tanstack/react-query@5.51.16(react@18.2.0))': - dependencies: - '@tanstack/query-persist-client-core': 4.27.0 - '@tanstack/react-query': 5.51.16(react@18.2.0) - '@tanstack/react-query@4.36.1(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.24.4)(@babel/preset-env@7.24.4(@babel/core@7.24.4))(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)': dependencies: '@tanstack/query-core': 4.36.1 @@ -33627,8 +30099,6 @@ snapshots: - supports-color - utf-8-validate - '@tootallnate/once@1.1.2': {} - '@tootallnate/once@2.0.0': {} '@tootallnate/quickjs-emscripten@0.23.0': {} @@ -33779,8 +30249,6 @@ snapshots: transitivePeerDependencies: - debug - '@trysound/sax@0.2.0': {} - '@ts-morph/common@0.11.1': dependencies: fast-glob: 3.3.1 @@ -33906,10 +30374,6 @@ snapshots: '@types/connect': 3.4.35 '@types/node': 20.14.14 - '@types/bonjour@3.5.13': - dependencies: - '@types/node': 22.1.0 - '@types/btoa-lite@1.0.0': {} '@types/cacheable-request@6.0.3': @@ -33942,11 +30406,6 @@ snapshots: dependencies: '@types/node': 20.14.14 - '@types/connect-history-api-fallback@1.5.4': - dependencies: - '@types/express-serve-static-core': 4.17.35 - '@types/node': 22.1.0 - '@types/connect@3.4.35': dependencies: '@types/node': 20.14.14 @@ -34123,8 +30582,6 @@ snapshots: dependencies: '@types/estree': 1.0.1 - '@types/estree@0.0.39': {} - '@types/estree@0.0.51': {} '@types/estree@1.0.1': {} @@ -34176,18 +30633,12 @@ snapshots: dependencies: '@types/unist': 2.0.7 - '@types/html-minifier-terser@6.1.0': {} - '@types/http-assert@1.5.5': {} '@types/http-cache-semantics@4.0.1': {} '@types/http-errors@2.0.1': {} - '@types/http-proxy@1.17.14': - dependencies: - '@types/node': 22.1.0 - '@types/is-ci@3.0.0': dependencies: ci-info: 3.8.0 @@ -34322,10 +30773,6 @@ snapshots: '@types/node': 22.1.0 form-data: 3.0.1 - '@types/node-forge@1.3.11': - dependencies: - '@types/node': 22.1.0 - '@types/node@10.17.60': {} '@types/node@12.20.55': {} @@ -34352,7 +30799,8 @@ snapshots: '@types/normalize-package-data@2.4.1': {} - '@types/parse-json@4.0.2': {} + '@types/parse-json@4.0.2': + optional: true '@types/pbkdf2@3.1.0': dependencies: @@ -34380,8 +30828,6 @@ snapshots: '@types/prop-types@15.7.5': {} - '@types/q@1.5.8': {} - '@types/qs@6.9.15': {} '@types/qs@6.9.8': {} @@ -34410,10 +30856,6 @@ snapshots: dependencies: '@types/react': 18.2.14 - '@types/react-slider@1.3.1': - dependencies: - '@types/react': 18.2.14 - '@types/react-virtualized-auto-sizer@1.0.1': dependencies: '@types/react': 18.2.14 @@ -34437,16 +30879,10 @@ snapshots: dependencies: '@types/node': 20.14.14 - '@types/resolve@1.17.1': - dependencies: - '@types/node': 22.1.0 - '@types/responselike@1.0.0': dependencies: '@types/node': 20.14.14 - '@types/retry@0.12.0': {} - '@types/scheduler@0.16.3': {} '@types/secp256k1@4.0.3': @@ -34468,10 +30904,6 @@ snapshots: '@types/mime': 1.3.2 '@types/node': 20.14.14 - '@types/serve-index@1.9.4': - dependencies: - '@types/express': 4.17.17 - '@types/serve-static@1.15.2': dependencies: '@types/http-errors': 2.0.1 @@ -34491,10 +30923,6 @@ snapshots: '@types/sinonjs__fake-timers@8.1.2': {} - '@types/sockjs@0.3.36': - dependencies: - '@types/node': 22.1.0 - '@types/stack-utils@2.0.1': {} '@types/stylis@4.2.5': {} @@ -34538,35 +30966,12 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@types/yargs@16.0.9': - dependencies: - '@types/yargs-parser': 21.0.3 - '@types/yargs@17.0.24': dependencies: '@types/yargs-parser': 21.0.0 '@types/zrender@4.0.6': {} - '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)': - dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - debug: 4.3.4(supports-color@8.1.1) - eslint: 8.57.0 - graphemer: 1.4.0 - ignore: 5.3.1 - natural-compare-lite: 1.4.0 - semver: 7.6.0 - tsutils: 3.21.0(typescript@5.5.4) - optionalDependencies: - typescript: 5.5.4 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/eslint-plugin@6.7.5(@typescript-eslint/parser@6.7.5(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.9.1 @@ -34587,26 +30992,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/experimental-utils@5.62.0(eslint@8.57.0)(typescript@5.5.4)': - dependencies: - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - eslint: 8.57.0 - transitivePeerDependencies: - - supports-color - - typescript - - '@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.5.4)': - dependencies: - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.5.4) - debug: 4.3.4(supports-color@8.1.1) - eslint: 8.57.0 - optionalDependencies: - typescript: 5.5.4 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/parser@6.7.5(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@typescript-eslint/scope-manager': 6.7.5 @@ -34630,18 +31015,6 @@ snapshots: '@typescript-eslint/types': 6.7.5 '@typescript-eslint/visitor-keys': 6.7.5 - '@typescript-eslint/type-utils@5.62.0(eslint@8.57.0)(typescript@5.5.4)': - dependencies: - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.5.4) - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - debug: 4.3.4(supports-color@8.1.1) - eslint: 8.57.0 - tsutils: 3.21.0(typescript@5.5.4) - optionalDependencies: - typescript: 5.5.4 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/type-utils@6.7.5(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@typescript-eslint/typescript-estree': 6.7.5(typescript@5.5.4) @@ -36386,24 +32759,14 @@ snapshots: mime-types: 2.1.35 negotiator: 0.6.3 - acorn-globals@6.0.0: - dependencies: - acorn: 7.4.1 - acorn-walk: 7.2.0 - acorn-globals@7.0.1: dependencies: acorn: 8.12.0 acorn-walk: 8.2.0 - acorn-import-assertions@1.9.0(acorn@8.11.3): - dependencies: - acorn: 8.11.3 - acorn-import-assertions@1.9.0(acorn@8.12.0): dependencies: acorn: 8.12.0 - optional: true acorn-import-attributes@1.9.5(acorn@8.12.0): dependencies: @@ -36495,11 +32858,6 @@ snapshots: dependencies: ajv: 6.12.6 - ajv-keywords@5.1.0(ajv@8.12.0): - dependencies: - ajv: 8.12.0 - fast-deep-equal: 3.1.3 - ajv@6.12.6: dependencies: fast-deep-equal: 3.1.3 @@ -36561,8 +32919,6 @@ snapshots: slice-ansi: 2.1.0 strip-ansi: 5.2.0 - ansi-html-community@0.0.8: {} - ansi-regex@2.1.1: {} ansi-regex@3.0.1: {} @@ -36589,63 +32945,6 @@ snapshots: ansicolors@0.3.2: {} - antd@5.17.0(date-fns@2.30.0)(moment@2.29.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@ant-design/colors': 7.0.2 - '@ant-design/cssinjs': 1.20.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@ant-design/icons': 5.3.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@ant-design/react-slick': 1.1.2(react@18.2.0) - '@babel/runtime': 7.24.5 - '@ctrl/tinycolor': 3.6.1 - '@rc-component/color-picker': 1.5.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@rc-component/mutate-observer': 1.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@rc-component/tour': 1.14.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@rc-component/trigger': 2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - classnames: 2.5.1 - copy-to-clipboard: 3.3.3 - dayjs: 1.11.10 - qrcode.react: 3.1.0(react@18.2.0) - rc-cascader: 3.25.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-checkbox: 3.2.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-collapse: 3.7.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-dialog: 9.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-drawer: 7.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-dropdown: 4.2.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-field-form: 2.0.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-image: 7.6.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-input: 1.4.5(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-input-number: 9.0.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-mentions: 2.11.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-menu: 9.13.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-motion: 2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-notification: 5.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-pagination: 4.0.4(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-picker: 4.5.0(date-fns@2.30.0)(dayjs@1.11.10)(moment@2.29.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-progress: 4.0.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-rate: 2.12.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-resize-observer: 1.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-segmented: 2.3.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-select: 14.13.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-slider: 10.6.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-steps: 6.0.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-switch: 4.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-table: 7.45.5(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-tabs: 15.0.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-textarea: 1.6.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-tooltip: 6.2.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-tree: 5.8.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-tree-select: 5.20.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-upload: 4.5.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - scroll-into-view-if-needed: 3.1.0 - throttle-debounce: 5.0.0 - transitivePeerDependencies: - - date-fns - - luxon - - moment - antlr4@4.7.1: {} antlr4ts@0.5.0-alpha.4: {} @@ -36764,8 +33063,6 @@ snapshots: get-intrinsic: 1.2.1 is-string: 1.0.7 - array-tree-filter@2.1.0: {} - array-union@2.1.0: {} array-uniq@1.0.3: {} @@ -37166,8 +33463,6 @@ snapshots: dependencies: dequal: 2.0.3 - b4a@1.6.4: {} - babel-code-frame@6.26.0: dependencies: chalk: 1.1.3 @@ -37306,20 +33601,6 @@ snapshots: transitivePeerDependencies: - supports-color - babel-jest@27.5.1(@babel/core@7.24.4): - dependencies: - '@babel/core': 7.24.4 - '@jest/transform': 27.5.1 - '@jest/types': 27.5.1 - '@types/babel__core': 7.20.5 - babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 27.5.1(@babel/core@7.24.4) - chalk: 4.1.2 - graceful-fs: 4.2.11 - slash: 3.0.0 - transitivePeerDependencies: - - supports-color - babel-jest@29.7.0(@babel/core@7.22.10): dependencies: '@babel/core': 7.22.10 @@ -37361,15 +33642,6 @@ snapshots: - supports-color optional: true - babel-loader@8.3.0(@babel/core@7.24.4)(webpack@5.91.0): - dependencies: - '@babel/core': 7.24.4 - find-cache-dir: 3.3.2 - loader-utils: 2.0.4 - make-dir: 3.1.0 - schema-utils: 2.7.1 - webpack: 5.91.0 - babel-messages@6.23.0: dependencies: babel-runtime: 6.26.0 @@ -37388,13 +33660,6 @@ snapshots: transitivePeerDependencies: - supports-color - babel-plugin-jest-hoist@27.5.1: - dependencies: - '@babel/template': 7.24.0 - '@babel/types': 7.24.0 - '@types/babel__core': 7.20.5 - '@types/babel__traverse': 7.20.5 - babel-plugin-jest-hoist@29.6.3: dependencies: '@babel/template': 7.24.0 @@ -37404,13 +33669,10 @@ snapshots: babel-plugin-macros@3.1.0: dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.25.4 cosmiconfig: 7.1.0 resolve: 1.22.8 - - babel-plugin-named-asset-import@0.3.8(@babel/core@7.24.4): - dependencies: - '@babel/core': 7.24.4 + optional: true babel-plugin-polyfill-corejs2@0.4.10(@babel/core@7.24.4): dependencies: @@ -37632,8 +33894,6 @@ snapshots: transitivePeerDependencies: - '@babel/core' - babel-plugin-transform-react-remove-prop-types@0.4.24: {} - babel-plugin-transform-regenerator@6.26.0: dependencies: regenerator-transform: 0.10.1 @@ -37690,6 +33950,7 @@ snapshots: '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.4) '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.4) '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.4) + optional: true babel-preset-env@1.7.0: dependencies: @@ -37726,12 +33987,6 @@ snapshots: transitivePeerDependencies: - supports-color - babel-preset-jest@27.5.1(@babel/core@7.24.4): - dependencies: - '@babel/core': 7.24.4 - babel-plugin-jest-hoist: 27.5.1 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.4) - babel-preset-jest@29.6.3(@babel/core@7.22.10): dependencies: '@babel/core': 7.22.10 @@ -37752,28 +34007,6 @@ snapshots: babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.4) optional: true - babel-preset-react-app@10.0.1: - dependencies: - '@babel/core': 7.24.4 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.24.4) - '@babel/plugin-proposal-decorators': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.24.4) - '@babel/plugin-proposal-numeric-separator': 7.18.6(@babel/core@7.24.4) - '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.24.4) - '@babel/plugin-proposal-private-methods': 7.18.6(@babel/core@7.24.4) - '@babel/plugin-proposal-private-property-in-object': 7.21.11(@babel/core@7.24.4) - '@babel/plugin-transform-flow-strip-types': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-react-display-name': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-runtime': 7.24.3(@babel/core@7.24.4) - '@babel/preset-env': 7.24.4(@babel/core@7.24.4) - '@babel/preset-react': 7.24.1(@babel/core@7.24.4) - '@babel/preset-typescript': 7.22.5(@babel/core@7.24.4) - '@babel/runtime': 7.24.5 - babel-plugin-macros: 3.1.0 - babel-plugin-transform-react-remove-prop-types: 0.4.24 - transitivePeerDependencies: - - supports-color - babel-register@6.26.0: dependencies: babel-core: 6.26.3 @@ -37859,8 +34092,6 @@ snapshots: basic-ftp@5.0.3: {} - batch@0.6.1: {} - bcrypt-pbkdf@1.0.2: dependencies: tweetnacl: 0.14.5 @@ -37879,14 +34110,6 @@ snapshots: dependencies: is-windows: 1.0.2 - bfj@7.1.0: - dependencies: - bluebird: 3.7.2 - check-types: 11.2.3 - hoopy: 0.1.4 - jsonpath: 1.1.1 - tryer: 1.0.1 - big-integer@1.6.51: {} big.js@5.2.2: {} @@ -37974,11 +34197,6 @@ snapshots: transitivePeerDependencies: - supports-color - bonjour-service@1.2.1: - dependencies: - fast-deep-equal: 3.1.3 - multicast-dns: 7.2.5 - boolbase@1.0.0: {} borsh@0.7.0: @@ -38055,8 +34273,6 @@ snapshots: browser-or-node@1.3.0: {} - browser-process-hrtime@1.0.0: {} - browser-stdout@1.3.1: {} browserify-aes@1.2.0: @@ -38308,11 +34524,6 @@ snapshots: callsites@3.1.0: {} - camel-case@4.1.2: - dependencies: - pascal-case: 3.1.2 - tslib: 2.7.0 - camelcase-css@2.0.1: {} camelcase-keys@6.2.2: @@ -38331,13 +34542,6 @@ snapshots: camelize@1.0.1: {} - caniuse-api@3.0.0: - dependencies: - browserslist: 4.23.0 - caniuse-lite: 1.0.30001611 - lodash.memoize: 4.1.2 - lodash.uniq: 4.5.0 - caniuse-lite@1.0.30001611: {} canonical-weth@1.4.0: {} @@ -38347,8 +34551,6 @@ snapshots: ansicolors: 0.3.2 redeyed: 2.1.1 - case-sensitive-paths-webpack-plugin@2.4.0: {} - caseless@0.12.0: {} cbor@8.1.0: @@ -38411,8 +34613,6 @@ snapshots: char-regex@1.0.2: {} - char-regex@2.0.1: {} - char-spinner@1.0.1: {} character-entities-html4@2.1.0: {} @@ -38439,8 +34639,6 @@ snapshots: dependencies: get-func-name: 2.0.2 - check-types@11.2.3: {} - checkpoint-store@1.1.0: dependencies: functional-red-black-tree: 1.0.1 @@ -38566,12 +34764,6 @@ snapshots: classnames@2.3.2: {} - classnames@2.5.1: {} - - clean-css@5.3.3: - dependencies: - source-map: 0.6.1 - clean-regexp@1.0.0: dependencies: escape-string-regexp: 1.0.5 @@ -38692,12 +34884,6 @@ snapshots: co@4.6.0: {} - coa@2.0.2: - dependencies: - '@types/q': 1.5.8 - chalk: 2.4.2 - q: 1.5.1 - code-block-writer@10.1.1: {} code-point-at@1.1.0: {} @@ -38729,20 +34915,8 @@ snapshots: color-name@1.1.4: {} - color-string@1.9.1: - dependencies: - color-name: 1.1.4 - simple-swizzle: 0.2.2 - color-support@1.1.3: {} - color@4.2.3: - dependencies: - color-convert: 2.0.1 - color-string: 1.9.1 - - colord@2.9.3: {} - colorette@1.4.0: {} colorette@2.0.20: {} @@ -38791,12 +34965,8 @@ snapshots: commander@7.2.0: {} - commander@8.3.0: {} - commander@9.5.0: {} - common-tags@1.8.2: {} - commondir@1.0.1: {} component-emitter@1.3.0: {} @@ -38824,8 +34994,6 @@ snapshots: transitivePeerDependencies: - supports-color - compute-scroll-into-view@3.1.0: {} - computeds@0.0.1: {} concat-map@0.0.1: {} @@ -38844,10 +35012,6 @@ snapshots: readable-stream: 3.6.2 typedarray: 0.0.6 - confusing-browser-globals@1.0.11: {} - - connect-history-api-fallback@2.0.0: {} - connect@3.7.0: dependencies: debug: 2.6.9 @@ -38926,8 +35090,6 @@ snapshots: core-js@2.6.12: {} - core-js@3.38.0: {} - core-util-is@1.0.2: {} core-util-is@1.0.3: {} @@ -38944,14 +35106,6 @@ snapshots: js-yaml: 3.14.1 parse-json: 4.0.0 - cosmiconfig@6.0.0: - dependencies: - '@types/parse-json': 4.0.2 - import-fresh: 3.3.0 - parse-json: 5.2.0 - path-type: 4.0.0 - yaml: 1.10.2 - cosmiconfig@7.1.0: dependencies: '@types/parse-json': 4.0.2 @@ -38959,6 +35113,7 @@ snapshots: parse-json: 5.2.0 path-type: 4.0.0 yaml: 1.10.2 + optional: true cosmiconfig@8.3.6(typescript@5.5.4): dependencies: @@ -39091,22 +35246,8 @@ snapshots: crypto-random-string@2.0.0: {} - css-blank-pseudo@3.0.3(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - css-color-keywords@1.0.0: {} - css-declaration-sorter@6.4.1(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - css-has-pseudo@3.0.4(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - css-loader@6.8.1(webpack@5.91.0(esbuild@0.18.20)): dependencies: icss-utils: 5.1.0(postcss@8.4.23) @@ -39119,51 +35260,8 @@ snapshots: semver: 7.5.4 webpack: 5.91.0(esbuild@0.18.20) - css-loader@6.8.1(webpack@5.91.0): - dependencies: - icss-utils: 5.1.0(postcss@8.4.23) - postcss: 8.4.23 - postcss-modules-extract-imports: 3.0.0(postcss@8.4.23) - postcss-modules-local-by-default: 4.0.3(postcss@8.4.23) - postcss-modules-scope: 3.0.0(postcss@8.4.23) - postcss-modules-values: 4.0.0(postcss@8.4.23) - postcss-value-parser: 4.2.0 - semver: 7.5.4 - webpack: 5.91.0 - css-mediaquery@0.1.2: {} - css-minimizer-webpack-plugin@3.4.1(webpack@5.91.0): - dependencies: - cssnano: 5.1.15(postcss@8.4.23) - jest-worker: 27.5.1 - postcss: 8.4.23 - schema-utils: 4.2.0 - serialize-javascript: 6.0.2 - source-map: 0.6.1 - webpack: 5.91.0 - - css-prefers-color-scheme@6.0.3(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - css-select-base-adapter@0.1.1: {} - - css-select@2.1.0: - dependencies: - boolbase: 1.0.0 - css-what: 3.4.2 - domutils: 1.7.0 - nth-check: 1.0.2 - - css-select@4.3.0: - dependencies: - boolbase: 1.0.0 - css-what: 6.1.0 - domhandler: 4.3.1 - domutils: 2.8.0 - nth-check: 2.1.1 - css-select@5.1.0: dependencies: boolbase: 1.0.0 @@ -39178,81 +35276,17 @@ snapshots: css-color-keywords: 1.0.0 postcss-value-parser: 4.2.0 - css-tree@1.0.0-alpha.37: - dependencies: - mdn-data: 2.0.4 - source-map: 0.6.1 - - css-tree@1.1.3: - dependencies: - mdn-data: 2.0.14 - source-map: 0.6.1 - css-tree@2.3.1: dependencies: mdn-data: 2.0.30 source-map-js: 1.2.0 - css-what@3.4.2: {} - css-what@6.1.0: {} - cssdb@7.11.2: {} - cssesc@3.0.0: {} - cssnano-preset-default@5.2.14(postcss@8.4.23): - dependencies: - css-declaration-sorter: 6.4.1(postcss@8.4.23) - cssnano-utils: 3.1.0(postcss@8.4.23) - postcss: 8.4.23 - postcss-calc: 8.2.4(postcss@8.4.23) - postcss-colormin: 5.3.1(postcss@8.4.23) - postcss-convert-values: 5.1.3(postcss@8.4.23) - postcss-discard-comments: 5.1.2(postcss@8.4.23) - postcss-discard-duplicates: 5.1.0(postcss@8.4.23) - postcss-discard-empty: 5.1.1(postcss@8.4.23) - postcss-discard-overridden: 5.1.0(postcss@8.4.23) - postcss-merge-longhand: 5.1.7(postcss@8.4.23) - postcss-merge-rules: 5.1.4(postcss@8.4.23) - postcss-minify-font-values: 5.1.0(postcss@8.4.23) - postcss-minify-gradients: 5.1.1(postcss@8.4.23) - postcss-minify-params: 5.1.4(postcss@8.4.23) - postcss-minify-selectors: 5.2.1(postcss@8.4.23) - postcss-normalize-charset: 5.1.0(postcss@8.4.23) - postcss-normalize-display-values: 5.1.0(postcss@8.4.23) - postcss-normalize-positions: 5.1.1(postcss@8.4.23) - postcss-normalize-repeat-style: 5.1.1(postcss@8.4.23) - postcss-normalize-string: 5.1.0(postcss@8.4.23) - postcss-normalize-timing-functions: 5.1.0(postcss@8.4.23) - postcss-normalize-unicode: 5.1.1(postcss@8.4.23) - postcss-normalize-url: 5.1.0(postcss@8.4.23) - postcss-normalize-whitespace: 5.1.1(postcss@8.4.23) - postcss-ordered-values: 5.1.3(postcss@8.4.23) - postcss-reduce-initial: 5.1.2(postcss@8.4.23) - postcss-reduce-transforms: 5.1.0(postcss@8.4.23) - postcss-svgo: 5.1.0(postcss@8.4.23) - postcss-unique-selectors: 5.1.1(postcss@8.4.23) - - cssnano-utils@3.1.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - cssnano@5.1.15(postcss@8.4.23): - dependencies: - cssnano-preset-default: 5.2.14(postcss@8.4.23) - lilconfig: 2.1.0 - postcss: 8.4.23 - yaml: 1.10.2 - - csso@4.2.0: - dependencies: - css-tree: 1.1.3 - cssom@0.3.8: {} - cssom@0.4.4: {} - cssom@0.5.0: {} cssstyle@2.3.0: @@ -39439,12 +35473,6 @@ snapshots: data-uri-to-buffer@5.0.1: {} - data-urls@2.0.0: - dependencies: - abab: 2.0.6 - whatwg-mimetype: 2.3.0 - whatwg-url: 8.7.0 - data-urls@3.0.2: dependencies: abab: 2.0.6 @@ -39484,8 +35512,6 @@ snapshots: date-fns@3.3.1: {} - dayjs@1.11.10: {} - dayjs@1.11.11: {} de-indent@1.0.2: {} @@ -39551,8 +35577,6 @@ snapshots: dedent-js@1.0.1: {} - dedent@0.7.0: {} - dedent@1.5.1(babel-plugin-macros@3.1.0): optionalDependencies: babel-plugin-macros: 3.1.0 @@ -39596,10 +35620,6 @@ snapshots: execa: 7.2.0 titleize: 3.0.0 - default-gateway@6.0.3: - dependencies: - execa: 5.1.1 - defaults@1.0.4: dependencies: clone: 1.0.4 @@ -39744,19 +35764,10 @@ snapshots: detect-node-es@1.1.0: {} - detect-node@2.1.0: {} - detect-package-manager@2.0.1: dependencies: execa: 5.1.1 - detect-port-alt@1.1.6: - dependencies: - address: 1.2.2 - debug: 2.6.9 - transitivePeerDependencies: - - supports-color - detect-port@1.5.1: dependencies: address: 1.2.2 @@ -39820,8 +35831,6 @@ snapshots: didyoumean@1.2.2: {} - diff-sequences@27.5.1: {} - diff-sequences@29.6.3: {} diff@3.5.0: {} @@ -39851,10 +35860,6 @@ snapshots: dlv@1.1.3: {} - dns-packet@5.6.1: - dependencies: - '@leichtgewicht/ip-codec': 2.0.5 - docker-modem@1.0.9: dependencies: JSONStream: 1.3.2 @@ -39905,21 +35910,6 @@ snapshots: minimist: 1.2.8 rc: 1.2.8 - dom-converter@0.2.0: - dependencies: - utila: 0.4.0 - - dom-serializer@0.2.2: - dependencies: - domelementtype: 2.3.0 - entities: 2.2.0 - - dom-serializer@1.4.1: - dependencies: - domelementtype: 2.3.0 - domhandler: 4.3.1 - entities: 2.2.0 - dom-serializer@2.0.0: dependencies: domelementtype: 2.3.0 @@ -39928,48 +35918,22 @@ snapshots: dom-walk@0.1.2: {} - domelementtype@1.3.1: {} - domelementtype@2.3.0: {} - domexception@2.0.1: - dependencies: - webidl-conversions: 5.0.0 - domexception@4.0.0: dependencies: webidl-conversions: 7.0.0 - domhandler@4.3.1: - dependencies: - domelementtype: 2.3.0 - domhandler@5.0.3: dependencies: domelementtype: 2.3.0 - domutils@1.7.0: - dependencies: - dom-serializer: 0.2.2 - domelementtype: 1.3.1 - - domutils@2.8.0: - dependencies: - dom-serializer: 1.4.1 - domelementtype: 2.3.0 - domhandler: 4.3.1 - domutils@3.1.0: dependencies: dom-serializer: 2.0.0 domelementtype: 2.3.0 domhandler: 5.0.3 - dot-case@3.0.4: - dependencies: - no-case: 3.0.4 - tslib: 2.7.0 - dotenv-cli@6.0.0: dependencies: cross-spawn: 7.0.3 @@ -39979,12 +35943,8 @@ snapshots: dotenv-expand@10.0.0: {} - dotenv-expand@5.1.0: {} - dotenv-expand@8.0.3: {} - dotenv@10.0.0: {} - dotenv@14.3.2: {} dotenv@16.0.3: {} @@ -40143,12 +36103,8 @@ snapshots: minimalistic-assert: 1.0.1 minimalistic-crypto-utils: 1.0.1 - emittery@0.10.2: {} - emittery@0.13.1: {} - emittery@0.8.1: {} - emoji-regex@10.2.1: {} emoji-regex@7.0.3: {} @@ -40214,8 +36170,6 @@ snapshots: ensure-posix-path@1.1.1: {} - entities@2.2.0: {} - entities@4.5.0: {} env-paths@2.2.1: {} @@ -40690,33 +36644,6 @@ snapshots: dependencies: eslint: 8.57.0 - eslint-config-react-app@7.0.1(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4))(eslint@8.57.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10))(typescript@5.5.4): - dependencies: - '@babel/core': 7.24.4 - '@babel/eslint-parser': 7.22.15(@babel/core@7.24.4)(eslint@8.57.0) - '@rushstack/eslint-patch': 1.3.3 - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - babel-preset-react-app: 10.0.1 - confusing-browser-globals: 1.0.11 - eslint: 8.57.0 - eslint-plugin-flowtype: 8.0.3(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4))(eslint@8.57.0) - eslint-plugin-import: 2.28.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0) - eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10))(typescript@5.5.4) - eslint-plugin-jsx-a11y: 6.7.1(eslint@8.57.0) - eslint-plugin-react: 7.33.2(eslint@8.57.0) - eslint-plugin-react-hooks: 4.6.0(eslint@8.57.0) - eslint-plugin-testing-library: 5.11.1(eslint@8.57.0)(typescript@5.5.4) - optionalDependencies: - typescript: 5.5.4 - transitivePeerDependencies: - - '@babel/plugin-syntax-flow' - - '@babel/plugin-transform-react-jsx' - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - jest - - supports-color - eslint-config-turbo@2.0.5(eslint@8.43.0): dependencies: eslint: 8.43.0 @@ -40793,16 +36720,6 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): - dependencies: - debug: 3.2.7 - optionalDependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - eslint: 8.57.0 - eslint-import-resolver-node: 0.3.9 - transitivePeerDependencies: - - supports-color - eslint-module-utils@2.8.0(@typescript-eslint/parser@6.7.5(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.0(@typescript-eslint/parser@6.7.5(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.28.1)(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 3.2.7 @@ -40831,41 +36748,6 @@ snapshots: eslint: 8.57.0 ignore: 5.2.4 - eslint-plugin-flowtype@8.0.3(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4))(eslint@8.57.0): - dependencies: - '@babel/plugin-syntax-flow': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-react-jsx': 7.23.4(@babel/core@7.24.4) - eslint: 8.57.0 - lodash: 4.17.21 - string-natural-compare: 3.0.1 - - eslint-plugin-import@2.28.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0): - dependencies: - array-includes: 3.1.6 - array.prototype.findlastindex: 1.2.2 - array.prototype.flat: 1.3.1 - array.prototype.flatmap: 1.3.1 - debug: 3.2.7 - doctrine: 2.1.0 - eslint: 8.57.0 - eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) - has: 1.0.3 - is-core-module: 2.13.0 - is-glob: 4.0.3 - minimatch: 3.1.2 - object.fromentries: 2.0.6 - object.groupby: 1.0.0 - object.values: 1.1.6 - semver: 6.3.1 - tsconfig-paths: 3.14.2 - optionalDependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - supports-color - eslint-plugin-import@2.28.1(@typescript-eslint/parser@6.7.5(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.0)(eslint@8.57.0): dependencies: array-includes: 3.1.6 @@ -40920,17 +36802,6 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-jest@25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10))(typescript@5.5.4): - dependencies: - '@typescript-eslint/experimental-utils': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - eslint: 8.57.0 - optionalDependencies: - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) - jest: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10) - transitivePeerDependencies: - - supports-color - - typescript - eslint-plugin-jest@27.4.2(@typescript-eslint/eslint-plugin@6.7.5(@typescript-eslint/parser@6.7.5(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.14)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4)))(typescript@5.5.4): dependencies: '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.5.4) @@ -41026,14 +36897,6 @@ snapshots: - supports-color - typescript - eslint-plugin-testing-library@5.11.1(eslint@8.57.0)(typescript@5.5.4): - dependencies: - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - eslint: 8.57.0 - transitivePeerDependencies: - - supports-color - - typescript - eslint-plugin-testing-library@6.1.0(eslint@8.57.0)(typescript@5.5.4): dependencies: '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.5.4) @@ -41101,16 +36964,6 @@ snapshots: eslint-visitor-keys@3.4.3: {} - eslint-webpack-plugin@3.2.0(eslint@8.57.0)(webpack@5.91.0): - dependencies: - '@types/eslint': 8.44.4 - eslint: 8.57.0 - jest-worker: 28.1.3 - micromatch: 4.0.5 - normalize-path: 3.0.0 - schema-utils: 4.2.0 - webpack: 5.91.0 - eslint@5.16.0: dependencies: '@babel/code-frame': 7.22.10 @@ -41251,8 +37104,6 @@ snapshots: acorn-jsx: 5.3.2(acorn@8.12.0) eslint-visitor-keys: 3.4.3 - esprima@1.2.2: {} - esprima@2.7.3: {} esprima@4.0.1: {} @@ -41286,8 +37137,6 @@ snapshots: '@types/estree-jsx': 1.0.1 '@types/unist': 2.0.7 - estree-walker@1.0.1: {} - estree-walker@2.0.2: {} estree-walker@3.0.3: @@ -41797,15 +37646,6 @@ snapshots: transitivePeerDependencies: - supports-color - expand-template@2.0.3: {} - - expect@27.5.1: - dependencies: - '@jest/types': 27.5.1 - jest-get-type: 27.5.1 - jest-matcher-utils: 27.5.1 - jest-message-util: 27.5.1 - expect@29.7.0: dependencies: '@jest/expect-utils': 29.7.0 @@ -41920,8 +37760,6 @@ snapshots: fast-diff@1.3.0: {} - fast-fifo@1.3.2: {} - fast-glob@3.3.1: dependencies: '@nodelib/fs.stat': 2.0.5 @@ -41970,10 +37808,6 @@ snapshots: dependencies: format: 0.2.2 - faye-websocket@0.11.4: - dependencies: - websocket-driver: 0.7.4 - fb-watchman@2.0.2: dependencies: bser: 2.1.1 @@ -42011,12 +37845,6 @@ snapshots: dependencies: flat-cache: 3.0.4 - file-loader@6.2.0(webpack@5.91.0): - dependencies: - loader-utils: 2.0.4 - schema-utils: 3.3.0 - webpack: 5.91.0 - file-selector@0.6.0: dependencies: tslib: 2.6.2 @@ -42032,8 +37860,6 @@ snapshots: dependencies: minimatch: 5.1.6 - filesize@8.0.7: {} - filing-cabinet@4.1.6: dependencies: app-module-path: 2.2.0 @@ -42173,18 +37999,10 @@ snapshots: flow-enums-runtime@0.0.6: {} - flow-parser@0.156.0: {} - flow-parser@0.206.0: {} flow-parser@0.214.0: {} - flow-remove-types@2.156.0: - dependencies: - flow-parser: 0.156.0 - pirates: 3.0.2 - vlq: 0.2.3 - flow-stoplight@1.0.0: {} fmix@0.1.0: @@ -42217,27 +38035,6 @@ snapshots: forever-agent@0.6.1: {} - fork-ts-checker-webpack-plugin@6.5.3(eslint@8.57.0)(typescript@5.5.4)(vue-template-compiler@2.7.16)(webpack@5.91.0): - dependencies: - '@babel/code-frame': 7.24.2 - '@types/json-schema': 7.0.15 - chalk: 4.1.2 - chokidar: 3.5.3 - cosmiconfig: 6.0.0 - deepmerge: 4.3.1 - fs-extra: 9.1.0 - glob: 7.2.3 - memfs: 3.5.3 - minimatch: 3.1.2 - schema-utils: 2.7.0 - semver: 7.6.0 - tapable: 1.1.3 - typescript: 5.5.4 - webpack: 5.91.0 - optionalDependencies: - eslint: 8.57.0 - vue-template-compiler: 2.7.16 - form-data-encoder@1.7.1: {} form-data@2.3.3: @@ -42358,8 +38155,6 @@ snapshots: dependencies: minipass: 3.3.6 - fs-monkey@1.0.6: {} - fs-readdir-recursive@1.1.0: {} fs.realpath@1.0.0: {} @@ -42561,8 +38356,6 @@ snapshots: git-hooks-list@3.1.0: {} - github-from-package@0.0.0: {} - github-slugger@1.5.0: {} glob-parent@5.1.2: @@ -42831,8 +38624,6 @@ snapshots: uncrypto: 0.1.3 unenv: 1.9.0 - handle-thing@2.0.1: {} - handlebars@4.7.8: dependencies: minimist: 1.2.8 @@ -43048,8 +38839,6 @@ snapshots: - supports-color - utf-8-validate - harmony-reflect@1.6.2: {} - has-ansi@2.0.0: dependencies: ansi-regex: 2.1.1 @@ -43188,64 +38977,22 @@ snapshots: os-homedir: 1.0.2 os-tmpdir: 1.0.2 - hoopy@0.1.4: {} - hosted-git-info@2.8.9: {} hot-shots@6.8.7: optionalDependencies: unix-dgram: 2.0.6 - hpack.js@2.1.6: - dependencies: - inherits: 2.0.4 - obuf: 1.1.2 - readable-stream: 2.3.8 - wbuf: 1.7.3 - hpagent@0.1.2: {} - html-encoding-sniffer@2.0.1: - dependencies: - whatwg-encoding: 1.0.5 - html-encoding-sniffer@3.0.0: dependencies: whatwg-encoding: 2.0.0 - html-entities@2.5.2: {} - html-escaper@2.0.2: {} - html-minifier-terser@6.1.0: - dependencies: - camel-case: 4.1.2 - clean-css: 5.3.3 - commander: 8.3.0 - he: 1.2.0 - param-case: 3.0.4 - relateurl: 0.2.7 - terser: 5.30.3 - html-tags@3.3.1: {} - html-webpack-plugin@5.6.0(webpack@5.91.0): - dependencies: - '@types/html-minifier-terser': 6.1.0 - html-minifier-terser: 6.1.0 - lodash: 4.17.21 - pretty-error: 4.0.0 - tapable: 2.2.1 - optionalDependencies: - webpack: 5.91.0 - - htmlparser2@6.1.0: - dependencies: - domelementtype: 2.3.0 - domhandler: 4.3.1 - domutils: 2.8.0 - entities: 2.2.0 - htmlparser2@8.0.2: dependencies: domelementtype: 2.3.0 @@ -43262,20 +39009,11 @@ snapshots: http-cache-semantics@4.1.1: {} - http-deceiver@1.2.7: {} - http-errors@1.4.0: dependencies: inherits: 2.0.1 statuses: 1.5.0 - http-errors@1.6.3: - dependencies: - depd: 1.1.2 - inherits: 2.0.3 - setprototypeof: 1.1.0 - statuses: 1.5.0 - http-errors@1.7.3: dependencies: depd: 1.1.2 @@ -43296,14 +39034,6 @@ snapshots: http-parser-js@0.5.8: {} - http-proxy-agent@4.0.1: - dependencies: - '@tootallnate/once': 1.1.2 - agent-base: 6.0.2 - debug: 4.3.4(supports-color@8.1.1) - transitivePeerDependencies: - - supports-color - http-proxy-agent@5.0.0: dependencies: '@tootallnate/once': 2.0.0 @@ -43319,18 +39049,6 @@ snapshots: transitivePeerDependencies: - supports-color - http-proxy-middleware@2.0.6(@types/express@4.17.17): - dependencies: - '@types/http-proxy': 1.17.14 - http-proxy: 1.18.1 - is-glob: 4.0.3 - is-plain-obj: 3.0.0 - micromatch: 4.0.5 - optionalDependencies: - '@types/express': 4.17.17 - transitivePeerDependencies: - - debug - http-proxy@1.18.1: dependencies: eventemitter3: 4.0.7 @@ -43433,14 +39151,8 @@ snapshots: idb-keyval@6.2.1: {} - idb@7.1.1: {} - idb@8.0.0: {} - identity-obj-proxy@3.0.0: - dependencies: - harmony-reflect: 1.6.2 - idna-uts46-hx@2.3.1: dependencies: punycode: 2.1.0 @@ -43468,7 +39180,8 @@ snapshots: immediate@3.3.0: {} - immer@9.0.21: {} + immer@9.0.21: + optional: true immutable@4.3.2: {} @@ -43517,8 +39230,6 @@ snapshots: inherits@2.0.1: {} - inherits@2.0.3: {} - inherits@2.0.4: {} ini@1.3.8: {} @@ -43589,8 +39300,6 @@ snapshots: ipaddr.js@1.9.1: {} - ipaddr.js@2.2.0: {} - iron-webcrypto@1.0.0: {} is-absolute-url@3.0.3: {} @@ -43631,8 +39340,6 @@ snapshots: is-arrayish@0.2.1: {} - is-arrayish@0.3.2: {} - is-async-function@2.0.0: dependencies: has-tostringtag: 1.0.2 @@ -43764,8 +39471,6 @@ snapshots: is-map@2.0.2: {} - is-module@1.0.0: {} - is-nan@1.3.2: dependencies: call-bind: 1.0.2 @@ -43795,8 +39500,6 @@ snapshots: is-plain-obj@2.1.0: {} - is-plain-obj@3.0.0: {} - is-plain-obj@4.1.0: {} is-plain-object@2.0.4: @@ -43826,8 +39529,6 @@ snapshots: is-relative-path@1.0.2: {} - is-root@2.1.0: {} - is-set@2.0.2: {} is-shared-array-buffer@1.0.2: @@ -44063,42 +39764,12 @@ snapshots: - bufferutil - utf-8-validate - jest-changed-files@27.5.1: - dependencies: - '@jest/types': 27.5.1 - execa: 5.1.1 - throat: 6.0.2 - jest-changed-files@29.7.0: dependencies: execa: 5.1.1 jest-util: 29.7.0 p-limit: 3.1.0 - jest-circus@27.5.1: - dependencies: - '@jest/environment': 27.5.1 - '@jest/test-result': 27.5.1 - '@jest/types': 27.5.1 - '@types/node': 22.1.0 - chalk: 4.1.2 - co: 4.6.0 - dedent: 0.7.0 - expect: 27.5.1 - is-generator-fn: 2.1.0 - jest-each: 27.5.1 - jest-matcher-utils: 27.5.1 - jest-message-util: 27.5.1 - jest-runtime: 27.5.1 - jest-snapshot: 27.5.1 - jest-util: 27.5.1 - pretty-format: 27.5.1 - slash: 3.0.0 - stack-utils: 2.0.6 - throat: 6.0.2 - transitivePeerDependencies: - - supports-color - jest-circus@29.7.0(babel-plugin-macros@3.1.0): dependencies: '@jest/environment': 29.7.0 @@ -44125,27 +39796,6 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10): - dependencies: - '@jest/core': 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10) - '@jest/test-result': 27.5.1 - '@jest/types': 27.5.1 - chalk: 4.1.2 - exit: 0.1.2 - graceful-fs: 4.2.11 - import-local: 3.1.0 - jest-config: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10) - jest-util: 27.5.1 - jest-validate: 27.5.1 - prompts: 2.4.2 - yargs: 16.2.0 - transitivePeerDependencies: - - bufferutil - - canvas - - supports-color - - ts-node - - utf-8-validate - jest-cli@29.7.0(@types/node@20.14.14)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4)): dependencies: '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4)) @@ -44165,40 +39815,6 @@ snapshots: - supports-color - ts-node - jest-config@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10): - dependencies: - '@babel/core': 7.24.4 - '@jest/test-sequencer': 27.5.1 - '@jest/types': 27.5.1 - babel-jest: 27.5.1(@babel/core@7.24.4) - chalk: 4.1.2 - ci-info: 3.8.0 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 27.5.1 - jest-environment-jsdom: 27.5.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) - jest-environment-node: 27.5.1 - jest-get-type: 27.5.1 - jest-jasmine2: 27.5.1 - jest-regex-util: 27.5.1 - jest-resolve: 27.5.1 - jest-runner: 27.5.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) - jest-util: 27.5.1 - jest-validate: 27.5.1 - micromatch: 4.0.5 - parse-json: 5.2.0 - pretty-format: 27.5.1 - slash: 3.0.0 - strip-json-comments: 3.1.1 - optionalDependencies: - ts-node: 10.9.2(@types/node@22.1.0)(typescript@5.5.4) - transitivePeerDependencies: - - bufferutil - - canvas - - supports-color - - utf-8-validate - jest-config@29.7.0(@types/node@20.14.14)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4)): dependencies: '@babel/core': 7.22.10 @@ -44261,13 +39877,6 @@ snapshots: - babel-plugin-macros - supports-color - jest-diff@27.5.1: - dependencies: - chalk: 4.1.2 - diff-sequences: 27.5.1 - jest-get-type: 27.5.1 - pretty-format: 27.5.1 - jest-diff@29.7.0: dependencies: chalk: 4.1.2 @@ -44275,22 +39884,10 @@ snapshots: jest-get-type: 29.6.3 pretty-format: 29.7.0 - jest-docblock@27.5.1: - dependencies: - detect-newline: 3.1.0 - jest-docblock@29.7.0: dependencies: detect-newline: 3.1.0 - jest-each@27.5.1: - dependencies: - '@jest/types': 27.5.1 - chalk: 4.1.2 - jest-get-type: 27.5.1 - jest-util: 27.5.1 - pretty-format: 27.5.1 - jest-each@29.7.0: dependencies: '@jest/types': 29.6.3 @@ -44299,21 +39896,6 @@ snapshots: jest-util: 29.7.0 pretty-format: 29.7.0 - jest-environment-jsdom@27.5.1(bufferutil@4.0.8)(utf-8-validate@5.0.10): - dependencies: - '@jest/environment': 27.5.1 - '@jest/fake-timers': 27.5.1 - '@jest/types': 27.5.1 - '@types/node': 22.1.0 - jest-mock: 27.5.1 - jest-util: 27.5.1 - jsdom: 16.7.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - bufferutil - - canvas - - supports-color - - utf-8-validate - jest-environment-jsdom@29.7.0(bufferutil@4.0.8)(utf-8-validate@6.0.3): dependencies: '@jest/environment': 29.7.0 @@ -44329,15 +39911,6 @@ snapshots: - supports-color - utf-8-validate - jest-environment-node@27.5.1: - dependencies: - '@jest/environment': 27.5.1 - '@jest/fake-timers': 27.5.1 - '@jest/types': 27.5.1 - '@types/node': 22.1.0 - jest-mock: 27.5.1 - jest-util: 27.5.1 - jest-environment-node@29.7.0: dependencies: '@jest/environment': 29.7.0 @@ -44347,27 +39920,8 @@ snapshots: jest-mock: 29.7.0 jest-util: 29.7.0 - jest-get-type@27.5.1: {} - jest-get-type@29.6.3: {} - jest-haste-map@27.5.1: - dependencies: - '@jest/types': 27.5.1 - '@types/graceful-fs': 4.1.6 - '@types/node': 22.1.0 - anymatch: 3.1.3 - fb-watchman: 2.0.2 - graceful-fs: 4.2.11 - jest-regex-util: 27.5.1 - jest-serializer: 27.5.1 - jest-util: 27.5.1 - jest-worker: 27.5.1 - micromatch: 4.0.5 - walker: 1.0.8 - optionalDependencies: - fsevents: 2.3.3 - jest-haste-map@29.7.0: dependencies: '@jest/types': 29.6.3 @@ -44384,45 +39938,11 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - jest-jasmine2@27.5.1: - dependencies: - '@jest/environment': 27.5.1 - '@jest/source-map': 27.5.1 - '@jest/test-result': 27.5.1 - '@jest/types': 27.5.1 - '@types/node': 22.1.0 - chalk: 4.1.2 - co: 4.6.0 - expect: 27.5.1 - is-generator-fn: 2.1.0 - jest-each: 27.5.1 - jest-matcher-utils: 27.5.1 - jest-message-util: 27.5.1 - jest-runtime: 27.5.1 - jest-snapshot: 27.5.1 - jest-util: 27.5.1 - pretty-format: 27.5.1 - throat: 6.0.2 - transitivePeerDependencies: - - supports-color - - jest-leak-detector@27.5.1: - dependencies: - jest-get-type: 27.5.1 - pretty-format: 27.5.1 - jest-leak-detector@29.7.0: dependencies: jest-get-type: 29.6.3 pretty-format: 29.7.0 - jest-matcher-utils@27.5.1: - dependencies: - chalk: 4.1.2 - jest-diff: 27.5.1 - jest-get-type: 27.5.1 - pretty-format: 27.5.1 - jest-matcher-utils@29.7.0: dependencies: chalk: 4.1.2 @@ -44430,30 +39950,6 @@ snapshots: jest-get-type: 29.6.3 pretty-format: 29.7.0 - jest-message-util@27.5.1: - dependencies: - '@babel/code-frame': 7.24.2 - '@jest/types': 27.5.1 - '@types/stack-utils': 2.0.1 - chalk: 4.1.2 - graceful-fs: 4.2.11 - micromatch: 4.0.5 - pretty-format: 27.5.1 - slash: 3.0.0 - stack-utils: 2.0.6 - - jest-message-util@28.1.3: - dependencies: - '@babel/code-frame': 7.24.2 - '@jest/types': 28.1.3 - '@types/stack-utils': 2.0.1 - chalk: 4.1.2 - graceful-fs: 4.2.11 - micromatch: 4.0.5 - pretty-format: 28.1.3 - slash: 3.0.0 - stack-utils: 2.0.6 - jest-message-util@29.7.0: dependencies: '@babel/code-frame': 7.24.2 @@ -44466,39 +39962,18 @@ snapshots: slash: 3.0.0 stack-utils: 2.0.6 - jest-mock@27.5.1: - dependencies: - '@jest/types': 27.5.1 - '@types/node': 22.1.0 - jest-mock@29.7.0: dependencies: '@jest/types': 29.6.3 '@types/node': 22.1.0 jest-util: 29.7.0 - jest-pnp-resolver@1.2.3(jest-resolve@27.5.1): - optionalDependencies: - jest-resolve: 27.5.1 - jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): optionalDependencies: jest-resolve: 29.7.0 - jest-regex-util@27.5.1: {} - - jest-regex-util@28.0.2: {} - jest-regex-util@29.6.3: {} - jest-resolve-dependencies@27.5.1: - dependencies: - '@jest/types': 27.5.1 - jest-regex-util: 27.5.1 - jest-snapshot: 27.5.1 - transitivePeerDependencies: - - supports-color - jest-resolve-dependencies@29.7.0: dependencies: jest-regex-util: 29.6.3 @@ -44506,19 +39981,6 @@ snapshots: transitivePeerDependencies: - supports-color - jest-resolve@27.5.1: - dependencies: - '@jest/types': 27.5.1 - chalk: 4.1.2 - graceful-fs: 4.2.11 - jest-haste-map: 27.5.1 - jest-pnp-resolver: 1.2.3(jest-resolve@27.5.1) - jest-util: 27.5.1 - jest-validate: 27.5.1 - resolve: 1.22.8 - resolve.exports: 1.1.1 - slash: 3.0.0 - jest-resolve@29.7.0: dependencies: chalk: 4.1.2 @@ -44531,35 +39993,6 @@ snapshots: resolve.exports: 2.0.2 slash: 3.0.0 - jest-runner@27.5.1(bufferutil@4.0.8)(utf-8-validate@5.0.10): - dependencies: - '@jest/console': 27.5.1 - '@jest/environment': 27.5.1 - '@jest/test-result': 27.5.1 - '@jest/transform': 27.5.1 - '@jest/types': 27.5.1 - '@types/node': 22.1.0 - chalk: 4.1.2 - emittery: 0.8.1 - graceful-fs: 4.2.11 - jest-docblock: 27.5.1 - jest-environment-jsdom: 27.5.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) - jest-environment-node: 27.5.1 - jest-haste-map: 27.5.1 - jest-leak-detector: 27.5.1 - jest-message-util: 27.5.1 - jest-resolve: 27.5.1 - jest-runtime: 27.5.1 - jest-util: 27.5.1 - jest-worker: 27.5.1 - source-map-support: 0.5.21 - throat: 6.0.2 - transitivePeerDependencies: - - bufferutil - - canvas - - supports-color - - utf-8-validate - jest-runner@29.7.0: dependencies: '@jest/console': 29.7.0 @@ -44586,33 +40019,6 @@ snapshots: transitivePeerDependencies: - supports-color - jest-runtime@27.5.1: - dependencies: - '@jest/environment': 27.5.1 - '@jest/fake-timers': 27.5.1 - '@jest/globals': 27.5.1 - '@jest/source-map': 27.5.1 - '@jest/test-result': 27.5.1 - '@jest/transform': 27.5.1 - '@jest/types': 27.5.1 - chalk: 4.1.2 - cjs-module-lexer: 1.2.3 - collect-v8-coverage: 1.0.2 - execa: 5.1.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-haste-map: 27.5.1 - jest-message-util: 27.5.1 - jest-mock: 27.5.1 - jest-regex-util: 27.5.1 - jest-resolve: 27.5.1 - jest-snapshot: 27.5.1 - jest-util: 27.5.1 - slash: 3.0.0 - strip-bom: 4.0.0 - transitivePeerDependencies: - - supports-color - jest-runtime@29.7.0: dependencies: '@jest/environment': 29.7.0 @@ -44640,38 +40046,6 @@ snapshots: transitivePeerDependencies: - supports-color - jest-serializer@27.5.1: - dependencies: - '@types/node': 22.1.0 - graceful-fs: 4.2.11 - - jest-snapshot@27.5.1: - dependencies: - '@babel/core': 7.24.4 - '@babel/generator': 7.24.4 - '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.24.4) - '@babel/traverse': 7.24.1 - '@babel/types': 7.24.0 - '@jest/transform': 27.5.1 - '@jest/types': 27.5.1 - '@types/babel__traverse': 7.20.5 - '@types/prettier': 2.7.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.4) - chalk: 4.1.2 - expect: 27.5.1 - graceful-fs: 4.2.11 - jest-diff: 27.5.1 - jest-get-type: 27.5.1 - jest-haste-map: 27.5.1 - jest-matcher-utils: 27.5.1 - jest-message-util: 27.5.1 - jest-util: 27.5.1 - natural-compare: 1.4.0 - pretty-format: 27.5.1 - semver: 7.6.0 - transitivePeerDependencies: - - supports-color - jest-snapshot@29.7.0: dependencies: '@babel/core': 7.23.2 @@ -44697,24 +40071,6 @@ snapshots: transitivePeerDependencies: - supports-color - jest-util@27.5.1: - dependencies: - '@jest/types': 27.5.1 - '@types/node': 22.1.0 - chalk: 4.1.2 - ci-info: 3.8.0 - graceful-fs: 4.2.11 - picomatch: 2.3.1 - - jest-util@28.1.3: - dependencies: - '@jest/types': 28.1.3 - '@types/node': 22.1.0 - chalk: 4.1.2 - ci-info: 3.8.0 - graceful-fs: 4.2.11 - picomatch: 2.3.1 - jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 @@ -44724,15 +40080,6 @@ snapshots: graceful-fs: 4.2.11 picomatch: 2.3.1 - jest-validate@27.5.1: - dependencies: - '@jest/types': 27.5.1 - camelcase: 6.3.0 - chalk: 4.1.2 - jest-get-type: 27.5.1 - leven: 3.1.0 - pretty-format: 27.5.1 - jest-validate@29.7.0: dependencies: '@jest/types': 29.6.3 @@ -44742,38 +40089,6 @@ snapshots: leven: 3.1.0 pretty-format: 29.7.0 - jest-watch-typeahead@1.1.0(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10)): - dependencies: - ansi-escapes: 4.3.2 - chalk: 4.1.2 - jest: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10) - jest-regex-util: 28.0.2 - jest-watcher: 28.1.3 - slash: 4.0.0 - string-length: 5.0.1 - strip-ansi: 7.1.0 - - jest-watcher@27.5.1: - dependencies: - '@jest/test-result': 27.5.1 - '@jest/types': 27.5.1 - '@types/node': 22.1.0 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - jest-util: 27.5.1 - string-length: 4.0.2 - - jest-watcher@28.1.3: - dependencies: - '@jest/test-result': 28.1.3 - '@jest/types': 28.1.3 - '@types/node': 22.1.0 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - emittery: 0.10.2 - jest-util: 28.1.3 - string-length: 4.0.2 - jest-watcher@29.7.0: dependencies: '@jest/test-result': 29.7.0 @@ -44785,24 +40100,12 @@ snapshots: jest-util: 29.7.0 string-length: 4.0.2 - jest-worker@26.6.2: - dependencies: - '@types/node': 22.1.0 - merge-stream: 2.0.0 - supports-color: 7.2.0 - jest-worker@27.5.1: dependencies: '@types/node': 22.1.0 merge-stream: 2.0.0 supports-color: 8.1.1 - jest-worker@28.1.3: - dependencies: - '@types/node': 22.1.0 - merge-stream: 2.0.0 - supports-color: 8.1.1 - jest-worker@29.7.0: dependencies: '@types/node': 22.1.0 @@ -44810,18 +40113,6 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10): - dependencies: - '@jest/core': 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10) - import-local: 3.1.0 - jest-cli: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10) - transitivePeerDependencies: - - bufferutil - - canvas - - supports-color - - ts-node - - utf-8-validate - jest@29.7.0(@types/node@20.14.14)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4)): dependencies: '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4)) @@ -44946,40 +40237,6 @@ snapshots: transitivePeerDependencies: - supports-color - jsdom@16.7.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): - dependencies: - abab: 2.0.6 - acorn: 8.12.0 - acorn-globals: 6.0.0 - cssom: 0.4.4 - cssstyle: 2.3.0 - data-urls: 2.0.0 - decimal.js: 10.4.3 - domexception: 2.0.1 - escodegen: 2.1.0 - form-data: 3.0.1 - html-encoding-sniffer: 2.0.1 - http-proxy-agent: 4.0.1 - https-proxy-agent: 5.0.1 - is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.7 - parse5: 6.0.1 - saxes: 5.0.1 - symbol-tree: 3.2.4 - tough-cookie: 4.1.3 - w3c-hr-time: 1.0.2 - w3c-xmlserializer: 2.0.0 - webidl-conversions: 6.1.0 - whatwg-encoding: 1.0.5 - whatwg-mimetype: 2.3.0 - whatwg-url: 8.7.0 - ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) - xml-name-validator: 3.0.0 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - jsdom@20.0.3(bufferutil@4.0.8)(utf-8-validate@6.0.3): dependencies: abab: 2.0.6 @@ -45091,10 +40348,6 @@ snapshots: json-to-graphql-query@2.2.5: {} - json2mq@0.2.0: - dependencies: - string-convert: 0.2.1 - json5@0.5.1: {} json5@1.0.2: @@ -45125,14 +40378,6 @@ snapshots: jsonpath-plus@7.2.0: {} - jsonpath@1.1.1: - dependencies: - esprima: 1.2.2 - static-eval: 2.0.2 - underscore: 1.12.1 - - jsonpointer@5.0.1: {} - jsonschema@1.4.1: {} jsonwebtoken@9.0.1: @@ -45210,8 +40455,6 @@ snapshots: kleur@4.1.5: {} - klona@2.0.6: {} - konva@9.3.6: {} language-subtag-registry@0.3.22: {} @@ -45220,11 +40463,6 @@ snapshots: dependencies: language-subtag-registry: 0.3.22 - launch-editor@2.6.1: - dependencies: - picocolors: 1.0.0 - shell-quote: 1.8.1 - lazy-universal-dotenv@4.0.0: dependencies: app-root-dir: 1.0.2 @@ -45468,8 +40706,6 @@ snapshots: emojis-list: 3.0.0 json5: 2.2.3 - loader-utils@3.2.1: {} - local-pkg@0.4.3: {} localforage@1.10.0: @@ -45546,8 +40782,6 @@ snapshots: lodash.union@4.6.0: {} - lodash.uniq@4.5.0: {} - lodash.uniqby@4.7.0: {} lodash.zip@4.2.0: {} @@ -45637,10 +40871,6 @@ snapshots: dependencies: react: 18.2.0 - magic-string@0.25.9: - dependencies: - sourcemap-codec: 1.4.8 - magic-string@0.27.0: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 @@ -45869,12 +41099,8 @@ snapshots: dependencies: '@types/mdast': 3.0.12 - mdn-data@2.0.14: {} - mdn-data@2.0.30: {} - mdn-data@2.0.4: {} - media-query-parser@2.0.2: dependencies: '@babel/runtime': 7.24.5 @@ -45899,10 +41125,6 @@ snapshots: ltgt: 2.2.1 safe-buffer: 5.1.2 - memfs@3.5.3: - dependencies: - fs-monkey: 1.0.6 - memoize-one@5.2.1: {} memoizerific@1.11.3: @@ -46464,12 +41686,6 @@ snapshots: min-indent@1.0.1: {} - mini-css-extract-plugin@2.9.0(webpack@5.91.0): - dependencies: - schema-utils: 4.2.0 - tapable: 2.2.1 - webpack: 5.91.0 - mini-svg-data-uri@1.4.4: {} minimalistic-assert@1.0.1: {} @@ -46702,11 +41918,6 @@ snapshots: base-x: 3.0.9 buffer: 5.7.1 - multicast-dns@7.2.5: - dependencies: - dns-packet: 5.6.1 - thunky: 1.1.0 - multicodec@0.5.7: dependencies: varint: 5.0.2 @@ -46773,10 +41984,6 @@ snapshots: nanotimer@0.3.14: {} - napi-build-utils@1.0.2: {} - - natural-compare-lite@1.4.0: {} - natural-compare@1.4.0: {} natural-orderby@2.0.3: {} @@ -46872,18 +42079,12 @@ snapshots: nocache@3.0.4: {} - node-abi@3.47.0: - dependencies: - semver: 7.6.0 - node-abort-controller@3.1.1: {} node-addon-api@2.0.2: {} node-addon-api@5.1.0: {} - node-addon-api@6.1.0: {} - node-addon-api@7.0.0: {} node-dir@0.1.17: @@ -46942,8 +42143,6 @@ snapshots: node-int64@0.4.0: {} - node-modules-regexp@1.0.0: {} - node-releases@2.0.13: {} node-releases@2.0.14: {} @@ -47001,10 +42200,6 @@ snapshots: gauge: 3.0.2 set-blocking: 2.0.0 - nth-check@1.0.2: - dependencies: - boolbase: 1.0.0 - nth-check@2.1.1: dependencies: boolbase: 1.0.0 @@ -47133,8 +42328,6 @@ snapshots: dependencies: http-https: 1.0.0 - obuf@1.1.2: {} - octokit@2.1.0(encoding@0.1.13): dependencies: '@octokit/app': 13.1.8(encoding@0.1.13) @@ -47330,11 +42523,6 @@ snapshots: dependencies: aggregate-error: 3.1.0 - p-retry@4.6.2: - dependencies: - '@types/retry': 0.12.0 - retry: 0.13.1 - p-try@1.0.0: {} p-try@2.2.0: {} @@ -47364,11 +42552,6 @@ snapshots: pako@1.0.11: {} - param-case@3.0.4: - dependencies: - dot-case: 3.0.4 - tslib: 2.7.0 - parent-module@1.0.1: dependencies: callsites: 3.1.0 @@ -47439,8 +42622,6 @@ snapshots: domhandler: 5.0.3 parse5: 7.1.2 - parse5@6.0.1: {} - parse5@7.1.2: dependencies: entities: 4.5.0 @@ -47593,8 +42774,6 @@ snapshots: postgres-date: 1.0.7 postgres-interval: 1.2.0 - picocolors@0.2.1: {} - picocolors@1.0.0: {} picomatch@2.3.1: {} @@ -47634,10 +42813,6 @@ snapshots: sonic-boom: 2.8.0 thread-stream: 0.15.2 - pirates@3.0.2: - dependencies: - node-modules-regexp: 1.0.0 - pirates@4.0.6: {} pkg-dir@3.0.0: @@ -47658,10 +42833,6 @@ snapshots: mlly: 1.4.0 pathe: 1.1.1 - pkg-up@3.1.0: - dependencies: - find-up: 3.0.0 - playwright-core@1.41.0: {} playwright-core@1.45.0: {} @@ -47698,130 +42869,6 @@ snapshots: possible-typed-array-names@1.0.0: {} - postcss-attribute-case-insensitive@5.0.2(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - - postcss-browser-comments@4.0.0(browserslist@4.23.0)(postcss@8.4.23): - dependencies: - browserslist: 4.23.0 - postcss: 8.4.23 - - postcss-calc@8.2.4(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - postcss-value-parser: 4.2.0 - - postcss-clamp@4.1.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-color-functional-notation@4.2.4(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-color-hex-alpha@8.0.4(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-color-rebeccapurple@7.1.1(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-colormin@5.3.1(postcss@8.4.23): - dependencies: - browserslist: 4.23.0 - caniuse-api: 3.0.0 - colord: 2.9.3 - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-convert-values@5.1.3(postcss@8.4.23): - dependencies: - browserslist: 4.23.0 - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-custom-media@8.0.2(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-custom-properties@12.1.11(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-custom-selectors@6.0.3(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - - postcss-dir-pseudo-class@6.0.5(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - - postcss-discard-comments@5.1.2(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - postcss-discard-duplicates@5.1.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - postcss-discard-empty@5.1.1(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - postcss-discard-overridden@5.1.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - postcss-double-position-gradients@3.1.2(postcss@8.4.23): - dependencies: - '@csstools/postcss-progressive-custom-properties': 1.3.0(postcss@8.4.23) - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-env-function@4.0.6(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-flexbugs-fixes@5.0.2(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - postcss-focus-visible@6.0.4(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - - postcss-focus-within@5.0.4(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - - postcss-font-variant@5.0.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - postcss-gap-properties@3.0.5(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - postcss-image-set-function@4.0.7(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - postcss-import@15.1.0(postcss@8.4.23): dependencies: postcss: 8.4.23 @@ -47829,21 +42876,11 @@ snapshots: read-cache: 1.0.0 resolve: 1.22.8 - postcss-initial@4.0.1(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-js@4.0.1(postcss@8.4.23): dependencies: camelcase-css: 2.0.1 postcss: 8.4.23 - postcss-lab-function@4.2.1(postcss@8.4.23): - dependencies: - '@csstools/postcss-progressive-custom-properties': 1.3.0(postcss@8.4.23) - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - postcss-load-config@4.0.1(postcss@8.4.23)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4)): dependencies: lilconfig: 2.1.0 @@ -47876,14 +42913,6 @@ snapshots: postcss: 8.4.38 ts-node: 10.9.2(@swc/core@1.4.2)(@types/node@20.14.14)(typescript@5.5.4) - postcss-loader@6.2.1(postcss@8.4.23)(webpack@5.91.0): - dependencies: - cosmiconfig: 7.1.0 - klona: 2.0.6 - postcss: 8.4.23 - semver: 7.6.0 - webpack: 5.91.0 - postcss-loader@7.3.3(postcss@8.4.23)(typescript@5.5.4)(webpack@5.91.0(esbuild@0.18.20)): dependencies: cosmiconfig: 8.3.6(typescript@5.5.4) @@ -47894,52 +42923,6 @@ snapshots: transitivePeerDependencies: - typescript - postcss-logical@5.0.4(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - postcss-media-minmax@5.0.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - postcss-merge-longhand@5.1.7(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - stylehacks: 5.1.1(postcss@8.4.23) - - postcss-merge-rules@5.1.4(postcss@8.4.23): - dependencies: - browserslist: 4.23.0 - caniuse-api: 3.0.0 - cssnano-utils: 3.1.0(postcss@8.4.23) - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - - postcss-minify-font-values@5.1.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-minify-gradients@5.1.1(postcss@8.4.23): - dependencies: - colord: 2.9.3 - cssnano-utils: 3.1.0(postcss@8.4.23) - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-minify-params@5.1.4(postcss@8.4.23): - dependencies: - browserslist: 4.23.0 - cssnano-utils: 3.1.0(postcss@8.4.23) - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-minify-selectors@5.2.1(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - postcss-modules-extract-imports@3.0.0(postcss@8.4.23): dependencies: postcss: 8.4.23 @@ -47966,168 +42949,6 @@ snapshots: postcss: 8.4.23 postcss-selector-parser: 6.0.13 - postcss-nesting@10.2.0(postcss@8.4.23): - dependencies: - '@csstools/selector-specificity': 2.2.0(postcss-selector-parser@6.0.13) - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - - postcss-normalize-charset@5.1.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - postcss-normalize-display-values@5.1.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-normalize-positions@5.1.1(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-normalize-repeat-style@5.1.1(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-normalize-string@5.1.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-normalize-timing-functions@5.1.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-normalize-unicode@5.1.1(postcss@8.4.23): - dependencies: - browserslist: 4.23.0 - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-normalize-url@5.1.0(postcss@8.4.23): - dependencies: - normalize-url: 6.1.0 - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-normalize-whitespace@5.1.1(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-normalize@10.0.1(browserslist@4.23.0)(postcss@8.4.23): - dependencies: - '@csstools/normalize.css': 12.1.1 - browserslist: 4.23.0 - postcss: 8.4.23 - postcss-browser-comments: 4.0.0(browserslist@4.23.0)(postcss@8.4.23) - sanitize.css: 13.0.0 - - postcss-opacity-percentage@1.1.3(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - postcss-ordered-values@5.1.3(postcss@8.4.23): - dependencies: - cssnano-utils: 3.1.0(postcss@8.4.23) - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-overflow-shorthand@3.0.4(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-page-break@3.0.4(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - postcss-place@7.0.5(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-preset-env@7.8.3(postcss@8.4.23): - dependencies: - '@csstools/postcss-cascade-layers': 1.1.1(postcss@8.4.23) - '@csstools/postcss-color-function': 1.1.1(postcss@8.4.23) - '@csstools/postcss-font-format-keywords': 1.0.1(postcss@8.4.23) - '@csstools/postcss-hwb-function': 1.0.2(postcss@8.4.23) - '@csstools/postcss-ic-unit': 1.0.1(postcss@8.4.23) - '@csstools/postcss-is-pseudo-class': 2.0.7(postcss@8.4.23) - '@csstools/postcss-nested-calc': 1.0.0(postcss@8.4.23) - '@csstools/postcss-normalize-display-values': 1.0.1(postcss@8.4.23) - '@csstools/postcss-oklab-function': 1.1.1(postcss@8.4.23) - '@csstools/postcss-progressive-custom-properties': 1.3.0(postcss@8.4.23) - '@csstools/postcss-stepped-value-functions': 1.0.1(postcss@8.4.23) - '@csstools/postcss-text-decoration-shorthand': 1.0.0(postcss@8.4.23) - '@csstools/postcss-trigonometric-functions': 1.0.2(postcss@8.4.23) - '@csstools/postcss-unset-value': 1.0.2(postcss@8.4.23) - autoprefixer: 10.4.14(postcss@8.4.23) - browserslist: 4.23.0 - css-blank-pseudo: 3.0.3(postcss@8.4.23) - css-has-pseudo: 3.0.4(postcss@8.4.23) - css-prefers-color-scheme: 6.0.3(postcss@8.4.23) - cssdb: 7.11.2 - postcss: 8.4.23 - postcss-attribute-case-insensitive: 5.0.2(postcss@8.4.23) - postcss-clamp: 4.1.0(postcss@8.4.23) - postcss-color-functional-notation: 4.2.4(postcss@8.4.23) - postcss-color-hex-alpha: 8.0.4(postcss@8.4.23) - postcss-color-rebeccapurple: 7.1.1(postcss@8.4.23) - postcss-custom-media: 8.0.2(postcss@8.4.23) - postcss-custom-properties: 12.1.11(postcss@8.4.23) - postcss-custom-selectors: 6.0.3(postcss@8.4.23) - postcss-dir-pseudo-class: 6.0.5(postcss@8.4.23) - postcss-double-position-gradients: 3.1.2(postcss@8.4.23) - postcss-env-function: 4.0.6(postcss@8.4.23) - postcss-focus-visible: 6.0.4(postcss@8.4.23) - postcss-focus-within: 5.0.4(postcss@8.4.23) - postcss-font-variant: 5.0.0(postcss@8.4.23) - postcss-gap-properties: 3.0.5(postcss@8.4.23) - postcss-image-set-function: 4.0.7(postcss@8.4.23) - postcss-initial: 4.0.1(postcss@8.4.23) - postcss-lab-function: 4.2.1(postcss@8.4.23) - postcss-logical: 5.0.4(postcss@8.4.23) - postcss-media-minmax: 5.0.0(postcss@8.4.23) - postcss-nesting: 10.2.0(postcss@8.4.23) - postcss-opacity-percentage: 1.1.3(postcss@8.4.23) - postcss-overflow-shorthand: 3.0.4(postcss@8.4.23) - postcss-page-break: 3.0.4(postcss@8.4.23) - postcss-place: 7.0.5(postcss@8.4.23) - postcss-pseudo-class-any-link: 7.1.6(postcss@8.4.23) - postcss-replace-overflow-wrap: 4.0.0(postcss@8.4.23) - postcss-selector-not: 6.0.1(postcss@8.4.23) - postcss-value-parser: 4.2.0 - - postcss-pseudo-class-any-link@7.1.6(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - - postcss-reduce-initial@5.1.2(postcss@8.4.23): - dependencies: - browserslist: 4.23.0 - caniuse-api: 3.0.0 - postcss: 8.4.23 - - postcss-reduce-transforms@5.1.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - - postcss-replace-overflow-wrap@4.0.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - - postcss-selector-not@6.0.1(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - postcss-selector-parser@6.0.10: dependencies: cssesc: 3.0.0 @@ -48138,17 +42959,6 @@ snapshots: cssesc: 3.0.0 util-deprecate: 1.0.2 - postcss-svgo@5.1.0(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-value-parser: 4.2.0 - svgo: 2.8.0 - - postcss-unique-selectors@5.1.1(postcss@8.4.23): - dependencies: - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - postcss-value-parser@4.2.0: {} postcss-values-parser@6.0.2(postcss@8.4.23): @@ -48158,11 +42968,6 @@ snapshots: postcss: 8.4.23 quote-unquote: 1.0.0 - postcss@7.0.39: - dependencies: - picocolors: 0.2.1 - source-map: 0.6.1 - postcss@8.4.23: dependencies: nanoid: 3.3.6 @@ -48205,21 +43010,6 @@ snapshots: preact@10.17.0: {} - prebuild-install@7.1.1: - dependencies: - detect-libc: 2.0.2 - expand-template: 2.0.3 - github-from-package: 0.0.0 - minimist: 1.2.8 - mkdirp-classic: 0.5.3 - napi-build-utils: 1.0.2 - node-abi: 3.47.0 - pump: 3.0.0 - rc: 1.2.8 - simple-get: 4.0.1 - tar-fs: 2.1.1 - tunnel-agent: 0.6.0 - precinct@11.0.5: dependencies: '@dependents/detective-less': 4.1.0 @@ -48277,11 +43067,6 @@ snapshots: pretty-bytes@5.6.0: {} - pretty-error@4.0.0: - dependencies: - lodash: 4.17.21 - renderkid: 3.0.0 - pretty-format@26.6.2: dependencies: '@jest/types': 26.6.2 @@ -48289,19 +43074,6 @@ snapshots: ansi-styles: 4.3.0 react-is: 17.0.2 - pretty-format@27.5.1: - dependencies: - ansi-regex: 5.0.1 - ansi-styles: 5.2.0 - react-is: 17.0.2 - - pretty-format@28.1.3: - dependencies: - '@jest/schemas': 28.1.3 - ansi-regex: 5.0.1 - ansi-styles: 5.2.0 - react-is: 18.2.0 - pretty-format@29.7.0: dependencies: '@jest/schemas': 29.6.3 @@ -48571,8 +43343,6 @@ snapshots: queue-microtask@1.2.3: {} - queue-tick@1.0.1: {} - queue@6.0.2: dependencies: inherits: 2.0.4 @@ -48587,10 +43357,6 @@ snapshots: radix3@1.1.0: {} - raf@3.4.1: - dependencies: - performance-now: 2.1.0 - ramda@0.29.0: {} randombytes@2.1.0: @@ -48628,327 +43394,6 @@ snapshots: iconv-lite: 0.4.24 unpipe: 1.0.0 - rc-cascader@3.25.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - array-tree-filter: 2.1.0 - classnames: 2.3.2 - rc-select: 14.13.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-tree: 5.8.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-checkbox@3.2.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-collapse@3.7.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-motion: 2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-dialog@9.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/portal': 1.1.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - classnames: 2.3.2 - rc-motion: 2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-drawer@7.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/portal': 1.1.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - classnames: 2.3.2 - rc-motion: 2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-dropdown@4.2.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/trigger': 2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-field-form@2.0.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/async-validator': 5.0.3 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-image@7.6.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/portal': 1.1.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - classnames: 2.3.2 - rc-dialog: 9.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-motion: 2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-input-number@9.0.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/mini-decimal': 1.1.0 - classnames: 2.3.2 - rc-input: 1.4.5(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-input@1.4.5(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-mentions@2.11.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/trigger': 2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - classnames: 2.3.2 - rc-input: 1.4.5(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-menu: 9.13.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-textarea: 1.6.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-menu@9.13.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/trigger': 2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - classnames: 2.3.2 - rc-motion: 2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-overflow: 1.3.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-motion@2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-notification@5.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-motion: 2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-overflow@1.3.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-resize-observer: 1.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-pagination@4.0.4(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-picker@4.5.0(date-fns@2.30.0)(dayjs@1.11.10)(moment@2.29.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/trigger': 2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - classnames: 2.3.2 - rc-overflow: 1.3.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-resize-observer: 1.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - optionalDependencies: - date-fns: 2.30.0 - dayjs: 1.11.10 - moment: 2.29.4 - - rc-progress@4.0.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-rate@2.12.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-resize-observer@1.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - resize-observer-polyfill: 1.5.1 - - rc-segmented@2.3.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-motion: 2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-select@14.13.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/trigger': 2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - classnames: 2.3.2 - rc-motion: 2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-overflow: 1.3.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-virtual-list: 3.12.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-slider@10.6.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-steps@6.0.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-switch@4.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-table@7.45.5(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/context': 1.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - classnames: 2.3.2 - rc-resize-observer: 1.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-virtual-list: 3.12.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-tabs@15.0.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-dropdown: 4.2.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-menu: 9.13.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-motion: 2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-resize-observer: 1.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-textarea@1.6.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-input: 1.4.5(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-resize-observer: 1.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-tooltip@6.2.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - '@rc-component/trigger': 2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - classnames: 2.3.2 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-tree-select@5.20.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-select: 14.13.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-tree: 5.8.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-tree@5.8.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-motion: 2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-virtual-list: 3.12.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-upload@4.5.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - - rc-util@5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - react-is: 18.2.0 - - rc-virtual-list@3.12.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): - dependencies: - '@babel/runtime': 7.24.5 - classnames: 2.3.2 - rc-resize-observer: 1.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - rc-util: 5.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - rc@1.2.8: dependencies: deep-extend: 0.6.0 @@ -48956,15 +43401,6 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - react-app-polyfill@3.0.0: - dependencies: - core-js: 3.38.0 - object-assign: 4.1.1 - promise: 8.3.0 - raf: 3.4.1 - regenerator-runtime: 0.13.11 - whatwg-fetch: 3.6.20 - react-colorful@5.6.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: react: 18.2.0 @@ -48986,40 +43422,6 @@ snapshots: date-fns: 2.30.0 react: 18.2.0 - react-dev-utils@12.0.1(eslint@8.57.0)(typescript@5.5.4)(vue-template-compiler@2.7.16)(webpack@5.91.0): - dependencies: - '@babel/code-frame': 7.24.2 - address: 1.2.2 - browserslist: 4.23.0 - chalk: 4.1.2 - cross-spawn: 7.0.3 - detect-port-alt: 1.1.6 - escape-string-regexp: 4.0.0 - filesize: 8.0.7 - find-up: 5.0.0 - fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.57.0)(typescript@5.5.4)(vue-template-compiler@2.7.16)(webpack@5.91.0) - global-modules: 2.0.0 - globby: 11.1.0 - gzip-size: 6.0.0 - immer: 9.0.21 - is-root: 2.1.0 - loader-utils: 3.2.1 - open: 8.4.2 - pkg-up: 3.1.0 - prompts: 2.4.2 - react-error-overlay: 6.0.11 - recursive-readdir: 2.2.3 - shell-quote: 1.8.1 - strip-ansi: 6.0.1 - text-table: 0.2.0 - webpack: 5.91.0 - optionalDependencies: - typescript: 5.5.4 - transitivePeerDependencies: - - eslint - - supports-color - - vue-template-compiler - react-devtools-core@4.28.5(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: shell-quote: 1.8.1 @@ -49073,8 +43475,6 @@ snapshots: '@babel/runtime': 7.24.5 react: 18.2.0 - react-error-overlay@6.0.11: {} - react-fast-compare@3.2.2: {} react-hook-form@7.41.2(react@18.2.0): @@ -49200,8 +43600,6 @@ snapshots: react: 18.2.0 scheduler: 0.21.0 - react-refresh@0.11.0: {} - react-refresh@0.14.0: {} react-remove-scroll-bar@2.3.4(@types/react@18.2.14)(react@18.2.0): @@ -49259,104 +43657,12 @@ snapshots: react: 18.2.0 shallow-equal: 1.2.1 - react-scripts@5.0.1(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4))(@types/babel__core@7.20.5)(bufferutil@4.0.8)(eslint@8.57.0)(react@18.2.0)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(type-fest@4.18.3)(typescript@5.5.4)(utf-8-validate@5.0.10)(vue-template-compiler@2.7.16): - dependencies: - '@babel/core': 7.24.4 - '@pmmmwh/react-refresh-webpack-plugin': 0.5.13(react-refresh@0.11.0)(type-fest@4.18.3)(webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.91.0))(webpack@5.91.0) - '@svgr/webpack': 5.5.0 - babel-jest: 27.5.1(@babel/core@7.24.4) - babel-loader: 8.3.0(@babel/core@7.24.4)(webpack@5.91.0) - babel-plugin-named-asset-import: 0.3.8(@babel/core@7.24.4) - babel-preset-react-app: 10.0.1 - bfj: 7.1.0 - browserslist: 4.23.0 - camelcase: 6.3.0 - case-sensitive-paths-webpack-plugin: 2.4.0 - css-loader: 6.8.1(webpack@5.91.0) - css-minimizer-webpack-plugin: 3.4.1(webpack@5.91.0) - dotenv: 10.0.0 - dotenv-expand: 5.1.0 - eslint: 8.57.0 - eslint-config-react-app: 7.0.1(@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4))(@babel/plugin-transform-react-jsx@7.23.4(@babel/core@7.24.4))(eslint@8.57.0)(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10))(typescript@5.5.4) - eslint-webpack-plugin: 3.2.0(eslint@8.57.0)(webpack@5.91.0) - file-loader: 6.2.0(webpack@5.91.0) - fs-extra: 10.1.0 - html-webpack-plugin: 5.6.0(webpack@5.91.0) - identity-obj-proxy: 3.0.0 - jest: 27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10) - jest-resolve: 27.5.1 - jest-watch-typeahead: 1.1.0(jest@27.5.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4))(utf-8-validate@5.0.10)) - mini-css-extract-plugin: 2.9.0(webpack@5.91.0) - postcss: 8.4.23 - postcss-flexbugs-fixes: 5.0.2(postcss@8.4.23) - postcss-loader: 6.2.1(postcss@8.4.23)(webpack@5.91.0) - postcss-normalize: 10.0.1(browserslist@4.23.0)(postcss@8.4.23) - postcss-preset-env: 7.8.3(postcss@8.4.23) - prompts: 2.4.2 - react: 18.2.0 - react-app-polyfill: 3.0.0 - react-dev-utils: 12.0.1(eslint@8.57.0)(typescript@5.5.4)(vue-template-compiler@2.7.16)(webpack@5.91.0) - react-refresh: 0.11.0 - resolve: 1.22.8 - resolve-url-loader: 4.0.0 - sass-loader: 12.6.0(webpack@5.91.0) - semver: 7.6.0 - source-map-loader: 3.0.2(webpack@5.91.0) - style-loader: 3.3.3(webpack@5.91.0) - tailwindcss: 3.3.2(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) - terser-webpack-plugin: 5.3.10(webpack@5.91.0) - webpack: 5.91.0 - webpack-dev-server: 4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.91.0) - webpack-manifest-plugin: 4.1.1(webpack@5.91.0) - workbox-webpack-plugin: 6.6.0(@types/babel__core@7.20.5)(webpack@5.91.0) - optionalDependencies: - fsevents: 2.3.3 - typescript: 5.5.4 - transitivePeerDependencies: - - '@babel/plugin-syntax-flow' - - '@babel/plugin-transform-react-jsx' - - '@parcel/css' - - '@rspack/core' - - '@swc/core' - - '@types/babel__core' - - '@types/webpack' - - bufferutil - - canvas - - clean-css - - csso - - debug - - esbuild - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - fibers - - node-notifier - - node-sass - - rework - - rework-visit - - sass - - sass-embedded - - sockjs-client - - supports-color - - ts-node - - type-fest - - uglify-js - - utf-8-validate - - vue-template-compiler - - webpack-cli - - webpack-hot-middleware - - webpack-plugin-serve - react-shallow-renderer@16.15.0(react@18.2.0): dependencies: object-assign: 4.1.1 react: 18.2.0 react-is: 18.2.0 - react-slider@2.0.4(react@18.2.0): - dependencies: - prop-types: 15.8.1 - react: 18.2.0 - react-spring@9.6.1(@react-three/fiber@8.16.2(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.24.4)(@babel/preset-env@7.24.4(@babel/core@7.24.4))(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(three@0.163.0))(konva@9.3.6)(react-dom@18.2.0(react@18.2.0))(react-konva@16.8.6(konva@9.3.6)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-native@0.73.7(@babel/core@7.24.4)(@babel/preset-env@7.24.4(@babel/core@7.24.4))(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10))(react-zdog@1.2.2)(react@18.2.0)(three@0.163.0)(zdog@1.1.3): dependencies: '@react-spring/core': 9.6.1(react@18.2.0) @@ -49655,8 +43961,6 @@ snapshots: reinterval@1.1.0: {} - relateurl@0.2.7: {} - remark-external-links@8.0.0: dependencies: extend: 3.0.2 @@ -49705,14 +44009,6 @@ snapshots: remove-accents@0.4.2: {} - renderkid@3.0.0: - dependencies: - css-select: 4.3.0 - dom-converter: 0.2.0 - htmlparser2: 6.1.0 - lodash: 4.17.21 - strip-ansi: 6.0.1 - repeat-element@1.1.4: {} repeat-string@1.6.1: {} @@ -49811,14 +44107,6 @@ snapshots: resolve-pkg-maps@1.0.0: {} - resolve-url-loader@4.0.0: - dependencies: - adjust-sourcemap-loader: 4.0.0 - convert-source-map: 1.9.0 - loader-utils: 2.0.4 - postcss: 7.0.39 - source-map: 0.6.1 - resolve-url-loader@5.0.0: dependencies: adjust-sourcemap-loader: 4.0.0 @@ -49829,8 +44117,6 @@ snapshots: resolve-url@0.2.1: {} - resolve.exports@1.1.1: {} - resolve.exports@2.0.2: {} resolve@1.1.7: {} @@ -49885,8 +44171,6 @@ snapshots: retimer@3.0.0: {} - retry@0.13.1: {} - reusify@1.0.4: {} rimraf@2.6.3: @@ -49912,14 +44196,6 @@ snapshots: robust-predicates@3.0.2: {} - rollup-plugin-terser@7.0.2(rollup@2.78.0): - dependencies: - '@babel/code-frame': 7.24.2 - jest-worker: 26.6.2 - rollup: 2.78.0 - serialize-javascript: 4.0.0 - terser: 5.30.3 - rollup-plugin-visualizer@5.12.0(rollup@2.78.0): dependencies: open: 8.4.2 @@ -50048,14 +44324,6 @@ snapshots: safer-buffer@2.1.2: {} - sanitize.css@13.0.0: {} - - sass-loader@12.6.0(webpack@5.91.0): - dependencies: - klona: 2.0.6 - neo-async: 2.6.2 - webpack: 5.91.0 - sass-loader@13.3.2(webpack@5.91.0(esbuild@0.18.20)): dependencies: neo-async: 2.6.2 @@ -50067,14 +44335,8 @@ snapshots: sax@1.2.1: {} - sax@1.2.4: {} - sax@1.3.0: {} - saxes@5.0.1: - dependencies: - xmlchars: 2.2.0 - saxes@6.0.0: dependencies: xmlchars: 2.2.0 @@ -50117,35 +44379,12 @@ snapshots: dependencies: typescript: 5.5.4 - schema-utils@2.7.0: - dependencies: - '@types/json-schema': 7.0.15 - ajv: 6.12.6 - ajv-keywords: 3.5.2(ajv@6.12.6) - - schema-utils@2.7.1: - dependencies: - '@types/json-schema': 7.0.15 - ajv: 6.12.6 - ajv-keywords: 3.5.2(ajv@6.12.6) - schema-utils@3.3.0: dependencies: '@types/json-schema': 7.0.15 ajv: 6.12.6 ajv-keywords: 3.5.2(ajv@6.12.6) - schema-utils@4.2.0: - dependencies: - '@types/json-schema': 7.0.15 - ajv: 8.12.0 - ajv-formats: 2.1.1(ajv@8.12.0) - ajv-keywords: 5.1.0(ajv@8.12.0) - - scroll-into-view-if-needed@3.1.0: - dependencies: - compute-scroll-into-view: 3.1.0 - scrypt-js@2.0.4: {} scrypt-js@3.0.1: {} @@ -50171,13 +44410,6 @@ snapshots: seedrandom@3.0.5: {} - select-hose@2.0.0: {} - - selfsigned@2.4.1: - dependencies: - '@types/node-forge': 1.3.11 - node-forge: 1.3.1 - semaphore@1.1.0: {} semver@5.4.1: {} @@ -50224,10 +44456,6 @@ snapshots: serialize-error@2.1.0: {} - serialize-javascript@4.0.0: - dependencies: - randombytes: 2.1.0 - serialize-javascript@6.0.0: dependencies: randombytes: 2.1.0 @@ -50247,18 +44475,6 @@ snapshots: path-to-regexp: 2.2.1 range-parser: 1.2.0 - serve-index@1.9.1: - dependencies: - accepts: 1.3.8 - batch: 0.6.1 - debug: 2.6.9 - escape-html: 1.0.3 - http-errors: 1.6.3 - mime-types: 2.1.35 - parseurl: 1.3.3 - transitivePeerDependencies: - - supports-color - serve-static@1.15.0: dependencies: encodeurl: 1.0.2 @@ -50327,8 +44543,6 @@ snapshots: setimmediate@1.0.5: {} - setprototypeof@1.1.0: {} - setprototypeof@1.1.1: {} setprototypeof@1.2.0: {} @@ -50351,17 +44565,6 @@ snapshots: shallowequal@1.1.0: {} - sharp@0.32.6: - dependencies: - color: 4.2.3 - detect-libc: 2.0.2 - node-addon-api: 6.1.0 - prebuild-install: 7.1.1 - semver: 7.6.0 - simple-get: 4.0.1 - tar-fs: 3.0.4 - tunnel-agent: 0.6.0 - shebang-command@1.2.0: dependencies: shebang-regex: 1.0.0 @@ -50413,24 +44616,6 @@ snapshots: once: 1.4.0 simple-concat: 1.0.1 - simple-get@4.0.1: - dependencies: - decompress-response: 6.0.0 - once: 1.4.0 - simple-concat: 1.0.1 - - simple-git@3.19.1: - dependencies: - '@kwsites/file-exists': 1.1.1 - '@kwsites/promise-deferred': 1.1.1 - debug: 4.3.4(supports-color@8.1.1) - transitivePeerDependencies: - - supports-color - - simple-swizzle@0.2.2: - dependencies: - is-arrayish: 0.3.2 - simple-update-notifier@2.0.0: dependencies: semver: 7.5.4 @@ -50519,12 +44704,6 @@ snapshots: socketio-wildcard@2.0.0: {} - sockjs@0.3.24: - dependencies: - faye-websocket: 0.11.4 - uuid: 8.3.2 - websocket-driver: 0.7.4 - socks-proxy-agent@8.0.2: dependencies: agent-base: 7.1.0 @@ -50634,19 +44813,10 @@ snapshots: is-plain-obj: 4.1.0 sort-object-keys: 1.1.3 - source-list-map@2.0.1: {} - source-map-js@1.0.2: {} source-map-js@1.2.0: {} - source-map-loader@3.0.2(webpack@5.91.0): - dependencies: - abab: 2.0.6 - iconv-lite: 0.6.3 - source-map-js: 1.2.0 - webpack: 5.91.0 - source-map-resolve@0.5.3: dependencies: atob: 2.1.2 @@ -50699,8 +44869,6 @@ snapshots: dependencies: whatwg-url: 7.1.0 - sourcemap-codec@1.4.8: {} - space-separated-tokens@1.1.5: {} spawndamnit@2.0.0: @@ -50722,27 +44890,6 @@ snapshots: spdx-license-ids@3.0.13: {} - spdy-transport@3.0.0: - dependencies: - debug: 4.3.4(supports-color@8.1.1) - detect-node: 2.1.0 - hpack.js: 2.1.6 - obuf: 1.1.2 - readable-stream: 3.6.2 - wbuf: 1.7.3 - transitivePeerDependencies: - - supports-color - - spdy@4.0.2: - dependencies: - debug: 4.3.4(supports-color@8.1.1) - handle-thing: 2.0.1 - http-deceiver: 1.2.7 - select-hose: 2.0.0 - spdy-transport: 3.0.0 - transitivePeerDependencies: - - supports-color - split-ca@1.0.1: {} split-on-first@1.1.0: {} @@ -50784,8 +44931,6 @@ snapshots: safer-buffer: 2.1.2 tweetnacl: 0.14.5 - stable@0.1.8: {} - stack-utils@2.0.6: dependencies: escape-string-regexp: 2.0.0 @@ -50808,10 +44953,6 @@ snapshots: stat-mode@0.3.0: {} - static-eval@2.0.2: - dependencies: - escodegen: 1.8.1 - static-extend@0.1.2: dependencies: define-property: 0.2.5 @@ -50874,17 +45015,10 @@ snapshots: streamsearch@1.1.0: {} - streamx@2.15.1: - dependencies: - fast-fifo: 1.3.2 - queue-tick: 1.0.1 - strict-uri-encode@1.1.0: {} strict-uri-encode@2.0.0: {} - string-convert@0.2.1: {} - string-format@2.0.0: {} string-length@4.0.2: @@ -50892,17 +45026,10 @@ snapshots: char-regex: 1.0.2 strip-ansi: 6.0.1 - string-length@5.0.1: - dependencies: - char-regex: 2.0.1 - strip-ansi: 7.1.0 - string-length@6.0.0: dependencies: strip-ansi: 7.1.0 - string-natural-compare@3.0.1: {} - string-similarity-js@2.1.4: {} string-width@1.0.2: @@ -51031,8 +45158,6 @@ snapshots: strip-bom@4.0.0: {} - strip-comments@2.0.1: {} - strip-final-newline@2.0.0: {} strip-final-newline@3.0.0: {} @@ -51059,10 +45184,6 @@ snapshots: dependencies: webpack: 5.91.0(esbuild@0.18.20) - style-loader@3.3.3(webpack@5.91.0): - dependencies: - webpack: 5.91.0 - styled-components@6.1.13(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: '@emotion/is-prop-valid': 1.2.2 @@ -51094,14 +45215,6 @@ snapshots: '@babel/core': 7.24.4 babel-plugin-macros: 3.1.0 - stylehacks@5.1.1(postcss@8.4.23): - dependencies: - browserslist: 4.23.0 - postcss: 8.4.23 - postcss-selector-parser: 6.0.13 - - stylis@4.2.0: {} - stylis@4.3.2: {} stylus-lookup@5.0.1: @@ -51206,34 +45319,6 @@ snapshots: magic-string: 0.30.10 periscopic: 3.1.0 - svg-parser@2.0.4: {} - - svgo@1.3.2: - dependencies: - chalk: 2.4.2 - coa: 2.0.2 - css-select: 2.1.0 - css-select-base-adapter: 0.1.1 - css-tree: 1.0.0-alpha.37 - csso: 4.2.0 - js-yaml: 3.14.1 - mkdirp: 0.5.6 - object.values: 1.1.6 - sax: 1.2.4 - stable: 0.1.8 - unquote: 1.1.1 - util.promisify: 1.0.1 - - svgo@2.8.0: - dependencies: - '@trysound/sax': 0.2.0 - commander: 7.2.0 - css-select: 4.3.0 - css-tree: 1.1.3 - csso: 4.2.0 - picocolors: 1.0.0 - stable: 0.1.8 - swarm-js@0.1.42(patch_hash=2sabagotzgj5qrte5szyhjypv4)(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: bluebird: 3.7.2 @@ -51362,8 +45447,6 @@ snapshots: transitivePeerDependencies: - ts-node - tapable@1.1.3: {} - tapable@2.2.1: {} tape@4.17.0: @@ -51406,12 +45489,6 @@ snapshots: pump: 3.0.0 tar-stream: 2.2.0 - tar-fs@3.0.4: - dependencies: - mkdirp-classic: 0.5.3 - pump: 3.0.0 - tar-stream: 3.1.6 - tar-stream@1.6.2: dependencies: bl: 1.2.3 @@ -51430,12 +45507,6 @@ snapshots: inherits: 2.0.4 readable-stream: 3.6.2 - tar-stream@3.1.6: - dependencies: - b4a: 1.6.4 - fast-fifo: 1.3.2 - streamx: 2.15.1 - tar@4.4.18: dependencies: chownr: 1.1.4 @@ -51484,13 +45555,6 @@ snapshots: mkdirp: 0.5.6 rimraf: 2.6.3 - tempy@0.6.0: - dependencies: - is-stream: 2.0.1 - temp-dir: 2.0.0 - type-fest: 0.16.0 - unique-string: 2.0.0 - tempy@1.0.1: dependencies: del: 6.1.1 @@ -51518,11 +45582,6 @@ snapshots: term-size@2.2.1: {} - terminal-link@2.1.1: - dependencies: - ansi-escapes: 4.3.2 - supports-hyperlinks: 2.3.0 - terser-webpack-plugin@5.3.10(esbuild@0.18.20)(webpack@5.91.0(esbuild@0.18.20)): dependencies: '@jridgewell/trace-mapping': 0.3.25 @@ -51608,12 +45667,8 @@ snapshots: throat@5.0.0: {} - throat@6.0.2: {} - throttle-debounce@2.3.0: {} - throttle-debounce@5.0.0: {} - through2@2.0.5: dependencies: readable-stream: 2.3.8 @@ -51621,8 +45676,6 @@ snapshots: through@2.3.8: {} - thunky@1.1.0: {} - time-span@4.0.0: dependencies: convert-hrtime: 3.0.0 @@ -51721,10 +45774,6 @@ snapshots: dependencies: punycode: 2.3.0 - tr46@2.1.0: - dependencies: - punycode: 2.3.0 - tr46@3.0.0: dependencies: punycode: 2.3.0 @@ -51759,8 +45808,6 @@ snapshots: try-require@1.2.1: {} - tryer@1.0.1: {} - ts-api-utils@1.0.3(typescript@5.5.4): dependencies: typescript: 5.5.4 @@ -52270,8 +46317,6 @@ snapshots: uncrypto@0.1.3: {} - underscore@1.12.1: {} - underscore@1.9.1: optional: true @@ -52349,28 +46394,6 @@ snapshots: trough: 2.1.0 vfile: 5.3.7 - unimported@1.30.0(eslint@8.57.0): - dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.5.4) - chalk: 4.1.2 - cosmiconfig: 8.3.6(typescript@5.5.4) - debug: 4.3.4(supports-color@8.1.1) - file-entry-cache: 6.0.1 - flow-remove-types: 2.156.0 - glob: 7.2.3 - json5: 2.2.3 - ora: 5.4.1 - read-pkg-up: 7.0.1 - resolve: 1.22.4 - simple-git: 3.19.1 - term-size: 2.2.1 - typescript: 5.5.4 - yargs: 16.2.0 - transitivePeerDependencies: - - eslint - - supports-color - union-value@1.0.1: dependencies: arr-union: 3.1.0 @@ -52468,8 +46491,6 @@ snapshots: webpack-sources: 3.2.3 webpack-virtual-modules: 0.5.0 - unquote@1.1.1: {} - unset-value@1.0.0: dependencies: has-value: 0.3.1 @@ -52502,8 +46523,6 @@ snapshots: consola: 3.2.3 pathe: 1.1.1 - upath@1.2.0: {} - update-browserslist-db@1.0.11(browserslist@4.21.10): dependencies: browserslist: 4.21.10 @@ -52602,13 +46621,6 @@ snapshots: util-deprecate@1.0.2: {} - util.promisify@1.0.1: - dependencies: - define-properties: 1.2.1 - es-abstract: 1.23.3 - has-symbols: 1.0.3 - object.getownpropertydescriptors: 2.1.6 - util.promisify@1.1.2: dependencies: call-bind: 1.0.7 @@ -52627,8 +46639,6 @@ snapshots: is-typed-array: 1.1.13 which-typed-array: 1.1.15 - utila@0.4.0: {} - utils-merge@1.0.1: {} uuid-parse@1.1.0: {} @@ -52656,12 +46666,6 @@ snapshots: v8-compile-cache-lib@3.0.1: {} - v8-to-istanbul@8.1.1: - dependencies: - '@types/istanbul-lib-coverage': 2.0.6 - convert-source-map: 1.9.0 - source-map: 0.7.4 - v8-to-istanbul@9.1.0: dependencies: '@jridgewell/trace-mapping': 0.3.25 @@ -52882,8 +46886,6 @@ snapshots: - supports-color - terser - vlq@0.2.3: {} - vlq@1.0.1: {} vue-template-compiler@2.7.16: @@ -52891,14 +46893,6 @@ snapshots: de-indent: 1.0.2 he: 1.2.0 - w3c-hr-time@1.0.2: - dependencies: - browser-process-hrtime: 1.0.0 - - w3c-xmlserializer@2.0.0: - dependencies: - xml-name-validator: 3.0.0 - w3c-xmlserializer@4.0.0: dependencies: xml-name-validator: 4.0.0 @@ -53033,10 +47027,6 @@ snapshots: glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 - wbuf@1.7.3: - dependencies: - minimalistic-assert: 1.0.1 - wcwidth@1.0.1: dependencies: defaults: 1.0.4 @@ -53541,10 +47531,6 @@ snapshots: webidl-conversions@4.0.2: {} - webidl-conversions@5.0.0: {} - - webidl-conversions@6.1.0: {} - webidl-conversions@7.0.0: {} webpack-bundle-analyzer@4.10.1(bufferutil@4.0.8)(utf-8-validate@5.0.10): @@ -53566,71 +47552,6 @@ snapshots: - bufferutil - utf-8-validate - webpack-dev-middleware@5.3.4(webpack@5.91.0): - dependencies: - colorette: 2.0.20 - memfs: 3.5.3 - mime-types: 2.1.35 - range-parser: 1.2.1 - schema-utils: 4.2.0 - webpack: 5.91.0 - - webpack-dev-server@4.15.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)(webpack@5.91.0): - dependencies: - '@types/bonjour': 3.5.13 - '@types/connect-history-api-fallback': 1.5.4 - '@types/express': 4.17.17 - '@types/serve-index': 1.9.4 - '@types/serve-static': 1.15.2 - '@types/sockjs': 0.3.36 - '@types/ws': 8.5.5 - ansi-html-community: 0.0.8 - bonjour-service: 1.2.1 - chokidar: 3.5.3 - colorette: 2.0.20 - compression: 1.7.4 - connect-history-api-fallback: 2.0.0 - default-gateway: 6.0.3 - express: 4.18.2 - graceful-fs: 4.2.11 - html-entities: 2.5.2 - http-proxy-middleware: 2.0.6(@types/express@4.17.17) - ipaddr.js: 2.2.0 - launch-editor: 2.6.1 - open: 8.4.2 - p-retry: 4.6.2 - rimraf: 3.0.2 - schema-utils: 4.2.0 - selfsigned: 2.4.1 - serve-index: 1.9.1 - sockjs: 0.3.24 - spdy: 4.0.2 - webpack-dev-middleware: 5.3.4(webpack@5.91.0) - ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) - optionalDependencies: - webpack: 5.91.0 - transitivePeerDependencies: - - bufferutil - - debug - - supports-color - - utf-8-validate - - webpack-manifest-plugin@4.1.1(webpack@5.91.0): - dependencies: - tapable: 2.2.1 - webpack: 5.91.0 - webpack-sources: 2.3.1 - - webpack-sources@1.4.3: - dependencies: - source-list-map: 2.0.1 - source-map: 0.6.1 - - webpack-sources@2.3.1: - dependencies: - source-list-map: 2.0.1 - source-map: 0.6.1 - webpack-sources@3.2.3: {} webpack-virtual-modules@0.5.0: {} @@ -53642,8 +47563,8 @@ snapshots: '@webassemblyjs/ast': 1.12.1 '@webassemblyjs/wasm-edit': 1.12.1 '@webassemblyjs/wasm-parser': 1.12.1 - acorn: 8.11.3 - acorn-import-assertions: 1.9.0(acorn@8.11.3) + acorn: 8.12.0 + acorn-import-assertions: 1.9.0(acorn@8.12.0) browserslist: 4.23.0 chrome-trace-event: 1.0.3 enhanced-resolve: 5.16.0 @@ -53673,8 +47594,8 @@ snapshots: '@webassemblyjs/ast': 1.12.1 '@webassemblyjs/wasm-edit': 1.12.1 '@webassemblyjs/wasm-parser': 1.12.1 - acorn: 8.11.3 - acorn-import-assertions: 1.9.0(acorn@8.11.3) + acorn: 8.12.0 + acorn-import-assertions: 1.9.0(acorn@8.12.0) browserslist: 4.23.0 chrome-trace-event: 1.0.3 enhanced-resolve: 5.16.0 @@ -53697,14 +47618,6 @@ snapshots: - esbuild - uglify-js - websocket-driver@0.7.4: - dependencies: - http-parser-js: 0.5.8 - safe-buffer: 5.2.1 - websocket-extensions: 0.1.4 - - websocket-extensions@0.1.4: {} - websocket@1.0.32: dependencies: bufferutil: 4.0.8 @@ -53716,10 +47629,6 @@ snapshots: transitivePeerDependencies: - supports-color - whatwg-encoding@1.0.5: - dependencies: - iconv-lite: 0.4.24 - whatwg-encoding@2.0.0: dependencies: iconv-lite: 0.6.3 @@ -53730,8 +47639,6 @@ snapshots: whatwg-fetch@3.6.20: {} - whatwg-mimetype@2.3.0: {} - whatwg-mimetype@3.0.0: {} whatwg-url@11.0.0: @@ -53750,12 +47657,6 @@ snapshots: tr46: 1.0.1 webidl-conversions: 4.0.2 - whatwg-url@8.7.0: - dependencies: - lodash: 4.17.21 - tr46: 2.1.0 - webidl-conversions: 6.1.0 - which-boxed-primitive@1.0.2: dependencies: is-bigint: 1.0.4 @@ -53851,131 +47752,6 @@ snapshots: reduce-flatten: 2.0.0 typical: 5.2.0 - workbox-background-sync@6.6.0: - dependencies: - idb: 7.1.1 - workbox-core: 6.6.0 - - workbox-broadcast-update@6.6.0: - dependencies: - workbox-core: 6.6.0 - - workbox-build@6.6.0(@types/babel__core@7.20.5): - dependencies: - '@apideck/better-ajv-errors': 0.3.6(ajv@8.12.0) - '@babel/core': 7.24.4 - '@babel/preset-env': 7.24.4(@babel/core@7.24.4) - '@babel/runtime': 7.24.5 - '@rollup/plugin-babel': 5.3.1(@babel/core@7.24.4)(@types/babel__core@7.20.5)(rollup@2.78.0) - '@rollup/plugin-node-resolve': 11.2.1(rollup@2.78.0) - '@rollup/plugin-replace': 2.4.2(rollup@2.78.0) - '@surma/rollup-plugin-off-main-thread': 2.2.3 - ajv: 8.12.0 - common-tags: 1.8.2 - fast-json-stable-stringify: 2.1.0 - fs-extra: 9.1.0 - glob: 7.2.3 - lodash: 4.17.21 - pretty-bytes: 5.6.0 - rollup: 2.78.0 - rollup-plugin-terser: 7.0.2(rollup@2.78.0) - source-map: 0.8.0-beta.0 - stringify-object: 3.3.0 - strip-comments: 2.0.1 - tempy: 0.6.0 - upath: 1.2.0 - workbox-background-sync: 6.6.0 - workbox-broadcast-update: 6.6.0 - workbox-cacheable-response: 6.6.0 - workbox-core: 6.6.0 - workbox-expiration: 6.6.0 - workbox-google-analytics: 6.6.0 - workbox-navigation-preload: 6.6.0 - workbox-precaching: 6.6.0 - workbox-range-requests: 6.6.0 - workbox-recipes: 6.6.0 - workbox-routing: 6.6.0 - workbox-strategies: 6.6.0 - workbox-streams: 6.6.0 - workbox-sw: 6.6.0 - workbox-window: 6.6.0 - transitivePeerDependencies: - - '@types/babel__core' - - supports-color - - workbox-cacheable-response@6.6.0: - dependencies: - workbox-core: 6.6.0 - - workbox-core@6.6.0: {} - - workbox-expiration@6.6.0: - dependencies: - idb: 7.1.1 - workbox-core: 6.6.0 - - workbox-google-analytics@6.6.0: - dependencies: - workbox-background-sync: 6.6.0 - workbox-core: 6.6.0 - workbox-routing: 6.6.0 - workbox-strategies: 6.6.0 - - workbox-navigation-preload@6.6.0: - dependencies: - workbox-core: 6.6.0 - - workbox-precaching@6.6.0: - dependencies: - workbox-core: 6.6.0 - workbox-routing: 6.6.0 - workbox-strategies: 6.6.0 - - workbox-range-requests@6.6.0: - dependencies: - workbox-core: 6.6.0 - - workbox-recipes@6.6.0: - dependencies: - workbox-cacheable-response: 6.6.0 - workbox-core: 6.6.0 - workbox-expiration: 6.6.0 - workbox-precaching: 6.6.0 - workbox-routing: 6.6.0 - workbox-strategies: 6.6.0 - - workbox-routing@6.6.0: - dependencies: - workbox-core: 6.6.0 - - workbox-strategies@6.6.0: - dependencies: - workbox-core: 6.6.0 - - workbox-streams@6.6.0: - dependencies: - workbox-core: 6.6.0 - workbox-routing: 6.6.0 - - workbox-sw@6.6.0: {} - - workbox-webpack-plugin@6.6.0(@types/babel__core@7.20.5)(webpack@5.91.0): - dependencies: - fast-json-stable-stringify: 2.1.0 - pretty-bytes: 5.6.0 - upath: 1.2.0 - webpack: 5.91.0 - webpack-sources: 1.4.3 - workbox-build: 6.6.0(@types/babel__core@7.20.5) - transitivePeerDependencies: - - '@types/babel__core' - - supports-color - - workbox-window@6.6.0: - dependencies: - '@types/trusted-types': 2.0.3 - workbox-core: 6.6.0 - workerpool@6.2.1: {} wrap-ansi@2.1.0: @@ -54015,13 +47791,6 @@ snapshots: imurmurhash: 0.1.4 signal-exit: 3.0.7 - write-file-atomic@3.0.3: - dependencies: - imurmurhash: 0.1.4 - is-typedarray: 1.0.0 - signal-exit: 3.0.7 - typedarray-to-buffer: 3.1.5 - write-file-atomic@4.0.2: dependencies: imurmurhash: 0.1.4 @@ -54128,8 +47897,6 @@ snapshots: parse-headers: 2.0.5 xtend: 4.0.2 - xml-name-validator@3.0.0: {} - xml-name-validator@4.0.0: {} xml2js@0.5.0: From 2adc6006c91b2f8c84a1f223558e24571096385f Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Sun, 1 Sep 2024 14:12:16 +0000 Subject: [PATCH 07/46] fix(tron): api links --- .../tron/_common/lib/hooks/useMyPositions.ts | 4 ++-- .../app/(non-evm)/tron/_common/lib/hooks/usePools.ts | 11 +++++++---- .../tron/_common/lib/hooks/useStablePrice.ts | 2 +- .../tron/_common/lib/utils/getAllPairAddresses.ts | 9 ++++++--- .../(non-evm)/tron/_common/lib/utils/getTokenData.ts | 2 +- .../(non-evm)/tron/_common/lib/utils/getTronPrice.ts | 2 +- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useMyPositions.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useMyPositions.ts index a4bdf81d2e..d703c52457 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useMyPositions.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useMyPositions.ts @@ -48,7 +48,7 @@ const getPairContributions = async ({ }) => { try { const res = await fetch( - `/api/pools/my-positions?pairAddresses=${pairAddresses}&walletAddress=${walletAddress}`, + `/tron/api/pools/my-positions?pairAddresses=${pairAddresses}&walletAddress=${walletAddress}`, { method: 'GET' }, ) if (!res.ok) { @@ -163,7 +163,7 @@ const injectReserves = async (pools: _IPools) => { for (const chunk of chunkedPools) { const pairAddresses = chunk.map((pool) => pool.pairAddress) const res = await fetch( - `/api/pools/get-reserves?pairAddresses=${pairAddresses}`, + `/tron/api/pools/get-reserves?pairAddresses=${pairAddresses}`, { method: 'GET' }, ) if (!res.ok) { diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts index dafe846fdb..93b5760c91 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts @@ -19,9 +19,12 @@ const getPoolsByEvent = async ({ factoryAddress, }: { factoryAddress: string }): Promise<_IPools> => { try { - const res = await fetch(`/api/pools?factoryAddress=${factoryAddress}`, { - method: 'GET', - }) + const res = await fetch( + `/tron/api/pools?factoryAddress=${factoryAddress}`, + { + method: 'GET', + }, + ) if (!res.ok) { throw new Error('Failed to fetch data from Tron API') } @@ -60,7 +63,7 @@ const injectReserves = async (pools: _IPools) => { for (const chunk of chunkedPools) { const pairAddresses = chunk.map((pool) => pool.pairAddress) const res = await fetch( - `/api/pools/get-reserves?pairAddresses=${pairAddresses}`, + `/tron/api/pools/get-reserves?pairAddresses=${pairAddresses}`, { method: 'GET' }, ) if (!res.ok) { diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useStablePrice.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useStablePrice.ts index 968c86aa17..2cc3dd99f9 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useStablePrice.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useStablePrice.ts @@ -182,7 +182,7 @@ const getPairsIfItExists = async (token: IToken) => { const getReserves = async (pairAddress: string) => { try { const res = await fetch( - `/api/pools/get-reserves?pairAddresses=${[pairAddress]}`, + `/tron/api/pools/get-reserves?pairAddresses=${[pairAddress]}`, { method: 'GET' }, ) if (!res.ok) { diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getAllPairAddresses.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getAllPairAddresses.ts index a10a8f94a9..17895f824d 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getAllPairAddresses.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getAllPairAddresses.ts @@ -3,9 +3,12 @@ import { IPoolDataResponse } from '~tron/_common/types/get-pools-type' export const getAllPairAddresses = async () => { try { - const res = await fetch(`/api/pools?factoryAddress=${FACTORY_CONTRACT}`, { - method: 'GET', - }) + const res = await fetch( + `/tron/api/pools?factoryAddress=${FACTORY_CONTRACT}`, + { + method: 'GET', + }, + ) if (!res.ok) { throw new Error('Failed to fetch data from Tron API') } diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getTokenData.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getTokenData.ts index c211cfe653..9b4393980d 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getTokenData.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getTokenData.ts @@ -5,7 +5,7 @@ export const getTokenData = async ({ }: { contractAddress: string }) => { try { const res = await fetch( - `/api/token-info?contractAddress=${contractAddress}`, + `/tron/api/token-info?contractAddress=${contractAddress}`, { method: 'GET' }, ) if (!res.ok) { diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getTronPrice.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getTronPrice.ts index 77e1a8a862..2a818780c0 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getTronPrice.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/getTronPrice.ts @@ -2,7 +2,7 @@ import { ITronInUSDTResponse } from '~tron/_common/types/pricing-types' export const getTronPrice = async () => { try { - const res = await fetch(`/api/pricing`, { method: 'GET' }) + const res = await fetch(`/tron/api/pricing`, { method: 'GET' }) if (!res.ok) { throw new Error('Failed to fetch data from Tron API') } From b666cf02f513bcde8f2d81851f1f479699351b76 Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Mon, 2 Sep 2024 17:14:04 +0000 Subject: [PATCH 08/46] chore: format --- apps/web/package.json | 10 +++++----- config/nextjs/index.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/web/package.json b/apps/web/package.json index 84b2eb6f0c..acfe1ae658 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -93,11 +93,11 @@ "viem": "2.21.4", "wagmi": "2.12.10", "zod": "3.23.8", - "tronweb": "^5.3.2", - "@tronweb3/tronwallet-abstract-adapter": "^1.1.6", - "@tronweb3/tronwallet-adapter-react-hooks": "^1.1.7", - "@tronweb3/tronwallet-adapter-react-ui": "^1.1.8", - "@tronweb3/tronwallet-adapters": "^1.2.1" + "@tronweb3/tronwallet-abstract-adapter": "1.1.6", + "@tronweb3/tronwallet-adapter-react-hooks": "1.1.7", + "@tronweb3/tronwallet-adapter-react-ui": "1.1.8", + "@tronweb3/tronwallet-adapters": "1.2.1", + "tronweb": "5.3.2" }, "devDependencies": { "@0xsquid/squid-types": "0.1.78", diff --git a/config/nextjs/index.js b/config/nextjs/index.js index 2e3ae64942..116fb30dac 100644 --- a/config/nextjs/index.js +++ b/config/nextjs/index.js @@ -27,7 +27,7 @@ const defaultNextConfig = { images: { loader: 'cloudinary', path: 'https://res.cloudinary.com/sushi-cdn/image/fetch/', - domains: ['cdn.sushi.com', "static.tronscan.org"], + domains: ['cdn.sushi.com', 'static.tronscan.org'], }, eslint: { dirs: [ From 6981b1b59363b3e0719c242f73ca3e94fc8ad108 Mon Sep 17 00:00:00 2001 From: solidityteam Date: Tue, 3 Sep 2024 12:14:10 -0400 Subject: [PATCH 09/46] chore: fix linting in tron --- .../tron/_common/lib/hooks/useAmountsOut.ts | 2 +- .../tron/_common/lib/hooks/useMyPositions.ts | 114 +++++++++--------- .../tron/_common/lib/hooks/useTokenBalance.ts | 2 +- .../tron/_common/lib/hooks/useTotalSupply.ts | 2 +- .../tron/_common/lib/utils/formatters.ts | 17 ++- .../tron/_common/lib/utils/helpers.ts | 13 +- .../_common/ui/General/TokenListSelect.tsx | 8 +- .../tron/_common/ui/Input/Search.tsx | 13 +- .../_common/ui/Pools/Add/AmountInToken0.tsx | 2 +- .../_common/ui/Pools/Add/AmountIntToken1.tsx | 9 +- .../tron/_common/ui/Pools/Add/DepositForm.tsx | 2 +- .../_common/ui/Pools/Add/SelectTokensForm.tsx | 2 +- .../ui/Pools/PoolDetails/PoolLiquidity.tsx | 12 +- .../ui/Pools/PoolPosition/PoolPosition.tsx | 8 +- .../tron/_common/ui/Pools/PoolSearchBar.tsx | 4 +- .../ui/Pools/PoolsTable/PoolsTable.tsx | 4 +- .../Pools/PositionsTable/PositionsTable.tsx | 2 +- .../ui/Pools/Remove/MinimumReceive.tsx | 8 +- .../ui/Pools/Remove/RemoveLiquidity.tsx | 2 +- .../tron/_common/ui/Pools/ReserveHelper.tsx | 2 +- .../tron/_common/ui/Shared/ApproveToken.tsx | 6 + .../tron/_common/ui/Swap/AmountIn.tsx | 4 +- .../ui/Swap/ReviewSwapDialogTrigger.tsx | 9 +- .../ui/WalletConnector/DefaultView.tsx | 1 + .../ui/WalletConnector/SettingsView.tsx | 8 +- .../app/(non-evm)/tron/pool/[poolId]/page.tsx | 5 +- .../tron/pool/[poolId]/remove-provider.tsx | 4 +- .../app/(non-evm)/tron/pool/pool-provider.tsx | 4 +- .../app/(non-evm)/tron/swap/swap-provider.tsx | 4 +- package.json | 6 +- pnpm-lock.yaml | 113 ++++++++++++----- 31 files changed, 232 insertions(+), 160 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts index d1a40fd4ba..b4eb96e368 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts @@ -23,7 +23,7 @@ export const useAmountsOut = ({ amountIn }: { amountIn: string }) => { if (!route) return [] const cleanedAddressRoute = route?.map((i) => getValidTokenAddress(i)) - if (!amountIn || isNaN(Number(amountIn))) return [] + if (!amountIn || Number.isNaN(Number(amountIn))) return [] try { tronWeb.setAddress(ROUTER_CONTRACT) const routerContract = await tronWeb.contract( diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useMyPositions.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useMyPositions.ts index d703c52457..ef69dbb264 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useMyPositions.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useMyPositions.ts @@ -84,64 +84,60 @@ const getPairContributions = async ({ ) if (!groupedData) return [] - const groupedDataArray = Object.entries(groupedData).map( - ([txHash, data]) => { - const [token0, token1] = sortTokenAddresses( - data?.[0]?.currency?.address ?? getValidTokenAddress(TRON.address), - data?.[1]?.currency?.address ?? getValidTokenAddress(TRON.address), - ) - const pairAddress = data?.[0]?.receiver as string + const groupedDataArray = Object.entries(groupedData).map(([_, data]) => { + const [token0, token1] = sortTokenAddresses( + data?.[0]?.currency?.address ?? getValidTokenAddress(TRON.address), + data?.[1]?.currency?.address ?? getValidTokenAddress(TRON.address), + ) + const pairAddress = data?.[0]?.receiver as string - //if token0 or token1 is equal to pairAddress, skip this pair - if (token0 === pairAddress || token1 === pairAddress) { - return - } + //if token0 or token1 is equal to pairAddress, skip this pair + if (token0 === pairAddress || token1 === pairAddress) { + return + } - const _token0: IToken = { - address: token0, - decimals: - data.find((i) => i?.currency?.address === token0)?.currency - ?.decimals ?? TRON.decimals, - name: - data.find((i) => i.currency.address === token0)?.currency.name ?? - TRON.name, - symbol: - data.find((i) => i.currency.address === token0)?.currency.symbol ?? - TRON.symbol, - logoURI: - DEFAULT_TOKEN_LIST.find( - (i) => - getValidTokenAddress(i.address) === - getValidTokenAddress(token0), - )?.logoURI ?? undefined, - } - const _token1: IToken = { - address: token1, - decimals: - data.find((i) => i.currency.address === token1)?.currency - .decimals ?? TRON.decimals, - name: - data.find((i) => i.currency.address === token1)?.currency.name ?? - TRON.name, - symbol: - data.find((i) => i.currency.address === token1)?.currency.symbol ?? - TRON.symbol, - logoURI: - DEFAULT_TOKEN_LIST.find( - (i) => - getValidTokenAddress(i.address) === - getValidTokenAddress(token1), - )?.logoURI ?? undefined, - } - return { - token0: _token0, - token1: _token1, - pairAddress: pairAddress, - reserve0: '0', - reserve1: '0', - } - }, - ) + const _token0: IToken = { + address: token0, + decimals: + data.find((i) => i?.currency?.address === token0)?.currency + ?.decimals ?? TRON.decimals, + name: + data.find((i) => i.currency.address === token0)?.currency.name ?? + TRON.name, + symbol: + data.find((i) => i.currency.address === token0)?.currency.symbol ?? + TRON.symbol, + logoURI: + DEFAULT_TOKEN_LIST.find( + (i) => + getValidTokenAddress(i.address) === getValidTokenAddress(token0), + )?.logoURI ?? undefined, + } + const _token1: IToken = { + address: token1, + decimals: + data.find((i) => i.currency.address === token1)?.currency.decimals ?? + TRON.decimals, + name: + data.find((i) => i.currency.address === token1)?.currency.name ?? + TRON.name, + symbol: + data.find((i) => i.currency.address === token1)?.currency.symbol ?? + TRON.symbol, + logoURI: + DEFAULT_TOKEN_LIST.find( + (i) => + getValidTokenAddress(i.address) === getValidTokenAddress(token1), + )?.logoURI ?? undefined, + } + return { + token0: _token0, + token1: _token1, + pairAddress: pairAddress, + reserve0: '0', + reserve1: '0', + } + }) // //filter out all objects that have duplicate pair addresses or are undefined const filteredDataArray = groupedDataArray.filter( (v, i, a) => @@ -164,7 +160,9 @@ const injectReserves = async (pools: _IPools) => { const pairAddresses = chunk.map((pool) => pool.pairAddress) const res = await fetch( `/tron/api/pools/get-reserves?pairAddresses=${pairAddresses}`, - { method: 'GET' }, + { + method: 'GET', + }, ) if (!res.ok) { throw new Error('Failed to fetch data from Tron API') @@ -209,7 +207,7 @@ export const useMyPositions = () => { const { address } = useWallet() return useQuery({ queryKey: ['useMyPositions', { address: address }], - queryFn: async (data) => { + queryFn: async () => { if (!address) return [] if (!isAddress(address)) return [] const allPairs = await getAllPairAddresses() diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenBalance.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenBalance.ts index 2e80d35080..cd6421f25c 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenBalance.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenBalance.ts @@ -1,5 +1,5 @@ -import { useTronWeb } from './useTronWeb' import { useQuery } from '@tanstack/react-query' +import { useTronWeb } from './useTronWeb' const abi = [ { diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTotalSupply.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTotalSupply.ts index 1cbc04060e..846951418b 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTotalSupply.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTotalSupply.ts @@ -1,5 +1,5 @@ -import { useTronWeb } from './useTronWeb' import { useQuery } from '@tanstack/react-query' +import { useTronWeb } from './useTronWeb' const abi = [ { diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/utils/formatters.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/formatters.ts index 02ecf2e9b3..a84682a6b3 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/utils/formatters.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/formatters.ts @@ -17,12 +17,9 @@ export const hashStringToColor = (str: string) => { const r = (hash & 0xff0000) >> 16 const g = (hash & 0x00ff00) >> 8 const b = hash & 0x0000ff - return ( - '#' + - ('0' + r.toString(16)).substr(-2) + - ('0' + g.toString(16)).substr(-2) + - ('0' + b.toString(16)).substr(-2) - ) + return `#${r.toString(16).padStart(2, '0')}${g + .toString(16) + .padStart(2, '0')}${b.toString(16).padStart(2, '0')}` } const _djb2 = (str: string) => { @@ -57,7 +54,7 @@ export const formatUnits = ( decimals: number, maxDecimals?: number, ): string => { - if (isNaN(Number(amount))) { + if (Number.isNaN(Number(amount))) { return '0' } const val = TronWeb.toBigNumber(amount).div(10 ** decimals) @@ -76,14 +73,14 @@ export const formatUnitsForInput = ( amount: string | number, decimals: number, ): string => { - if (isNaN(Number(amount))) { + if (Number.isNaN(Number(amount))) { return '0' } const _decimals = toBigNumber(10).pow(decimals) const val = TronWeb.toBigNumber(amount).div(_decimals) - if (isNaN(val)) { + if (Number.isNaN(val)) { return '0' } @@ -94,7 +91,7 @@ export const parseUnits = ( amount: string | number, decimals: number, ): string => { - if (isNaN(Number(amount))) { + if (Number.isNaN(Number(amount))) { return '0' } diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/utils/helpers.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/helpers.ts index 26a603f166..5fef61aee3 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/utils/helpers.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/utils/helpers.ts @@ -143,8 +143,8 @@ export const getTransactionInfo = async ( for (let i = 0; i < maxTries; i++) { transactionInfo = await tronWebInstance.trx.getUnconfirmedTransactionInfo(txId) - console.log({ transactionInfo }) - if (transactionInfo && transactionInfo.receipt) { + // console.log({ transactionInfo }); + if (transactionInfo?.receipt) { return transactionInfo } await timer(waitIntervalMs) @@ -412,7 +412,7 @@ export const getArgsForAddLiquidity = ( ], to, ] - case 'addLiquidityETH(address,uint256,uint256,uint256,address,uint256)': + case 'addLiquidityETH(address,uint256,uint256,uint256,address,uint256)': { const tokenAddress = token0Address === 'TRON' ? token1Address : token0Address const tokenAmount = @@ -435,6 +435,7 @@ export const getArgsForAddLiquidity = ( ], to, ] + } default: throw new Error('Invalid function selector') @@ -483,7 +484,7 @@ export const getArgsForRemoveLiquidity = ( ], to, ] - case 'removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)': + case 'removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)': { const tokenAddress = token0Address === 'TRON' ? token1Address : token0Address const tokenMinAmount = @@ -504,7 +505,8 @@ export const getArgsForRemoveLiquidity = ( ], to, ] - case 'removeLiquidityETHSupportingFeeOnTransferTokens(address,uint256,uint256,uint256,address,uint256)': + } + case 'removeLiquidityETHSupportingFeeOnTransferTokens(address,uint256,uint256,uint256,address,uint256)': { const _tokenAddress = token0Address === 'TRON' ? token1Address : token0Address const _tokenMinAmount = @@ -525,6 +527,7 @@ export const getArgsForRemoveLiquidity = ( ], to, ] + } } } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx index 7b15899b2b..c9eb22ce00 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx @@ -147,8 +147,8 @@ const TokenButton = ({ () => DEFAULT_TOKEN_LIST.some((t) => t.address === token.address), [token], ) - const isNew = hasToken && !hasToken(token) - const isCustomAdded = hasToken && hasToken(token) + const isNew = !hasToken?.(token) + const isCustomAdded = hasToken?.(token) return (
    @@ -190,7 +190,7 @@ const TokenButton = ({ {isNew && !isOnDefaultList ? ( -
    -
    - -
    -
    - - Looking for a partnership with Sushi? - - -
    -
    - Need Help? - -
    -
    - - + return ( + <> + +
    +
    +
    +

    + Put your funds to work
    + by providing liquidity. +

    +

    + When you add liquidity to a pool, you can receive a share of its trading volume and + potentially snag extra rewards when there are incentives involved! +

    +
    +
    +
    + +
    +
    +
    +
    +
    + Looking for a partnership with Sushi? + +
    +
    + Need Help? + +
    +
    +
    +
    - - - ) + + + ); } diff --git a/package.json b/package.json index 802556b61d..549a864814 100644 --- a/package.json +++ b/package.json @@ -38,10 +38,10 @@ "tsx": "4.19.0", "turbo": "2.0.5" }, - + "packageManager": "pnpm@9.4.0", "engines": { - "node": ">=20.x" - + "node": ">=20.x", + "pnpm": "9.4.0" }, "pnpm": { "overrides": { From da14aa1f3036ba894bc968152ec622b52c068b1d Mon Sep 17 00:00:00 2001 From: solidityteam Date: Tue, 3 Sep 2024 12:45:15 -0400 Subject: [PATCH 12/46] chore: fix linting --- apps/web/next.config.mjs | 232 +++++++++--------- .../ui/Pools/PoolsTable/PoolsTable.tsx | 132 +++++----- apps/web/src/app/(non-evm)/tron/pool/page.tsx | 129 +++++----- 3 files changed, 257 insertions(+), 236 deletions(-) diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 65e6f1a42f..2d6d94d575 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -1,131 +1,131 @@ -import { withSentryConfig } from "@sentry/nextjs"; -import defaultNextConfig from "@sushiswap/nextjs-config"; -import { withAxiom } from "next-axiom"; +import { withSentryConfig } from '@sentry/nextjs' +import defaultNextConfig from '@sushiswap/nextjs-config' +import { withAxiom } from 'next-axiom' -import withBundleAnalyzer from "@next/bundle-analyzer"; +import withBundleAnalyzer from '@next/bundle-analyzer' const bundleAnalyzer = withBundleAnalyzer({ - enabled: false && process.env.NODE_ENV !== "development", -}); + enabled: false && process.env.NODE_ENV !== 'development', +}) /** @type {import('next').NextConfig} */ const nextConfig = bundleAnalyzer({ - ...defaultNextConfig, - experimental: { - ...defaultNextConfig.experimental, - testProxy: process.env.NEXT_PUBLIC_APP_ENV === "test", - }, - async redirects() { - return [ - { - source: "/:path*", - has: [ - { - type: "host", - value: "test.sushi.com", - }, - ], - destination: "https://sushi.com/test/:path*", - permanent: true, - }, - { - source: "/:path*", - has: [ - { - type: "host", - value: "aptos.sushi.com", - }, - ], - destination: "https://sushi.com/aptos/:path*", - permanent: true, - }, - { - source: "/aptos", - permanent: true, - destination: "/aptos/swap", - }, - { - source: "/tron", - permanent: true, - destination: "/tron/swap", - }, - { - source: "/", - permanent: true, - destination: "/swap", - }, - { - source: "/discord{/}?", - permanent: true, - destination: "https://discord.gg/ej78AWjy6Y", - }, - { - source: "/github{/}?", - permanent: true, - destination: "https://github.com/sushiswap", - }, - { - source: "/twitter{/}?", - permanent: true, - destination: "https://twitter.com/sushiswap", - }, - { - source: "/instagram{/}?", - permanent: true, - destination: "https://instagram.com/instasushiswap", - }, - { - source: "/medium{/}?", - permanent: true, - destination: "https://medium.com/sushiswap-org", - }, - { - source: "/skale/swap", - permanent: true, - destination: "/swap?chainId=2046399126", - }, - { - source: "/swap/cross-chain:path*", - permanent: true, - destination: "/cross-chain-swap:path*", - }, - ]; - }, - async rewrites() { - return []; - }, -}); + ...defaultNextConfig, + experimental: { + ...defaultNextConfig.experimental, + testProxy: process.env.NEXT_PUBLIC_APP_ENV === 'test', + }, + async redirects() { + return [ + { + source: '/:path*', + has: [ + { + type: 'host', + value: 'test.sushi.com', + }, + ], + destination: 'https://sushi.com/test/:path*', + permanent: true, + }, + { + source: '/:path*', + has: [ + { + type: 'host', + value: 'aptos.sushi.com', + }, + ], + destination: 'https://sushi.com/aptos/:path*', + permanent: true, + }, + { + source: '/aptos', + permanent: true, + destination: '/aptos/swap', + }, + { + source: '/tron', + permanent: true, + destination: '/tron/swap', + }, + { + source: '/', + permanent: true, + destination: '/swap', + }, + { + source: '/discord{/}?', + permanent: true, + destination: 'https://discord.gg/ej78AWjy6Y', + }, + { + source: '/github{/}?', + permanent: true, + destination: 'https://github.com/sushiswap', + }, + { + source: '/twitter{/}?', + permanent: true, + destination: 'https://twitter.com/sushiswap', + }, + { + source: '/instagram{/}?', + permanent: true, + destination: 'https://instagram.com/instasushiswap', + }, + { + source: '/medium{/}?', + permanent: true, + destination: 'https://medium.com/sushiswap-org', + }, + { + source: '/skale/swap', + permanent: true, + destination: '/swap?chainId=2046399126', + }, + { + source: '/swap/cross-chain:path*', + permanent: true, + destination: '/cross-chain-swap:path*', + }, + ] + }, + async rewrites() { + return [] + }, +}) export default withSentryConfig(withAxiom(nextConfig), { - // For all available options, see: - // https://github.com/getsentry/sentry-webpack-plugin#options + // For all available options, see: + // https://github.com/getsentry/sentry-webpack-plugin#options - org: "sushi-j9", - project: "evm", + org: 'sushi-j9', + project: 'evm', - // Only print logs for uploading source maps in CI - silent: !process.env.CI, + // Only print logs for uploading source maps in CI + silent: !process.env.CI, - // For all available options, see: - // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ + // For all available options, see: + // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ - // Upload a larger set of source maps for prettier stack traces (increases build time) - widenClientFileUpload: true, + // Upload a larger set of source maps for prettier stack traces (increases build time) + widenClientFileUpload: true, - // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. - // This can increase your server load as well as your hosting bill. - // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- - // side errors will fail. - tunnelRoute: "/monitoring", + // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. + // This can increase your server load as well as your hosting bill. + // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- + // side errors will fail. + tunnelRoute: '/monitoring', - // Hides source maps from generated client bundles - hideSourceMaps: true, + // Hides source maps from generated client bundles + hideSourceMaps: true, - // Automatically tree-shake Sentry logger statements to reduce bundle size - disableLogger: true, + // Automatically tree-shake Sentry logger statements to reduce bundle size + disableLogger: true, - // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.) - // See the following for more information: - // https://docs.sentry.io/product/crons/ - // https://vercel.com/docs/cron-jobs - automaticVercelMonitors: true, -}); + // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.) + // See the following for more information: + // https://docs.sentry.io/product/crons/ + // https://vercel.com/docs/cron-jobs + automaticVercelMonitors: true, +}) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx index 0b290b7eb5..dc9bedfcc3 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx @@ -1,75 +1,77 @@ -import { useDebounce } from "@sushiswap/hooks"; -import { DataTable } from "@sushiswap/ui"; -import { PaginationState } from "@tanstack/react-table"; -import { useEffect, useMemo, useState } from "react"; -import { usePools } from "~tron/_common/lib/hooks/usePools"; -import { NAME_COLUMN, RESERVES_COLUMN, TVL_COLUMN } from "./PoolColumns"; +import { useDebounce } from '@sushiswap/hooks' +import { DataTable } from '@sushiswap/ui' +import { PaginationState } from '@tanstack/react-table' +import { useEffect, useMemo, useState } from 'react' +import { usePools } from '~tron/_common/lib/hooks/usePools' +import { NAME_COLUMN, RESERVES_COLUMN, TVL_COLUMN } from './PoolColumns' export type IRowData = { - name: string; - pairAddress: string; - token0Address: string; - token1Address: string; - reserve0: string; - reserve1: string; -}; + name: string + pairAddress: string + token0Address: string + token1Address: string + reserve0: string + reserve1: string +} type PoolsTableProps = { - query: string; - handlePoolsOnView: (pools: number) => void; -}; + query: string + handlePoolsOnView: (pools: number) => void +} export const PoolsTable = ({ query, handlePoolsOnView }: PoolsTableProps) => { - const [paginationState, setPaginationState] = useState({ - pageIndex: 0, - pageSize: 10, - }); - const debouncedQuery = useDebounce(query, 250); - const { data, isLoading } = usePools(); + const [paginationState, setPaginationState] = useState({ + pageIndex: 0, + pageSize: 10, + }) + const debouncedQuery = useDebounce(query, 250) + const { data, isLoading } = usePools() - const filteredData = useMemo(() => { - if (!data) return []; - if (!debouncedQuery) return data; - const lowercasedQuery = debouncedQuery.toLowerCase()?.replaceAll(" ", ""); + const filteredData = useMemo(() => { + if (!data) return [] + if (!debouncedQuery) return data + const lowercasedQuery = debouncedQuery.toLowerCase()?.replaceAll(' ', '') - return data.filter((pool) => { - return (["pairAddress", "token0Address", "token1Address"] as Array).some( - (key) => pool[key].toLowerCase().includes(lowercasedQuery) - ); - }); - }, [data, debouncedQuery]); + return data.filter((pool) => { + return ( + ['pairAddress', 'token0Address', 'token1Address'] as Array< + keyof (typeof data)[0] + > + ).some((key) => pool[key].toLowerCase().includes(lowercasedQuery)) + }) + }, [data, debouncedQuery]) - useEffect(() => { - if (filteredData && !isLoading) { - handlePoolsOnView(filteredData.length); - } - }, [filteredData, isLoading, handlePoolsOnView]); + useEffect(() => { + if (filteredData && !isLoading) { + handlePoolsOnView(filteredData.length) + } + }, [filteredData, isLoading, handlePoolsOnView]) - return ( - ({ - name: `${pool.token0Address}/${pool.token1Address}`, - pairAddress: pool.pairAddress, - token0Address: pool.token0Address, - token1Address: pool.token1Address, - reserve0: pool.reserve0, - reserve1: pool.reserve1, - })) ?? [] - } - columns={[NAME_COLUMN, TVL_COLUMN, RESERVES_COLUMN]} - linkFormatter={(data) => { - const token0 = data.name.split("/")[0]; - const token1 = data.name.split("/")[1]; - return `/tron/pool/${token0}:${token1}:${data.pairAddress}`; - }} - pagination={true} - externalLink={false} - onPaginationChange={setPaginationState} - state={{ - pagination: paginationState, - }} - /> - ); -}; + return ( + ({ + name: `${pool.token0Address}/${pool.token1Address}`, + pairAddress: pool.pairAddress, + token0Address: pool.token0Address, + token1Address: pool.token1Address, + reserve0: pool.reserve0, + reserve1: pool.reserve1, + })) ?? [] + } + columns={[NAME_COLUMN, TVL_COLUMN, RESERVES_COLUMN]} + linkFormatter={(data) => { + const token0 = data.name.split('/')[0] + const token1 = data.name.split('/')[1] + return `/tron/pool/${token0}:${token1}:${data.pairAddress}` + }} + pagination={true} + externalLink={false} + onPaginationChange={setPaginationState} + state={{ + pagination: paginationState, + }} + /> + ) +} diff --git a/apps/web/src/app/(non-evm)/tron/pool/page.tsx b/apps/web/src/app/(non-evm)/tron/pool/page.tsx index 8ab5a4a4a6..4a47641659 100644 --- a/apps/web/src/app/(non-evm)/tron/pool/page.tsx +++ b/apps/web/src/app/(non-evm)/tron/pool/page.tsx @@ -1,59 +1,78 @@ -"use client"; -import { ChevronRightIcon } from "@heroicons/react/24/outline"; -import { Button, Container, LinkExternal, LinkInternal, typographyVariants } from "@sushiswap/ui"; -import { DiscordIcon } from "@sushiswap/ui/icons/DiscordIcon"; -import { PoolsView } from "~tron/_common/ui/Pools/PoolsView"; +'use client' +import { ChevronRightIcon } from '@heroicons/react/24/outline' +import { + Button, + Container, + LinkExternal, + LinkInternal, + typographyVariants, +} from '@sushiswap/ui' +import { DiscordIcon } from '@sushiswap/ui/icons/DiscordIcon' +import { PoolsView } from '~tron/_common/ui/Pools/PoolsView' export default function Pool() { - return ( - <> - -
    -
    -
    -

    - Put your funds to work
    - by providing liquidity. -

    -

    - When you add liquidity to a pool, you can receive a share of its trading volume and - potentially snag extra rewards when there are incentives involved! -

    -
    -
    -
    - -
    -
    -
    -
    -
    - Looking for a partnership with Sushi? - -
    -
    - Need Help? - -
    -
    -
    -
    + return ( + <> + +
    +
    +
    +

    + Put your funds to work
    + by providing liquidity. +

    +

    + When you add liquidity to a pool, you can receive a share of its + trading volume and potentially snag extra rewards when there are + incentives involved! +

    +
    +
    +
    + +
    +
    +
    +
    +
    + + Looking for a partnership with Sushi? + + +
    +
    + Need Help? + +
    +
    +
    +
    - - - ); + + + ) } From 9179b35565b53b3f3926f7d1ac8c605c3b572933 Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Tue, 3 Sep 2024 20:20:36 +0000 Subject: [PATCH 13/46] fix(apps/tron): pricing thing --- apps/web/src/app/(non-evm)/tron/api/pricing/route.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/web/src/app/(non-evm)/tron/api/pricing/route.ts b/apps/web/src/app/(non-evm)/tron/api/pricing/route.ts index 40b0741c24..97cf62f763 100644 --- a/apps/web/src/app/(non-evm)/tron/api/pricing/route.ts +++ b/apps/web/src/app/(non-evm)/tron/api/pricing/route.ts @@ -4,6 +4,8 @@ import { getOptions } from '~tron/_common/lib/bitquery/bitquery-options' import { getTronInUSDT } from '~tron/_common/lib/bitquery/queries/getTronInUSDT' // revalidate every 2 minutes + +export const dynamic = 'force-dynamic' export const revalidate = 120 export async function GET(): Promise { From f89480ddd4c002325b719f50723bd517637e5015 Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Wed, 4 Sep 2024 08:55:53 +0000 Subject: [PATCH 14/46] fix(apps/tron): add envs to workflow --- .github/workflows/apps-web-e2e.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/apps-web-e2e.yml b/.github/workflows/apps-web-e2e.yml index ec554d3046..0cbe401bd8 100644 --- a/.github/workflows/apps-web-e2e.yml +++ b/.github/workflows/apps-web-e2e.yml @@ -73,6 +73,10 @@ jobs: NEXT_PUBLIC_APP_ENV: 'test' NEXT_PUBLIC_CHAIN_ID: ${{ matrix.chain-id }} NEXT_TELEMETRY_DISABLED: 1 + # Tron + NEXT_PUBLIC_TRON_PRO_API_KEY: ${{ secrets.NEXT_PUBLIC_TRON_PRO_API_KEY }} + BITQUERY_API_KEY: ${{ secrets.BITQUERY_API_KEY }} + BITQUERY_BEARER_TOKEN: ${{ secrets.BITQUERY_BEARER_TOKEN }} - name: Upload test results if: always() From 48cefe60cfa9e487bdad9660775dc0d76366e3ba Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Thu, 12 Sep 2024 16:02:06 +0000 Subject: [PATCH 15/46] chore: format --- apps/web/package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/web/package.json b/apps/web/package.json index acfe1ae658..22b5350320 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -50,6 +50,10 @@ "@tanstack/react-query": "5.51.16", "@tanstack/react-query-devtools": "4.28.0", "@tanstack/react-table": "8.9.1", + "@tronweb3/tronwallet-abstract-adapter": "1.1.6", + "@tronweb3/tronwallet-adapter-react-hooks": "1.1.7", + "@tronweb3/tronwallet-adapter-react-ui": "1.1.8", + "@tronweb3/tronwallet-adapters": "1.2.1", "@tryghost/content-api": "1.11.17", "@upstash/ratelimit": "0.4.4", "@upstash/redis": "1.22.1", @@ -90,14 +94,10 @@ "sushi": "workspace:*", "swr": "2.1.5", "tiny-invariant": "1.3.1", + "tronweb": "5.3.2", "viem": "2.21.4", "wagmi": "2.12.10", - "zod": "3.23.8", - "@tronweb3/tronwallet-abstract-adapter": "1.1.6", - "@tronweb3/tronwallet-adapter-react-hooks": "1.1.7", - "@tronweb3/tronwallet-adapter-react-ui": "1.1.8", - "@tronweb3/tronwallet-adapters": "1.2.1", - "tronweb": "5.3.2" + "zod": "3.23.8" }, "devDependencies": { "@0xsquid/squid-types": "0.1.78", From b2698b7a629c5b5bb551717276f641a6fba34418 Mon Sep 17 00:00:00 2001 From: solidityteam Date: Thu, 12 Sep 2024 13:14:26 -0400 Subject: [PATCH 16/46] chore: new router and factory contracts --- .../(non-evm)/tron/_common/constants/contracts.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/constants/contracts.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/contracts.ts index f5218bd3aa..db94d11cd7 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/constants/contracts.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/constants/contracts.ts @@ -1,11 +1,5 @@ -import { IS_TESTNET } from './is-testnet' +import { IS_TESTNET } from "./is-testnet"; -export const FACTORY_CONTRACT = IS_TESTNET - ? '' - : 'TKWJdrQkqHisa1X8HUdHEfREvTzw4pMAaY' //sun.io factory contract address -export const ROUTER_CONTRACT = IS_TESTNET - ? '' - : 'TKzxdSv2FZKQrEqkKVgp5DcwEXBEKMg2Ax' //sun.io router contract address -export const MULTICALL_CONTRACT = IS_TESTNET - ? '' - : 'TGXuuKAb4bnrn137u39EKbYzKNXvdCes98' +export const FACTORY_CONTRACT = IS_TESTNET ? "" : "TPA5vJu579Ub5BRXETiEYZUs1SmGh7cDia"; //sun.io factory contract address +export const ROUTER_CONTRACT = IS_TESTNET ? "" : "TG61TbGhkx757ATfceRbnSHD3kHzQ7tk97"; //sun.io router contract address +export const MULTICALL_CONTRACT = IS_TESTNET ? "" : "TGXuuKAb4bnrn137u39EKbYzKNXvdCes98"; From a2435bb74ff56fed5b202719fb1ff6526d16db4c Mon Sep 17 00:00:00 2001 From: solidityteam Date: Thu, 12 Sep 2024 13:15:34 -0400 Subject: [PATCH 17/46] chore: exact factory abi --- .../_common/constants/abis/factory-abi.ts | 270 ++++++++++++------ 1 file changed, 188 insertions(+), 82 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/constants/abis/factory-abi.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/factory-abi.ts index 4e151d0aed..1f7b38ef85 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/constants/abis/factory-abi.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/factory-abi.ts @@ -1,83 +1,189 @@ export const FACTORY_ABI = [ - { - outputs: [{ type: 'address' }], - constant: true, - name: 'feeTo', - stateMutability: 'view', - type: 'function', - }, - { - outputs: [{ type: 'address' }], - constant: true, - name: 'feeToSetter', - stateMutability: 'view', - type: 'function', - }, - { - outputs: [{ type: 'address' }], - constant: true, - inputs: [{ type: 'uint256' }], - name: 'allPairs', - stateMutability: 'view', - type: 'function', - }, - { - outputs: [{ type: 'uint256' }], - constant: true, - name: 'allPairsLength', - stateMutability: 'view', - type: 'function', - }, - { - outputs: [{ type: 'bytes32' }], - constant: true, - name: 'getPairHash', - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ name: '_feeToSetter', type: 'address' }], - name: 'setFeeToSetter', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - outputs: [{ name: 'pair', type: 'address' }], - inputs: [ - { name: 'tokenA', type: 'address' }, - { name: 'tokenB', type: 'address' }, - ], - name: 'createPair', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - outputs: [{ type: 'address' }], - constant: true, - inputs: [{ type: 'address' }, { type: 'address' }], - name: 'getPair', - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ name: '_feeTo', type: 'address' }], - name: 'setFeeTo', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - inputs: [{ name: '_feeToSetter', type: 'address' }], - stateMutability: 'Nonpayable', - type: 'Constructor', - }, - { - inputs: [ - { indexed: true, name: 'token0', type: 'address' }, - { indexed: true, name: 'token1', type: 'address' }, - { name: 'pair', type: 'address' }, - { type: 'uint256' }, - ], - name: 'PairCreated', - type: 'Event', - }, -] + { + inputs: [ + { + internalType: "address", + name: "_feeToSetter", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "token0", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "token1", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "pair", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "PairCreated", + type: "event", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "allPairs", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "allPairsLength", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "tokenA", + type: "address", + }, + { + internalType: "address", + name: "tokenB", + type: "address", + }, + ], + name: "createPair", + outputs: [ + { + internalType: "address", + name: "pair", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "feeTo", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "feeToSetter", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "getPair", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPairHash", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_feeTo", + type: "address", + }, + ], + name: "setFeeTo", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_feeToSetter", + type: "address", + }, + ], + name: "setFeeToSetter", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; From eefb59b834b88c53ddb1533c59d60650916d693f Mon Sep 17 00:00:00 2001 From: solidityteam Date: Thu, 12 Sep 2024 13:16:12 -0400 Subject: [PATCH 18/46] chore: exact pair abi --- .../tron/_common/constants/abis/pair-abi.ts | 1091 ++++++++++------- 1 file changed, 657 insertions(+), 434 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/constants/abis/pair-abi.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/pair-abi.ts index c0469a268f..3ef4abe55c 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/constants/abis/pair-abi.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/pair-abi.ts @@ -1,435 +1,658 @@ export const PAIR_ABI = [ - { - inputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'sender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount0', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount1', - type: 'uint256', - }, - { indexed: true, internalType: 'address', name: 'to', type: 'address' }, - ], - name: 'Burn', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'sender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount0', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount1', - type: 'uint256', - }, - ], - name: 'Mint', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'sender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount0In', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount1In', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount0Out', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount1Out', - type: 'uint256', - }, - { indexed: true, internalType: 'address', name: 'to', type: 'address' }, - ], - name: 'Swap', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint112', - name: 'reserve0', - type: 'uint112', - }, - { - indexed: false, - internalType: 'uint112', - name: 'reserve1', - type: 'uint112', - }, - ], - name: 'Sync', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'address', name: 'from', type: 'address' }, - { indexed: true, internalType: 'address', name: 'to', type: 'address' }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - constant: true, - inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'MINIMUM_LIQUIDITY', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'PERMIT_TYPEHASH', - outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { internalType: 'address', name: '', type: 'address' }, - { internalType: 'address', name: '', type: 'address' }, - ], - name: 'allowance', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { internalType: 'address', name: 'spender', type: 'address' }, - { internalType: 'uint256', name: 'value', type: 'uint256' }, - ], - name: 'approve', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'balanceOf', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [{ internalType: 'address', name: 'to', type: 'address' }], - name: 'burn', - outputs: [ - { internalType: 'uint256', name: 'amount0', type: 'uint256' }, - { internalType: 'uint256', name: 'amount1', type: 'uint256' }, - ], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'decimals', - outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'factory', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'getReserves', - outputs: [ - { internalType: 'uint112', name: '_reserve0', type: 'uint112' }, - { internalType: 'uint112', name: '_reserve1', type: 'uint112' }, - { internalType: 'uint32', name: '_blockTimestampLast', type: 'uint32' }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { internalType: 'address', name: '_token0', type: 'address' }, - { internalType: 'address', name: '_token1', type: 'address' }, - ], - name: 'initialize', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'kLast', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [{ internalType: 'address', name: 'to', type: 'address' }], - name: 'mint', - outputs: [{ internalType: 'uint256', name: 'liquidity', type: 'uint256' }], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'name', - outputs: [{ internalType: 'string', name: '', type: 'string' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [{ internalType: 'address', name: '', type: 'address' }], - name: 'nonces', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { internalType: 'address', name: 'owner', type: 'address' }, - { internalType: 'address', name: 'spender', type: 'address' }, - { internalType: 'uint256', name: 'value', type: 'uint256' }, - { internalType: 'uint256', name: 'deadline', type: 'uint256' }, - { internalType: 'uint8', name: 'v', type: 'uint8' }, - { internalType: 'bytes32', name: 'r', type: 'bytes32' }, - { internalType: 'bytes32', name: 's', type: 'bytes32' }, - ], - name: 'permit', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'price0CumulativeLast', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'price1CumulativeLast', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [{ internalType: 'address', name: 'to', type: 'address' }], - name: 'skim', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { internalType: 'uint256', name: 'amount0Out', type: 'uint256' }, - { internalType: 'uint256', name: 'amount1Out', type: 'uint256' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'bytes', name: 'data', type: 'bytes' }, - ], - name: 'swap', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'symbol', - outputs: [{ internalType: 'string', name: '', type: 'string' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [], - name: 'sync', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'token0', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'token1', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [], - name: 'totalSupply', - outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: false, - inputs: [ - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'value', type: 'uint256' }, - ], - name: 'transfer', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, - { - constant: false, - inputs: [ - { internalType: 'address', name: 'from', type: 'address' }, - { internalType: 'address', name: 'to', type: 'address' }, - { internalType: 'uint256', name: 'value', type: 'uint256' }, - ], - name: 'transferFrom', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - payable: false, - stateMutability: 'nonpayable', - type: 'function', - }, -] + { + inputs: [], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "spender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount0", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount1", + type: "uint256", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + ], + name: "Burn", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount0", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount1", + type: "uint256", + }, + ], + name: "Mint", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount0In", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount1In", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount0Out", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount1Out", + type: "uint256", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + ], + name: "Swap", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint112", + name: "reserve0", + type: "uint112", + }, + { + indexed: false, + internalType: "uint112", + name: "reserve1", + type: "uint112", + }, + ], + name: "Sync", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [], + name: "DOMAIN_SEPARATOR", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MINIMUM_LIQUIDITY", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PERMIT_TYPEHASH", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + ], + name: "burn", + outputs: [ + { + internalType: "uint256", + name: "amount0", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "factory", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getReserves", + outputs: [ + { + internalType: "uint112", + name: "_reserve0", + type: "uint112", + }, + { + internalType: "uint112", + name: "_reserve1", + type: "uint112", + }, + { + internalType: "uint32", + name: "_blockTimestampLast", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_token0", + type: "address", + }, + { + internalType: "address", + name: "_token1", + type: "address", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "kLast", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + ], + name: "mint", + outputs: [ + { + internalType: "uint256", + name: "liquidity", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "nonces", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + ], + name: "permit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "price0CumulativeLast", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "price1CumulativeLast", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + ], + name: "skim", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amount0Out", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1Out", + type: "uint256", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "swap", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "sync", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "token0", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "token1", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, +]; From 79582196f9dab1fabf61ffe61c4cf21139ae2ad2 Mon Sep 17 00:00:00 2001 From: solidityteam Date: Thu, 12 Sep 2024 13:16:41 -0400 Subject: [PATCH 19/46] chore: exact router abi --- .../tron/_common/constants/abis/router-abi.ts | 1316 ++++++++++++----- 1 file changed, 972 insertions(+), 344 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/constants/abis/router-abi.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/router-abi.ts index 437f0abf56..b5c5622630 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/constants/abis/router-abi.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/router-abi.ts @@ -1,345 +1,973 @@ export const ROUTER_ABI = [ - { - inputs: [ - { name: '_factory', type: 'address' }, - { name: '_WETH', type: 'address' }, - ], - stateMutability: 'Nonpayable', - type: 'Constructor', - }, - { - outputs: [{ type: 'address' }], - name: 'WETH', - stateMutability: 'View', - type: 'Function', - }, - { - outputs: [ - { name: 'amountA', type: 'uint256' }, - { name: 'amountB', type: 'uint256' }, - { name: 'liquidity', type: 'uint256' }, - ], - inputs: [ - { name: 'tokenA', type: 'address' }, - { name: 'tokenB', type: 'address' }, - { name: 'amountADesired', type: 'uint256' }, - { name: 'amountBDesired', type: 'uint256' }, - { name: 'amountAMin', type: 'uint256' }, - { name: 'amountBMin', type: 'uint256' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'addLiquidity', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - outputs: [ - { name: 'amountToken', type: 'uint256' }, - { name: 'amountETH', type: 'uint256' }, - { name: 'liquidity', type: 'uint256' }, - ], - inputs: [ - { name: 'token', type: 'address' }, - { name: 'amountTokenDesired', type: 'uint256' }, - { name: 'amountTokenMin', type: 'uint256' }, - { name: 'amountETHMin', type: 'uint256' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'addLiquidityETH', - stateMutability: 'Payable', - type: 'Function', - }, - { - outputs: [{ type: 'address' }], - name: 'factory', - stateMutability: 'View', - type: 'Function', - }, - { - outputs: [{ name: 'amountIn', type: 'uint256' }], - inputs: [ - { name: 'amountOut', type: 'uint256' }, - { name: 'reserveIn', type: 'uint256' }, - { name: 'reserveOut', type: 'uint256' }, - ], - name: 'getAmountIn', - stateMutability: 'Pure', - type: 'Function', - }, - { - outputs: [{ name: 'amountOut', type: 'uint256' }], - inputs: [ - { name: 'amountIn', type: 'uint256' }, - { name: 'reserveIn', type: 'uint256' }, - { name: 'reserveOut', type: 'uint256' }, - ], - name: 'getAmountOut', - stateMutability: 'Pure', - type: 'Function', - }, - { - outputs: [{ name: 'amounts', type: 'uint256[]' }], - inputs: [ - { name: 'amountOut', type: 'uint256' }, - { name: 'path', type: 'address[]' }, - ], - name: 'getAmountsIn', - stateMutability: 'View', - type: 'Function', - }, - { - outputs: [{ name: 'amounts', type: 'uint256[]' }], - inputs: [ - { name: 'amountIn', type: 'uint256' }, - { name: 'path', type: 'address[]' }, - ], - name: 'getAmountsOut', - stateMutability: 'View', - type: 'Function', - }, - { - outputs: [{ name: 'pair', type: 'address' }], - inputs: [ - { name: 'tokenA', type: 'address' }, - { name: 'tokenB', type: 'address' }, - ], - name: 'getPairOffChain', - stateMutability: 'View', - type: 'Function', - }, - { - outputs: [{ name: 'amountB', type: 'uint256' }], - inputs: [ - { name: 'amountA', type: 'uint256' }, - { name: 'reserveA', type: 'uint256' }, - { name: 'reserveB', type: 'uint256' }, - ], - name: 'quote', - stateMutability: 'Pure', - type: 'Function', - }, - { - outputs: [ - { name: 'amountA', type: 'uint256' }, - { name: 'amountB', type: 'uint256' }, - ], - inputs: [ - { name: 'tokenA', type: 'address' }, - { name: 'tokenB', type: 'address' }, - { name: 'liquidity', type: 'uint256' }, - { name: 'amountAMin', type: 'uint256' }, - { name: 'amountBMin', type: 'uint256' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'removeLiquidity', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - outputs: [ - { name: 'amountToken', type: 'uint256' }, - { name: 'amountETH', type: 'uint256' }, - ], - inputs: [ - { name: 'token', type: 'address' }, - { name: 'liquidity', type: 'uint256' }, - { name: 'amountTokenMin', type: 'uint256' }, - { name: 'amountETHMin', type: 'uint256' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'removeLiquidityETH', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - outputs: [{ name: 'amountETH', type: 'uint256' }], - inputs: [ - { name: 'token', type: 'address' }, - { name: 'liquidity', type: 'uint256' }, - { name: 'amountTokenMin', type: 'uint256' }, - { name: 'amountETHMin', type: 'uint256' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'removeLiquidityETHSupportingFeeOnTransferTokens', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - outputs: [ - { name: 'amountToken', type: 'uint256' }, - { name: 'amountETH', type: 'uint256' }, - ], - inputs: [ - { name: 'token', type: 'address' }, - { name: 'liquidity', type: 'uint256' }, - { name: 'amountTokenMin', type: 'uint256' }, - { name: 'amountETHMin', type: 'uint256' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - { name: 'approveMax', type: 'bool' }, - { name: 'v', type: 'uint8' }, - { name: 'r', type: 'bytes32' }, - { name: 's', type: 'bytes32' }, - ], - name: 'removeLiquidityETHWithPermit', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - outputs: [{ name: 'amountETH', type: 'uint256' }], - inputs: [ - { name: 'token', type: 'address' }, - { name: 'liquidity', type: 'uint256' }, - { name: 'amountTokenMin', type: 'uint256' }, - { name: 'amountETHMin', type: 'uint256' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - { name: 'approveMax', type: 'bool' }, - { name: 'v', type: 'uint8' }, - { name: 'r', type: 'bytes32' }, - { name: 's', type: 'bytes32' }, - ], - name: 'removeLiquidityETHWithPermitSupportingFeeOnTransferTokens', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - outputs: [ - { name: 'amountA', type: 'uint256' }, - { name: 'amountB', type: 'uint256' }, - ], - inputs: [ - { name: 'tokenA', type: 'address' }, - { name: 'tokenB', type: 'address' }, - { name: 'liquidity', type: 'uint256' }, - { name: 'amountAMin', type: 'uint256' }, - { name: 'amountBMin', type: 'uint256' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - { name: 'approveMax', type: 'bool' }, - { name: 'v', type: 'uint8' }, - { name: 'r', type: 'bytes32' }, - { name: 's', type: 'bytes32' }, - ], - name: 'removeLiquidityWithPermit', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - outputs: [{ name: 'amounts', type: 'uint256[]' }], - inputs: [ - { name: 'amountOut', type: 'uint256' }, - { name: 'path', type: 'address[]' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'swapETHForExactTokens', - stateMutability: 'Payable', - type: 'Function', - }, - { - outputs: [{ name: 'amounts', type: 'uint256[]' }], - inputs: [ - { name: 'amountOutMin', type: 'uint256' }, - { name: 'path', type: 'address[]' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'swapExactETHForTokens', - stateMutability: 'Payable', - type: 'Function', - }, - { - inputs: [ - { name: 'amountOutMin', type: 'uint256' }, - { name: 'path', type: 'address[]' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'swapExactETHForTokensSupportingFeeOnTransferTokens', - stateMutability: 'Payable', - type: 'Function', - }, - { - outputs: [{ name: 'amounts', type: 'uint256[]' }], - inputs: [ - { name: 'amountIn', type: 'uint256' }, - { name: 'amountOutMin', type: 'uint256' }, - { name: 'path', type: 'address[]' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'swapExactTokensForETH', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - inputs: [ - { name: 'amountIn', type: 'uint256' }, - { name: 'amountOutMin', type: 'uint256' }, - { name: 'path', type: 'address[]' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'swapExactTokensForETHSupportingFeeOnTransferTokens', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - outputs: [{ name: 'amounts', type: 'uint256[]' }], - inputs: [ - { name: 'amountIn', type: 'uint256' }, - { name: 'amountOutMin', type: 'uint256' }, - { name: 'path', type: 'address[]' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'swapExactTokensForTokens', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - inputs: [ - { name: 'amountIn', type: 'uint256' }, - { name: 'amountOutMin', type: 'uint256' }, - { name: 'path', type: 'address[]' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'swapExactTokensForTokensSupportingFeeOnTransferTokens', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - outputs: [{ name: 'amounts', type: 'uint256[]' }], - inputs: [ - { name: 'amountOut', type: 'uint256' }, - { name: 'amountInMax', type: 'uint256' }, - { name: 'path', type: 'address[]' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'swapTokensForExactETH', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { - outputs: [{ name: 'amounts', type: 'uint256[]' }], - inputs: [ - { name: 'amountOut', type: 'uint256' }, - { name: 'amountInMax', type: 'uint256' }, - { name: 'path', type: 'address[]' }, - { name: 'to', type: 'address' }, - { name: 'deadline', type: 'uint256' }, - ], - name: 'swapTokensForExactTokens', - stateMutability: 'Nonpayable', - type: 'Function', - }, - { stateMutability: 'Payable', type: 'Receive' }, -] + { + inputs: [ + { + internalType: "address", + name: "_factory", + type: "address", + }, + { + internalType: "address", + name: "_WETH", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "WETH", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "tokenA", + type: "address", + }, + { + internalType: "address", + name: "tokenB", + type: "address", + }, + { + internalType: "uint256", + name: "amountADesired", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountBDesired", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountAMin", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountBMin", + type: "uint256", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "addLiquidity", + outputs: [ + { + internalType: "uint256", + name: "amountA", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountB", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidity", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "amountTokenDesired", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountTokenMin", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountETHMin", + type: "uint256", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "addLiquidityETH", + outputs: [ + { + internalType: "uint256", + name: "amountToken", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountETH", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidity", + type: "uint256", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "factory", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountOut", + type: "uint256", + }, + { + internalType: "uint256", + name: "reserveIn", + type: "uint256", + }, + { + internalType: "uint256", + name: "reserveOut", + type: "uint256", + }, + ], + name: "getAmountIn", + outputs: [ + { + internalType: "uint256", + name: "amountIn", + type: "uint256", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountIn", + type: "uint256", + }, + { + internalType: "uint256", + name: "reserveIn", + type: "uint256", + }, + { + internalType: "uint256", + name: "reserveOut", + type: "uint256", + }, + ], + name: "getAmountOut", + outputs: [ + { + internalType: "uint256", + name: "amountOut", + type: "uint256", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountOut", + type: "uint256", + }, + { + internalType: "address[]", + name: "path", + type: "address[]", + }, + ], + name: "getAmountsIn", + outputs: [ + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountIn", + type: "uint256", + }, + { + internalType: "address[]", + name: "path", + type: "address[]", + }, + ], + name: "getAmountsOut", + outputs: [ + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountA", + type: "uint256", + }, + { + internalType: "uint256", + name: "reserveA", + type: "uint256", + }, + { + internalType: "uint256", + name: "reserveB", + type: "uint256", + }, + ], + name: "quote", + outputs: [ + { + internalType: "uint256", + name: "amountB", + type: "uint256", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "tokenA", + type: "address", + }, + { + internalType: "address", + name: "tokenB", + type: "address", + }, + { + internalType: "uint256", + name: "liquidity", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountAMin", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountBMin", + type: "uint256", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "removeLiquidity", + outputs: [ + { + internalType: "uint256", + name: "amountA", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountB", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "liquidity", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountTokenMin", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountETHMin", + type: "uint256", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "removeLiquidityETH", + outputs: [ + { + internalType: "uint256", + name: "amountToken", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountETH", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "liquidity", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountTokenMin", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountETHMin", + type: "uint256", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "removeLiquidityETHSupportingFeeOnTransferTokens", + outputs: [ + { + internalType: "uint256", + name: "amountETH", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "liquidity", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountTokenMin", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountETHMin", + type: "uint256", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bool", + name: "approveMax", + type: "bool", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + ], + name: "removeLiquidityETHWithPermit", + outputs: [ + { + internalType: "uint256", + name: "amountToken", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountETH", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "liquidity", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountTokenMin", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountETHMin", + type: "uint256", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bool", + name: "approveMax", + type: "bool", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + ], + name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens", + outputs: [ + { + internalType: "uint256", + name: "amountETH", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "tokenA", + type: "address", + }, + { + internalType: "address", + name: "tokenB", + type: "address", + }, + { + internalType: "uint256", + name: "liquidity", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountAMin", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountBMin", + type: "uint256", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bool", + name: "approveMax", + type: "bool", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + ], + name: "removeLiquidityWithPermit", + outputs: [ + { + internalType: "uint256", + name: "amountA", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountB", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountOut", + type: "uint256", + }, + { + internalType: "address[]", + name: "path", + type: "address[]", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "swapETHForExactTokens", + outputs: [ + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountOutMin", + type: "uint256", + }, + { + internalType: "address[]", + name: "path", + type: "address[]", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "swapExactETHForTokens", + outputs: [ + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountOutMin", + type: "uint256", + }, + { + internalType: "address[]", + name: "path", + type: "address[]", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "swapExactETHForTokensSupportingFeeOnTransferTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountIn", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountOutMin", + type: "uint256", + }, + { + internalType: "address[]", + name: "path", + type: "address[]", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "swapExactTokensForETH", + outputs: [ + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountIn", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountOutMin", + type: "uint256", + }, + { + internalType: "address[]", + name: "path", + type: "address[]", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "swapExactTokensForETHSupportingFeeOnTransferTokens", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountIn", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountOutMin", + type: "uint256", + }, + { + internalType: "address[]", + name: "path", + type: "address[]", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "swapExactTokensForTokens", + outputs: [ + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountIn", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountOutMin", + type: "uint256", + }, + { + internalType: "address[]", + name: "path", + type: "address[]", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "swapExactTokensForTokensSupportingFeeOnTransferTokens", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountOut", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountInMax", + type: "uint256", + }, + { + internalType: "address[]", + name: "path", + type: "address[]", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "swapTokensForExactETH", + outputs: [ + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountOut", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountInMax", + type: "uint256", + }, + { + internalType: "address[]", + name: "path", + type: "address[]", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "swapTokensForExactTokens", + outputs: [ + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, +]; From 1bcdbca4cf543f924408742e9c806dbcb9deb7c6 Mon Sep 17 00:00:00 2001 From: solidityteam Date: Thu, 12 Sep 2024 13:17:25 -0400 Subject: [PATCH 20/46] fix: external link to pair --- .../ui/Pools/PoolDetails/PoolHeader.tsx | 139 ++++++++---------- 1 file changed, 64 insertions(+), 75 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx index 4be232e6bc..01622a48a7 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx @@ -1,81 +1,70 @@ import { - Button, - Currency, - LinkExternal, - SkeletonCircle, - SkeletonText, - classNames, - typographyVariants, -} from '@sushiswap/ui' -import { IToken } from '~tron/_common/types/token-type' -import { Icon } from '~tron/_common/ui/General/Icon' + Button, + Currency, + LinkExternal, + SkeletonCircle, + SkeletonText, + classNames, + typographyVariants, +} from "@sushiswap/ui"; +import { IToken } from "~tron/_common/types/token-type"; +import { Icon } from "~tron/_common/ui/General/Icon"; export const PoolHeader = ({ - token0, - token1, - isLoading, - pairAddress, + token0, + token1, + isLoading, + pairAddress, }: { - token0: IToken | undefined - token1: IToken | undefined - isLoading: boolean - pairAddress: string + token0: IToken | undefined; + token1: IToken | undefined; + isLoading: boolean; + pairAddress: string; }) => { - return ( -
    -
    - - {isLoading ? ( - - ) : ( - - )} - {isLoading ? ( - - ) : ( - - )} - - -
    + return ( +
    +
    + + {isLoading ? : } + {isLoading ? : } + + +
    -
    - Network - Tron -
    -
    - ) -} +
    + Network + Tron +
    +
    + ); +}; From e65f0cfb9a3e4e244c2680549edd83956e4336fb Mon Sep 17 00:00:00 2001 From: solidityteam Date: Thu, 12 Sep 2024 13:18:35 -0400 Subject: [PATCH 21/46] chore: lint changed files --- .../_common/constants/abis/factory-abi.ts | 376 ++-- .../tron/_common/constants/abis/pair-abi.ts | 1314 +++++------ .../tron/_common/constants/abis/router-abi.ts | 1944 ++++++++--------- .../tron/_common/constants/contracts.ts | 14 +- .../ui/Pools/PoolDetails/PoolHeader.tsx | 139 +- 5 files changed, 1902 insertions(+), 1885 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/constants/abis/factory-abi.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/factory-abi.ts index 1f7b38ef85..f9e43a77b7 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/constants/abis/factory-abi.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/factory-abi.ts @@ -1,189 +1,189 @@ export const FACTORY_ABI = [ - { - inputs: [ - { - internalType: "address", - name: "_feeToSetter", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "token0", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "token1", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "pair", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - name: "PairCreated", - type: "event", - }, - { - inputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - name: "allPairs", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "allPairsLength", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "tokenA", - type: "address", - }, - { - internalType: "address", - name: "tokenB", - type: "address", - }, - ], - name: "createPair", - outputs: [ - { - internalType: "address", - name: "pair", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "feeTo", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "feeToSetter", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "getPair", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getPairHash", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_feeTo", - type: "address", - }, - ], - name: "setFeeTo", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_feeToSetter", - type: "address", - }, - ], - name: "setFeeToSetter", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -]; + { + inputs: [ + { + internalType: 'address', + name: '_feeToSetter', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'token0', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'token1', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'pair', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'PairCreated', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'allPairs', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'allPairsLength', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'tokenA', + type: 'address', + }, + { + internalType: 'address', + name: 'tokenB', + type: 'address', + }, + ], + name: 'createPair', + outputs: [ + { + internalType: 'address', + name: 'pair', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'feeTo', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'feeToSetter', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'getPair', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPairHash', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_feeTo', + type: 'address', + }, + ], + name: 'setFeeTo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_feeToSetter', + type: 'address', + }, + ], + name: 'setFeeToSetter', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] diff --git a/apps/web/src/app/(non-evm)/tron/_common/constants/abis/pair-abi.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/pair-abi.ts index 3ef4abe55c..0f9cc56367 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/constants/abis/pair-abi.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/pair-abi.ts @@ -1,658 +1,658 @@ export const PAIR_ABI = [ - { - inputs: [], - stateMutability: "nonpayable", - type: "constructor", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "spender", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "value", - type: "uint256", - }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount0", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "amount1", - type: "uint256", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - ], - name: "Burn", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount0", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "amount1", - type: "uint256", - }, - ], - name: "Mint", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "sender", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount0In", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "amount1In", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "amount0Out", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "amount1Out", - type: "uint256", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - ], - name: "Swap", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint112", - name: "reserve0", - type: "uint112", - }, - { - indexed: false, - internalType: "uint112", - name: "reserve1", - type: "uint112", - }, - ], - name: "Sync", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "value", - type: "uint256", - }, - ], - name: "Transfer", - type: "event", - }, - { - inputs: [], - name: "DOMAIN_SEPARATOR", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "MINIMUM_LIQUIDITY", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "PERMIT_TYPEHASH", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "allowance", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "spender", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - ], - name: "approve", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - ], - name: "burn", - outputs: [ - { - internalType: "uint256", - name: "amount0", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "decimals", - outputs: [ - { - internalType: "uint8", - name: "", - type: "uint8", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "factory", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getReserves", - outputs: [ - { - internalType: "uint112", - name: "_reserve0", - type: "uint112", - }, - { - internalType: "uint112", - name: "_reserve1", - type: "uint112", - }, - { - internalType: "uint32", - name: "_blockTimestampLast", - type: "uint32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_token0", - type: "address", - }, - { - internalType: "address", - name: "_token1", - type: "address", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "kLast", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - ], - name: "mint", - outputs: [ - { - internalType: "uint256", - name: "liquidity", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "name", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "nonces", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "spender", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, - ], - name: "permit", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "price0CumulativeLast", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "price1CumulativeLast", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - ], - name: "skim", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amount0Out", - type: "uint256", - }, - { - internalType: "uint256", - name: "amount1Out", - type: "uint256", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "swap", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "symbol", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "sync", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "token0", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "token1", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "totalSupply", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - ], - name: "transfer", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - ], - name: "transferFrom", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, -]; + { + inputs: [], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1', + type: 'uint256', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + ], + name: 'Burn', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1', + type: 'uint256', + }, + ], + name: 'Mint', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0In', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1In', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0Out', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1Out', + type: 'uint256', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + ], + name: 'Swap', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint112', + name: 'reserve0', + type: 'uint112', + }, + { + indexed: false, + internalType: 'uint112', + name: 'reserve1', + type: 'uint112', + }, + ], + name: 'Sync', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MINIMUM_LIQUIDITY', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PERMIT_TYPEHASH', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + ], + name: 'burn', + outputs: [ + { + internalType: 'uint256', + name: 'amount0', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'factory', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getReserves', + outputs: [ + { + internalType: 'uint112', + name: '_reserve0', + type: 'uint112', + }, + { + internalType: 'uint112', + name: '_reserve1', + type: 'uint112', + }, + { + internalType: 'uint32', + name: '_blockTimestampLast', + type: 'uint32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_token0', + type: 'address', + }, + { + internalType: 'address', + name: '_token1', + type: 'address', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'kLast', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + ], + name: 'mint', + outputs: [ + { + internalType: 'uint256', + name: 'liquidity', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'nonces', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'permit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'price0CumulativeLast', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'price1CumulativeLast', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + ], + name: 'skim', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount0Out', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount1Out', + type: 'uint256', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'swap', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'sync', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'token0', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'token1', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, +] diff --git a/apps/web/src/app/(non-evm)/tron/_common/constants/abis/router-abi.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/router-abi.ts index b5c5622630..41e0a62d73 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/constants/abis/router-abi.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/constants/abis/router-abi.ts @@ -1,973 +1,973 @@ export const ROUTER_ABI = [ - { - inputs: [ - { - internalType: "address", - name: "_factory", - type: "address", - }, - { - internalType: "address", - name: "_WETH", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [], - name: "WETH", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "tokenA", - type: "address", - }, - { - internalType: "address", - name: "tokenB", - type: "address", - }, - { - internalType: "uint256", - name: "amountADesired", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountBDesired", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountAMin", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountBMin", - type: "uint256", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "addLiquidity", - outputs: [ - { - internalType: "uint256", - name: "amountA", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountB", - type: "uint256", - }, - { - internalType: "uint256", - name: "liquidity", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "amountTokenDesired", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountTokenMin", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountETHMin", - type: "uint256", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "addLiquidityETH", - outputs: [ - { - internalType: "uint256", - name: "amountToken", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountETH", - type: "uint256", - }, - { - internalType: "uint256", - name: "liquidity", - type: "uint256", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [], - name: "factory", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountOut", - type: "uint256", - }, - { - internalType: "uint256", - name: "reserveIn", - type: "uint256", - }, - { - internalType: "uint256", - name: "reserveOut", - type: "uint256", - }, - ], - name: "getAmountIn", - outputs: [ - { - internalType: "uint256", - name: "amountIn", - type: "uint256", - }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountIn", - type: "uint256", - }, - { - internalType: "uint256", - name: "reserveIn", - type: "uint256", - }, - { - internalType: "uint256", - name: "reserveOut", - type: "uint256", - }, - ], - name: "getAmountOut", - outputs: [ - { - internalType: "uint256", - name: "amountOut", - type: "uint256", - }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountOut", - type: "uint256", - }, - { - internalType: "address[]", - name: "path", - type: "address[]", - }, - ], - name: "getAmountsIn", - outputs: [ - { - internalType: "uint256[]", - name: "amounts", - type: "uint256[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountIn", - type: "uint256", - }, - { - internalType: "address[]", - name: "path", - type: "address[]", - }, - ], - name: "getAmountsOut", - outputs: [ - { - internalType: "uint256[]", - name: "amounts", - type: "uint256[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountA", - type: "uint256", - }, - { - internalType: "uint256", - name: "reserveA", - type: "uint256", - }, - { - internalType: "uint256", - name: "reserveB", - type: "uint256", - }, - ], - name: "quote", - outputs: [ - { - internalType: "uint256", - name: "amountB", - type: "uint256", - }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "tokenA", - type: "address", - }, - { - internalType: "address", - name: "tokenB", - type: "address", - }, - { - internalType: "uint256", - name: "liquidity", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountAMin", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountBMin", - type: "uint256", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "removeLiquidity", - outputs: [ - { - internalType: "uint256", - name: "amountA", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountB", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "liquidity", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountTokenMin", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountETHMin", - type: "uint256", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "removeLiquidityETH", - outputs: [ - { - internalType: "uint256", - name: "amountToken", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountETH", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "liquidity", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountTokenMin", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountETHMin", - type: "uint256", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "removeLiquidityETHSupportingFeeOnTransferTokens", - outputs: [ - { - internalType: "uint256", - name: "amountETH", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "liquidity", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountTokenMin", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountETHMin", - type: "uint256", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "bool", - name: "approveMax", - type: "bool", - }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, - ], - name: "removeLiquidityETHWithPermit", - outputs: [ - { - internalType: "uint256", - name: "amountToken", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountETH", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "uint256", - name: "liquidity", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountTokenMin", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountETHMin", - type: "uint256", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "bool", - name: "approveMax", - type: "bool", - }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, - ], - name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens", - outputs: [ - { - internalType: "uint256", - name: "amountETH", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "tokenA", - type: "address", - }, - { - internalType: "address", - name: "tokenB", - type: "address", - }, - { - internalType: "uint256", - name: "liquidity", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountAMin", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountBMin", - type: "uint256", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "bool", - name: "approveMax", - type: "bool", - }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, - ], - name: "removeLiquidityWithPermit", - outputs: [ - { - internalType: "uint256", - name: "amountA", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountB", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountOut", - type: "uint256", - }, - { - internalType: "address[]", - name: "path", - type: "address[]", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "swapETHForExactTokens", - outputs: [ - { - internalType: "uint256[]", - name: "amounts", - type: "uint256[]", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountOutMin", - type: "uint256", - }, - { - internalType: "address[]", - name: "path", - type: "address[]", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "swapExactETHForTokens", - outputs: [ - { - internalType: "uint256[]", - name: "amounts", - type: "uint256[]", - }, - ], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountOutMin", - type: "uint256", - }, - { - internalType: "address[]", - name: "path", - type: "address[]", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "swapExactETHForTokensSupportingFeeOnTransferTokens", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountIn", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountOutMin", - type: "uint256", - }, - { - internalType: "address[]", - name: "path", - type: "address[]", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "swapExactTokensForETH", - outputs: [ - { - internalType: "uint256[]", - name: "amounts", - type: "uint256[]", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountIn", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountOutMin", - type: "uint256", - }, - { - internalType: "address[]", - name: "path", - type: "address[]", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "swapExactTokensForETHSupportingFeeOnTransferTokens", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountIn", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountOutMin", - type: "uint256", - }, - { - internalType: "address[]", - name: "path", - type: "address[]", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "swapExactTokensForTokens", - outputs: [ - { - internalType: "uint256[]", - name: "amounts", - type: "uint256[]", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountIn", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountOutMin", - type: "uint256", - }, - { - internalType: "address[]", - name: "path", - type: "address[]", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "swapExactTokensForTokensSupportingFeeOnTransferTokens", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountOut", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountInMax", - type: "uint256", - }, - { - internalType: "address[]", - name: "path", - type: "address[]", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "swapTokensForExactETH", - outputs: [ - { - internalType: "uint256[]", - name: "amounts", - type: "uint256[]", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "amountOut", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountInMax", - type: "uint256", - }, - { - internalType: "address[]", - name: "path", - type: "address[]", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - ], - name: "swapTokensForExactTokens", - outputs: [ - { - internalType: "uint256[]", - name: "amounts", - type: "uint256[]", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - stateMutability: "payable", - type: "receive", - }, -]; + { + inputs: [ + { + internalType: 'address', + name: '_factory', + type: 'address', + }, + { + internalType: 'address', + name: '_WETH', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [], + name: 'WETH', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'tokenA', + type: 'address', + }, + { + internalType: 'address', + name: 'tokenB', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountADesired', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountBDesired', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountAMin', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountBMin', + type: 'uint256', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'addLiquidity', + outputs: [ + { + internalType: 'uint256', + name: 'amountA', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountB', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidity', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'token', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountTokenDesired', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountTokenMin', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountETHMin', + type: 'uint256', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'addLiquidityETH', + outputs: [ + { + internalType: 'uint256', + name: 'amountToken', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountETH', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'liquidity', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'factory', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountOut', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reserveIn', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reserveOut', + type: 'uint256', + }, + ], + name: 'getAmountIn', + outputs: [ + { + internalType: 'uint256', + name: 'amountIn', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountIn', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reserveIn', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reserveOut', + type: 'uint256', + }, + ], + name: 'getAmountOut', + outputs: [ + { + internalType: 'uint256', + name: 'amountOut', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountOut', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'path', + type: 'address[]', + }, + ], + name: 'getAmountsIn', + outputs: [ + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountIn', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'path', + type: 'address[]', + }, + ], + name: 'getAmountsOut', + outputs: [ + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountA', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reserveA', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'reserveB', + type: 'uint256', + }, + ], + name: 'quote', + outputs: [ + { + internalType: 'uint256', + name: 'amountB', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'tokenA', + type: 'address', + }, + { + internalType: 'address', + name: 'tokenB', + type: 'address', + }, + { + internalType: 'uint256', + name: 'liquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountAMin', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountBMin', + type: 'uint256', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'removeLiquidity', + outputs: [ + { + internalType: 'uint256', + name: 'amountA', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountB', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'token', + type: 'address', + }, + { + internalType: 'uint256', + name: 'liquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountTokenMin', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountETHMin', + type: 'uint256', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'removeLiquidityETH', + outputs: [ + { + internalType: 'uint256', + name: 'amountToken', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountETH', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'token', + type: 'address', + }, + { + internalType: 'uint256', + name: 'liquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountTokenMin', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountETHMin', + type: 'uint256', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'removeLiquidityETHSupportingFeeOnTransferTokens', + outputs: [ + { + internalType: 'uint256', + name: 'amountETH', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'token', + type: 'address', + }, + { + internalType: 'uint256', + name: 'liquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountTokenMin', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountETHMin', + type: 'uint256', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'approveMax', + type: 'bool', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'removeLiquidityETHWithPermit', + outputs: [ + { + internalType: 'uint256', + name: 'amountToken', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountETH', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'token', + type: 'address', + }, + { + internalType: 'uint256', + name: 'liquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountTokenMin', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountETHMin', + type: 'uint256', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'approveMax', + type: 'bool', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'removeLiquidityETHWithPermitSupportingFeeOnTransferTokens', + outputs: [ + { + internalType: 'uint256', + name: 'amountETH', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'tokenA', + type: 'address', + }, + { + internalType: 'address', + name: 'tokenB', + type: 'address', + }, + { + internalType: 'uint256', + name: 'liquidity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountAMin', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountBMin', + type: 'uint256', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'approveMax', + type: 'bool', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'removeLiquidityWithPermit', + outputs: [ + { + internalType: 'uint256', + name: 'amountA', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountB', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountOut', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'path', + type: 'address[]', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'swapETHForExactTokens', + outputs: [ + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountOutMin', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'path', + type: 'address[]', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'swapExactETHForTokens', + outputs: [ + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountOutMin', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'path', + type: 'address[]', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'swapExactETHForTokensSupportingFeeOnTransferTokens', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountIn', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountOutMin', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'path', + type: 'address[]', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'swapExactTokensForETH', + outputs: [ + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountIn', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountOutMin', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'path', + type: 'address[]', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'swapExactTokensForETHSupportingFeeOnTransferTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountIn', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountOutMin', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'path', + type: 'address[]', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'swapExactTokensForTokens', + outputs: [ + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountIn', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountOutMin', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'path', + type: 'address[]', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'swapExactTokensForTokensSupportingFeeOnTransferTokens', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountOut', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountInMax', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'path', + type: 'address[]', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'swapTokensForExactETH', + outputs: [ + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amountOut', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amountInMax', + type: 'uint256', + }, + { + internalType: 'address[]', + name: 'path', + type: 'address[]', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + ], + name: 'swapTokensForExactTokens', + outputs: [ + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + stateMutability: 'payable', + type: 'receive', + }, +] diff --git a/apps/web/src/app/(non-evm)/tron/_common/constants/contracts.ts b/apps/web/src/app/(non-evm)/tron/_common/constants/contracts.ts index db94d11cd7..c31c802277 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/constants/contracts.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/constants/contracts.ts @@ -1,5 +1,11 @@ -import { IS_TESTNET } from "./is-testnet"; +import { IS_TESTNET } from './is-testnet' -export const FACTORY_CONTRACT = IS_TESTNET ? "" : "TPA5vJu579Ub5BRXETiEYZUs1SmGh7cDia"; //sun.io factory contract address -export const ROUTER_CONTRACT = IS_TESTNET ? "" : "TG61TbGhkx757ATfceRbnSHD3kHzQ7tk97"; //sun.io router contract address -export const MULTICALL_CONTRACT = IS_TESTNET ? "" : "TGXuuKAb4bnrn137u39EKbYzKNXvdCes98"; +export const FACTORY_CONTRACT = IS_TESTNET + ? '' + : 'TPA5vJu579Ub5BRXETiEYZUs1SmGh7cDia' //sun.io factory contract address +export const ROUTER_CONTRACT = IS_TESTNET + ? '' + : 'TG61TbGhkx757ATfceRbnSHD3kHzQ7tk97' //sun.io router contract address +export const MULTICALL_CONTRACT = IS_TESTNET + ? '' + : 'TGXuuKAb4bnrn137u39EKbYzKNXvdCes98' diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx index 01622a48a7..e1e006cd7a 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx @@ -1,70 +1,81 @@ import { - Button, - Currency, - LinkExternal, - SkeletonCircle, - SkeletonText, - classNames, - typographyVariants, -} from "@sushiswap/ui"; -import { IToken } from "~tron/_common/types/token-type"; -import { Icon } from "~tron/_common/ui/General/Icon"; + Button, + Currency, + LinkExternal, + SkeletonCircle, + SkeletonText, + classNames, + typographyVariants, +} from '@sushiswap/ui' +import { IToken } from '~tron/_common/types/token-type' +import { Icon } from '~tron/_common/ui/General/Icon' export const PoolHeader = ({ - token0, - token1, - isLoading, - pairAddress, + token0, + token1, + isLoading, + pairAddress, }: { - token0: IToken | undefined; - token1: IToken | undefined; - isLoading: boolean; - pairAddress: string; + token0: IToken | undefined + token1: IToken | undefined + isLoading: boolean + pairAddress: string }) => { - return ( -
    -
    - - {isLoading ? : } - {isLoading ? : } - - -
    + return ( +
    +
    + + {isLoading ? ( + + ) : ( + + )} + {isLoading ? ( + + ) : ( + + )} + + +
    -
    - Network - Tron -
    -
    - ); -}; +
    + Network + Tron +
    +
    + ) +} From eb1df96a3f71b905511123c130f512d9bf6fc97c Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Fri, 13 Sep 2024 08:55:24 +0000 Subject: [PATCH 22/46] feat(apps/tron): wip reorg, bring swap page in-line --- .../tron/_common/ui/Input/TokenInput.tsx | 212 ++++++++++++++---- .../tron/_common/ui/Pools/Add/AddButton.tsx | 5 +- .../_common/ui/Pools/Add/AmountInToken0.tsx | 8 +- .../_common/ui/Pools/Add/AmountIntToken1.tsx | 8 +- .../tron/_common/ui/Pools/Add/Rate.tsx | 2 +- .../_common/ui/Pools/Add/ReviewAddDialog.tsx | 2 +- .../ui/Pools/Add/ReviewAddDialogTrigger.tsx | 2 +- .../_common/ui/Pools/Add/SelectTokensForm.tsx | 5 +- .../ui/Pools/PoolPosition/PoolPosition.tsx | 4 +- .../ui/Pools/Remove/MinimumReceive.tsx | 4 +- .../_common/ui/Pools/Remove/RemoveButton.tsx | 4 +- .../_common/ui/Pools/Remove/RemoveInput.tsx | 2 +- .../tron/_common/ui/Pools/ReserveHelper.tsx | 5 +- .../tron/_common/ui/Swap/AmountIn.tsx | 4 +- .../tron/_common/ui/Swap/AmountOut.tsx | 4 +- .../tron/_common/ui/Swap/ReviewSwapDialog.tsx | 15 +- .../_common/ui/Swap/SwitchSwapDirection.tsx | 11 +- .../ui/WalletConnector/WalletConnector.tsx | 13 +- .../pools}/[poolId]/layout.tsx | 0 .../{pool => explore/pools}/[poolId]/page.tsx | 0 .../pools}/[poolId]/remove-provider.tsx | 0 .../{pool => explore/pools}/add/layout.tsx | 0 .../tron/{pool => explore/pools}/add/page.tsx | 0 .../tron/{pool => explore/pools}/layout.tsx | 8 +- .../tron/{pool => explore/pools}/page.tsx | 0 .../{pool => explore/pools}/pool-provider.tsx | 0 apps/web/src/app/(non-evm)/tron/header.tsx | 51 ++++- apps/web/src/app/(non-evm)/tron/layout.tsx | 16 +- .../src/app/(non-evm)/tron/swap/layout.tsx | 15 +- apps/web/src/app/(non-evm)/tron/swap/page.tsx | 38 ++-- .../components/header-network-selector.tsx | 2 +- .../ui/src/components/network-selector.tsx | 49 ++-- .../src/icons/network/circle/TronCircle.tsx | 13 ++ .../ui/src/icons/network/circle/index.tsx | 1 + .../ui/src/icons/network/naked/TronNaked.tsx | 19 ++ packages/ui/src/icons/network/naked/index.tsx | 1 + 36 files changed, 389 insertions(+), 134 deletions(-) rename apps/web/src/app/(non-evm)/tron/{pool => explore/pools}/[poolId]/layout.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{pool => explore/pools}/[poolId]/page.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{pool => explore/pools}/[poolId]/remove-provider.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{pool => explore/pools}/add/layout.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{pool => explore/pools}/add/page.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{pool => explore/pools}/layout.tsx (63%) rename apps/web/src/app/(non-evm)/tron/{pool => explore/pools}/page.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{pool => explore/pools}/pool-provider.tsx (100%) create mode 100644 packages/ui/src/icons/network/circle/TronCircle.tsx create mode 100644 packages/ui/src/icons/network/naked/TronNaked.tsx diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx index df91caede5..0d421e47a7 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx @@ -1,80 +1,185 @@ -import { Button, TextField } from '@sushiswap/ui' +import { + Button, + SelectIcon, + SkeletonBox, + TextField, + classNames, +} from '@sushiswap/ui' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' +import { useMemo } from 'react' import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' import { formatUnitsForInput } from '~tron/_common/lib/utils/formatters' import { IToken } from '~tron/_common/types/token-type' import { Icon } from '../General/Icon' -import { TokenListSelect } from '../General/TokenListSelect' import { DollarAmountDisplay } from '../Shared/DollarAmountDisplay' import { TokenBalanceDisplay } from '../Shared/TokenBalanceDisplay' type TokenInputProps = { + id?: string type: 'input' | 'output' - token: IToken | undefined - setToken: (token: IToken) => void + currency: IToken | undefined + setToken?: (token: IToken) => void amount: string setAmount: (amount: string) => void - hasTokenListSelect?: boolean + className?: string + hideIcon?: boolean + label?: string } export const TokenInput = ({ + id, type, - token, + currency, setToken, amount, setAmount, - hasTokenListSelect = true, + className, + hideIcon, + label, }: TokenInputProps) => { const { address } = useWallet() const { data: tokenBalance, isInitialLoading: isInitialLoadingTokenBalance } = useTokenBalance({ accountAddress: address, - tokenAddress: token?.address, + tokenAddress: currency?.address, }) const { data: usdValue, isLoading: isUSDValueLoading } = useStablePrice({ - token: token, + token: currency, }) const usdAmount = amount ? (Number(amount) * (usdValue ? Number(usdValue) : 0)).toString(10) : '0.00' - return ( -
    -
    - { - if (type === 'output') return - const value = e.target.value + const currencyLoading = false + const isLoading = false + const fetching = false - setAmount(value) - }} - // isError={true} - /> - {hasTokenListSelect ? ( - + const insufficientBalance = false + const _error = insufficientBalance ? 'Exceeds Balance' : undefined + + const selector = useMemo(() => { + if (!setToken) return null + + return ( + + 'Select Token' )} + + ) + }, [currency, currencyLoading, id, setToken]) + + return ( +
    +
    + {label ? ( + {label} + ) : null} +
    +
    + + {currencyLoading ? ( + + ) : null} +
    +
    + { + if (type === 'output') return + const value = e.target.value + + setAmount(value) + }} + value={amount} + readOnly={type === 'output'} + data-state={isLoading ? 'inactive' : 'active'} + className={classNames('p-0 py-1 !text-3xl font-medium')} + /> +
    + + {selector} + {!setToken ? ( +
    + {currency ? ( + <> + {!hideIcon && ( + <> +
    + +
    + + )} + {currency.symbol} + + ) : ( + + No token selected + + )} +
    + ) : null}
    -
    +
    { if (type === 'output') return if (tokenBalance === '0') { @@ -92,7 +197,7 @@ export const TokenInput = ({ return } setAmount( - formatUnitsForInput(tokenBalance ?? '0', token?.decimals ?? 0), + formatUnitsForInput(tokenBalance ?? '0', currency?.decimals ?? 0), ) }} /> @@ -100,3 +205,26 @@ export const TokenInput = ({
    ) } + +{ + /* {hasTokenListSelect ? ( + + ) : ( + + )} + +
    + + +
    +
    */ +} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx index 796854ce1f..c71cbb4408 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx @@ -23,7 +23,10 @@ import { safeGasEstimates, } from '~tron/_common/lib/utils/helpers' import { getTronscanTxnLink } from '~tron/_common/lib/utils/tronscan-helpers' -import { usePoolDispatch, usePoolState } from '~tron/pool/pool-provider' +import { + usePoolDispatch, + usePoolState, +} from '~tron/explore/pools/pool-provider' export const AddButton = ({ closeModal }: { closeModal: () => void }) => { const queryClient = useQueryClient() diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx index 9f05e1006d..ca4cb18d21 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx @@ -5,7 +5,10 @@ import { } from '~tron/_common/lib/utils/formatters' import { getToken1AmountForLiquidity } from '~tron/_common/lib/utils/helpers' import { TokenInput } from '~tron/_common/ui/Input/TokenInput' -import { usePoolDispatch, usePoolState } from '~tron/pool/pool-provider' +import { + usePoolDispatch, + usePoolState, +} from '~tron/explore/pools/pool-provider' export const AmountInToken0 = () => { const { @@ -70,9 +73,8 @@ export const AmountInToken0 = () => { type="input" amount={amountInToken0} setAmount={setAmount} - token={token0} + currency={token0} setToken={setToken0} - hasTokenListSelect={false} /> ) } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx index 7d2eccbb88..a8fd122fc1 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx @@ -5,7 +5,10 @@ import { } from '~tron/_common/lib/utils/formatters' import { getToken0AmountForLiquidity } from '~tron/_common/lib/utils/helpers' import { TokenInput } from '~tron/_common/ui/Input/TokenInput' -import { usePoolDispatch, usePoolState } from '~tron/pool/pool-provider' +import { + usePoolDispatch, + usePoolState, +} from '~tron/explore/pools/pool-provider' export const AmountInToken1 = () => { const { @@ -70,9 +73,8 @@ export const AmountInToken1 = () => { type="input" amount={amountInToken1} setAmount={setAmount} - token={token1} + currency={token1} setToken={setToken1} - hasTokenListSelect={false} /> ) } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx index 91cb284f65..10528b9e55 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx @@ -6,7 +6,7 @@ import { getToken0AmountForLiquidity, getToken1AmountForLiquidity, } from '~tron/_common/lib/utils/helpers' -import { usePoolState } from '~tron/pool/pool-provider' +import { usePoolState } from '~tron/explore/pools/pool-provider' export const Rate = ({ token0Price, diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx index 4c7e93d4c6..c8f881535a 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx @@ -12,7 +12,7 @@ import { useRef } from 'react' import { formatUSD } from 'sushi/format' import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' import { formatUnits } from '~tron/_common/lib/utils/formatters' -import { usePoolState } from '~tron/pool/pool-provider' +import { usePoolState } from '~tron/explore/pools/pool-provider' import { Icon } from '../../General/Icon' import { WalletConnector } from '../../WalletConnector/WalletConnector' import { AddButton } from './AddButton' diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx index d278370dff..e3af2b381f 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx @@ -6,7 +6,7 @@ import { useAllowance } from '~tron/_common/lib/hooks/useAllowance' import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' import { formatUnitsForInput } from '~tron/_common/lib/utils/formatters' import { ApproveToken } from '~tron/_common/ui/Shared/ApproveToken' -import { usePoolState } from '~tron/pool/pool-provider' +import { usePoolState } from '~tron/explore/pools/pool-provider' export const ReviewAddDialogTrigger = () => { const { token0, token1, isTxnPending, amountInToken0, amountInToken1 } = diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx index 608326281f..8057a9efd9 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx @@ -4,7 +4,10 @@ import { useEffect } from 'react' import { useIsContract } from '~tron/_common/lib/hooks/useIsContract' import { usePairContract } from '~tron/_common/lib/hooks/usePairContract' import { TokenListSelect } from '~tron/_common/ui/General/TokenListSelect' -import { usePoolDispatch, usePoolState } from '~tron/pool/pool-provider' +import { + usePoolDispatch, + usePoolState, +} from '~tron/explore/pools/pool-provider' export const SelectTokensForm = () => { const { token0, token1 } = usePoolState() diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx index 4e46321fc5..9618c507a3 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx @@ -20,8 +20,8 @@ import { toBigNumber, } from '~tron/_common/lib/utils/formatters' import { IToken } from '~tron/_common/types/token-type' -import { useRemoveLiqDispatch } from '~tron/pool/[poolId]/remove-provider' -import { usePoolState } from '~tron/pool/pool-provider' +import { useRemoveLiqDispatch } from '~tron/explore/pools/[poolId]/remove-provider' +import { usePoolState } from '~tron/explore/pools/pool-provider' import { LiquidityItem } from '../PoolDetails/LiquidityItem' export const PoolPosition = ({ diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx index 3f75814119..a643804639 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx @@ -15,8 +15,8 @@ import { import { useRemoveLiqDispatch, useRemoveLiqState, -} from '~tron/pool/[poolId]/remove-provider' -import { usePoolState } from '~tron/pool/pool-provider' +} from '~tron/explore/pools/[poolId]/remove-provider' +import { usePoolState } from '~tron/explore/pools/pool-provider' import { LiquidityItem } from '../PoolDetails/LiquidityItem' export const MinimumReceive = () => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx index d2070baa82..243238e843 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx @@ -27,8 +27,8 @@ import { WalletConnector } from '~tron/_common/ui/WalletConnector/WalletConnecto import { useRemoveLiqDispatch, useRemoveLiqState, -} from '~tron/pool/[poolId]/remove-provider' -import { usePoolState } from '~tron/pool/pool-provider' +} from '~tron/explore/pools/[poolId]/remove-provider' +import { usePoolState } from '~tron/explore/pools/pool-provider' export const RemoveButton = () => { const queryClient = useQueryClient() diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx index 7f575d82ad..8c553183bf 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx @@ -2,7 +2,7 @@ import { Button, Card, Message } from '@sushiswap/ui' import { useRemoveLiqDispatch, useRemoveLiqState, -} from '~tron/pool/[poolId]/remove-provider' +} from '~tron/explore/pools/[poolId]/remove-provider' const PercentageOptions = [25, 50, 75, 100] diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx index 51a6455396..9ac8ab20e5 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx @@ -1,7 +1,10 @@ import { useEffect } from 'react' import { useReserves } from '~tron/_common/lib/hooks/useReserves' import { getValidTokenAddress } from '~tron/_common/lib/utils/helpers' -import { usePoolDispatch, usePoolState } from '~tron/pool/pool-provider' +import { + usePoolDispatch, + usePoolState, +} from '~tron/explore/pools/pool-provider' export const ReserveHelper = () => { const { token0, token1, pairAddress } = usePoolState() diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx index dac61b661a..c249459fb4 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx @@ -42,11 +42,13 @@ export const AmountIn = () => { return ( ) } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx index 338b14dec0..347905ad6f 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx @@ -7,11 +7,13 @@ export const AmountOut = () => { return ( ) } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx index 5fb30b4c01..116e22e9a7 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx @@ -61,12 +61,9 @@ export const ReviewSwapDialog = () => { {isConnected ? ( ) : ( - +
    + +
    )} @@ -156,10 +153,8 @@ export const ReviewSwapDialog = () => { )}
    -
    -
    - -
    +
    +
    diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx index 4723f23a73..1b41830021 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx @@ -5,14 +5,17 @@ import { useSwapDispatch } from '~tron/swap/swap-provider' export const SwitchSwapDirection = () => { const { swapTokens } = useSwapDispatch() return ( -
    +
    diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/WalletConnector.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/WalletConnector.tsx index 275aeb0fd3..38713f9e5f 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/WalletConnector.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/WalletConnector.tsx @@ -4,7 +4,6 @@ import { Popover, PopoverContent, PopoverTrigger, - SelectIcon, } from '@sushiswap/ui' import { JazzIcon } from '@sushiswap/ui/icons/JazzIcon' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' @@ -20,12 +19,11 @@ export type IProfileView = 'default' | 'settings' type WalletConnectorProps = { hideChevron?: boolean fullWidth?: boolean - size?: 'default' | 'lg' + size?: Parameters[0]['size'] variant?: 'secondary' | 'default' } export const WalletConnector = ({ - hideChevron, fullWidth, size = 'default', variant = 'secondary', @@ -36,14 +34,14 @@ export const WalletConnector = ({ return ( - + {IS_TESTNET && isConnected ? ( diff --git a/apps/web/src/app/(non-evm)/tron/pool/[poolId]/layout.tsx b/apps/web/src/app/(non-evm)/tron/explore/pools/[poolId]/layout.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/pool/[poolId]/layout.tsx rename to apps/web/src/app/(non-evm)/tron/explore/pools/[poolId]/layout.tsx diff --git a/apps/web/src/app/(non-evm)/tron/pool/[poolId]/page.tsx b/apps/web/src/app/(non-evm)/tron/explore/pools/[poolId]/page.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/pool/[poolId]/page.tsx rename to apps/web/src/app/(non-evm)/tron/explore/pools/[poolId]/page.tsx diff --git a/apps/web/src/app/(non-evm)/tron/pool/[poolId]/remove-provider.tsx b/apps/web/src/app/(non-evm)/tron/explore/pools/[poolId]/remove-provider.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/pool/[poolId]/remove-provider.tsx rename to apps/web/src/app/(non-evm)/tron/explore/pools/[poolId]/remove-provider.tsx diff --git a/apps/web/src/app/(non-evm)/tron/pool/add/layout.tsx b/apps/web/src/app/(non-evm)/tron/explore/pools/add/layout.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/pool/add/layout.tsx rename to apps/web/src/app/(non-evm)/tron/explore/pools/add/layout.tsx diff --git a/apps/web/src/app/(non-evm)/tron/pool/add/page.tsx b/apps/web/src/app/(non-evm)/tron/explore/pools/add/page.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/pool/add/page.tsx rename to apps/web/src/app/(non-evm)/tron/explore/pools/add/page.tsx diff --git a/apps/web/src/app/(non-evm)/tron/pool/layout.tsx b/apps/web/src/app/(non-evm)/tron/explore/pools/layout.tsx similarity index 63% rename from apps/web/src/app/(non-evm)/tron/pool/layout.tsx rename to apps/web/src/app/(non-evm)/tron/explore/pools/layout.tsx index 99edcc757e..03b1afcb7e 100644 --- a/apps/web/src/app/(non-evm)/tron/pool/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/explore/pools/layout.tsx @@ -1,4 +1,5 @@ import { Metadata } from 'next' +import { Header } from '../../header' import { PoolProvider } from './pool-provider' export const metadata: Metadata = { @@ -8,5 +9,10 @@ export const metadata: Metadata = { export default function PoolLayout({ children, }: { children: React.ReactNode }) { - return {children} + return ( + +
    + {children} + + ) } diff --git a/apps/web/src/app/(non-evm)/tron/pool/page.tsx b/apps/web/src/app/(non-evm)/tron/explore/pools/page.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/pool/page.tsx rename to apps/web/src/app/(non-evm)/tron/explore/pools/page.tsx diff --git a/apps/web/src/app/(non-evm)/tron/pool/pool-provider.tsx b/apps/web/src/app/(non-evm)/tron/explore/pools/pool-provider.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/pool/pool-provider.tsx rename to apps/web/src/app/(non-evm)/tron/explore/pools/pool-provider.tsx diff --git a/apps/web/src/app/(non-evm)/tron/header.tsx b/apps/web/src/app/(non-evm)/tron/header.tsx index 7dd2c5e384..83384c4e0c 100644 --- a/apps/web/src/app/(non-evm)/tron/header.tsx +++ b/apps/web/src/app/(non-evm)/tron/header.tsx @@ -4,6 +4,10 @@ import { Navigation, NavigationElement, NavigationElementType, + NavigationListItem, + NavigationMenuContent, + NavigationMenuItem, + NavigationMenuTrigger, } from '@sushiswap/ui' import React, { FC } from 'react' @@ -11,15 +15,54 @@ import { WalletConnector } from '~tron/_common/ui/WalletConnector/WalletConnecto const nagivationElements: NavigationElement[] = [ { - title: 'Swap', - href: '/tron/swap', + title: 'Explore', + items: [ + { + title: 'Swap', + href: '/swap', + description: 'The easiest way to trade.', + }, + { + title: 'Explore', + href: `/tron/explore/pools`, + description: 'Explore top pools.', + }, + { + title: 'Pool', + href: `/tron/pool`, + description: 'Earn fees by providing liquidity.', + }, + ], + type: NavigationElementType.Dropdown, show: 'everywhere', + }, + { + show: 'desktop', + type: NavigationElementType.Custom, + href: '/tron/swap', + item: ( + + Trade + +
      + + The easiest way to trade. + +
    +
    +
    + ), + }, + { + title: 'Explore', + href: `/tron/explore/pools`, + show: 'desktop', type: NavigationElementType.Single, }, { title: 'Pool', - href: '/tron/pool', - show: 'everywhere', + href: `/tron/pool`, + show: 'desktop', type: NavigationElementType.Single, }, ] diff --git a/apps/web/src/app/(non-evm)/tron/layout.tsx b/apps/web/src/app/(non-evm)/tron/layout.tsx index 30c2634d1c..a178a392f6 100644 --- a/apps/web/src/app/(non-evm)/tron/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/layout.tsx @@ -1,16 +1,22 @@ -import '@sushiswap/ui/index.css' - +import { Metadata } from 'next' import React from 'react' -import { Header } from './header' import { Providers } from './providers' +export const metadata: Metadata = { + title: { + default: 'Sushi 🍣', + template: '%s | Sushi 🍣', + }, + description: + 'A Decentralised Finance (DeFi) app with features such as swap, cross chain swap, streaming, vesting, and permissionless market making for liquidity providers.', +} + export default function RootLayout({ children, }: { children: React.ReactNode }) { return ( -
    - {children} +
    {children}
    ) } diff --git a/apps/web/src/app/(non-evm)/tron/swap/layout.tsx b/apps/web/src/app/(non-evm)/tron/swap/layout.tsx index 30fb454f7d..380cd5c59f 100644 --- a/apps/web/src/app/(non-evm)/tron/swap/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/swap/layout.tsx @@ -1,12 +1,15 @@ -import { Metadata } from 'next' +import { Header } from '../header' import { Providers } from './providers' -export const metadata: Metadata = { - title: 'SushiSwap on Tron', -} - export default function SwapLayout({ children, }: { children: React.ReactNode }) { - return {children} + return ( + <> + +
    +
    {children}
    + + + ) } diff --git a/apps/web/src/app/(non-evm)/tron/swap/page.tsx b/apps/web/src/app/(non-evm)/tron/swap/page.tsx index f8ae159dad..f5e226be41 100644 --- a/apps/web/src/app/(non-evm)/tron/swap/page.tsx +++ b/apps/web/src/app/(non-evm)/tron/swap/page.tsx @@ -11,24 +11,30 @@ import { SwitchSwapType } from '~tron/_common/ui/Swap/SwitchSwapType' export default function SwapSimplePage() { return ( - - Trade -
    - - -
    -
    + +
    +
    + Trade +
    +
    + + +
    - -
    - - +
    + + +
    + +
    ) } diff --git a/apps/web/src/lib/wagmi/components/header-network-selector.tsx b/apps/web/src/lib/wagmi/components/header-network-selector.tsx index 98c96a760a..7debb424e6 100644 --- a/apps/web/src/lib/wagmi/components/header-network-selector.tsx +++ b/apps/web/src/lib/wagmi/components/header-network-selector.tsx @@ -42,7 +42,7 @@ export const HeaderNetworkSelector: FC<{ return ( { - showAptos?: boolean + showNonEvm?: boolean hideNetworkName?: boolean networks: readonly T[] selected: T @@ -65,8 +66,34 @@ const NEW_CHAINS: number[] = [ ChainId.MANTLE, ] satisfies ChainId[] +function Aptos() { + return ( + + +
    + + Aptos +
    +
    + + ) +} + +function Tron() { + return ( + + +
    + + Tron +
    +
    + + ) +} + const NetworkSelector = ({ - showAptos = false, + showNonEvm = false, onSelect, networks = [], children, @@ -91,19 +118,11 @@ const NetworkSelector = ({ /> No network found. - {showAptos ? ( - - -
    - - Aptos -
    -
    - + {showNonEvm ? ( + <> + + + ) : null} {_networks .sort((a) => (NEW_CHAINS.includes(a) ? -1 : 0)) diff --git a/packages/ui/src/icons/network/circle/TronCircle.tsx b/packages/ui/src/icons/network/circle/TronCircle.tsx new file mode 100644 index 0000000000..5289b81f33 --- /dev/null +++ b/packages/ui/src/icons/network/circle/TronCircle.tsx @@ -0,0 +1,13 @@ +import * as React from 'react' + +import classNames from 'classnames' +import { IconComponent } from '../../../types' +import { TronNaked } from '../naked' + +export const TronCircle: IconComponent = (props) => ( + } + /> +) diff --git a/packages/ui/src/icons/network/circle/index.tsx b/packages/ui/src/icons/network/circle/index.tsx index c009e961d0..7df2044de4 100644 --- a/packages/ui/src/icons/network/circle/index.tsx +++ b/packages/ui/src/icons/network/circle/index.tsx @@ -79,6 +79,7 @@ export * from './ScrollCircle' export * from './SkaleCircle' export * from './TelosCircle' export * from './ThunderCoreCircle' +export * from './TronCircle' export * from './ZKSyncCircle' export * from './ZetaChainCircle' diff --git a/packages/ui/src/icons/network/naked/TronNaked.tsx b/packages/ui/src/icons/network/naked/TronNaked.tsx new file mode 100644 index 0000000000..a64d31b78c --- /dev/null +++ b/packages/ui/src/icons/network/naked/TronNaked.tsx @@ -0,0 +1,19 @@ +import * as React from 'react' + +import classNames from 'classnames' +import { NakedNetworkIconComponent } from '../../../types' + +export const TronNaked: NakedNetworkIconComponent = (props) => ( + + {props.circle} + + + + +) diff --git a/packages/ui/src/icons/network/naked/index.tsx b/packages/ui/src/icons/network/naked/index.tsx index 7d0f4a71cb..bbccdfd5a6 100644 --- a/packages/ui/src/icons/network/naked/index.tsx +++ b/packages/ui/src/icons/network/naked/index.tsx @@ -77,6 +77,7 @@ export * from './RootstockNaked' export * from './ScrollNaked' export * from './SkaleNaked' export * from './TelosNaked' +export * from './TronNaked' export * from './ZKSyncNaked' export * from './ZetaChainNaked' From 2895d94d422f25dcb1930b44c88a801ce2dd09a9 Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Fri, 13 Sep 2024 10:02:15 +0000 Subject: [PATCH 23/46] feat(tron): more reorgs --- .../[chainId]/pool/v2/[address]/layout.tsx | 3 +- .../tron/{ => (trade)}/swap/layout.tsx | 2 +- .../tron/{ => (trade)}/swap/page.tsx | 0 .../tron/{ => (trade)}/swap/providers.tsx | 0 .../tron/{ => (trade)}/swap/swap-provider.tsx | 0 .../(non-evm)/tron/(tron)/explore/layout.tsx | 47 +++++++ .../{ => (tron)}/explore/pools/layout.tsx | 8 +- .../tron/(tron)/explore/pools/page.tsx | 17 +++ .../explore/pools/pool-provider.tsx | 0 .../src/app/(non-evm)/tron/(tron)/layout.tsx | 10 ++ .../app/(non-evm)/tron/(tron)/not-found.tsx | 41 ++++++ .../pool/(pool)/[address]}/layout.tsx | 0 .../pool/(pool)/[address]}/page.tsx | 2 +- .../(pool)/[address]}/remove-provider.tsx | 0 .../pool/(pool)}/add/layout.tsx | 5 +- .../pools => (tron)/pool/(pool)}/add/page.tsx | 0 .../tron/(tron)/pool/(positions)/hero.tsx | 61 +++++++++ .../tron/(tron)/pool/(positions)/layout.tsx | 64 +++++++++ .../tron/(tron)/pool/(positions)/page.tsx | 17 +++ .../tron/_common/lib/hooks/useAmountsOut.ts | 2 +- .../tron/_common/lib/hooks/usePools.ts | 3 +- .../tron/_common/ui/Pools/Add/AddButton.tsx | 8 +- .../_common/ui/Pools/Add/AmountInToken0.tsx | 8 +- .../_common/ui/Pools/Add/AmountIntToken1.tsx | 8 +- .../tron/_common/ui/Pools/Add/Rate.tsx | 2 +- .../_common/ui/Pools/Add/ReviewAddDialog.tsx | 2 +- .../ui/Pools/Add/ReviewAddDialogTrigger.tsx | 2 +- .../_common/ui/Pools/Add/SelectTokensForm.tsx | 8 +- .../ui/Pools/PoolPosition/PoolPosition.tsx | 4 +- .../ui/Pools/PoolsTable/PoolsTable.tsx | 122 +++++++++++------- .../tron/_common/ui/Pools/PoolsView.tsx | 101 --------------- .../Pools/PositionsTable/PositionsTable.tsx | 111 ++++++++++------ .../ui/Pools/Remove/MinimumReceive.tsx | 10 +- .../_common/ui/Pools/Remove/RemoveButton.tsx | 10 +- .../_common/ui/Pools/Remove/RemoveInput.tsx | 2 +- .../tron/_common/ui/Pools/ReserveHelper.tsx | 6 +- .../tron/_common/ui/Swap/AmountIn.tsx | 2 +- .../tron/_common/ui/Swap/AmountOut.tsx | 2 +- .../tron/_common/ui/Swap/ReviewSwapDialog.tsx | 2 +- .../ui/Swap/ReviewSwapDialogTrigger.tsx | 2 +- .../tron/_common/ui/Swap/SwapButton.tsx | 2 +- .../tron/_common/ui/Swap/SwapRoutesDialog.tsx | 2 +- .../tron/_common/ui/Swap/SwapStats.tsx | 2 +- .../_common/ui/Swap/SwitchSwapDirection.tsx | 2 +- .../app/(non-evm)/tron/explore/pools/page.tsx | 78 ----------- apps/web/src/app/(non-evm)/tron/header.tsx | 2 +- 46 files changed, 455 insertions(+), 327 deletions(-) rename apps/web/src/app/(non-evm)/tron/{ => (trade)}/swap/layout.tsx (88%) rename apps/web/src/app/(non-evm)/tron/{ => (trade)}/swap/page.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{ => (trade)}/swap/providers.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{ => (trade)}/swap/swap-provider.tsx (100%) create mode 100644 apps/web/src/app/(non-evm)/tron/(tron)/explore/layout.tsx rename apps/web/src/app/(non-evm)/tron/{ => (tron)}/explore/pools/layout.tsx (63%) create mode 100644 apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/page.tsx rename apps/web/src/app/(non-evm)/tron/{ => (tron)}/explore/pools/pool-provider.tsx (100%) create mode 100644 apps/web/src/app/(non-evm)/tron/(tron)/layout.tsx create mode 100644 apps/web/src/app/(non-evm)/tron/(tron)/not-found.tsx rename apps/web/src/app/(non-evm)/tron/{explore/pools/[poolId] => (tron)/pool/(pool)/[address]}/layout.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{explore/pools/[poolId] => (tron)/pool/(pool)/[address]}/page.tsx (97%) rename apps/web/src/app/(non-evm)/tron/{explore/pools/[poolId] => (tron)/pool/(pool)/[address]}/remove-provider.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{explore/pools => (tron)/pool/(pool)}/add/layout.tsx (87%) rename apps/web/src/app/(non-evm)/tron/{explore/pools => (tron)/pool/(pool)}/add/page.tsx (100%) create mode 100644 apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/hero.tsx create mode 100644 apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/layout.tsx create mode 100644 apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/page.tsx delete mode 100644 apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsView.tsx delete mode 100644 apps/web/src/app/(non-evm)/tron/explore/pools/page.tsx diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx index a9ae9be319..fabe6d3e1e 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx @@ -3,6 +3,7 @@ import { unstable_cache } from 'next/cache' import { ChainId } from 'sushi' import { isSushiSwapV2ChainId } from 'sushi/config' import { isAddress } from 'viem' +import { PoolProvider } from '~tron/(tron)/explore/pools/pool-provider' import notFound from '../../../not-found' export const metadata = { @@ -39,5 +40,5 @@ export default async function Layout({ return notFound() } - return <>{children} + return {children} } diff --git a/apps/web/src/app/(non-evm)/tron/swap/layout.tsx b/apps/web/src/app/(non-evm)/tron/(trade)/swap/layout.tsx similarity index 88% rename from apps/web/src/app/(non-evm)/tron/swap/layout.tsx rename to apps/web/src/app/(non-evm)/tron/(trade)/swap/layout.tsx index 380cd5c59f..469b02f72f 100644 --- a/apps/web/src/app/(non-evm)/tron/swap/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/(trade)/swap/layout.tsx @@ -1,4 +1,4 @@ -import { Header } from '../header' +import { Header } from '../../header' import { Providers } from './providers' export default function SwapLayout({ diff --git a/apps/web/src/app/(non-evm)/tron/swap/page.tsx b/apps/web/src/app/(non-evm)/tron/(trade)/swap/page.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/swap/page.tsx rename to apps/web/src/app/(non-evm)/tron/(trade)/swap/page.tsx diff --git a/apps/web/src/app/(non-evm)/tron/swap/providers.tsx b/apps/web/src/app/(non-evm)/tron/(trade)/swap/providers.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/swap/providers.tsx rename to apps/web/src/app/(non-evm)/tron/(trade)/swap/providers.tsx diff --git a/apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx b/apps/web/src/app/(non-evm)/tron/(trade)/swap/swap-provider.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx rename to apps/web/src/app/(non-evm)/tron/(trade)/swap/swap-provider.tsx diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/explore/layout.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/explore/layout.tsx new file mode 100644 index 0000000000..6a4786b615 --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/(tron)/explore/layout.tsx @@ -0,0 +1,47 @@ +import { Container } from '@sushiswap/ui' +import { LinkInternal } from '@sushiswap/ui' + +import React from 'react' +import { GlobalStatsCharts } from 'src/ui/explore/global-stats-charts' +import { PathnameButton } from 'src/ui/pathname-button' +import { PoolsFiltersProvider } from 'src/ui/pool' + +export const metadata = { + title: 'Pools 💦', +} + +export default async function ExploreLayout({ + children, +}: { children: React.ReactNode }) { + return ( + <> + + THIS IS THE ETHEREUM CHART FIX IT + + +
    + +
    + + + All Pools + + +
    +
    +
    + {children} +
    +
    + + ) +} diff --git a/apps/web/src/app/(non-evm)/tron/explore/pools/layout.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/layout.tsx similarity index 63% rename from apps/web/src/app/(non-evm)/tron/explore/pools/layout.tsx rename to apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/layout.tsx index 03b1afcb7e..99edcc757e 100644 --- a/apps/web/src/app/(non-evm)/tron/explore/pools/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/layout.tsx @@ -1,5 +1,4 @@ import { Metadata } from 'next' -import { Header } from '../../header' import { PoolProvider } from './pool-provider' export const metadata: Metadata = { @@ -9,10 +8,5 @@ export const metadata: Metadata = { export default function PoolLayout({ children, }: { children: React.ReactNode }) { - return ( - -
    - {children} - - ) + return {children} } diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/page.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/page.tsx new file mode 100644 index 0000000000..5f1a096fb0 --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/page.tsx @@ -0,0 +1,17 @@ +import { Container } from '@sushiswap/ui' +import React from 'react' +import { TableFiltersResetButton } from 'src/ui/pool/TableFiltersResetButton' +import { TableFiltersSearchToken } from 'src/ui/pool/TableFiltersSearchToken' +import { PoolsTable } from '~tron/_common/ui/Pools/PoolsTable/PoolsTable' + +export default async function PoolsPage() { + return ( + +
    + + +
    + +
    + ) +} diff --git a/apps/web/src/app/(non-evm)/tron/explore/pools/pool-provider.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/pool-provider.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/explore/pools/pool-provider.tsx rename to apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/pool-provider.tsx diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/layout.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/layout.tsx new file mode 100644 index 0000000000..1ced76ab13 --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/(tron)/layout.tsx @@ -0,0 +1,10 @@ +import { Header } from '../header' + +export default function Layout({ children }: { children: React.ReactNode }) { + return ( + <> +
    +
    {children}
    + + ) +} diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/not-found.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/not-found.tsx new file mode 100644 index 0000000000..3f5fbceee4 --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/(tron)/not-found.tsx @@ -0,0 +1,41 @@ +import { ChevronRightIcon } from '@heroicons/react/20/solid' +import { Button, LinkInternal, typographyVariants } from '@sushiswap/ui' + +export default function NotFound() { + return ( +
    +
    +

    + Not Found +

    +
    + + +
    +
    +
    + ) +} diff --git a/apps/web/src/app/(non-evm)/tron/explore/pools/[poolId]/layout.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/layout.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/explore/pools/[poolId]/layout.tsx rename to apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/layout.tsx diff --git a/apps/web/src/app/(non-evm)/tron/explore/pools/[poolId]/page.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/page.tsx similarity index 97% rename from apps/web/src/app/(non-evm)/tron/explore/pools/[poolId]/page.tsx rename to apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/page.tsx index f17f4d8241..ae61991117 100644 --- a/apps/web/src/app/(non-evm)/tron/explore/pools/[poolId]/page.tsx +++ b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/page.tsx @@ -8,7 +8,7 @@ import { PoolHeader } from '~tron/_common/ui/Pools/PoolDetails/PoolHeader' import { PoolLiquidity } from '~tron/_common/ui/Pools/PoolDetails/PoolLiquidity' import { PoolPosition } from '~tron/_common/ui/Pools/PoolPosition/PoolPosition' import { PoolRewards } from '~tron/_common/ui/Pools/PoolRewards/PoolRewards' -import { usePoolDispatch } from '../pool-provider' +import { usePoolDispatch } from '../../../explore/pools/pool-provider' export default function PoolByIdPage({ params, diff --git a/apps/web/src/app/(non-evm)/tron/explore/pools/[poolId]/remove-provider.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/remove-provider.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/explore/pools/[poolId]/remove-provider.tsx rename to apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/remove-provider.tsx diff --git a/apps/web/src/app/(non-evm)/tron/explore/pools/add/layout.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/add/layout.tsx similarity index 87% rename from apps/web/src/app/(non-evm)/tron/explore/pools/add/layout.tsx rename to apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/add/layout.tsx index 7fbb23fe1a..0031b58862 100644 --- a/apps/web/src/app/(non-evm)/tron/explore/pools/add/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/add/layout.tsx @@ -1,6 +1,7 @@ import { Container, typographyVariants } from '@sushiswap/ui' import { Metadata } from 'next' -import { BackButton } from '~tron/_common/ui/Pools/BackButton' +import { BackButton } from 'src/ui/pool/BackButton' +import { PoolProvider } from '~tron/(tron)/explore/pools/pool-provider' export const metadata: Metadata = { title: 'Pool 💦', @@ -32,7 +33,7 @@ export default function CreatePositionLayout({
    - {children} + {children}
    diff --git a/apps/web/src/app/(non-evm)/tron/explore/pools/add/page.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/add/page.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/explore/pools/add/page.tsx rename to apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/add/page.tsx diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/hero.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/hero.tsx new file mode 100644 index 0000000000..08130b88db --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/hero.tsx @@ -0,0 +1,61 @@ +import { + Button, + DropdownMenu, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuItem, + DropdownMenuTrigger, + LinkInternal, + SelectIcon, +} from '@sushiswap/ui' + +export function Hero() { + return ( +
    + Manage Liquidity Positions +
    + + You can adjust and claim rewards for your liquidity positions on the + connected network. + +
    +
    + + + + + + + + + +
    + V2 Position +
    +

    + Provide liquidity to a V2 liquidity pool. +

    +
    +
    +
    +
    +
    +
    +
    +
    +
    + ) +} diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/layout.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/layout.tsx new file mode 100644 index 0000000000..ba777d9bfa --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/layout.tsx @@ -0,0 +1,64 @@ +'use client' + +import { Container, LinkInternal } from '@sushiswap/ui' +import { useSearchParams } from 'next/navigation' +import { PathnameButton } from 'src/ui/pathname-button' +import { PoolsFiltersProvider } from 'src/ui/pool' +import { Hero } from './hero' + +export default function Layout({ + children, +}: { + children: React.ReactNode + params: { chainId: string } +}) { + const searchParams = useSearchParams() + + return ( + <> + + + + +
    + + + My Positions + + + {/* + + My Rewards + + */} +
    +
    +
    +
    + {children} +
    +
    + + ) +} diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/page.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/page.tsx new file mode 100644 index 0000000000..a052fca909 --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/page.tsx @@ -0,0 +1,17 @@ +import { Container } from '@sushiswap/ui' +import React from 'react' +import { TableFiltersResetButton } from 'src/ui/pool/TableFiltersResetButton' +import { TableFiltersSearchToken } from 'src/ui/pool/TableFiltersSearchToken' +import { PositionsTable } from '~tron/_common/ui/Pools/PositionsTable/PositionsTable' + +export default function Page() { + return ( + +
    + + +
    + +
    + ) +} diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts index b4eb96e368..83a468fce3 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts @@ -1,12 +1,12 @@ import { useQuery } from '@tanstack/react-query' import TronWeb from 'tronweb' +import { useSwapState } from '~tron/(trade)/swap/swap-provider' import { ROUTER_ABI } from '~tron/_common/constants/abis/router-abi' import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' import { getIfWrapOrUnwrap, getValidTokenAddress, } from '~tron/_common/lib/utils/helpers' -import { useSwapState } from '~tron/swap/swap-provider' import { useTronWeb } from './useTronWeb' export const useAmountsOut = ({ amountIn }: { amountIn: string }) => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts index 93b5760c91..c4433aa611 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts @@ -6,6 +6,7 @@ import { IReserveDataResponse, } from '~tron/_common/types/get-pools-type' import { useTronWeb } from './useTronWeb' +import ms from 'ms' type _IPools = { token0Address: string @@ -110,7 +111,6 @@ export const usePools = () => { const { tronWeb } = useTronWeb() return useQuery({ queryKey: ['usePools'], - staleTime: Infinity, //TODO: remove after testing queryFn: async () => { if (!tronWeb) return [] const pools = await getPoolsByEvent({ factoryAddress: FACTORY_CONTRACT }) @@ -123,6 +123,7 @@ export const usePools = () => { refetchOnMount: false, refetchOnWindowFocus: false, refetchOnReconnect: false, + staleTime: ms('15 minutes'), }) } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx index c71cbb4408..e79eeb7d38 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx @@ -11,6 +11,10 @@ import { Button } from '@sushiswap/ui' import { useQueryClient } from '@tanstack/react-query' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useMemo } from 'react' +import { + usePoolDispatch, + usePoolState, +} from '~tron/(tron)/explore/pools/pool-provider' import { useTronWeb } from '~tron/_common/lib/hooks/useTronWeb' import { parseUnits } from '~tron/_common/lib/utils/formatters' import { @@ -23,10 +27,6 @@ import { safeGasEstimates, } from '~tron/_common/lib/utils/helpers' import { getTronscanTxnLink } from '~tron/_common/lib/utils/tronscan-helpers' -import { - usePoolDispatch, - usePoolState, -} from '~tron/explore/pools/pool-provider' export const AddButton = ({ closeModal }: { closeModal: () => void }) => { const queryClient = useQueryClient() diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx index ca4cb18d21..7f61ed1518 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx @@ -1,14 +1,14 @@ import { useEffect, useMemo } from 'react' +import { + usePoolDispatch, + usePoolState, +} from '~tron/(tron)/explore/pools/pool-provider' import { formatUnitsForInput, parseUnits, } from '~tron/_common/lib/utils/formatters' import { getToken1AmountForLiquidity } from '~tron/_common/lib/utils/helpers' import { TokenInput } from '~tron/_common/ui/Input/TokenInput' -import { - usePoolDispatch, - usePoolState, -} from '~tron/explore/pools/pool-provider' export const AmountInToken0 = () => { const { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx index a8fd122fc1..bd1338f076 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx @@ -1,14 +1,14 @@ import { useEffect, useMemo } from 'react' +import { + usePoolDispatch, + usePoolState, +} from '~tron/(tron)/explore/pools/pool-provider' import { formatUnitsForInput, parseUnits, } from '~tron/_common/lib/utils/formatters' import { getToken0AmountForLiquidity } from '~tron/_common/lib/utils/helpers' import { TokenInput } from '~tron/_common/ui/Input/TokenInput' -import { - usePoolDispatch, - usePoolState, -} from '~tron/explore/pools/pool-provider' export const AmountInToken1 = () => { const { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx index 10528b9e55..a96ccdb77f 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx @@ -1,12 +1,12 @@ import { Button, SkeletonBox } from '@sushiswap/ui' import { useMemo, useState } from 'react' import { formatUSD } from 'sushi/format' +import { usePoolState } from '~tron/(tron)/explore/pools/pool-provider' import { formatUnits, parseUnits } from '~tron/_common/lib/utils/formatters' import { getToken0AmountForLiquidity, getToken1AmountForLiquidity, } from '~tron/_common/lib/utils/helpers' -import { usePoolState } from '~tron/explore/pools/pool-provider' export const Rate = ({ token0Price, diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx index c8f881535a..f6463cffd2 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx @@ -10,9 +10,9 @@ import { import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useRef } from 'react' import { formatUSD } from 'sushi/format' +import { usePoolState } from '~tron/(tron)/explore/pools/pool-provider' import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' import { formatUnits } from '~tron/_common/lib/utils/formatters' -import { usePoolState } from '~tron/explore/pools/pool-provider' import { Icon } from '../../General/Icon' import { WalletConnector } from '../../WalletConnector/WalletConnector' import { AddButton } from './AddButton' diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx index e3af2b381f..146f2fa75f 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx @@ -1,12 +1,12 @@ import { Button, DialogTrigger } from '@sushiswap/ui' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useMemo } from 'react' +import { usePoolState } from '~tron/(tron)/explore/pools/pool-provider' import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' import { useAllowance } from '~tron/_common/lib/hooks/useAllowance' import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' import { formatUnitsForInput } from '~tron/_common/lib/utils/formatters' import { ApproveToken } from '~tron/_common/ui/Shared/ApproveToken' -import { usePoolState } from '~tron/explore/pools/pool-provider' export const ReviewAddDialogTrigger = () => { const { token0, token1, isTxnPending, amountInToken0, amountInToken1 } = diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx index 8057a9efd9..5bc96b77c3 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx @@ -1,13 +1,13 @@ 'use client' import { FormSection } from '@sushiswap/ui' import { useEffect } from 'react' -import { useIsContract } from '~tron/_common/lib/hooks/useIsContract' -import { usePairContract } from '~tron/_common/lib/hooks/usePairContract' -import { TokenListSelect } from '~tron/_common/ui/General/TokenListSelect' import { usePoolDispatch, usePoolState, -} from '~tron/explore/pools/pool-provider' +} from '~tron/(tron)/explore/pools/pool-provider' +import { useIsContract } from '~tron/_common/lib/hooks/useIsContract' +import { usePairContract } from '~tron/_common/lib/hooks/usePairContract' +import { TokenListSelect } from '~tron/_common/ui/General/TokenListSelect' export const SelectTokensForm = () => { const { token0, token1 } = usePoolState() diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx index 9618c507a3..cf5739be81 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx @@ -10,6 +10,8 @@ import { import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useEffect, useMemo } from 'react' import { formatUSD } from 'sushi/format' +import { usePoolState } from '~tron/(tron)/explore/pools/pool-provider' +import { useRemoveLiqDispatch } from '~tron/(tron)/pool/(pool)/[address]/remove-provider' import { PAIR_DECIMALS } from '~tron/_common/constants/pair-decimals' import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' @@ -20,8 +22,6 @@ import { toBigNumber, } from '~tron/_common/lib/utils/formatters' import { IToken } from '~tron/_common/types/token-type' -import { useRemoveLiqDispatch } from '~tron/explore/pools/[poolId]/remove-provider' -import { usePoolState } from '~tron/explore/pools/pool-provider' import { LiquidityItem } from '../PoolDetails/LiquidityItem' export const PoolPosition = ({ diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx index dc9bedfcc3..0e7c04496e 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx @@ -1,7 +1,15 @@ -import { useDebounce } from '@sushiswap/hooks' -import { DataTable } from '@sushiswap/ui' +'use client' + +import { + Card, + CardHeader, + CardTitle, + DataTable, + SkeletonText, +} from '@sushiswap/ui' import { PaginationState } from '@tanstack/react-table' -import { useEffect, useMemo, useState } from 'react' +import { useMemo, useState } from 'react' +import { usePoolFilters } from 'src/ui/pool' import { usePools } from '~tron/_common/lib/hooks/usePools' import { NAME_COLUMN, RESERVES_COLUMN, TVL_COLUMN } from './PoolColumns' @@ -14,64 +22,82 @@ export type IRowData = { reserve1: string } -type PoolsTableProps = { - query: string - handlePoolsOnView: (pools: number) => void -} +export const PoolsTable = () => { + const { tokenSymbols } = usePoolFilters() -export const PoolsTable = ({ query, handlePoolsOnView }: PoolsTableProps) => { const [paginationState, setPaginationState] = useState({ pageIndex: 0, pageSize: 10, }) - const debouncedQuery = useDebounce(query, 250) const { data, isLoading } = usePools() const filteredData = useMemo(() => { if (!data) return [] - if (!debouncedQuery) return data - const lowercasedQuery = debouncedQuery.toLowerCase()?.replaceAll(' ', '') + if (!tokenSymbols.length) return data + const queries = tokenSymbols.map((symbol) => + symbol.toLowerCase()?.replaceAll(' ', ''), + ) return data.filter((pool) => { - return ( - ['pairAddress', 'token0Address', 'token1Address'] as Array< - keyof (typeof data)[0] - > - ).some((key) => pool[key].toLowerCase().includes(lowercasedQuery)) - }) - }, [data, debouncedQuery]) + const poolValues = [ + pool.pairAddress, + // pool.token0?.address, + // pool.token1?.address, + // pool.token0?.symbol, + // pool.token1?.symbol, + // pool.token0?.name, + // pool.token1?.name, + ] - useEffect(() => { - if (filteredData && !isLoading) { - handlePoolsOnView(filteredData.length) - } - }, [filteredData, isLoading, handlePoolsOnView]) + return queries.every((query) => + poolValues.some((value) => value?.toLowerCase()?.includes(query)), + ) + }) + }, [data, tokenSymbols]) return ( - ({ - name: `${pool.token0Address}/${pool.token1Address}`, - pairAddress: pool.pairAddress, - token0Address: pool.token0Address, - token1Address: pool.token1Address, - reserve0: pool.reserve0, - reserve1: pool.reserve1, - })) ?? [] - } - columns={[NAME_COLUMN, TVL_COLUMN, RESERVES_COLUMN]} - linkFormatter={(data) => { - const token0 = data.name.split('/')[0] - const token1 = data.name.split('/')[1] - return `/tron/pool/${token0}:${token1}:${data.pairAddress}` - }} - pagination={true} - externalLink={false} - onPaginationChange={setPaginationState} - state={{ - pagination: paginationState, - }} - /> + + + + {isLoading ? ( +
    + +
    + ) : ( + + Pools{' '} + + ({filteredData?.length ?? 0}) + + + )} +
    +
    + ({ + name: `${pool.token0Address}/${pool.token1Address}`, + pairAddress: pool.pairAddress, + token0Address: pool.token0Address, + token1Address: pool.token1Address, + reserve0: pool.reserve0, + reserve1: pool.reserve1, + })) ?? [] + } + columns={[NAME_COLUMN, TVL_COLUMN, RESERVES_COLUMN]} + linkFormatter={(data) => { + const token0 = data.name.split('/')[0] + const token1 = data.name.split('/')[1] + return `/tron/pool/${token0}:${token1}:${data.pairAddress}` + }} + pagination={true} + externalLink={false} + onPaginationChange={setPaginationState} + state={{ + pagination: paginationState, + }} + /> +
    ) } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsView.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsView.tsx deleted file mode 100644 index 7c262fe807..0000000000 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsView.tsx +++ /dev/null @@ -1,101 +0,0 @@ -import { Tab } from '@headlessui/react' -import { Card, CardHeader, CardTitle, Container } from '@sushiswap/ui' -import { Button } from '@sushiswap/ui' -import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' -import React, { Fragment, useState } from 'react' -import { PoolSearchBar } from './PoolSearchBar' -import { PoolsTable } from './PoolsTable/PoolsTable' -import { PositionsTable } from './PositionsTable/PositionsTable' - -export const PoolsView = () => { - const [tab, setTab] = useState(0) - const { address } = useWallet() - const [query, setQuery] = useState('') - const [poolsOnView, setPoolsOnView] = useState(-1) - const [myPositionsOnView, setMyPositionsOnView] = useState(-1) - - const handlePoolsOnView = (pools: number) => { - setPoolsOnView(pools) - } - - const handleMyPositionsOnView = (positions: number) => { - setMyPositionsOnView(positions) - } - - return ( -
    - - -
    - - {({ selected }) => ( - - )} - - {address && ( - <> - - {({ selected }) => ( - - )} - - - )} -
    -
    - - - - - -
    - - - - Pools ({poolsOnView === -1 ? '-' : poolsOnView}) - - - - -
    -
    - -
    - - - - My Positions ( - {myPositionsOnView === -1 ? '-' : myPositionsOnView}) - - - - -
    -
    - -
    -
    -
    - ) -} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionsTable.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionsTable.tsx index 2d4f2fbfa2..b1869e1cfc 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionsTable.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PositionsTable/PositionsTable.tsx @@ -1,7 +1,17 @@ -import { useDebounce } from '@sushiswap/hooks' -import { DataTable } from '@sushiswap/ui' +'use client' + +import { PlusIcon } from '@heroicons/react/20/solid' +import { + Button, + Card, + CardHeader, + CardTitle, + DataTable, + LinkInternal, +} from '@sushiswap/ui' import { PaginationState } from '@tanstack/react-table' -import { useEffect, useMemo, useState } from 'react' +import { useMemo, useState } from 'react' +import { usePoolFilters } from 'src/ui/pool' import { useMyPositions } from '~tron/_common/lib/hooks/useMyPositions' import { IMyPositionData } from '~tron/_common/types/get-pools-type' import { IToken } from '~tron/_common/types/token-type' @@ -12,8 +22,7 @@ import { } from './PositionColumns' type PositionsTableProps = { - query: string - handleMyPositionsOnView: (positions: number) => void + hideNewPositionButton?: boolean } export type IPositionRowData = { @@ -25,20 +34,21 @@ export type IPositionRowData = { } export const PositionsTable = ({ - query, - handleMyPositionsOnView, + hideNewPositionButton, }: PositionsTableProps) => { const [paginationState, setPaginationState] = useState({ pageIndex: 0, pageSize: 10, }) - const debouncedQuery = useDebounce(query, 250) + const { tokenSymbols } = usePoolFilters() const { data, isLoading } = useMyPositions() const filteredData = useMemo(() => { if (!data) return [] - if (!debouncedQuery) return data - const lowercasedQuery = debouncedQuery.toLowerCase()?.replaceAll(' ', '') + if (!tokenSymbols.length) return data + const queries = tokenSymbols.map((symbol) => + symbol.toLowerCase()?.replaceAll(' ', ''), + ) return data.filter((pool) => { const poolValues = [ @@ -52,41 +62,58 @@ export const PositionsTable = ({ ] return poolValues.some((value) => - value?.toLowerCase().includes(lowercasedQuery), + queries.some((query) => value?.toLowerCase().includes(query)), ) }) - }, [data, debouncedQuery]) - - useEffect(() => { - if (filteredData && !isLoading) { - handleMyPositionsOnView(filteredData.length) - } - }, [filteredData, isLoading, handleMyPositionsOnView]) + }, [data, tokenSymbols]) return ( - ({ - token0: pool?.token0, - token1: pool?.token1, - pairAddress: pool?.pairAddress, - reserve0: pool?.reserve0, - reserve1: pool?.reserve1, - })) ?? [] - } - columns={[POSITION_NAME_COLUMN, TVL_COLUMN, SIZE_COLUMN]} - linkFormatter={(data: IMyPositionData) => { - const token0 = data?.token0?.address - const token1 = data?.token1?.address - return `/pool/${token0}:${token1}:${data?.pairAddress}` - }} - externalLink={false} - pagination={true} - state={{ - pagination: paginationState, - }} - onPaginationChange={setPaginationState} - /> + + + +
    + + My Positions{' '} + + ({filteredData.length}) + + +
    + {!hideNewPositionButton ? ( + + + + ) : null} +
    +
    +
    +
    + ({ + token0: pool?.token0, + token1: pool?.token1, + pairAddress: pool?.pairAddress, + reserve0: pool?.reserve0, + reserve1: pool?.reserve1, + })) ?? [] + } + columns={[POSITION_NAME_COLUMN, TVL_COLUMN, SIZE_COLUMN]} + linkFormatter={(data: IMyPositionData) => { + const token0 = data?.token0?.address + const token1 = data?.token1?.address + return `/pool/${token0}:${token1}:${data?.pairAddress}` + }} + externalLink={false} + pagination={true} + state={{ + pagination: paginationState, + }} + onPaginationChange={setPaginationState} + /> +
    ) } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx index a643804639..e695e73051 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx @@ -4,6 +4,11 @@ import { } from '@sushiswap/hooks' import { Card, CardGroup, CardLabel } from '@sushiswap/ui' import { useEffect, useMemo } from 'react' +import { usePoolState } from '~tron/(tron)/explore/pools/pool-provider' +import { + useRemoveLiqDispatch, + useRemoveLiqState, +} from '~tron/(tron)/pool/(pool)/[address]/remove-provider' import { PAIR_DECIMALS } from '~tron/_common/constants/pair-decimals' import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' import { @@ -12,11 +17,6 @@ import { removeDecimals, toBigNumber, } from '~tron/_common/lib/utils/formatters' -import { - useRemoveLiqDispatch, - useRemoveLiqState, -} from '~tron/explore/pools/[poolId]/remove-provider' -import { usePoolState } from '~tron/explore/pools/pool-provider' import { LiquidityItem } from '../PoolDetails/LiquidityItem' export const MinimumReceive = () => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx index 243238e843..98ac9f09ea 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx @@ -7,6 +7,11 @@ import { Button } from '@sushiswap/ui' import { useQueryClient } from '@tanstack/react-query' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useMemo } from 'react' +import { usePoolState } from '~tron/(tron)/explore/pools/pool-provider' +import { + useRemoveLiqDispatch, + useRemoveLiqState, +} from '~tron/(tron)/pool/(pool)/[address]/remove-provider' import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' import { PAIR_DECIMALS } from '~tron/_common/constants/pair-decimals' import { useAllowance } from '~tron/_common/lib/hooks/useAllowance' @@ -24,11 +29,6 @@ import { import { getTronscanTxnLink } from '~tron/_common/lib/utils/tronscan-helpers' import { ApproveToken } from '~tron/_common/ui/Shared/ApproveToken' import { WalletConnector } from '~tron/_common/ui/WalletConnector/WalletConnector' -import { - useRemoveLiqDispatch, - useRemoveLiqState, -} from '~tron/explore/pools/[poolId]/remove-provider' -import { usePoolState } from '~tron/explore/pools/pool-provider' export const RemoveButton = () => { const queryClient = useQueryClient() diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx index 8c553183bf..29d6ce1dd4 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx @@ -2,7 +2,7 @@ import { Button, Card, Message } from '@sushiswap/ui' import { useRemoveLiqDispatch, useRemoveLiqState, -} from '~tron/explore/pools/[poolId]/remove-provider' +} from '~tron/(tron)/pool/(pool)/[address]/remove-provider' const PercentageOptions = [25, 50, 75, 100] diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx index 9ac8ab20e5..c125995284 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx @@ -1,10 +1,10 @@ import { useEffect } from 'react' -import { useReserves } from '~tron/_common/lib/hooks/useReserves' -import { getValidTokenAddress } from '~tron/_common/lib/utils/helpers' import { usePoolDispatch, usePoolState, -} from '~tron/explore/pools/pool-provider' +} from '~tron/(tron)/explore/pools/pool-provider' +import { useReserves } from '~tron/_common/lib/hooks/useReserves' +import { getValidTokenAddress } from '~tron/_common/lib/utils/helpers' export const ReserveHelper = () => { const { token0, token1, pairAddress } = usePoolState() diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx index c249459fb4..54a00a6bcb 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx @@ -1,11 +1,11 @@ import { useDebounce } from '@sushiswap/hooks' import { useEffect } from 'react' +import { useSwapDispatch, useSwapState } from '~tron/(trade)/swap/swap-provider' import { useAmountsOut } from '~tron/_common/lib/hooks/useAmountsOut' import { formatUnitsForInput, parseUnits, } from '~tron/_common/lib/utils/formatters' -import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' import { TokenInput } from '../Input/TokenInput' export const AmountIn = () => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx index 347905ad6f..7f3114e653 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx @@ -1,4 +1,4 @@ -import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' +import { useSwapDispatch, useSwapState } from '~tron/(trade)/swap/swap-provider' import { TokenInput } from '../Input/TokenInput' export const AmountOut = () => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx index 116e22e9a7..e1015afd5e 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx @@ -11,13 +11,13 @@ import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import Link from 'next/link' import { useMemo, useRef } from 'react' import { formatPercent } from 'sushi/format' +import { useSwapState } from '~tron/(trade)/swap/swap-provider' import { truncateText } from '~tron/_common/lib/utils/formatters' import { getTronscanAddressLink } from '~tron/_common/lib/utils/tronscan-helpers' import { warningSeverity, warningSeverityClassName, } from '~tron/_common/lib/utils/warning-severity' -import { useSwapState } from '~tron/swap/swap-provider' import { Icon } from '../General/Icon' import { WalletConnector } from '../WalletConnector/WalletConnector' import { ReviewSwapDialogTrigger } from './ReviewSwapDialogTrigger' diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx index 12bef50766..a22db21da2 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx @@ -1,6 +1,7 @@ import { Button, Checkbox, DialogTrigger } from '@sushiswap/ui' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useEffect, useMemo, useState } from 'react' +import { useSwapDispatch, useSwapState } from '~tron/(trade)/swap/swap-provider' import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' import { useAllowance } from '~tron/_common/lib/hooks/useAllowance' import { usePriceImpact } from '~tron/_common/lib/hooks/usePriceImpact' @@ -10,7 +11,6 @@ import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' import { formatUnitsForInput } from '~tron/_common/lib/utils/formatters' import { getIfWrapOrUnwrap } from '~tron/_common/lib/utils/helpers' import { warningSeverity } from '~tron/_common/lib/utils/warning-severity' -import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' import { ApproveToken } from '../Shared/ApproveToken' export const ReviewSwapDialogTrigger = () => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapButton.tsx index be73d1b9e7..5182539108 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapButton.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapButton.tsx @@ -6,8 +6,8 @@ import { import { useQueryClient } from '@tanstack/react-query' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useMemo } from 'react' +import { useSwapDispatch, useSwapState } from '~tron/(trade)/swap/swap-provider' import { WTRX } from '~tron/_common/constants/token-list' -import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' import { Button, Dots } from '@sushiswap/ui' import { useTronWeb } from '~tron/_common/lib/hooks/useTronWeb' diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapRoutesDialog.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapRoutesDialog.tsx index d084a657f6..f3186b057b 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapRoutesDialog.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapRoutesDialog.tsx @@ -7,8 +7,8 @@ import { DialogTitle, DialogTrigger, } from '@sushiswap/ui' +import { useSwapState } from '~tron/(trade)/swap/swap-provider' import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' -import { useSwapState } from '~tron/swap/swap-provider' import { Icon } from '../General/Icon' export const SwapRoutesDialog = () => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapStats.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapStats.tsx index a8bad94464..d37ed30ad5 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapStats.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapStats.tsx @@ -9,6 +9,7 @@ import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import Link from 'next/link' import { useMemo } from 'react' import { formatPercent } from 'sushi/format' +import { useSwapState } from '~tron/(trade)/swap/swap-provider' import { truncateText } from '~tron/_common/lib/utils/formatters' import { getIfWrapOrUnwrap } from '~tron/_common/lib/utils/helpers' import { getTronscanAddressLink } from '~tron/_common/lib/utils/tronscan-helpers' @@ -16,7 +17,6 @@ import { warningSeverity, warningSeverityClassName, } from '~tron/_common/lib/utils/warning-severity' -import { useSwapState } from '~tron/swap/swap-provider' import { SwapRoutesDialog } from './SwapRoutesDialog' export const SwapStats = () => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx index 1b41830021..0d49c8607e 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx @@ -1,6 +1,6 @@ import { ArrowsUpDownIcon } from '@heroicons/react/24/outline' import React from 'react' -import { useSwapDispatch } from '~tron/swap/swap-provider' +import { useSwapDispatch } from '~tron/(trade)/swap/swap-provider' export const SwitchSwapDirection = () => { const { swapTokens } = useSwapDispatch() diff --git a/apps/web/src/app/(non-evm)/tron/explore/pools/page.tsx b/apps/web/src/app/(non-evm)/tron/explore/pools/page.tsx deleted file mode 100644 index 4a47641659..0000000000 --- a/apps/web/src/app/(non-evm)/tron/explore/pools/page.tsx +++ /dev/null @@ -1,78 +0,0 @@ -'use client' -import { ChevronRightIcon } from '@heroicons/react/24/outline' -import { - Button, - Container, - LinkExternal, - LinkInternal, - typographyVariants, -} from '@sushiswap/ui' -import { DiscordIcon } from '@sushiswap/ui/icons/DiscordIcon' -import { PoolsView } from '~tron/_common/ui/Pools/PoolsView' - -export default function Pool() { - return ( - <> - -
    -
    -
    -

    - Put your funds to work
    - by providing liquidity. -

    -

    - When you add liquidity to a pool, you can receive a share of its - trading volume and potentially snag extra rewards when there are - incentives involved! -

    -
    -
    -
    - -
    -
    -
    -
    -
    - - Looking for a partnership with Sushi? - - -
    -
    - Need Help? - -
    -
    -
    -
    - - - - ) -} diff --git a/apps/web/src/app/(non-evm)/tron/header.tsx b/apps/web/src/app/(non-evm)/tron/header.tsx index 83384c4e0c..cb1bc6e833 100644 --- a/apps/web/src/app/(non-evm)/tron/header.tsx +++ b/apps/web/src/app/(non-evm)/tron/header.tsx @@ -34,7 +34,7 @@ const nagivationElements: NavigationElement[] = [ }, ], type: NavigationElementType.Dropdown, - show: 'everywhere', + show: 'mobile', }, { show: 'desktop', From fd9650befb2935569a62136f84429ccf80b98247 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@users.noreply.github.com> Date: Fri, 13 Sep 2024 22:22:27 +0000 Subject: [PATCH 24/46] chore: lint --- apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts index c4433aa611..9ea59abc17 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/usePools.ts @@ -1,4 +1,5 @@ import { keepPreviousData, useQuery } from '@tanstack/react-query' +import ms from 'ms' import { FACTORY_CONTRACT } from '~tron/_common/constants/contracts' import { chunk } from '~tron/_common/lib/utils/helpers' import { @@ -6,7 +7,6 @@ import { IReserveDataResponse, } from '~tron/_common/types/get-pools-type' import { useTronWeb } from './useTronWeb' -import ms from 'ms' type _IPools = { token0Address: string From 8be5037136e170ff77eb8f44850b0917e114d354 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sat, 14 Sep 2024 08:37:09 +0800 Subject: [PATCH 25/46] fix: tron add liquidity styles --- .../tron/_common/ui/General/TokenListSelect.tsx | 7 ++----- .../tron/_common/ui/Pools/Add/AmountInToken0.tsx | 1 + .../tron/_common/ui/Pools/Add/AmountIntToken1.tsx | 1 + .../tron/_common/ui/Pools/Add/DepositForm.tsx | 2 +- .../app/(non-evm)/tron/_common/ui/Pools/Add/Plus.tsx | 4 ++-- .../tron/_common/ui/Pools/Add/ReviewAddDialog.tsx | 2 +- .../_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx | 2 +- .../tron/_common/ui/Pools/Add/SelectTokensForm.tsx | 12 ++---------- 8 files changed, 11 insertions(+), 20 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx index c9eb22ce00..2044a24e9b 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx @@ -60,13 +60,10 @@ export const TokenListSelect = ({ diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx index 5bc96b77c3..0be81ab76e 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx @@ -32,16 +32,8 @@ export const SelectTokensForm = () => { description="Which token pair would you like to add liquidity to." >
    - - + +
    ) From 2af0f695e8315d67793b106031567559694861f6 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sat, 14 Sep 2024 08:58:17 +0800 Subject: [PATCH 26/46] fix: tron token selector style --- .../app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx | 1 + apps/web/src/app/(non-evm)/tron/_common/ui/Input/Search.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx index 2044a24e9b..69de1e57db 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx @@ -82,6 +82,7 @@ export const TokenListSelect = ({
    = forwardRef( value={value} onChange={(e) => onChange(e.target.value)} className={classNames( - 'truncate font-semibold w-full bg-transparent !p-0 placeholder:font-medium placeholder:text-gray-400 placeholder:dark:text-slate-500 text-gray-900 dark:text-slate-200', + 'truncate outline-none font-semibold w-full bg-transparent !p-0 placeholder:font-medium placeholder:text-gray-400 placeholder:dark:text-slate-500 text-gray-900 dark:text-slate-200', )} autoCorrect="off" autoCapitalize="off" From 34a6a5498b422d57cb08daa2db2842b6203a87b0 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sat, 14 Sep 2024 09:09:22 +0800 Subject: [PATCH 27/46] fix: tron explore hero --- .../(non-evm)/tron/(tron)/explore/hero.tsx | 65 +++++++++++++++++++ .../(non-evm)/tron/(tron)/explore/layout.tsx | 29 ++------- 2 files changed, 69 insertions(+), 25 deletions(-) create mode 100644 apps/web/src/app/(non-evm)/tron/(tron)/explore/hero.tsx diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/explore/hero.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/explore/hero.tsx new file mode 100644 index 0000000000..07ae287c15 --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/(tron)/explore/hero.tsx @@ -0,0 +1,65 @@ +import { + Button, + LinkExternal, + LinkInternal, + typographyVariants, +} from '@sushiswap/ui' +import { DiscordIcon } from '@sushiswap/ui/icons/DiscordIcon' +import { FC } from 'react' + +export const Hero: FC = () => { + return ( +
    +
    +
    +

    + Put your funds to work
    + by providing liquidity. +

    +

    + When you add liquidity to a pool, you can receive a share of its + trading volume and potentially snag extra rewards when there are + incentives involved! +

    +
    +
    +
    + +
    +
    +
    +
    +
    + + Looking for a partnership with Sushi? + + +
    +
    + Need Help? + +
    +
    +
    + ) +} diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/explore/layout.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/explore/layout.tsx index 6a4786b615..29b5075560 100644 --- a/apps/web/src/app/(non-evm)/tron/(tron)/explore/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/(tron)/explore/layout.tsx @@ -1,43 +1,22 @@ import { Container } from '@sushiswap/ui' -import { LinkInternal } from '@sushiswap/ui' import React from 'react' -import { GlobalStatsCharts } from 'src/ui/explore/global-stats-charts' -import { PathnameButton } from 'src/ui/pathname-button' import { PoolsFiltersProvider } from 'src/ui/pool' +import { Hero } from './hero' export const metadata = { title: 'Pools 💦', } -export default async function ExploreLayout({ +export default function ExploreLayout({ children, }: { children: React.ReactNode }) { return ( <> - - THIS IS THE ETHEREUM CHART FIX IT - + +
    - -
    - - - All Pools - - -
    -
    {children}
    From 4bc536654b4fc86ae0a183c3941f3693c748efca Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sat, 14 Sep 2024 11:08:02 +0800 Subject: [PATCH 28/46] fix: tron pool page --- .../[chainId]/pool/v2/[address]/layout.tsx | 3 +- .../tron/(tron)/explore/pools/layout.tsx | 12 -- .../(tron)/pool/(pool)/[address]/layout.tsx | 40 +++- .../(tron)/pool/(pool)/[address]/page.tsx | 62 +++---- .../pool/(pool)/[address]/providers.tsx | 10 + .../tron/(tron)/pool/(pool)/add/layout.tsx | 2 +- .../providers/query-client-provider.tsx | 17 -- .../tron/_common/ui/Input/TokenInput.tsx | 10 +- .../tron/_common/ui/Pools/Add/AddButton.tsx | 5 +- .../_common/ui/Pools/Add/AmountInToken0.tsx | 13 +- .../_common/ui/Pools/Add/AmountIntToken1.tsx | 13 +- .../tron/_common/ui/Pools/Add/Plus.tsx | 27 ++- .../tron/_common/ui/Pools/Add/Rate.tsx | 2 +- .../_common/ui/Pools/Add/ReviewAddDialog.tsx | 2 +- .../ui/Pools/Add/ReviewAddDialogTrigger.tsx | 2 +- .../_common/ui/Pools/Add/SelectTokensForm.tsx | 5 +- .../_common/ui/Pools/Manage/AddSection.tsx | 8 +- .../ui/Pools/PoolDetails/LiquidityItem.tsx | 4 +- .../ui/Pools/PoolDetails/PoolHeader.tsx | 173 ++++++++++++------ .../ui/Pools/PoolDetails/PoolLiquidity.tsx | 13 +- .../ui/Pools/PoolPosition/PoolPosition.tsx | 21 ++- .../ui/Pools/PoolRewards/PoolRewards.tsx | 11 +- .../ui/Pools/Remove/MinimumReceive.tsx | 7 +- .../_common/ui/Pools/Remove/RemoveButton.tsx | 7 +- .../_common/ui/Pools/Remove/RemoveInput.tsx | 5 +- .../ui/Pools/Remove/pool-remove-provider.tsx} | 0 .../tron/_common/ui/Pools/ReserveHelper.tsx | 5 +- .../ui/Pools}/pool-provider.tsx | 0 apps/web/src/app/(non-evm)/tron/providers.tsx | 2 +- 29 files changed, 278 insertions(+), 203 deletions(-) delete mode 100644 apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/layout.tsx create mode 100644 apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/providers.tsx delete mode 100644 apps/web/src/app/(non-evm)/tron/_common/providers/query-client-provider.tsx rename apps/web/src/app/(non-evm)/tron/{(tron)/pool/(pool)/[address]/remove-provider.tsx => _common/ui/Pools/Remove/pool-remove-provider.tsx} (100%) rename apps/web/src/app/(non-evm)/tron/{(tron)/explore/pools => _common/ui/Pools}/pool-provider.tsx (100%) diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx index fabe6d3e1e..a9ae9be319 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx @@ -3,7 +3,6 @@ import { unstable_cache } from 'next/cache' import { ChainId } from 'sushi' import { isSushiSwapV2ChainId } from 'sushi/config' import { isAddress } from 'viem' -import { PoolProvider } from '~tron/(tron)/explore/pools/pool-provider' import notFound from '../../../not-found' export const metadata = { @@ -40,5 +39,5 @@ export default async function Layout({ return notFound() } - return {children} + return <>{children} } diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/layout.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/layout.tsx deleted file mode 100644 index 99edcc757e..0000000000 --- a/apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/layout.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { Metadata } from 'next' -import { PoolProvider } from './pool-provider' - -export const metadata: Metadata = { - title: 'Pool', -} - -export default function PoolLayout({ - children, -}: { children: React.ReactNode }) { - return {children} -} diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/layout.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/layout.tsx index 84682d8efd..e27bd8fc3d 100644 --- a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/layout.tsx @@ -1,7 +1,39 @@ -import { RemoveProvider } from './remove-provider' +import { Container } from '@sushiswap/ui' +import { headers } from 'next/headers' +import { PoolHeader } from '~tron/_common/ui/Pools/PoolDetails/PoolHeader' +import Providers from './providers' -export default function RemoveLiqLayout({ +export default function PoolLayout({ children, -}: { children: React.ReactNode }) { - return {children} + params, +}: { children: React.ReactNode; params: { address: string } }) { + const decodedPoolId = decodeURIComponent(params.address).split(':') + const token0 = decodedPoolId[0] + const token1 = decodedPoolId[1] + const pairAddress = decodedPoolId[2] + + const headersList = headers() + const referer = headersList.get('referer') + + return ( + + + + +
    +
    + {children} +
    +
    +
    + ) } diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/page.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/page.tsx index ae61991117..ac5eaefa62 100644 --- a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/page.tsx +++ b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/page.tsx @@ -1,23 +1,22 @@ 'use client' -import { Breadcrumb, Container } from '@sushiswap/ui' + +import { Container } from '@sushiswap/ui' import { useEffect } from 'react' import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' import { isAddress } from '~tron/_common/lib/utils/helpers' import { Manage } from '~tron/_common/ui/Pools/Manage/Manage' -import { PoolHeader } from '~tron/_common/ui/Pools/PoolDetails/PoolHeader' import { PoolLiquidity } from '~tron/_common/ui/Pools/PoolDetails/PoolLiquidity' import { PoolPosition } from '~tron/_common/ui/Pools/PoolPosition/PoolPosition' import { PoolRewards } from '~tron/_common/ui/Pools/PoolRewards/PoolRewards' -import { usePoolDispatch } from '../../../explore/pools/pool-provider' +import { usePoolDispatch } from '../../../../_common/ui/Pools/pool-provider' export default function PoolByIdPage({ params, -}: { params: { poolId: string } }) { - const { poolId } = params - const decodedPoolId = decodeURIComponent(poolId) - const token0 = decodedPoolId?.split(':')?.[0] - const token1 = decodedPoolId?.split(':')?.[1] - const pairAddress = decodedPoolId?.split(':')?.[2] +}: { params: { address: string } }) { + const decodedPoolId = decodeURIComponent(params.address).split(':') + const token0 = decodedPoolId[0] + const token1 = decodedPoolId[1] + const pairAddress = decodedPoolId[2] const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ tokenAddress: token0, }) @@ -44,41 +43,26 @@ export default function PoolByIdPage({ }, [token0Data, token1Data, setToken0, setToken1]) return ( - <> -
    - - - - - +
    +
    + + - +
    +
    + + +
    -
    - -
    - - -
    -
    - - -
    -
    -
    - +
    ) } diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/providers.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/providers.tsx new file mode 100644 index 0000000000..bb39c860fa --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/providers.tsx @@ -0,0 +1,10 @@ +import { RemoveProvider } from '~tron/_common/ui/Pools/Remove/pool-remove-provider' +import { PoolProvider } from '~tron/_common/ui/Pools/pool-provider' + +export default function Providers({ children }: { children: React.ReactNode }) { + return ( + + {children} + + ) +} diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/add/layout.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/add/layout.tsx index 0031b58862..7d0280cdfb 100644 --- a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/add/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/add/layout.tsx @@ -1,7 +1,7 @@ import { Container, typographyVariants } from '@sushiswap/ui' import { Metadata } from 'next' import { BackButton } from 'src/ui/pool/BackButton' -import { PoolProvider } from '~tron/(tron)/explore/pools/pool-provider' +import { PoolProvider } from '~tron/_common/ui/Pools/pool-provider' export const metadata: Metadata = { title: 'Pool 💦', diff --git a/apps/web/src/app/(non-evm)/tron/_common/providers/query-client-provider.tsx b/apps/web/src/app/(non-evm)/tron/_common/providers/query-client-provider.tsx deleted file mode 100644 index 7a714bf403..0000000000 --- a/apps/web/src/app/(non-evm)/tron/_common/providers/query-client-provider.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { createQueryClient } from '@sushiswap/react-query' -// import { ReactQueryDevtools } from '@tanstack/react-query-devtools' -import { QueryClientProvider as _QueryClientProvider } from '@tanstack/react-query' -import { FC, ReactNode } from 'react' - -const client = createQueryClient() - -export const QueryClientProvider: FC<{ children: ReactNode }> = ({ - children, -}) => { - return ( - <_QueryClientProvider client={client}> - {children} - {/* */} - - ) -} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx index 0d421e47a7..16b4913f40 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx @@ -15,6 +15,11 @@ import { Icon } from '../General/Icon' import { DollarAmountDisplay } from '../Shared/DollarAmountDisplay' import { TokenBalanceDisplay } from '../Shared/TokenBalanceDisplay' +const themes = { + default: 'bg-white dark:bg-slate-800', + outline: 'border border-accent', +} as const + type TokenInputProps = { id?: string type: 'input' | 'output' @@ -25,6 +30,7 @@ type TokenInputProps = { className?: string hideIcon?: boolean label?: string + theme?: keyof typeof themes } export const TokenInput = ({ @@ -37,6 +43,7 @@ export const TokenInput = ({ className, hideIcon, label, + theme = 'default', }: TokenInputProps) => { const { address } = useWallet() const { data: tokenBalance, isInitialLoading: isInitialLoadingTokenBalance } = @@ -93,7 +100,8 @@ export const TokenInput = ({
    diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx index e79eeb7d38..09c60a1b11 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx @@ -11,10 +11,6 @@ import { Button } from '@sushiswap/ui' import { useQueryClient } from '@tanstack/react-query' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useMemo } from 'react' -import { - usePoolDispatch, - usePoolState, -} from '~tron/(tron)/explore/pools/pool-provider' import { useTronWeb } from '~tron/_common/lib/hooks/useTronWeb' import { parseUnits } from '~tron/_common/lib/utils/formatters' import { @@ -27,6 +23,7 @@ import { safeGasEstimates, } from '~tron/_common/lib/utils/helpers' import { getTronscanTxnLink } from '~tron/_common/lib/utils/tronscan-helpers' +import { usePoolDispatch, usePoolState } from '../pool-provider' export const AddButton = ({ closeModal }: { closeModal: () => void }) => { const queryClient = useQueryClient() diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx index f9ef9b5d6d..da929838d9 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx @@ -1,16 +1,15 @@ -import { useEffect, useMemo } from 'react' -import { - usePoolDispatch, - usePoolState, -} from '~tron/(tron)/explore/pools/pool-provider' +import { ComponentProps, useEffect, useMemo } from 'react' import { formatUnitsForInput, parseUnits, } from '~tron/_common/lib/utils/formatters' import { getToken1AmountForLiquidity } from '~tron/_common/lib/utils/helpers' import { TokenInput } from '~tron/_common/ui/Input/TokenInput' +import { usePoolDispatch, usePoolState } from '../pool-provider' -export const AmountInToken0 = () => { +export const AmountInToken0 = ({ + theme, +}: { theme?: ComponentProps['theme'] }) => { const { token0, token1, @@ -70,7 +69,7 @@ export const AmountInToken0 = () => { return ( { +export const AmountInToken1 = ({ + theme, +}: { theme?: ComponentProps['theme'] }) => { const { token0, token1, @@ -70,7 +69,7 @@ export const AmountInToken1 = () => { return ( { +const themes = { + default: '', + outline: 'border border-accent bg-white dark:bg-slate-900', +} as const + +export const Plus = ({ + theme = 'default', +}: { theme?: keyof typeof themes }) => { return ( -
    - +
    +
    + +
    ) } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx index a96ccdb77f..cd2c0bb447 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/Rate.tsx @@ -1,12 +1,12 @@ import { Button, SkeletonBox } from '@sushiswap/ui' import { useMemo, useState } from 'react' import { formatUSD } from 'sushi/format' -import { usePoolState } from '~tron/(tron)/explore/pools/pool-provider' import { formatUnits, parseUnits } from '~tron/_common/lib/utils/formatters' import { getToken0AmountForLiquidity, getToken1AmountForLiquidity, } from '~tron/_common/lib/utils/helpers' +import { usePoolState } from '../pool-provider' export const Rate = ({ token0Price, diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx index fb44b944bf..55e54ab18a 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx @@ -10,11 +10,11 @@ import { import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useRef } from 'react' import { formatUSD } from 'sushi/format' -import { usePoolState } from '~tron/(tron)/explore/pools/pool-provider' import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' import { formatUnits } from '~tron/_common/lib/utils/formatters' import { Icon } from '../../General/Icon' import { WalletConnector } from '../../WalletConnector/WalletConnector' +import { usePoolState } from '../pool-provider' import { AddButton } from './AddButton' import { Rate } from './Rate' import { ReviewAddDialogTrigger } from './ReviewAddDialogTrigger' diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx index 483e1e2961..75ed260efe 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx @@ -1,12 +1,12 @@ import { Button, DialogTrigger } from '@sushiswap/ui' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useMemo } from 'react' -import { usePoolState } from '~tron/(tron)/explore/pools/pool-provider' import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' import { useAllowance } from '~tron/_common/lib/hooks/useAllowance' import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' import { formatUnitsForInput } from '~tron/_common/lib/utils/formatters' import { ApproveToken } from '~tron/_common/ui/Shared/ApproveToken' +import { usePoolState } from '../pool-provider' export const ReviewAddDialogTrigger = () => { const { token0, token1, isTxnPending, amountInToken0, amountInToken1 } = diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx index 0be81ab76e..0eabbff2cd 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx @@ -1,13 +1,10 @@ 'use client' import { FormSection } from '@sushiswap/ui' import { useEffect } from 'react' -import { - usePoolDispatch, - usePoolState, -} from '~tron/(tron)/explore/pools/pool-provider' import { useIsContract } from '~tron/_common/lib/hooks/useIsContract' import { usePairContract } from '~tron/_common/lib/hooks/usePairContract' import { TokenListSelect } from '~tron/_common/ui/General/TokenListSelect' +import { usePoolDispatch, usePoolState } from '../pool-provider' export const SelectTokensForm = () => { const { token0, token1 } = usePoolState() diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/AddSection.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/AddSection.tsx index 65d21b5196..c2f2949923 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/AddSection.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/AddSection.tsx @@ -41,10 +41,10 @@ export const AddSection = () => { -
    - - - +
    + + +
    diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/LiquidityItem.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/LiquidityItem.tsx index 860d752f8d..16a0411bbc 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/LiquidityItem.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/LiquidityItem.tsx @@ -1,5 +1,5 @@ import { CardItem } from '@sushiswap/ui' -import { formatNumber, formatUSD } from 'sushi/format' +import { formatUSD } from 'sushi/format' import { formatUnits } from '~tron/_common/lib/utils/formatters' import { IToken } from '~tron/_common/types/token-type' import { Icon } from '~tron/_common/ui/General/Icon' @@ -28,7 +28,7 @@ export const LiquidityItem = ({ } > - {formatNumber(formatUnits(amount ?? '', token?.decimals ?? 0, 4))}{' '} + {+amount > 0 ? formatUnits(amount, token.decimals, 4) : 0}{' '} {formatUSD(usdAmount)} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx index e1e006cd7a..6f4be9a4f3 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolHeader.tsx @@ -1,80 +1,149 @@ +'use client' + +import { ArrowTopRightOnSquareIcon } from '@heroicons/react/20/solid' import { Button, Currency, LinkExternal, + LinkInternal, SkeletonCircle, SkeletonText, - classNames, typographyVariants, } from '@sushiswap/ui' -import { IToken } from '~tron/_common/types/token-type' +import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' import { Icon } from '~tron/_common/ui/General/Icon' export const PoolHeader = ({ - token0, - token1, - isLoading, + token0: _token0, + token1: _token1, pairAddress, + backUrl, }: { - token0: IToken | undefined - token1: IToken | undefined - isLoading: boolean + token0: string + token1: string pairAddress: string + backUrl: string }) => { + const { data: token0, isLoading: isLoadingToken0 } = useTokenInfo({ + tokenAddress: _token0, + }) + + const { data: token1, isLoading: isLoadingToken1 } = useTokenInfo({ + tokenAddress: _token1, + }) + + const isLoading = isLoadingToken0 || isLoadingToken1 + return ( -
    -
    - - {isLoading ? ( - - ) : ( - - )} - {isLoading ? ( - - ) : ( - - )} - - +
    V2
    - + )}
    - -
    - Network - Tron +
    +
    + Fee + 0.3% +
    +
    + Network + Tron +
    + {isLoading ? ( + <> +
    + +
    +
    + +
    + + ) : ( + <> +
    + + {token0?.symbol} + + + + +
    +
    + + {token1?.symbol} + + + + +
    + + )}
    ) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx index d92d64a457..78b4aa4a02 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx @@ -6,6 +6,7 @@ import { CardHeader, CardLabel, CardTitle, + SkeletonText, } from '@sushiswap/ui' import { formatUSD } from 'sushi/format' import { useReserves } from '~tron/_common/lib/hooks/useReserves' @@ -53,9 +54,15 @@ export const PoolLiquidity = ({ Pool Liquidity - - {formatUSD(Number(token0PoolPrice) + Number(token1PoolPrice))} - + {!token0Price || !token1Price ? ( +
    + +
    + ) : ( + + {formatUSD(Number(token0PoolPrice) + Number(token1PoolPrice))} + + )}
    diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx index cf5739be81..31cb14f679 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolPosition/PoolPosition.tsx @@ -6,12 +6,11 @@ import { CardHeader, CardLabel, CardTitle, + SkeletonText, } from '@sushiswap/ui' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useEffect, useMemo } from 'react' import { formatUSD } from 'sushi/format' -import { usePoolState } from '~tron/(tron)/explore/pools/pool-provider' -import { useRemoveLiqDispatch } from '~tron/(tron)/pool/(pool)/[address]/remove-provider' import { PAIR_DECIMALS } from '~tron/_common/constants/pair-decimals' import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' @@ -23,6 +22,8 @@ import { } from '~tron/_common/lib/utils/formatters' import { IToken } from '~tron/_common/types/token-type' import { LiquidityItem } from '../PoolDetails/LiquidityItem' +import { useRemoveLiqDispatch } from '../Remove/pool-remove-provider' +import { usePoolState } from '../pool-provider' export const PoolPosition = ({ token0, @@ -134,11 +135,17 @@ export const PoolPosition = ({ My Position - {formatUSD( - token0StakedInUsd + - token1StakedInUsd + - token0UnstakedInUsd + - token1UnstakedInUsd, + {loading ? ( +
    + +
    + ) : ( + formatUSD( + token0StakedInUsd + + token1StakedInUsd + + token0UnstakedInUsd + + token1UnstakedInUsd, + ) )}
    diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolRewards/PoolRewards.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolRewards/PoolRewards.tsx index c83e551305..4dd6de4a8e 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolRewards/PoolRewards.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolRewards/PoolRewards.tsx @@ -8,8 +8,8 @@ import { CardTitle, } from '@sushiswap/ui' import { CardItem } from '@sushiswap/ui' -import Image from 'next/image' import { WTRX } from '~tron/_common/constants/token-list' +import { Icon } from '../../General/Icon' export const PoolRewards = () => { return ( @@ -26,14 +26,7 @@ export const PoolRewards = () => { - {' '} - TRX + TRX
    } > diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx index e695e73051..16d02164e7 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/MinimumReceive.tsx @@ -4,11 +4,6 @@ import { } from '@sushiswap/hooks' import { Card, CardGroup, CardLabel } from '@sushiswap/ui' import { useEffect, useMemo } from 'react' -import { usePoolState } from '~tron/(tron)/explore/pools/pool-provider' -import { - useRemoveLiqDispatch, - useRemoveLiqState, -} from '~tron/(tron)/pool/(pool)/[address]/remove-provider' import { PAIR_DECIMALS } from '~tron/_common/constants/pair-decimals' import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' import { @@ -18,6 +13,8 @@ import { toBigNumber, } from '~tron/_common/lib/utils/formatters' import { LiquidityItem } from '../PoolDetails/LiquidityItem' +import { usePoolState } from '../pool-provider' +import { useRemoveLiqDispatch, useRemoveLiqState } from './pool-remove-provider' export const MinimumReceive = () => { const { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx index 98ac9f09ea..94a292bdd4 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx @@ -7,11 +7,6 @@ import { Button } from '@sushiswap/ui' import { useQueryClient } from '@tanstack/react-query' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useMemo } from 'react' -import { usePoolState } from '~tron/(tron)/explore/pools/pool-provider' -import { - useRemoveLiqDispatch, - useRemoveLiqState, -} from '~tron/(tron)/pool/(pool)/[address]/remove-provider' import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' import { PAIR_DECIMALS } from '~tron/_common/constants/pair-decimals' import { useAllowance } from '~tron/_common/lib/hooks/useAllowance' @@ -29,6 +24,8 @@ import { import { getTronscanTxnLink } from '~tron/_common/lib/utils/tronscan-helpers' import { ApproveToken } from '~tron/_common/ui/Shared/ApproveToken' import { WalletConnector } from '~tron/_common/ui/WalletConnector/WalletConnector' +import { usePoolState } from '../pool-provider' +import { useRemoveLiqDispatch, useRemoveLiqState } from './pool-remove-provider' export const RemoveButton = () => { const queryClient = useQueryClient() diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx index 29d6ce1dd4..5d6cccc4a4 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveInput.tsx @@ -1,8 +1,5 @@ import { Button, Card, Message } from '@sushiswap/ui' -import { - useRemoveLiqDispatch, - useRemoveLiqState, -} from '~tron/(tron)/pool/(pool)/[address]/remove-provider' +import { useRemoveLiqDispatch, useRemoveLiqState } from './pool-remove-provider' const PercentageOptions = [25, 50, 75, 100] diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/remove-provider.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/pool-remove-provider.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/remove-provider.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/pool-remove-provider.tsx diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx index c125995284..934503784f 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/ReserveHelper.tsx @@ -1,10 +1,7 @@ import { useEffect } from 'react' -import { - usePoolDispatch, - usePoolState, -} from '~tron/(tron)/explore/pools/pool-provider' import { useReserves } from '~tron/_common/lib/hooks/useReserves' import { getValidTokenAddress } from '~tron/_common/lib/utils/helpers' +import { usePoolDispatch, usePoolState } from './pool-provider' export const ReserveHelper = () => { const { token0, token1, pairAddress } = usePoolState() diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/pool-provider.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/pool-provider.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/pool-provider.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/Pools/pool-provider.tsx diff --git a/apps/web/src/app/(non-evm)/tron/providers.tsx b/apps/web/src/app/(non-evm)/tron/providers.tsx index 3f0c5a7699..9b14f8ac52 100644 --- a/apps/web/src/app/(non-evm)/tron/providers.tsx +++ b/apps/web/src/app/(non-evm)/tron/providers.tsx @@ -7,8 +7,8 @@ import { WalletError } from '@tronweb3/tronwallet-abstract-adapter' import { WalletProvider } from '@tronweb3/tronwallet-adapter-react-hooks' import { WalletModalProvider } from '@tronweb3/tronwallet-adapter-react-ui' import { useCallback } from 'react' +import { QueryClientProvider } from 'src/providers/query-client-provider' import { useWalletAdapters } from '~tron/_common/lib/hooks/useWalletAdapters' -import { QueryClientProvider } from './_common/providers/query-client-provider' export function Providers({ children }: { children: React.ReactNode }) { const { adapters } = useWalletAdapters() From 4d84740e1a4dc9fabd940709324dd8f946271dcc Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sat, 14 Sep 2024 11:34:37 +0800 Subject: [PATCH 29/46] chore: adjust tron directory structure to match aptos --- .../app/(non-evm)/tron/(positions)/hero.tsx | 39 ++++++++++++ .../{(tron)/pool => }/(positions)/layout.tsx | 4 +- .../(positions) => (positions)/pool}/page.tsx | 0 .../(non-evm)/tron/(trade)/swap/layout.tsx | 15 ----- .../src/app/(non-evm)/tron/(tron)/layout.tsx | 10 --- .../tron/(tron)/pool/(positions)/hero.tsx | 61 ------------------- .../tron/_common/lib/hooks/useAmountsOut.ts | 2 +- .../tron/_common/ui/Swap/AmountIn.tsx | 2 +- .../tron/_common/ui/Swap/AmountOut.tsx | 2 +- .../tron/_common/ui/Swap/ReviewSwapDialog.tsx | 2 +- .../ui/Swap/ReviewSwapDialogTrigger.tsx | 2 +- .../tron/_common/ui/Swap/SwapButton.tsx | 2 +- .../tron/_common/ui/Swap/SwapRoutesDialog.tsx | 2 +- .../tron/_common/ui/Swap/SwapStats.tsx | 2 +- .../_common/ui/Swap/SwitchSwapDirection.tsx | 2 +- .../tron/{(tron) => }/explore/hero.tsx | 0 .../tron/{(tron) => }/explore/layout.tsx | 0 .../tron/{(tron) => }/explore/pools/page.tsx | 0 apps/web/src/app/(non-evm)/tron/layout.tsx | 6 +- .../pool/(pool) => pool}/[address]/layout.tsx | 0 .../pool/(pool) => pool}/[address]/page.tsx | 2 +- .../(pool) => pool}/[address]/providers.tsx | 0 .../pool/(pool) => pool}/add/layout.tsx | 0 .../{(tron)/pool/(pool) => pool}/add/page.tsx | 0 .../tron/{(tron) => pool}/not-found.tsx | 0 .../src/app/(non-evm)/tron/swap/layout.tsx | 11 ++++ .../tron/{(trade) => }/swap/page.tsx | 0 .../tron/{(trade) => }/swap/providers.tsx | 0 .../tron/{(trade) => }/swap/swap-provider.tsx | 0 29 files changed, 67 insertions(+), 99 deletions(-) create mode 100644 apps/web/src/app/(non-evm)/tron/(positions)/hero.tsx rename apps/web/src/app/(non-evm)/tron/{(tron)/pool => }/(positions)/layout.tsx (94%) rename apps/web/src/app/(non-evm)/tron/{(tron)/pool/(positions) => (positions)/pool}/page.tsx (100%) delete mode 100644 apps/web/src/app/(non-evm)/tron/(trade)/swap/layout.tsx delete mode 100644 apps/web/src/app/(non-evm)/tron/(tron)/layout.tsx delete mode 100644 apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/hero.tsx rename apps/web/src/app/(non-evm)/tron/{(tron) => }/explore/hero.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{(tron) => }/explore/layout.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{(tron) => }/explore/pools/page.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{(tron)/pool/(pool) => pool}/[address]/layout.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{(tron)/pool/(pool) => pool}/[address]/page.tsx (96%) rename apps/web/src/app/(non-evm)/tron/{(tron)/pool/(pool) => pool}/[address]/providers.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{(tron)/pool/(pool) => pool}/add/layout.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{(tron)/pool/(pool) => pool}/add/page.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{(tron) => pool}/not-found.tsx (100%) create mode 100644 apps/web/src/app/(non-evm)/tron/swap/layout.tsx rename apps/web/src/app/(non-evm)/tron/{(trade) => }/swap/page.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{(trade) => }/swap/providers.tsx (100%) rename apps/web/src/app/(non-evm)/tron/{(trade) => }/swap/swap-provider.tsx (100%) diff --git a/apps/web/src/app/(non-evm)/tron/(positions)/hero.tsx b/apps/web/src/app/(non-evm)/tron/(positions)/hero.tsx new file mode 100644 index 0000000000..bd41cd6db0 --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/(positions)/hero.tsx @@ -0,0 +1,39 @@ +import { GiftIcon } from '@heroicons/react-v1/outline' +import { Button, LinkInternal } from '@sushiswap/ui' +import { FC } from 'react' + +export const Hero: FC = () => { + return ( +
    + Manage Liquidity Positions +
    + + You can adjust and claim rewards for your liquidity positions on the + connected network. + + For V2 pools, you can migrate to increase capital efficiency. + + +
    + + +
    +
    +
    + ) +} diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/layout.tsx b/apps/web/src/app/(non-evm)/tron/(positions)/layout.tsx similarity index 94% rename from apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/layout.tsx rename to apps/web/src/app/(non-evm)/tron/(positions)/layout.tsx index ba777d9bfa..8e9af4f820 100644 --- a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/(positions)/layout.tsx @@ -2,8 +2,8 @@ import { Container, LinkInternal } from '@sushiswap/ui' import { useSearchParams } from 'next/navigation' -import { PathnameButton } from 'src/ui/pathname-button' -import { PoolsFiltersProvider } from 'src/ui/pool' +import React from 'react' +import { PathnameButton, PoolsFiltersProvider } from 'src/ui/pool' import { Hero } from './hero' export default function Layout({ diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/page.tsx b/apps/web/src/app/(non-evm)/tron/(positions)/pool/page.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/page.tsx rename to apps/web/src/app/(non-evm)/tron/(positions)/pool/page.tsx diff --git a/apps/web/src/app/(non-evm)/tron/(trade)/swap/layout.tsx b/apps/web/src/app/(non-evm)/tron/(trade)/swap/layout.tsx deleted file mode 100644 index 469b02f72f..0000000000 --- a/apps/web/src/app/(non-evm)/tron/(trade)/swap/layout.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { Header } from '../../header' -import { Providers } from './providers' - -export default function SwapLayout({ - children, -}: { children: React.ReactNode }) { - return ( - <> - -
    -
    {children}
    - - - ) -} diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/layout.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/layout.tsx deleted file mode 100644 index 1ced76ab13..0000000000 --- a/apps/web/src/app/(non-evm)/tron/(tron)/layout.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { Header } from '../header' - -export default function Layout({ children }: { children: React.ReactNode }) { - return ( - <> -
    -
    {children}
    - - ) -} diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/hero.tsx b/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/hero.tsx deleted file mode 100644 index 08130b88db..0000000000 --- a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(positions)/hero.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import { - Button, - DropdownMenu, - DropdownMenuContent, - DropdownMenuGroup, - DropdownMenuItem, - DropdownMenuTrigger, - LinkInternal, - SelectIcon, -} from '@sushiswap/ui' - -export function Hero() { - return ( -
    - Manage Liquidity Positions -
    - - You can adjust and claim rewards for your liquidity positions on the - connected network. - -
    -
    - - - - - - - - - -
    - V2 Position -
    -

    - Provide liquidity to a V2 liquidity pool. -

    -
    -
    -
    -
    -
    -
    -
    -
    -
    - ) -} diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts index 83a468fce3..b4eb96e368 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts @@ -1,12 +1,12 @@ import { useQuery } from '@tanstack/react-query' import TronWeb from 'tronweb' -import { useSwapState } from '~tron/(trade)/swap/swap-provider' import { ROUTER_ABI } from '~tron/_common/constants/abis/router-abi' import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' import { getIfWrapOrUnwrap, getValidTokenAddress, } from '~tron/_common/lib/utils/helpers' +import { useSwapState } from '~tron/swap/swap-provider' import { useTronWeb } from './useTronWeb' export const useAmountsOut = ({ amountIn }: { amountIn: string }) => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx index 54a00a6bcb..c249459fb4 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx @@ -1,11 +1,11 @@ import { useDebounce } from '@sushiswap/hooks' import { useEffect } from 'react' -import { useSwapDispatch, useSwapState } from '~tron/(trade)/swap/swap-provider' import { useAmountsOut } from '~tron/_common/lib/hooks/useAmountsOut' import { formatUnitsForInput, parseUnits, } from '~tron/_common/lib/utils/formatters' +import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' import { TokenInput } from '../Input/TokenInput' export const AmountIn = () => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx index 7f3114e653..347905ad6f 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountOut.tsx @@ -1,4 +1,4 @@ -import { useSwapDispatch, useSwapState } from '~tron/(trade)/swap/swap-provider' +import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' import { TokenInput } from '../Input/TokenInput' export const AmountOut = () => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx index e1015afd5e..116e22e9a7 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx @@ -11,13 +11,13 @@ import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import Link from 'next/link' import { useMemo, useRef } from 'react' import { formatPercent } from 'sushi/format' -import { useSwapState } from '~tron/(trade)/swap/swap-provider' import { truncateText } from '~tron/_common/lib/utils/formatters' import { getTronscanAddressLink } from '~tron/_common/lib/utils/tronscan-helpers' import { warningSeverity, warningSeverityClassName, } from '~tron/_common/lib/utils/warning-severity' +import { useSwapState } from '~tron/swap/swap-provider' import { Icon } from '../General/Icon' import { WalletConnector } from '../WalletConnector/WalletConnector' import { ReviewSwapDialogTrigger } from './ReviewSwapDialogTrigger' diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx index a22db21da2..12bef50766 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx @@ -1,7 +1,6 @@ import { Button, Checkbox, DialogTrigger } from '@sushiswap/ui' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useEffect, useMemo, useState } from 'react' -import { useSwapDispatch, useSwapState } from '~tron/(trade)/swap/swap-provider' import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' import { useAllowance } from '~tron/_common/lib/hooks/useAllowance' import { usePriceImpact } from '~tron/_common/lib/hooks/usePriceImpact' @@ -11,6 +10,7 @@ import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' import { formatUnitsForInput } from '~tron/_common/lib/utils/formatters' import { getIfWrapOrUnwrap } from '~tron/_common/lib/utils/helpers' import { warningSeverity } from '~tron/_common/lib/utils/warning-severity' +import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' import { ApproveToken } from '../Shared/ApproveToken' export const ReviewSwapDialogTrigger = () => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapButton.tsx index 5182539108..be73d1b9e7 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapButton.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapButton.tsx @@ -6,8 +6,8 @@ import { import { useQueryClient } from '@tanstack/react-query' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useMemo } from 'react' -import { useSwapDispatch, useSwapState } from '~tron/(trade)/swap/swap-provider' import { WTRX } from '~tron/_common/constants/token-list' +import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' import { Button, Dots } from '@sushiswap/ui' import { useTronWeb } from '~tron/_common/lib/hooks/useTronWeb' diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapRoutesDialog.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapRoutesDialog.tsx index f3186b057b..d084a657f6 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapRoutesDialog.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapRoutesDialog.tsx @@ -7,8 +7,8 @@ import { DialogTitle, DialogTrigger, } from '@sushiswap/ui' -import { useSwapState } from '~tron/(trade)/swap/swap-provider' import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' +import { useSwapState } from '~tron/swap/swap-provider' import { Icon } from '../General/Icon' export const SwapRoutesDialog = () => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapStats.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapStats.tsx index d37ed30ad5..a8bad94464 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapStats.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwapStats.tsx @@ -9,7 +9,6 @@ import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import Link from 'next/link' import { useMemo } from 'react' import { formatPercent } from 'sushi/format' -import { useSwapState } from '~tron/(trade)/swap/swap-provider' import { truncateText } from '~tron/_common/lib/utils/formatters' import { getIfWrapOrUnwrap } from '~tron/_common/lib/utils/helpers' import { getTronscanAddressLink } from '~tron/_common/lib/utils/tronscan-helpers' @@ -17,6 +16,7 @@ import { warningSeverity, warningSeverityClassName, } from '~tron/_common/lib/utils/warning-severity' +import { useSwapState } from '~tron/swap/swap-provider' import { SwapRoutesDialog } from './SwapRoutesDialog' export const SwapStats = () => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx index 0d49c8607e..1b41830021 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx @@ -1,6 +1,6 @@ import { ArrowsUpDownIcon } from '@heroicons/react/24/outline' import React from 'react' -import { useSwapDispatch } from '~tron/(trade)/swap/swap-provider' +import { useSwapDispatch } from '~tron/swap/swap-provider' export const SwitchSwapDirection = () => { const { swapTokens } = useSwapDispatch() diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/explore/hero.tsx b/apps/web/src/app/(non-evm)/tron/explore/hero.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(tron)/explore/hero.tsx rename to apps/web/src/app/(non-evm)/tron/explore/hero.tsx diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/explore/layout.tsx b/apps/web/src/app/(non-evm)/tron/explore/layout.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(tron)/explore/layout.tsx rename to apps/web/src/app/(non-evm)/tron/explore/layout.tsx diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/page.tsx b/apps/web/src/app/(non-evm)/tron/explore/pools/page.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(tron)/explore/pools/page.tsx rename to apps/web/src/app/(non-evm)/tron/explore/pools/page.tsx diff --git a/apps/web/src/app/(non-evm)/tron/layout.tsx b/apps/web/src/app/(non-evm)/tron/layout.tsx index a178a392f6..f74188769c 100644 --- a/apps/web/src/app/(non-evm)/tron/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/layout.tsx @@ -1,5 +1,6 @@ import { Metadata } from 'next' import React from 'react' +import { Header } from './header' import { Providers } from './providers' export const metadata: Metadata = { @@ -16,7 +17,10 @@ export default function RootLayout({ }: { children: React.ReactNode }) { return ( -
    {children}
    +
    +
    + {children} +
    ) } diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/layout.tsx b/apps/web/src/app/(non-evm)/tron/pool/[address]/layout.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/layout.tsx rename to apps/web/src/app/(non-evm)/tron/pool/[address]/layout.tsx diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/page.tsx b/apps/web/src/app/(non-evm)/tron/pool/[address]/page.tsx similarity index 96% rename from apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/page.tsx rename to apps/web/src/app/(non-evm)/tron/pool/[address]/page.tsx index ac5eaefa62..8581713eb9 100644 --- a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/page.tsx +++ b/apps/web/src/app/(non-evm)/tron/pool/[address]/page.tsx @@ -8,7 +8,7 @@ import { Manage } from '~tron/_common/ui/Pools/Manage/Manage' import { PoolLiquidity } from '~tron/_common/ui/Pools/PoolDetails/PoolLiquidity' import { PoolPosition } from '~tron/_common/ui/Pools/PoolPosition/PoolPosition' import { PoolRewards } from '~tron/_common/ui/Pools/PoolRewards/PoolRewards' -import { usePoolDispatch } from '../../../../_common/ui/Pools/pool-provider' +import { usePoolDispatch } from '~tron/_common/ui/Pools/pool-provider' export default function PoolByIdPage({ params, diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/providers.tsx b/apps/web/src/app/(non-evm)/tron/pool/[address]/providers.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/[address]/providers.tsx rename to apps/web/src/app/(non-evm)/tron/pool/[address]/providers.tsx diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/add/layout.tsx b/apps/web/src/app/(non-evm)/tron/pool/add/layout.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/add/layout.tsx rename to apps/web/src/app/(non-evm)/tron/pool/add/layout.tsx diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/add/page.tsx b/apps/web/src/app/(non-evm)/tron/pool/add/page.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(tron)/pool/(pool)/add/page.tsx rename to apps/web/src/app/(non-evm)/tron/pool/add/page.tsx diff --git a/apps/web/src/app/(non-evm)/tron/(tron)/not-found.tsx b/apps/web/src/app/(non-evm)/tron/pool/not-found.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(tron)/not-found.tsx rename to apps/web/src/app/(non-evm)/tron/pool/not-found.tsx diff --git a/apps/web/src/app/(non-evm)/tron/swap/layout.tsx b/apps/web/src/app/(non-evm)/tron/swap/layout.tsx new file mode 100644 index 0000000000..aed2f3d639 --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/swap/layout.tsx @@ -0,0 +1,11 @@ +import { Providers } from './providers' + +export default function SwapLayout({ + children, +}: { children: React.ReactNode }) { + return ( + +
    {children}
    +
    + ) +} diff --git a/apps/web/src/app/(non-evm)/tron/(trade)/swap/page.tsx b/apps/web/src/app/(non-evm)/tron/swap/page.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(trade)/swap/page.tsx rename to apps/web/src/app/(non-evm)/tron/swap/page.tsx diff --git a/apps/web/src/app/(non-evm)/tron/(trade)/swap/providers.tsx b/apps/web/src/app/(non-evm)/tron/swap/providers.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(trade)/swap/providers.tsx rename to apps/web/src/app/(non-evm)/tron/swap/providers.tsx diff --git a/apps/web/src/app/(non-evm)/tron/(trade)/swap/swap-provider.tsx b/apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx similarity index 100% rename from apps/web/src/app/(non-evm)/tron/(trade)/swap/swap-provider.tsx rename to apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx From 85f6c5a43797e78a2fec044ddc3357282b3925b7 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sat, 14 Sep 2024 12:16:49 +0800 Subject: [PATCH 30/46] chore: prep tron explore page for data-api --- .../tron/_common/lib/hooks/useTopPools.ts | 21 ++++ .../ui/Pools/PoolsTable/PoolNameCell.tsx | 5 +- .../ui/Pools/PoolsTable/_PoolColumns.tsx | 91 +++++++++++++++ .../ui/Pools/PoolsTable/_PoolNameCell.tsx | 93 +++++++++++++++ .../ui/Pools/PoolsTable/_PoolsTable.tsx | 109 ++++++++++++++++++ 5 files changed, 316 insertions(+), 3 deletions(-) create mode 100644 apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTopPools.ts create mode 100644 apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolColumns.tsx create mode 100644 apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolNameCell.tsx create mode 100644 apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolsTable.tsx diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTopPools.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTopPools.ts new file mode 100644 index 0000000000..11de74efab --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTopPools.ts @@ -0,0 +1,21 @@ +import { + TopNonEvmPools, + getTopNonEvmPools, +} from '@sushiswap/graph-client/data-api' +import { useQuery } from '@tanstack/react-query' + +interface UseTopPools { + enabled?: boolean +} + +export type TopPool = TopNonEvmPools[number] + +export function useTopPools( + { enabled = true }: UseTopPools = { enabled: true }, +) { + return useQuery({ + queryKey: ['pools', { chainId: 'tron' }], + queryFn: async () => await getTopNonEvmPools({ chainId: 'tron' }), + enabled: Boolean(enabled), + }) +} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolNameCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolNameCell.tsx index 89acb0bf54..441da8072c 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolNameCell.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolNameCell.tsx @@ -1,17 +1,16 @@ import { Currency, SkeletonText, classNames } from '@sushiswap/ui' import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' -import { getBase58Address } from '~tron/_common/lib/utils/helpers' import { Icon } from '../../General/Icon' import { IRowData } from './PoolsTable' export const PoolNameCell = ({ data }: { data: IRowData }) => { const { token0Address, token1Address } = data const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ - tokenAddress: getBase58Address(token0Address), + tokenAddress: token0Address, }) const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ - tokenAddress: getBase58Address(token1Address), + tokenAddress: token1Address, }) return ( diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolColumns.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolColumns.tsx new file mode 100644 index 0000000000..01cc3941de --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolColumns.tsx @@ -0,0 +1,91 @@ +import { SkeletonCircle, SkeletonText } from '@sushiswap/ui' +import { ColumnDef } from '@tanstack/react-table' +import { formatPercent, formatUSD } from 'sushi/format' +import { TopPool } from '~tron/_common/lib/hooks/useTopPools' +import { PoolNameCell } from './_PoolNameCell' + +export const NAME_COLUMN: ColumnDef = { + id: 'name', + header: 'Name', + cell: (props) => , + meta: { + skeleton: ( +
    +
    + + +
    +
    + +
    +
    + ), + }, +} + +export const TVL_COLUMN: ColumnDef = { + id: 'liquidityUSD', + header: 'TVL', + accessorFn: (row) => row.liquidityUSD, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.liquidityUSD - rowB.liquidityUSD, + cell: (props) => + formatUSD(props.row.original.liquidityUSD).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.liquidityUSD), + meta: { + skeleton: , + }, +} + +export const VOLUME_1D_COLUMN: ColumnDef = { + id: 'volumeUSD1d', + header: 'Volume (24h)', + accessorFn: (row) => row.volumeUSD1d, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.volumeUSD1d - rowB.volumeUSD1d, + cell: (props) => + formatUSD(props.row.original.volumeUSD1d).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.volumeUSD1d), + meta: { + skeleton: , + }, +} + +export const FEES_1D_COLUMN: ColumnDef = { + id: 'feeUSD1d', + header: 'Fees (24h)', + accessorFn: (row) => row.feeUSD1d, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.feeUSD1d - rowB.feeUSD1d, + cell: (props) => + formatUSD(props.row.original.feeUSD1d).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.feeUSD1d), + meta: { + skeleton: , + }, +} + +export const TRANSACTIONS_1D_COLUMN: ColumnDef = { + id: 'txCount1d', + header: 'Transactions (24h)', + accessorFn: (row) => row.txCount1d, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.txCount1d - rowB.txCount1d, + cell: (props) => props.row.original.txCount1d, + meta: { + skeleton: , + }, +} + +export const APR_COLUMN: ColumnDef = { + id: 'totalApr1d', + header: 'APR', + accessorFn: (row) => row.totalApr1d, + cell: (props) => formatPercent(props.row.original.totalApr1d), + meta: { + skeleton: , + }, +} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolNameCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolNameCell.tsx new file mode 100644 index 0000000000..a38406cfa0 --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolNameCell.tsx @@ -0,0 +1,93 @@ +import { Badge, Currency, TooltipContent } from '@sushiswap/ui' +import { Tooltip, TooltipProvider, TooltipTrigger } from '@sushiswap/ui' +import React from 'react' +import { ProtocolBadge } from 'src/ui/pool/PoolNameCell' +import { SushiSwapProtocol, formatNumber } from 'sushi' +import { WTRX } from '~tron/_common/constants/token-list' +import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' +import { TopPool } from '~tron/_common/lib/hooks/useTopPools' +import { Icon } from '../../General/Icon' + +export const PoolNameCell = ({ data }: { data: TopPool }) => { + const { data: token0 } = useTokenInfo({ + tokenAddress: data.token0Address, + }) + + const { data: token1 } = useTokenInfo({ + tokenAddress: data.token1Address, + }) + + return ( +
    +
    + } + > + + + + + +
    +
    + + {data.name} + +
    + + + + {ProtocolBadge[data.protocol as SushiSwapProtocol]} + + +

    Protocol version

    +
    +
    +
    + + + +
    + {formatNumber(data.swapFee * 100)}% +
    +
    + +

    Swap fee

    +
    +
    +
    + {data.isIncentivized && ( + + + +
    + 🧑‍🌾{' '} +
    +
    + +

    Farm rewards available

    +
    +
    +
    + )} + {data.isSmartPool && ( + + + +
    + 💡 +
    +
    + +

    Smart Pool available

    +
    +
    +
    + )} +
    +
    +
    + ) +} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolsTable.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolsTable.tsx new file mode 100644 index 0000000000..8fba46f67a --- /dev/null +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolsTable.tsx @@ -0,0 +1,109 @@ +'use client' + +import { + Card, + CardHeader, + CardTitle, + DataTable, + SkeletonText, +} from '@sushiswap/ui' +import { ColumnDef, SortingState, TableState } from '@tanstack/react-table' +import React, { useCallback, useMemo, useState } from 'react' +import { usePoolFilters } from 'src/ui/pool' +import { TopPool, useTopPools } from '~tron/_common/lib/hooks/useTopPools' +import { + APR_COLUMN, + FEES_1D_COLUMN, + NAME_COLUMN, + TRANSACTIONS_1D_COLUMN, + TVL_COLUMN, + VOLUME_1D_COLUMN, +} from './_PoolColumns' + +const COLUMNS = [ + NAME_COLUMN, + TVL_COLUMN, + VOLUME_1D_COLUMN, + FEES_1D_COLUMN, + TRANSACTIONS_1D_COLUMN, + APR_COLUMN, +] satisfies ColumnDef[] + +export const PoolsTable = () => { + const { tokenSymbols, farmsOnly } = usePoolFilters() + + const [sorting, setSorting] = useState([ + { id: 'liquidityUSD', desc: true }, + ]) + + const { data: pools, isLoading } = useTopPools() + + const rowLink = useCallback((row: TopPool) => { + return `/tron/pool/${row.token0Address}:${row.token1Address}:${row.address}` + }, []) + + const filtered = useMemo(() => { + if (!pools) return [] as TopPool[] + + return pools.filter((pool) => { + if (farmsOnly) { + if (!pool.isIncentivized) return false + } + + if (tokenSymbols.length) { + if ( + !tokenSymbols.every((symbol) => { + symbol = symbol.toLowerCase() + + if (pool.name.toLowerCase().includes(symbol)) return true + + return false + }) + ) { + return false + } + } + + return true + }) + }, [farmsOnly, tokenSymbols, pools]) + + const state: Partial = useMemo(() => { + return { + sorting, + pagination: { + pageIndex: 0, + pageSize: filtered?.length, + }, + } + }, [sorting, filtered]) + + return ( + + + + {isLoading ? ( +
    + +
    + ) : ( + + Pools{' '} + + ({filtered.length}) + + + )} +
    +
    + +
    + ) +} From d21770ffde050905b81b5a474f20c67e8b20825f Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sun, 15 Sep 2024 10:10:08 +0800 Subject: [PATCH 31/46] fix: various swap and pool issues on tron --- .../RemoveSection/RemoveSectionLegacy.tsx | 46 +++++----- .../RemoveSection/RemoveSectionWidget.tsx | 2 +- .../tron/_common/constants/token-list.tsx | 27 +++--- .../tron/_common/lib/hooks/useAmountsOut.ts | 2 +- ...{TokenListSelect.tsx => TokenSelector.tsx} | 85 +++++++------------ .../tron/_common/ui/Input/TokenInput.tsx | 64 ++++++-------- .../tron/_common/ui/Pools/Add/AddButton.tsx | 11 +-- .../_common/ui/Pools/Add/AmountInToken0.tsx | 10 ++- .../_common/ui/Pools/Add/AmountIntToken1.tsx | 10 ++- .../tron/_common/ui/Pools/Add/DepositForm.tsx | 2 +- .../_common/ui/Pools/Add/ReviewAddDialog.tsx | 23 ++--- .../ui/Pools/Add/ReviewAddDialogTrigger.tsx | 8 +- .../_common/ui/Pools/Add/SelectTokensForm.tsx | 33 ++++++- .../_common/ui/Pools/Manage/AddSection.tsx | 8 +- .../_common/ui/Pools/Remove/RemoveButton.tsx | 18 ++-- .../ui/Pools/Remove/RemoveLiquidity.tsx | 2 +- .../tron/_common/ui/Shared/ApproveToken.tsx | 6 +- .../tron/_common/ui/Swap/AmountIn.tsx | 2 +- .../tron/_common/ui/Swap/AmountOut.tsx | 2 +- .../tron/_common/ui/Swap/ReviewSwapDialog.tsx | 12 +-- .../ui/Swap/ReviewSwapDialogTrigger.tsx | 4 +- .../_common/ui/Swap/SwitchSwapDirection.tsx | 2 +- .../ui/WalletConnector/WalletConnector.tsx | 23 +---- apps/web/src/app/(non-evm)/tron/header.tsx | 2 +- apps/web/src/app/(non-evm)/tron/swap/page.tsx | 13 ++- .../src/app/(non-evm)/tron/swap/providers.tsx | 1 - 26 files changed, 192 insertions(+), 226 deletions(-) rename apps/web/src/app/(non-evm)/tron/_common/ui/General/{TokenListSelect.tsx => TokenSelector.tsx} (74%) diff --git a/apps/web/src/app/(non-evm)/aptos/(common)/components/RemoveSection/RemoveSectionLegacy.tsx b/apps/web/src/app/(non-evm)/aptos/(common)/components/RemoveSection/RemoveSectionLegacy.tsx index 96f24276cd..47f9918d05 100644 --- a/apps/web/src/app/(non-evm)/aptos/(common)/components/RemoveSection/RemoveSectionLegacy.tsx +++ b/apps/web/src/app/(non-evm)/aptos/(common)/components/RemoveSection/RemoveSectionLegacy.tsx @@ -3,7 +3,7 @@ import { SlippageToleranceStorageKey, useSlippageTolerance, } from '@sushiswap/hooks' -import { classNames } from '@sushiswap/ui' +import { Button } from '@sushiswap/ui' import { Dots } from '@sushiswap/ui' import { Provider } from 'aptos' import React, { useMemo, useState } from 'react' @@ -12,8 +12,8 @@ import { networkNameToNetwork } from '~aptos/(common)/config/chains' import { formatNumberWithDecimals } from '~aptos/(common)/lib/common/format-number-with-decimals' import { useNetwork } from '~aptos/(common)/lib/common/use-network' import { Token } from '~aptos/(common)/lib/types/token' +import { Checker } from '~aptos/(common)/ui/checker' import { createToast } from '~aptos/(common)/ui/toast' -import { UserProfile } from '~aptos/(common)/ui/user-profile/user-profile' import { Pool } from '~aptos/pool/lib/convert-pool-to-sushi-pool' import { RemoveSectionWidget } from './RemoveSectionWidget' @@ -60,7 +60,7 @@ export const RemoveSectionLegacy = ({ const [percentage, setPercentage] = useState('0') const [isTransactionPending, setisTransactionPending] = useState(false) - const { account, signAndSubmitTransaction, connected } = useWallet() + const { account, signAndSubmitTransaction } = useWallet() const currencyAToRemove = useMemo(() => { return token0 @@ -160,30 +160,22 @@ export const RemoveSectionLegacy = ({ token1.decimals, )} > - <> - {connected ? ( - - ) : ( - - )} - + + + ) } diff --git a/apps/web/src/app/(non-evm)/aptos/(common)/components/RemoveSection/RemoveSectionWidget.tsx b/apps/web/src/app/(non-evm)/aptos/(common)/components/RemoveSection/RemoveSectionWidget.tsx index 32c9347e39..7e5b08dc36 100644 --- a/apps/web/src/app/(non-evm)/aptos/(common)/components/RemoveSection/RemoveSectionWidget.tsx +++ b/apps/web/src/app/(non-evm)/aptos/(common)/components/RemoveSection/RemoveSectionWidget.tsx @@ -169,8 +169,8 @@ export const RemoveSectionWidget: FC = ({
    - {children}
    + {children} ) } diff --git a/apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx b/apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx index 1d5b238097..19752e8fbc 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx @@ -92,21 +92,18 @@ const TESTNET_TOKENS: IToken[] = [ export const DEFAULT_TOKEN_LIST = IS_TESTNET ? TESTNET_TOKENS : MAINNET_TOKENS -export const DEFAULT_TOKEN_LIST_WITH_KEY = () => { - return DEFAULT_TOKEN_LIST.reduce>( - (acc, { address, decimals, name, symbol, logoURI }) => { - acc[address] = { - name, - decimals, - symbol, - address, - logoURI, - } - return acc - }, - {}, - ) -} +export const DEFAULT_TOKEN_LIST_WITH_KEY = DEFAULT_TOKEN_LIST.reduce< + Record +>((acc, { address, decimals, name, symbol, logoURI }) => { + acc[address] = { + name, + decimals, + symbol, + address, + logoURI, + } + return acc +}, {}) export const STABLE_TOKENS = DEFAULT_TOKEN_LIST.filter( (token) => diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts index b4eb96e368..96c31c3e9d 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useAmountsOut.ts @@ -39,7 +39,7 @@ export const useAmountsOut = ({ amountIn }: { amountIn: string }) => { ) as string[] } catch (error) { console.log('useAmountsOut error', error) - return [amountIn, ''] + return [amountIn, '0'] } }, enabled: !!amountIn && !!tronWeb, diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx similarity index 74% rename from apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx rename to apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx index 69de1e57db..83f5639b38 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenListSelect.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx @@ -4,16 +4,14 @@ import { Badge, Button, Dialog, - DialogClose, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, List, - SelectIcon, } from '@sushiswap/ui' -import { useMemo, useRef, useState } from 'react' +import { ReactNode, useCallback, useMemo, useState } from 'react' import { DEFAULT_TOKEN_LIST, DEFAULT_TOKEN_LIST_WITH_KEY, @@ -25,54 +23,39 @@ import { IToken } from '~tron/_common/types/token-type' import { Search } from '../Input/Search' import { Icon } from './Icon' -export const TokenListSelect = ({ - token, - setToken, - className, +export const TokenSelector = ({ + selected, + onSelect, + children, }: { - token: IToken | undefined - setToken: (token: IToken) => void - className?: string + selected: IToken | undefined + onSelect: (token: IToken) => void + children: ReactNode }) => { - const [query, setQuery] = useState('') + const [open, setOpen] = useState(false) + const [query, setQuery] = useState('') const debouncedQuery = useDebounce(query, 500) - const closeBtnRef = useRef(null) - const { data: newToken } = useTokenInfo({ tokenAddress: debouncedQuery }) const { customTokens, addOrRemoveToken, hasToken } = useCustomTokens() + const { data: queryToken } = useTokenInfo({ tokenAddress: debouncedQuery }) + const { data: sortedTokenList } = useSortedTokenList({ query: debouncedQuery, - tokenMap: DEFAULT_TOKEN_LIST_WITH_KEY(), + tokenMap: DEFAULT_TOKEN_LIST_WITH_KEY, customTokenMap: customTokens, }) - const closeModal = () => { - closeBtnRef?.current?.click() - setQuery('') - } - - const selectToken = (token: IToken) => { - setToken(token) - closeModal() - } + const _onSelect = useCallback( + (token: IToken) => { + onSelect(token) + setOpen(false) + }, + [onSelect], + ) return ( - - - - + + {children} - Select a token @@ -93,17 +76,15 @@ export const TokenListSelect = ({
    - {newToken ? ( - [newToken].map((_token) => ( - - )) + {queryToken ? ( + ) : sortedTokenList?.length === 0 ? (

    No tokens found @@ -112,11 +93,11 @@ export const TokenListSelect = ({ sortedTokenList?.map((_token) => ( )) )} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx index 16b4913f40..6959c2dc6f 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Input/TokenInput.tsx @@ -12,6 +12,7 @@ import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' import { formatUnitsForInput } from '~tron/_common/lib/utils/formatters' import { IToken } from '~tron/_common/types/token-type' import { Icon } from '../General/Icon' +import { TokenSelector } from '../General/TokenSelector' import { DollarAmountDisplay } from '../Shared/DollarAmountDisplay' import { TokenBalanceDisplay } from '../Shared/TokenBalanceDisplay' @@ -70,29 +71,31 @@ export const TokenInput = ({ if (!setToken) return null return ( - + + + ) }, [currency, currencyLoading, id, setToken]) @@ -160,20 +163,7 @@ export const TokenInput = ({ {!hideIcon && ( <>

    - +
    )} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx index 09c60a1b11..8d6e49e9bf 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AddButton.tsx @@ -7,7 +7,7 @@ import { createInfoToast, createSuccessToast, } from '@sushiswap/notifications' -import { Button } from '@sushiswap/ui' +import { Button, ButtonProps } from '@sushiswap/ui' import { useQueryClient } from '@tanstack/react-query' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useMemo } from 'react' @@ -25,7 +25,10 @@ import { import { getTronscanTxnLink } from '~tron/_common/lib/utils/tronscan-helpers' import { usePoolDispatch, usePoolState } from '../pool-provider' -export const AddButton = ({ closeModal }: { closeModal: () => void }) => { +export const AddButton = ({ + closeModal, + buttonProps, +}: { closeModal: () => void; buttonProps?: ButtonProps }) => { const queryClient = useQueryClient() const { @@ -180,10 +183,8 @@ export const AddButton = ({ closeModal }: { closeModal: () => void }) => { diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx index da929838d9..e6211088ec 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountInToken0.tsx @@ -8,8 +8,12 @@ import { TokenInput } from '~tron/_common/ui/Input/TokenInput' import { usePoolDispatch, usePoolState } from '../pool-provider' export const AmountInToken0 = ({ - theme, -}: { theme?: ComponentProps['theme'] }) => { + theme = 'default', + disabled = false, +}: { + theme?: ComponentProps['theme'] + disabled?: boolean +}) => { const { token0, token1, @@ -74,7 +78,7 @@ export const AmountInToken0 = ({ amount={amountInToken0} setAmount={setAmount} currency={token0} - setToken={setToken0} + setToken={disabled ? undefined : setToken0} /> ) } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx index c1dac3b0e1..c1877f4db7 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/AmountIntToken1.tsx @@ -8,8 +8,12 @@ import { TokenInput } from '~tron/_common/ui/Input/TokenInput' import { usePoolDispatch, usePoolState } from '../pool-provider' export const AmountInToken1 = ({ - theme, -}: { theme?: ComponentProps['theme'] }) => { + theme = 'default', + disabled = false, +}: { + theme?: ComponentProps['theme'] + disabled?: boolean +}) => { const { token0, token1, @@ -74,7 +78,7 @@ export const AmountInToken1 = ({ amount={amountInToken1} setAmount={setAmount} currency={token1} - setToken={setToken1} + setToken={disabled ? undefined : setToken1} /> ) } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/DepositForm.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/DepositForm.tsx index dd1f0bc6af..74cde16baa 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/DepositForm.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/DepositForm.tsx @@ -17,7 +17,7 @@ export const DepositForm = () => {
    - +
    ) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx index 55e54ab18a..1cfd079425 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialog.tsx @@ -1,4 +1,4 @@ -import { List, SkeletonBox } from '@sushiswap/ui' +import { ButtonProps, List, SkeletonBox } from '@sushiswap/ui' import { Dialog, DialogClose, @@ -16,10 +16,9 @@ import { Icon } from '../../General/Icon' import { WalletConnector } from '../../WalletConnector/WalletConnector' import { usePoolState } from '../pool-provider' import { AddButton } from './AddButton' -import { Rate } from './Rate' import { ReviewAddDialogTrigger } from './ReviewAddDialogTrigger' -export const ReviewAddDialog = () => { +export const ReviewAddDialog = (props: ButtonProps) => { const { token0, token1, amountInToken0, amountInToken1 } = usePoolState() const closeBtnRef = useRef(null) const { address, connected } = useWallet() @@ -38,14 +37,9 @@ export const ReviewAddDialog = () => { return ( {isConnected ? ( - + ) : ( - + )} @@ -97,16 +91,9 @@ export const ReviewAddDialog = () => { )}
    - - - - +
    diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx index 75ed260efe..0ca185198e 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/ReviewAddDialogTrigger.tsx @@ -1,4 +1,4 @@ -import { Button, DialogTrigger } from '@sushiswap/ui' +import { Button, ButtonProps, DialogTrigger } from '@sushiswap/ui' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useMemo } from 'react' import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' @@ -8,7 +8,7 @@ import { formatUnitsForInput } from '~tron/_common/lib/utils/formatters' import { ApproveToken } from '~tron/_common/ui/Shared/ApproveToken' import { usePoolState } from '../pool-provider' -export const ReviewAddDialogTrigger = () => { +export const ReviewAddDialogTrigger = (props: ButtonProps) => { const { token0, token1, isTxnPending, amountInToken0, amountInToken1 } = usePoolState() const { address } = useWallet() @@ -131,6 +131,7 @@ export const ReviewAddDialogTrigger = () => { onSuccess={async () => { await refetchToken0Allowance() }} + buttonProps={props} /> ) } @@ -144,6 +145,7 @@ export const ReviewAddDialogTrigger = () => { onSuccess={async () => { await refetchToken1Allowance() }} + buttonProps={props} /> ) } @@ -158,7 +160,7 @@ export const ReviewAddDialogTrigger = () => { } asChild > - diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx index 0eabbff2cd..5f67cdf8ae 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Add/SelectTokensForm.tsx @@ -1,9 +1,10 @@ 'use client' -import { FormSection } from '@sushiswap/ui' +import { Button, FormSection, SelectIcon } from '@sushiswap/ui' import { useEffect } from 'react' import { useIsContract } from '~tron/_common/lib/hooks/useIsContract' import { usePairContract } from '~tron/_common/lib/hooks/usePairContract' -import { TokenListSelect } from '~tron/_common/ui/General/TokenListSelect' +import { Icon } from '../../General/Icon' +import { TokenSelector } from '../../General/TokenSelector' import { usePoolDispatch, usePoolState } from '../pool-provider' export const SelectTokensForm = () => { @@ -29,8 +30,32 @@ export const SelectTokensForm = () => { description="Which token pair would you like to add liquidity to." >
    - - + + + + + +
    ) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/AddSection.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/AddSection.tsx index c2f2949923..3edf268d6e 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/AddSection.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Manage/AddSection.tsx @@ -42,12 +42,12 @@ export const AddSection = () => {
    - + - +
    -
    - +
    +
    ) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx index 94a292bdd4..02a6186c1d 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveButton.tsx @@ -3,7 +3,7 @@ import { createInfoToast, createSuccessToast, } from '@sushiswap/notifications' -import { Button } from '@sushiswap/ui' +import { Button, ButtonProps } from '@sushiswap/ui' import { useQueryClient } from '@tanstack/react-query' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import { useMemo } from 'react' @@ -27,7 +27,7 @@ import { WalletConnector } from '~tron/_common/ui/WalletConnector/WalletConnecto import { usePoolState } from '../pool-provider' import { useRemoveLiqDispatch, useRemoveLiqState } from './pool-remove-provider' -export const RemoveButton = () => { +export const RemoveButton = (props: ButtonProps) => { const queryClient = useQueryClient() const { address, connected, signTransaction } = useWallet() const isConnected = address && connected @@ -190,14 +190,7 @@ export const RemoveButton = () => { ]) if (!isConnected) { - return ( - - ) + return } if (buttonText === 'Approve') { @@ -214,6 +207,7 @@ export const RemoveButton = () => { onSuccess={async () => { await refetch() }} + buttonProps={props} /> ) } @@ -221,10 +215,8 @@ export const RemoveButton = () => { return ( diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveLiquidity.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveLiquidity.tsx index 238a589224..1db1cb9f3e 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveLiquidity.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/Remove/RemoveLiquidity.tsx @@ -8,7 +8,7 @@ export const RemoveLiquidity = () => {
    - +
    ) } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Shared/ApproveToken.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Shared/ApproveToken.tsx index 83f8994f19..098c08d72a 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Shared/ApproveToken.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Shared/ApproveToken.tsx @@ -5,6 +5,7 @@ import { } from '@sushiswap/notifications' import { Button, + ButtonProps, Command, CommandGroup, CommandItem, @@ -29,11 +30,13 @@ export const ApproveToken = ({ amount, spenderAddress, onSuccess, + buttonProps, }: { tokenToApprove: IToken amount: string spenderAddress: string onSuccess: () => Promise + buttonProps?: ButtonProps }) => { const [isApproving, setIsApproving] = useState(false) const { address, signTransaction } = useWallet() @@ -119,8 +122,7 @@ export const ApproveToken = ({ disabled={isApproving} loading={isApproving} role="combobox" - size="lg" - className="w-full" + {...buttonProps} > {isApproving ? 'Approving' : 'Approve'} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx index c249459fb4..2cf36c66d6 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx @@ -42,7 +42,7 @@ export const AmountIn = () => { return ( { return ( { return ( - {isConnected ? ( - - ) : ( -
    +
    + {isConnected ? ( + + ) : ( -
    - )} + )} +
    diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx index 12bef50766..bd1f0bffb6 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx @@ -174,7 +174,9 @@ export const ReviewSwapDialogTrigger = () => { } asChild > - + )} {userConfirmationNeeded && !isChecked ? ( diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx index 1b41830021..71eccf8ef6 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/SwitchSwapDirection.tsx @@ -1,4 +1,4 @@ -import { ArrowsUpDownIcon } from '@heroicons/react/24/outline' +import ArrowsUpDownIcon from '@heroicons/react/24/solid/ArrowsUpDownIcon' import React from 'react' import { useSwapDispatch } from '~tron/swap/swap-provider' diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/WalletConnector.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/WalletConnector.tsx index 38713f9e5f..48bcaffa66 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/WalletConnector.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/WalletConnector/WalletConnector.tsx @@ -1,5 +1,6 @@ import { Button, + ButtonProps, Chip, Popover, PopoverContent, @@ -16,18 +17,7 @@ import { WalletListView } from './WalletListView' export type IProfileView = 'default' | 'settings' -type WalletConnectorProps = { - hideChevron?: boolean - fullWidth?: boolean - size?: Parameters[0]['size'] - variant?: 'secondary' | 'default' -} - -export const WalletConnector = ({ - fullWidth, - size = 'default', - variant = 'secondary', -}: WalletConnectorProps) => { +export const WalletConnector = (props: ButtonProps) => { const [view, setView] = useState('default') const { connected, connecting, address } = useWallet() const isConnected = address && connected @@ -35,14 +25,7 @@ export const WalletConnector = ({ return ( - @@ -28,7 +28,7 @@ export const Hero: FC = () => { variant="secondary" size="sm" > - + I want to incentivize a pool From fbd5288318e0e50c1d9e9311f610ed5111fe00b3 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Mon, 16 Sep 2024 19:09:50 +0800 Subject: [PATCH 34/46] chore: update tron token list --- .../tron/_common/constants/token-list.tsx | 431 +++++++++++++++++- 1 file changed, 419 insertions(+), 12 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx b/apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx index 19752e8fbc..859679864a 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx @@ -31,35 +31,442 @@ const MAINNET_TOKENS: IToken[] = [ symbol: 'TRX', }, { - address: 'TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR', + symbol: 'SUN', + address: 'TSSMHYeV2uE9qYH95DqyoCuNCzEL1NvU3S', + decimals: 18, + name: 'SUN', + logoURI: + 'https://static.tronscan.org/production/logo/TSSMHYeV2uE9qYH95DqyoCuNCzEL1NvU3S.png', + }, + { + symbol: 'BTT', + address: 'TAFjULxiVgT4qWk6UZwjqwZXTSaGaqnVp4', + decimals: 18, + name: 'BitTorrent', + logoURI: 'https://static.tronscan.org/production/logo/1002000.png', + }, + { + symbol: 'SUNOLD', + address: 'TKkeiboTkxXKJpbmVFbv4a8ov5rAfRDMf9', + decimals: 18, + name: 'SUNOLD', + logoURI: 'https://static.tronscan.org/production/logo/SUNLogo.178d4636.png', + }, + { + symbol: 'NFT', + address: 'TFczxzPhnThNSqr5by8tvxsdCFRRz6cPNq', decimals: 6, + name: 'APENFT', logoURI: - 'https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png?t=1598430824415', - name: 'Wrapped TRX', - symbol: 'WTRX', + 'https://static.tronscan.org/production/upload/logo/TFczxzPhnThNSqr5by8tvxsdCFRRz6cPNq.png', }, { - address: 'TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4', + symbol: 'BTC', + address: 'TN3W4H6rK2ce4vX9YnFQHwKENnHjoxb3m9', + decimals: 8, + name: 'Bitcoin', + logoURI: + 'https://static.tronscan.org/production/logo/TN3W4H6rK2ce4vX9YnFQHwKENnHjoxb3m9.png', + }, + { + symbol: 'WBTC', + address: 'TXpw8XeWYeTUd4quDskoUqeQPowRh4jY65', + decimals: 8, + name: 'Wrapped BTC', + logoURI: + 'https://static.tronscan.org/production/logo/TXpw8XeWYeTUd4quDskoUqeQPowRh4jY65.png', + }, + { + symbol: 'ETHOLD', + address: 'THb4CqiFdwNHsWsQCs4JhzwjMWys4aqCbF', decimals: 18, + name: 'EthereumOLD', logoURI: - 'https://static.tronscan.org/production/logo/TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4.png', - name: 'TrueUSD', - symbol: 'TUSD', + 'https://static.tronscan.org/production/logo/THb4CqiFdwNHsWsQCs4JhzwjMWys4aqCbF.png', + }, + { + symbol: 'WETH', + address: 'TXWkP3jLBqRGojUih1ShzNyDaN5Csnebok', + decimals: 18, + name: 'Wrapped ETH', + logoURI: + 'https://static.tronscan.org/production/logo/TXWkP3jLBqRGojUih1ShzNyDaN5Csnebok.png', }, { + symbol: 'WBTT', + address: 'TKfjV9RNKJJCqPvBtK8L7Knykh7DNWvnYt', + decimals: 6, + name: 'Wrapped BitTorrent', + logoURI: + 'https://static.tronscan.org/production/logo/TKfjV9RNKJJCqPvBtK8L7Knykh7DNWvnYt.png', + }, + { + symbol: 'WTRX', + address: 'TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR', + decimals: 6, + name: 'Wrapped TRX', + logoURI: + 'https://static.tronscan.org/production/upload/logo/TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR.png', + }, + { + symbol: 'JST', + address: 'TCFLL5dx5ZJdKnWuesXxi1VPwjLVmWZZy9', + decimals: 18, + name: 'JUST GOV v1.0', + logoURI: 'https://static.tronscan.org/production/logo/just_icon.png', + }, + { + symbol: 'WIN', + address: 'TLa2f6VPqDgRE67v1736s7bJ8Ray5wYjU7', + decimals: 6, + name: 'WINK', + logoURI: 'https://static.tronscan.org/profile_images/JKtJTydD_400x400.jpg', + }, + { + symbol: 'USDT', address: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t', decimals: 6, - logoURI: 'https://static.tronscan.org/production/logo/usdtlogo.png', name: 'Tether USD', - symbol: 'USDT', + logoURI: 'https://static.tronscan.org/production/logo/usdtlogo.png', + }, + { + symbol: 'USDJ', + address: 'TMwFHYXLJaRUPeW6421aqXL4ZEzPRFGkGT', + decimals: 18, + name: 'JUST Stablecoin v1.0', + logoURI: 'https://static.tronscan.org/production/logo/usdj.png', + }, + { + symbol: 'TUSD', + address: 'TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4', + decimals: 18, + name: 'TrueUSD', + logoURI: + 'https://static.tronscan.org/production/logo/TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4.png', + }, + { + symbol: 'LTC', + address: 'TR3DLthpnDdCGabhVDbD3VMsiJoCXY3bZd', + decimals: 8, + name: 'Litecoin', + logoURI: + 'https://static.tronscan.org/production/logo/TR3DLthpnDdCGabhVDbD3VMsiJoCXY3bZd.png', }, { + symbol: 'HT', + address: 'TDyvndWuvX5xTBwHPYJi7J3Yq8pq8yh62h', + decimals: 18, + name: 'HuobiToken', + logoURI: + 'https://static.tronscan.org/production/logo/TDyvndWuvX5xTBwHPYJi7J3Yq8pq8yh62h.png', + }, + { + symbol: 'USDD', address: 'TPYmHEhy5n8TCEfYGqW2rPxsghSfzghPDn', decimals: 18, + name: 'Decentralized USD', logoURI: 'https://static.tronscan.org/production/upload/logo/TPYmHEhy5n8TCEfYGqW2rPxsghSfzghPDn.png', - name: 'Decentralized USD', - symbol: 'USDD', + }, + { + symbol: 'sTRX', + address: 'TU3kjFuhtEo42tsCBtfYUAZxoqQ4yuSLQ5', + decimals: 18, + name: 'staked TRX', + logoURI: + 'https://static.tronscan.org/production/upload/logo/new/TU3kjFuhtEo42tsCBtfYUAZxoqQ4yuSLQ5.png', + }, + { + symbol: 'ETH', + address: 'TRFe3hT5oYhjSZ6f3ji5FJ7YCfrkWnHRvh', + decimals: 18, + name: 'Ethereum', + logoURI: + 'https://static.tronscan.org/production/logo/TRFe3hT5oYhjSZ6f3ji5FJ7YCfrkWnHRvh.png', + }, + { + symbol: 'stUSDT', + address: 'TThzxNRLrW2Brp9DcTQU8i4Wd9udCWEdZ3', + decimals: 18, + name: 'Staked USDT', + logoURI: + 'https://static.tronscan.org/production/upload/logo/new/stUSDT_logo.png', + }, + { + symbol: 'HTX', + address: 'TUPM7K8REVzD2UdV4R5fe5M8XbnR2DdoJ6', + decimals: 18, + name: 'HTX', + logoURI: 'https://static.tronscan.org/production/upload/logo/new/HTX.png', + }, + { + symbol: 'SUNDOG', + address: 'TXL6rJbvmjD46zeN1JssfgxvSo99qC8MRT', + decimals: 18, + name: 'Sundog', + logoURI: + 'https://cdn.sunpump.meme/public/logo/SUNDOG_TXr7if_EzxfYukzq9ZU.png', + }, + { + symbol: 'FOFAR', + address: 'TUFonyWZ4Tza5MzgDj6g2u5rfdGoRVYG7g', + decimals: 18, + name: 'FOFAR', + logoURI: + 'https://cdn.sunpump.meme/public/logo/FOFAR_THQg9C_IavjUsY3Wun7.jpg', + }, + { + symbol: 'IVfun', + address: 'TSig7sWzEL2K83mkJMQtbyPpiVSbR6pZnb', + decimals: 18, + name: 'Invest Zone', + logoURI: + 'https://cdn.sunpump.meme/public/logo/IVfun_TYE2hX_1rR7Q8GfwFKa.jpg', + }, + { + symbol: 'MUNCAT', + address: 'TE2T2vLnEQT1XW647EAQAHWqd6NZL1hweR', + decimals: 18, + name: 'MUNCAT', + logoURI: + 'https://cdn.sunpump.meme/public/logo/MUNCAT_TJ44MB_FKFM8Y8eyhH2.jpeg', + }, + { + symbol: 'SUNWUKONG', + address: 'TP3prcvQknVthrVnn281cKST56eWiLgJJM', + decimals: 18, + name: 'SunWukong', + logoURI: + 'https://cdn.sunpump.meme/public/logo/SUNWUKONG_TCyGhb_xSV6IxtwuU33.png', + }, + { + symbol: 'CZ', + address: 'TSZu2myGg42ZEsT7RvvbVvhVS3kf9f1e57', + decimals: 18, + name: 'Changpeng Zhao', + logoURI: 'https://cdn.sunpump.meme/public/logo/CZ_TBDSE9_iEzd2xG48TpN.jpeg', + }, + { + symbol: 'SUNCAT', + address: 'TAwAg9wtQzTMFsijnSFotJrpxhMm3AqW1d', + decimals: 18, + name: 'SUNCAT', + logoURI: + 'https://cdn.sunpump.meme/public/logo/SUNCAT_TWj3Mp_ynpQjPlfRZu9.jpeg', + }, + { + symbol: 'Tcat', + address: 'TVgHqeP41s3qMDH3oKBsScEUzvyXw6bKAm', + decimals: 18, + name: 'Tron Cat', + logoURI: + 'https://cdn.sunpump.meme/public/logo/Tcat_TXv3PZ_f4HN7mpJqQ9V.png', + }, + { + symbol: 'DRGN', + address: 'TV5yB8f4AdoAfVVUdkytyZnX5e7SeGAZr2', + decimals: 18, + name: 'Dragon Sun', + logoURI: + 'https://cdn.sunpump.meme/public/logo/DRGN_TUcY9d_GmJcXp1VNNqz.jpg', + }, + { + symbol: 'BULL', + address: 'TAt4ufXFaHZAEV44ev7onThjTnF61SEaEM', + decimals: 18, + name: 'Tron Bull', + logoURI: + 'https://cdn.sunpump.meme/public/logo/BULL_TYvwPp_negdGNxhFCpp.png', + }, + { + symbol: 'SUNDOGE', + address: 'TAz6oGWhsmHPp7Ap6khmAYxjfHFYokqdQ4', + decimals: 18, + name: 'SUNDOGE', + logoURI: + 'https://cdn.sunpump.meme/public/logo/SUNDOGE_THL9Hf_XQ7Lq2GubqOE.PNG', + }, + { + symbol: 'ROCK', + address: 'TJvwMR3RjHc8jA9QwwjWGANrR3Y4scLSZm', + decimals: 18, + name: 'ROCK', + logoURI: + 'https://cdn.sunpump.meme/public/logo/ROCK_TK157u_SW8560kjmR1W.jpeg', + }, + { + symbol: 'TDOG', + address: 'TAPxMfHHgFyZMHuuz8wL56pi54eB2xkK2q', + decimals: 18, + name: 'Tron Dog', + logoURI: + 'https://cdn.sunpump.meme/public/logo/TDOG_TW2UbF_SHNKw5HVdKEF.PNG', + }, + { + symbol: 'PSYOP', + address: 'TBFr8v7HkKGydiHAjDL8NzqYf7cJqNsTVY', + decimals: 18, + name: 'PSYOPTRON', + logoURI: + 'https://cdn.sunpump.meme/public/logo/PSYOP_TEX3q5_JlNNNeGizAHQ.png', + }, + { + symbol: 'MWD', + address: 'TEfg1LnM3yApCjAgax35wDg6SRpmZFuQS3', + decimals: 18, + name: 'MEW-WOOF-DAO', + logoURI: + 'https://cdn.sunpump.meme/public/logo/MWD_TWcE6E_SsCtXAZ1KvWi.jpeg', + }, + { + symbol: 'TRONKEY', + address: 'TRHsKfoPJxFHnJ4wJ8Zc9nmSNAyaNYqff7', + decimals: 18, + name: 'TRONKEY', + logoURI: + 'https://cdn.sunpump.meme/public/logo/TRONKEY_TVFkWK_9m3fDI3ioDiW.jpeg', + }, + { + symbol: 'HOTSUN', + address: 'TCXTVfR7pFH8voLyqhbUGXdiYaBkTDmYCQ', + decimals: 18, + name: 'HOTSUN', + logoURI: + 'https://cdn.sunpump.meme/public/logo/HOTSUN_TUueYg_emDoYuKXklz4.jpeg', + }, + { + symbol: 'SUNKEY', + address: 'TJgB8bFWzMQfbqmCicf39XHby5uB5qoEQq', + decimals: 18, + name: 'SUNKEY', + logoURI: + 'https://cdn.sunpump.meme/public/logo/SUNKEY_TArygL_CL1PcUh6ZQr5.jpg', + }, + { + symbol: 'CZC', + address: 'TRJBN2ninnLKUUDR1f686goCYetPcPed8f', + decimals: 18, + name: 'Crypto Zillion Club', + logoURI: 'https://cdn.sunpump.meme/public/logo/CZC_TH5Eyn_1tR9tsfvqbYq.png', + }, + { + symbol: 'TBEER', + address: 'TKCJp1q9325BfQbu2Suh7mshQs8ijuqv3y', + decimals: 18, + name: 'TRON BEER', + logoURI: + 'https://cdn.sunpump.meme/public/logo/TBEER_TXMN3d_FSZeVq8A5nzi.jpg', + }, + { + symbol: 'VIKITA', + address: 'TP7r1pDoS1snMjEJE1kE17GRt3Df4mYuZz', + decimals: 18, + name: 'VIKITA', + logoURI: + 'https://cdn.sunpump.meme/public/logo/VIKITA_TVNpDy_QRP17X2aRh0E.jpg', + }, + { + symbol: 'MEOWKA', + address: 'TYpSKB5hfaKpRDwS2p7bait3xuCKYnwDKJ', + decimals: 18, + name: 'Meowka Neko', + logoURI: + 'https://cdn.sunpump.meme/public/logo/MEOWKA_TFD7X8_2AtEA0p50jde.PNG', + }, + { + symbol: 'TWX', + address: 'TTFreuJ4pYDaCeEMEtiR1GQDwPPrS4jKFk', + decimals: 18, + name: 'Twiskers', + logoURI: 'https://cdn.sunpump.meme/public/logo/TWX_TF8z6B_bQu1A9s9Wox2.png', + }, + { + symbol: 'PUSS', + address: 'TX5eXdf8458bZ77fk8xdvUgiQmC3L93iv7', + decimals: 18, + name: 'PUSS', + logoURI: + 'https://cdn.sunpump.meme/public/logo/PUSS_TQRxQN_ls9y5lDjLoeb.png', + }, + { + symbol: 'LABR', + address: 'TMEvVHCUngZ6JfuvnH74cX8UFw1KedAuhR', + decimals: 18, + name: 'Labrador', + logoURI: + 'https://cdn.sunpump.meme/public/logo/LABR_TTGSZE_HG9I7qi3BY11.png', + }, + { + symbol: '$Afro', + address: 'TDnXXUXH37zEojEfrvYziS6yKSpYmkdjHE', + decimals: 18, + name: 'Afro', + logoURI: + 'https://cdn.sunpump.meme/public/logo/$Afro_TPeQ55_cHUMaVSFmoe8.png', + }, + { + symbol: 'CDOG', + address: 'TVXmroHbJsJ6rVm3wGn2G9723yz3Kbqp9x', + decimals: 18, + name: 'Cyber Dog', + logoURI: + 'https://cdn.sunpump.meme/public/logo/CDOG_TQU2Lr_ZBlOpcEb0sXM.jpg', + }, + { + symbol: 'TBULL', + address: 'TPeoxx1VhUMnAUyjwWfximDYFDQaxNQQ45', + decimals: 18, + name: 'Tron Bull', + logoURI: + 'https://cdn.sunpump.meme/public/logo/TBULL_TSfV1B_YQaduaEhm0cB.webp', + }, + { + symbol: 'USDCOLD', + address: 'TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8', + decimals: 6, + name: 'USD Coin Old', + logoURI: + 'https://static.tronscan.org/production/upload/logo/TEkxiTehnzSmSe2XqrBj4w32RUN966rdz81.png', + }, + { + symbol: 'MOONDOG', + address: 'TMWD9A3N3EhhEhiTCkEESBrVTosNmMJy8T', + decimals: 18, + name: 'MOONDOG', + logoURI: + 'https://cdn.sunpump.meme/public/logo/MOONDOG_TQXe52_BoDeNysxsme5.png', + }, + { + symbol: 'SunJoker', + address: 'TRGEYcmBSAz3PswhtAHcUPjGbuGr1H9Fza', + decimals: 18, + name: 'SunJoker', + logoURI: + 'https://cdn.sunpump.meme/public/logo/SunJoker_TM2wL8_WsJV6iyQA2Fr.jpg', + }, + { + symbol: 'WHALE', + address: 'TWP6GgtstiuYbpygSFcZLzJQrj9eDVQcq2', + decimals: 18, + name: 'Crypto Whale', + logoURI: + 'https://cdn.sunpump.meme/public/logo/WHALE_TDnHMp_YlFkVV8WBOWL.png', + }, + { + symbol: 'BICOIN', + address: 'TF7ixydn7nfCgj9wQj3fRdKRAvsZ8egHcx', + decimals: 18, + name: 'B1COIN', + logoURI: + 'https://cdn.sunpump.meme/public/logo/BICOIN_TJvQmL_cpZkc8sGaKuC.png', + }, + { + symbol: 'BOG', + address: 'TYteXtNLyZb9D6vZatpwvkq52YrdSMP4Y1', + decimals: 18, + name: 'Birddog', + logoURI: + 'https://cdn.sunpump.meme/public/logo/BOG_TEuGom_vb57Hpv7PKdK.jpeg', }, ] From 55831bca3ffb9bf9f89e2d39f29423b765eac66b Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Mon, 16 Sep 2024 19:10:10 +0800 Subject: [PATCH 35/46] fix: tron token icon --- .../tron/_common/ui/General/Icon.tsx | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx index 37cf412d93..52091e39df 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx @@ -12,14 +12,19 @@ export const Icon = ({ currency, height = 40, width = 40 }: IconProps) => { return ( <> {currency?.logoURI ? ( - src} - src={currency?.logoURI} - alt="" - className="rounded-full" - height={height} - width={width} - /> +
    + src} + src={currency.logoURI} + alt={currency.symbol} + height={height} + width={width} + className="aspect-square h-full w-full" + /> +
    ) : (
    Date: Mon, 16 Sep 2024 19:10:22 +0800 Subject: [PATCH 36/46] chore: tron default tokens --- .../(non-evm)/tron/_common/ui/Pools/pool-provider.tsx | 10 +++++++--- apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/pool-provider.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/pool-provider.tsx index a9423d7047..58ab880444 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/pool-provider.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/pool-provider.tsx @@ -1,7 +1,11 @@ 'use client' import { FC, createContext, useContext, useMemo, useReducer } from 'react' -import { DEFAULT_TOKEN_LIST } from '~tron/_common/constants/token-list' +import { + DEFAULT_TOKEN_LIST, + STABLE_TOKENS, + TRON, +} from '~tron/_common/constants/token-list' import { IToken } from '~tron/_common/types/token-type' import { ReserveHelper } from '~tron/_common/ui/Pools/ReserveHelper' @@ -111,8 +115,8 @@ function poolReducer(_state: State, action: Action) { const PoolProvider: FC = ({ children }) => { const [state, dispatch] = useReducer(poolReducer, { - token0: DEFAULT_TOKEN_LIST[0], - token1: DEFAULT_TOKEN_LIST[2], + token0: TRON, + token1: STABLE_TOKENS[0], isTxnPending: false, amountInToken0: '', amountInToken1: '', diff --git a/apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx b/apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx index 395587e1a0..44066d8eab 100644 --- a/apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx +++ b/apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx @@ -1,7 +1,7 @@ 'use client' import { FC, createContext, useContext, useMemo, useReducer } from 'react' -import { DEFAULT_TOKEN_LIST } from '~tron/_common/constants/token-list' +import { STABLE_TOKENS, TRON } from '~tron/_common/constants/token-list' import { IToken } from '~tron/_common/types/token-type' type Action = @@ -83,8 +83,8 @@ function swapReducer(_state: State, action: Action) { const SwapProvider: FC = ({ children }) => { const [state, dispatch] = useReducer(swapReducer, { - token0: DEFAULT_TOKEN_LIST[0], - token1: DEFAULT_TOKEN_LIST[1], + token0: TRON, + token1: STABLE_TOKENS[0], isTxnPending: false, amountIn: '', amountOut: '', From 5b132031275bf9740d5c990d6bca4fad10899b1b Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Tue, 17 Sep 2024 00:01:51 +0800 Subject: [PATCH 37/46] feat: use data api on tron explore page --- .../tron/_common/lib/hooks/useTokenInfo.ts | 10 +- .../ui/Pools/PoolDetails/PoolLiquidity.tsx | 14 +- .../ui/Pools/PoolsTable/PoolAprCell.tsx | 5 - .../ui/Pools/PoolsTable/PoolColumns.tsx | 92 +++++++++---- .../ui/Pools/PoolsTable/PoolNameCell.tsx | 105 +++++++++----- .../ui/Pools/PoolsTable/PoolReservesCell.tsx | 30 ---- .../ui/Pools/PoolsTable/PoolTvlCell.tsx | 52 ------- .../ui/Pools/PoolsTable/PoolsTable.tsx | 128 +++++++++--------- .../ui/Pools/PoolsTable/_PoolColumns.tsx | 91 ------------- .../ui/Pools/PoolsTable/_PoolNameCell.tsx | 93 ------------- .../ui/Pools/PoolsTable/_PoolsTable.tsx | 109 --------------- .../(non-evm)/tron/pool/[address]/layout.tsx | 2 +- pnpm-lock.yaml | 41 ++++-- 13 files changed, 251 insertions(+), 521 deletions(-) delete mode 100644 apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolAprCell.tsx delete mode 100644 apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolReservesCell.tsx delete mode 100644 apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolTvlCell.tsx delete mode 100644 apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolColumns.tsx delete mode 100644 apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolNameCell.tsx delete mode 100644 apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolsTable.tsx diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts index 2df2a2c247..16d04d3fec 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts @@ -5,10 +5,7 @@ import { WTRX, } from '~tron/_common/constants/token-list' import { getTokenData } from '~tron/_common/lib/utils/getTokenData' -import { - getValidTokenAddress, - isAddress, -} from '~tron/_common/lib/utils/helpers' +import { getValidTokenAddress } from '~tron/_common/lib/utils/helpers' export const useTokenInfo = ({ tokenAddress }: { tokenAddress: string }) => { return useQuery({ @@ -22,11 +19,10 @@ export const useTokenInfo = ({ tokenAddress }: { tokenAddress: string }) => { return WTRX } - if (!isAddress(tokenAddress)) return undefined const foundInTokenList = DEFAULT_TOKEN_LIST.find( (i) => - getValidTokenAddress(i.address) === - getValidTokenAddress(tokenAddress), + getValidTokenAddress(i.address).toLowerCase() === + getValidTokenAddress(tokenAddress).toLowerCase(), ) if (foundInTokenList) return foundInTokenList diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx index 78b4aa4a02..52015e9fe9 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolDetails/PoolLiquidity.tsx @@ -38,8 +38,12 @@ export const PoolLiquidity = ({ const reserve1 = data?.[1]?.reserve ?? '0' const reserve1Formatted = formatUnitsForInput(reserve1, token1?.decimals ?? 0) - const { data: token0Price } = useStablePrice({ token: token0 }) - const { data: token1Price } = useStablePrice({ token: token1 }) + const { data: token0Price, isLoading: isToken0PriceLoading } = useStablePrice( + { token: token0 }, + ) + const { data: token1Price, isLoading: isToken1PriceLoading } = useStablePrice( + { token: token1 }, + ) const token0PoolPrice = ( Number(token0Price) * Number(reserve0Formatted) @@ -48,7 +52,11 @@ export const PoolLiquidity = ({ Number(token1Price) * Number(reserve1Formatted) ).toString(10) - const isLoadingData = isLoading || isLoadingReserves + const isLoadingData = + isLoading || + isLoadingReserves || + isToken0PriceLoading || + isToken1PriceLoading return ( diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolAprCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolAprCell.tsx deleted file mode 100644 index e1fa2b04a9..0000000000 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolAprCell.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { formatPercent } from 'sushi/format' - -export const PoolAprCell = () => { - return
    {formatPercent(0)}
    -} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolColumns.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolColumns.tsx index af36b7c3f1..ecae4fa09d 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolColumns.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolColumns.tsx @@ -1,11 +1,10 @@ import { SkeletonCircle, SkeletonText } from '@sushiswap/ui' import { ColumnDef } from '@tanstack/react-table' -import { ICON_SIZE } from '~tron/_common/constants/icon-size' +import { formatPercent, formatUSD } from 'sushi/format' +import { TopPool } from '~tron/_common/lib/hooks/useTopPools' import { PoolNameCell } from './PoolNameCell' -import { PoolReservesCell } from './PoolReservesCell' -import { PoolTvlCell } from './PoolTvlCell' -export const NAME_COLUMN: ColumnDef = { +export const NAME_COLUMN: ColumnDef = { id: 'name', header: 'Name', cell: (props) => , @@ -13,10 +12,10 @@ export const NAME_COLUMN: ColumnDef = { skeleton: (
    - - + +
    -
    +
    @@ -24,32 +23,69 @@ export const NAME_COLUMN: ColumnDef = { }, } -export const TVL_COLUMN: ColumnDef = { - id: 'TVL', +export const TVL_COLUMN: ColumnDef = { + id: 'liquidityUSD', header: 'TVL', - cell: (props) => , + accessorFn: (row) => row.liquidityUSD, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.liquidityUSD - rowB.liquidityUSD, + cell: (props) => + formatUSD(props.row.original.liquidityUSD).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.liquidityUSD), meta: { - skeleton: ( -
    -
    - -
    -
    - ), + skeleton: , }, } -export const RESERVES_COLUMN: ColumnDef = { - id: 'reserves', - header: 'Reserves', - cell: (props) => , +export const VOLUME_1D_COLUMN: ColumnDef = { + id: 'volumeUSD1d', + header: 'Volume (24h)', + accessorFn: (row) => row.volumeUSD1d, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.volumeUSD1d - rowB.volumeUSD1d, + cell: (props) => + formatUSD(props.row.original.volumeUSD1d).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.volumeUSD1d), meta: { - skeleton: ( -
    -
    - -
    -
    - ), + skeleton: , + }, +} + +export const FEES_1D_COLUMN: ColumnDef = { + id: 'feeUSD1d', + header: 'Fees (24h)', + accessorFn: (row) => row.feeUSD1d, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.feeUSD1d - rowB.feeUSD1d, + cell: (props) => + formatUSD(props.row.original.feeUSD1d).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.feeUSD1d), + meta: { + skeleton: , + }, +} + +export const TRANSACTIONS_1D_COLUMN: ColumnDef = { + id: 'txCount1d', + header: 'Transactions (24h)', + accessorFn: (row) => row.txCount1d, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.txCount1d - rowB.txCount1d, + cell: (props) => props.row.original.txCount1d, + meta: { + skeleton: , + }, +} + +export const APR_COLUMN: ColumnDef = { + id: 'totalApr1d', + header: 'APR', + accessorFn: (row) => row.totalApr1d, + cell: (props) => formatPercent(props.row.original.totalApr1d), + meta: { + skeleton: , }, } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolNameCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolNameCell.tsx index 441da8072c..a38406cfa0 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolNameCell.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolNameCell.tsx @@ -1,49 +1,92 @@ -import { Currency, SkeletonText, classNames } from '@sushiswap/ui' +import { Badge, Currency, TooltipContent } from '@sushiswap/ui' +import { Tooltip, TooltipProvider, TooltipTrigger } from '@sushiswap/ui' +import React from 'react' +import { ProtocolBadge } from 'src/ui/pool/PoolNameCell' +import { SushiSwapProtocol, formatNumber } from 'sushi' +import { WTRX } from '~tron/_common/constants/token-list' import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' +import { TopPool } from '~tron/_common/lib/hooks/useTopPools' import { Icon } from '../../General/Icon' -import { IRowData } from './PoolsTable' -export const PoolNameCell = ({ data }: { data: IRowData }) => { - const { token0Address, token1Address } = data - const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ - tokenAddress: token0Address, +export const PoolNameCell = ({ data }: { data: TopPool }) => { + const { data: token0 } = useTokenInfo({ + tokenAddress: data.token0Address, }) - const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ - tokenAddress: token1Address, + const { data: token1 } = useTokenInfo({ + tokenAddress: data.token1Address, }) return ( -
    +
    - {token0Address && token1Address && ( + } + > - - + + - )} +
    - - {isLoadingToken0 ? ( - - ) : ( - token0Data?.symbol + + {data.name} + +
    + + + + {ProtocolBadge[data.protocol as SushiSwapProtocol]} + + +

    Protocol version

    +
    +
    +
    + + + +
    + {formatNumber(data.swapFee * 100)}% +
    +
    + +

    Swap fee

    +
    +
    +
    + {data.isIncentivized && ( + + + +
    + 🧑‍🌾{' '} +
    +
    + +

    Farm rewards available

    +
    +
    +
    )} - - / - - {isLoadingToken1 ? ( - - ) : ( - token1Data?.symbol + {data.isSmartPool && ( + + + +
    + 💡 +
    +
    + +

    Smart Pool available

    +
    +
    +
    )} -
    - +
    ) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolReservesCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolReservesCell.tsx deleted file mode 100644 index acfdedc3e5..0000000000 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolReservesCell.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { SkeletonText } from '@sushiswap/ui' -import { formatNumber } from 'sushi/format' -import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' -import { formatUnits } from '~tron/_common/lib/utils/formatters' -import { getBase58Address } from '~tron/_common/lib/utils/helpers' -import { IRowData } from './PoolsTable' - -export const PoolReservesCell = ({ data }: { data: IRowData }) => { - const { token0Address, token1Address, reserve0, reserve1 } = data - const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ - tokenAddress: getBase58Address(token0Address), - }) - - const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ - tokenAddress: getBase58Address(token1Address), - }) - - if (isLoadingToken0 || isLoadingToken1) { - return - } - - return ( -
    - {formatNumber(formatUnits(reserve0, token0Data?.decimals ?? 18, 4))}{' '} - {token0Data?.symbol} /{' '} - {formatNumber(formatUnits(reserve1, token1Data?.decimals ?? 18, 4))}{' '} - {token1Data?.symbol} -
    - ) -} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolTvlCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolTvlCell.tsx deleted file mode 100644 index aecc3a7996..0000000000 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolTvlCell.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { SkeletonText } from '@sushiswap/ui' -import { formatUSD } from 'sushi/format' -import { useStablePrice } from '~tron/_common/lib/hooks/useStablePrice' -import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' -import { getBase58Address } from '~tron/_common/lib/utils/helpers' -import { IRowData } from './PoolsTable' - -export const PoolTvlCell = ({ data }: { data: IRowData }) => { - const { token0Address, token1Address, reserve0, reserve1 } = data - const { data: token0Data, isLoading: isLoadingToken0 } = useTokenInfo({ - tokenAddress: getBase58Address(token0Address), - }) - - const { data: token1Data, isLoading: isLoadingToken1 } = useTokenInfo({ - tokenAddress: getBase58Address(token1Address), - }) - - const { data: token0Price, isLoading: isLoadingToken0Price } = useStablePrice( - { token: token0Data }, - ) - const { data: token1Price, isLoading: isLoadingToken1Price } = useStablePrice( - { token: token1Data }, - ) - - if ( - isLoadingToken0 || - isLoadingToken1 || - isLoadingToken0Price || - isLoadingToken1Price - ) { - return - } - - const reserve0Usd = - (Number(token0Price) ?? 0) * - (Number(reserve0) / 10 ** (token0Data?.decimals ?? 18)) - const reserve1Usd = - (Number(token1Price) ?? 0) * - (Number(reserve1) / 10 ** (token1Data?.decimals ?? 18)) - - const poolTvl = reserve0Usd + reserve1Usd - - return ( -
    -
    - - {formatUSD(poolTvl)} - -
    -
    - ) -} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx index 0e7c04496e..153ac49d01 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/PoolsTable.tsx @@ -7,53 +7,76 @@ import { DataTable, SkeletonText, } from '@sushiswap/ui' -import { PaginationState } from '@tanstack/react-table' -import { useMemo, useState } from 'react' +import { ColumnDef, SortingState, TableState } from '@tanstack/react-table' +import React, { useCallback, useMemo, useState } from 'react' import { usePoolFilters } from 'src/ui/pool' -import { usePools } from '~tron/_common/lib/hooks/usePools' -import { NAME_COLUMN, RESERVES_COLUMN, TVL_COLUMN } from './PoolColumns' +import { TopPool, useTopPools } from '~tron/_common/lib/hooks/useTopPools' +import { + APR_COLUMN, + FEES_1D_COLUMN, + NAME_COLUMN, + TRANSACTIONS_1D_COLUMN, + TVL_COLUMN, + VOLUME_1D_COLUMN, +} from './PoolColumns' -export type IRowData = { - name: string - pairAddress: string - token0Address: string - token1Address: string - reserve0: string - reserve1: string -} +const COLUMNS = [ + NAME_COLUMN, + TVL_COLUMN, + VOLUME_1D_COLUMN, + FEES_1D_COLUMN, + TRANSACTIONS_1D_COLUMN, + APR_COLUMN, +] satisfies ColumnDef[] export const PoolsTable = () => { - const { tokenSymbols } = usePoolFilters() + const { tokenSymbols, farmsOnly } = usePoolFilters() + + const [sorting, setSorting] = useState([ + { id: 'liquidityUSD', desc: true }, + ]) + + const { data: pools, isLoading } = useTopPools() + + const rowLink = useCallback((row: TopPool) => { + return `/tron/pool/${row.token0Address}:${row.token1Address}:${row.address}` + }, []) - const [paginationState, setPaginationState] = useState({ - pageIndex: 0, - pageSize: 10, - }) - const { data, isLoading } = usePools() + const filtered = useMemo(() => { + if (!pools) return [] as TopPool[] - const filteredData = useMemo(() => { - if (!data) return [] - if (!tokenSymbols.length) return data - const queries = tokenSymbols.map((symbol) => - symbol.toLowerCase()?.replaceAll(' ', ''), - ) + return pools.filter((pool) => { + if (farmsOnly) { + if (!pool.isIncentivized) return false + } - return data.filter((pool) => { - const poolValues = [ - pool.pairAddress, - // pool.token0?.address, - // pool.token1?.address, - // pool.token0?.symbol, - // pool.token1?.symbol, - // pool.token0?.name, - // pool.token1?.name, - ] + if (tokenSymbols.length) { + if ( + !tokenSymbols.every((symbol) => { + symbol = symbol.toLowerCase() - return queries.every((query) => - poolValues.some((value) => value?.toLowerCase()?.includes(query)), - ) + if (pool.name.toLowerCase().includes(symbol)) return true + + return false + }) + ) { + return false + } + } + + return true }) - }, [data, tokenSymbols]) + }, [farmsOnly, tokenSymbols, pools]) + + const state: Partial = useMemo(() => { + return { + sorting, + pagination: { + pageIndex: 0, + pageSize: filtered?.length, + }, + } + }, [sorting, filtered]) return ( @@ -67,36 +90,19 @@ export const PoolsTable = () => { Pools{' '} - ({filteredData?.length ?? 0}) + ({filtered.length}) )} ({ - name: `${pool.token0Address}/${pool.token1Address}`, - pairAddress: pool.pairAddress, - token0Address: pool.token0Address, - token1Address: pool.token1Address, - reserve0: pool.reserve0, - reserve1: pool.reserve1, - })) ?? [] - } - columns={[NAME_COLUMN, TVL_COLUMN, RESERVES_COLUMN]} - linkFormatter={(data) => { - const token0 = data.name.split('/')[0] - const token1 = data.name.split('/')[1] - return `/tron/pool/${token0}:${token1}:${data.pairAddress}` - }} - pagination={true} - externalLink={false} - onPaginationChange={setPaginationState} - state={{ - pagination: paginationState, - }} + linkFormatter={rowLink} + columns={COLUMNS} + data={filtered} /> ) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolColumns.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolColumns.tsx deleted file mode 100644 index 01cc3941de..0000000000 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolColumns.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import { SkeletonCircle, SkeletonText } from '@sushiswap/ui' -import { ColumnDef } from '@tanstack/react-table' -import { formatPercent, formatUSD } from 'sushi/format' -import { TopPool } from '~tron/_common/lib/hooks/useTopPools' -import { PoolNameCell } from './_PoolNameCell' - -export const NAME_COLUMN: ColumnDef = { - id: 'name', - header: 'Name', - cell: (props) => , - meta: { - skeleton: ( -
    -
    - - -
    -
    - -
    -
    - ), - }, -} - -export const TVL_COLUMN: ColumnDef = { - id: 'liquidityUSD', - header: 'TVL', - accessorFn: (row) => row.liquidityUSD, - sortingFn: ({ original: rowA }, { original: rowB }) => - rowA.liquidityUSD - rowB.liquidityUSD, - cell: (props) => - formatUSD(props.row.original.liquidityUSD).includes('NaN') - ? '$0.00' - : formatUSD(props.row.original.liquidityUSD), - meta: { - skeleton: , - }, -} - -export const VOLUME_1D_COLUMN: ColumnDef = { - id: 'volumeUSD1d', - header: 'Volume (24h)', - accessorFn: (row) => row.volumeUSD1d, - sortingFn: ({ original: rowA }, { original: rowB }) => - rowA.volumeUSD1d - rowB.volumeUSD1d, - cell: (props) => - formatUSD(props.row.original.volumeUSD1d).includes('NaN') - ? '$0.00' - : formatUSD(props.row.original.volumeUSD1d), - meta: { - skeleton: , - }, -} - -export const FEES_1D_COLUMN: ColumnDef = { - id: 'feeUSD1d', - header: 'Fees (24h)', - accessorFn: (row) => row.feeUSD1d, - sortingFn: ({ original: rowA }, { original: rowB }) => - rowA.feeUSD1d - rowB.feeUSD1d, - cell: (props) => - formatUSD(props.row.original.feeUSD1d).includes('NaN') - ? '$0.00' - : formatUSD(props.row.original.feeUSD1d), - meta: { - skeleton: , - }, -} - -export const TRANSACTIONS_1D_COLUMN: ColumnDef = { - id: 'txCount1d', - header: 'Transactions (24h)', - accessorFn: (row) => row.txCount1d, - sortingFn: ({ original: rowA }, { original: rowB }) => - rowA.txCount1d - rowB.txCount1d, - cell: (props) => props.row.original.txCount1d, - meta: { - skeleton: , - }, -} - -export const APR_COLUMN: ColumnDef = { - id: 'totalApr1d', - header: 'APR', - accessorFn: (row) => row.totalApr1d, - cell: (props) => formatPercent(props.row.original.totalApr1d), - meta: { - skeleton: , - }, -} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolNameCell.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolNameCell.tsx deleted file mode 100644 index a38406cfa0..0000000000 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolNameCell.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import { Badge, Currency, TooltipContent } from '@sushiswap/ui' -import { Tooltip, TooltipProvider, TooltipTrigger } from '@sushiswap/ui' -import React from 'react' -import { ProtocolBadge } from 'src/ui/pool/PoolNameCell' -import { SushiSwapProtocol, formatNumber } from 'sushi' -import { WTRX } from '~tron/_common/constants/token-list' -import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' -import { TopPool } from '~tron/_common/lib/hooks/useTopPools' -import { Icon } from '../../General/Icon' - -export const PoolNameCell = ({ data }: { data: TopPool }) => { - const { data: token0 } = useTokenInfo({ - tokenAddress: data.token0Address, - }) - - const { data: token1 } = useTokenInfo({ - tokenAddress: data.token1Address, - }) - - return ( -
    -
    - } - > - - - - - -
    -
    - - {data.name} - -
    - - - - {ProtocolBadge[data.protocol as SushiSwapProtocol]} - - -

    Protocol version

    -
    -
    -
    - - - -
    - {formatNumber(data.swapFee * 100)}% -
    -
    - -

    Swap fee

    -
    -
    -
    - {data.isIncentivized && ( - - - -
    - 🧑‍🌾{' '} -
    -
    - -

    Farm rewards available

    -
    -
    -
    - )} - {data.isSmartPool && ( - - - -
    - 💡 -
    -
    - -

    Smart Pool available

    -
    -
    -
    - )} -
    -
    -
    - ) -} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolsTable.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolsTable.tsx deleted file mode 100644 index 8fba46f67a..0000000000 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Pools/PoolsTable/_PoolsTable.tsx +++ /dev/null @@ -1,109 +0,0 @@ -'use client' - -import { - Card, - CardHeader, - CardTitle, - DataTable, - SkeletonText, -} from '@sushiswap/ui' -import { ColumnDef, SortingState, TableState } from '@tanstack/react-table' -import React, { useCallback, useMemo, useState } from 'react' -import { usePoolFilters } from 'src/ui/pool' -import { TopPool, useTopPools } from '~tron/_common/lib/hooks/useTopPools' -import { - APR_COLUMN, - FEES_1D_COLUMN, - NAME_COLUMN, - TRANSACTIONS_1D_COLUMN, - TVL_COLUMN, - VOLUME_1D_COLUMN, -} from './_PoolColumns' - -const COLUMNS = [ - NAME_COLUMN, - TVL_COLUMN, - VOLUME_1D_COLUMN, - FEES_1D_COLUMN, - TRANSACTIONS_1D_COLUMN, - APR_COLUMN, -] satisfies ColumnDef[] - -export const PoolsTable = () => { - const { tokenSymbols, farmsOnly } = usePoolFilters() - - const [sorting, setSorting] = useState([ - { id: 'liquidityUSD', desc: true }, - ]) - - const { data: pools, isLoading } = useTopPools() - - const rowLink = useCallback((row: TopPool) => { - return `/tron/pool/${row.token0Address}:${row.token1Address}:${row.address}` - }, []) - - const filtered = useMemo(() => { - if (!pools) return [] as TopPool[] - - return pools.filter((pool) => { - if (farmsOnly) { - if (!pool.isIncentivized) return false - } - - if (tokenSymbols.length) { - if ( - !tokenSymbols.every((symbol) => { - symbol = symbol.toLowerCase() - - if (pool.name.toLowerCase().includes(symbol)) return true - - return false - }) - ) { - return false - } - } - - return true - }) - }, [farmsOnly, tokenSymbols, pools]) - - const state: Partial = useMemo(() => { - return { - sorting, - pagination: { - pageIndex: 0, - pageSize: filtered?.length, - }, - } - }, [sorting, filtered]) - - return ( - - - - {isLoading ? ( -
    - -
    - ) : ( - - Pools{' '} - - ({filtered.length}) - - - )} -
    -
    - -
    - ) -} diff --git a/apps/web/src/app/(non-evm)/tron/pool/[address]/layout.tsx b/apps/web/src/app/(non-evm)/tron/pool/[address]/layout.tsx index e27bd8fc3d..e152eab4b9 100644 --- a/apps/web/src/app/(non-evm)/tron/pool/[address]/layout.tsx +++ b/apps/web/src/app/(non-evm)/tron/pool/[address]/layout.tsx @@ -22,7 +22,7 @@ export default function PoolLayout({ backUrl={ referer?.includes('/pool?') ? referer?.toString() - : `/aptos/explore/pools` + : `/tron/explore/pools` } token0={token0} token1={token1} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b42c2538c0..80bc317183 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1356,6 +1356,10 @@ importers: specifier: 3.23.8 version: 3.23.8 + packages/sushi/dist/_cjs: {} + + packages/sushi/dist/_esm: {} + packages/telemetry: devDependencies: '@tsconfig/esm': @@ -23829,7 +23833,7 @@ snapshots: '@cosmjs/socket': 0.31.3(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@cosmjs/stream': 0.31.3 '@cosmjs/utils': 0.31.3 - axios: 0.21.4(debug@4.3.4) + axios: 0.21.4(debug@4.3.7) readonly-date: 1.0.0 xstream: 11.14.0 transitivePeerDependencies: @@ -25096,7 +25100,7 @@ snapshots: '@json-rpc-tools/provider@1.7.6(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: '@json-rpc-tools/utils': 1.7.6 - axios: 0.21.4(debug@4.3.4) + axios: 0.21.4(debug@4.3.7) safe-json-utils: 1.1.1 ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: @@ -30091,7 +30095,7 @@ snapshots: dependencies: '@ethersproject/bignumber': 5.7.0 '@nomiclabs/hardhat-ethers': hardhat-deploy-ethers@0.3.0-beta.13(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10)) - axios: 0.27.2(debug@4.3.4) + axios: 0.27.2 ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) fs-extra: 10.1.0 hardhat: 2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10) @@ -33389,6 +33393,19 @@ snapshots: transitivePeerDependencies: - debug + axios@0.21.4(debug@4.3.7): + dependencies: + follow-redirects: 1.15.6(debug@4.3.7) + transitivePeerDependencies: + - debug + + axios@0.27.2: + dependencies: + follow-redirects: 1.15.6(debug@4.3.7) + form-data: 4.0.0 + transitivePeerDependencies: + - debug + axios@0.27.2(debug@4.3.4): dependencies: follow-redirects: 1.15.6(debug@4.3.4) @@ -33398,7 +33415,7 @@ snapshots: axios@1.6.2: dependencies: - follow-redirects: 1.15.6(debug@4.3.4) + follow-redirects: 1.15.6(debug@4.3.7) form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: @@ -33406,7 +33423,7 @@ snapshots: axios@1.6.8: dependencies: - follow-redirects: 1.15.6(debug@4.3.4) + follow-redirects: 1.15.6(debug@4.3.7) form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: @@ -37981,6 +37998,10 @@ snapshots: optionalDependencies: debug: 4.3.4(supports-color@8.1.1) + follow-redirects@1.15.6(debug@4.3.7): + optionalDependencies: + debug: 4.3.7 + for-each@0.3.3: dependencies: is-callable: 1.2.7 @@ -38670,10 +38691,10 @@ snapshots: '@ethersproject/transactions': 5.7.0 '@ethersproject/wallet': 5.7.0 '@types/qs': 6.9.15 - axios: 0.21.4(debug@4.3.4) + axios: 0.21.4(debug@4.3.7) chalk: 4.1.2 chokidar: 3.5.3 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.7 enquirer: 2.4.1 ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) form-data: 4.0.0 @@ -39054,7 +39075,7 @@ snapshots: http-proxy@1.18.1: dependencies: eventemitter3: 4.0.7 - follow-redirects: 1.15.6(debug@4.3.4) + follow-redirects: 1.15.6(debug@4.3.7) requires-port: 1.0.0 transitivePeerDependencies: - debug @@ -44996,7 +45017,7 @@ snapshots: dependencies: '@types/js-cookie': 3.0.6 '@types/qs': 6.9.15 - axios: 0.27.2(debug@4.3.4) + axios: 0.27.2 defu: 5.0.1 js-cookie: 3.0.5 qs: 6.12.1 @@ -45588,7 +45609,7 @@ snapshots: tenderly@0.0.3(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4): dependencies: - axios: 0.27.2(debug@4.3.4) + axios: 0.27.2 cli-table3: 0.6.4 commander: 9.5.0 express: 4.18.2 From 053227f6a422810e1c50e9e9ca49be41613dbe5a Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sat, 21 Sep 2024 11:02:47 +0800 Subject: [PATCH 38/46] fix: tron token selector --- .../app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts | 6 +++++- .../(non-evm)/tron/_common/ui/General/TokenSelector.tsx | 8 +++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts index 16d04d3fec..7165465517 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts @@ -5,7 +5,10 @@ import { WTRX, } from '~tron/_common/constants/token-list' import { getTokenData } from '~tron/_common/lib/utils/getTokenData' -import { getValidTokenAddress } from '~tron/_common/lib/utils/helpers' +import { + getValidTokenAddress, + isAddress, +} from '~tron/_common/lib/utils/helpers' export const useTokenInfo = ({ tokenAddress }: { tokenAddress: string }) => { return useQuery({ @@ -19,6 +22,7 @@ export const useTokenInfo = ({ tokenAddress }: { tokenAddress: string }) => { return WTRX } + if (!isAddress(tokenAddress)) return null const foundInTokenList = DEFAULT_TOKEN_LIST.find( (i) => getValidTokenAddress(i.address).toLowerCase() === diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx index 83f5639b38..ad481c0267 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx @@ -1,5 +1,4 @@ import { CheckCircleIcon } from '@heroicons/react/20/solid' -import { useDebounce } from '@sushiswap/hooks' import { Badge, Button, @@ -34,12 +33,11 @@ export const TokenSelector = ({ }) => { const [open, setOpen] = useState(false) const [query, setQuery] = useState('') - const debouncedQuery = useDebounce(query, 500) const { customTokens, addOrRemoveToken, hasToken } = useCustomTokens() - const { data: queryToken } = useTokenInfo({ tokenAddress: debouncedQuery }) + const { data: queryToken } = useTokenInfo({ tokenAddress: query }) const { data: sortedTokenList } = useSortedTokenList({ - query: debouncedQuery, + query, tokenMap: DEFAULT_TOKEN_LIST_WITH_KEY, customTokenMap: customTokens, }) @@ -83,7 +81,7 @@ export const TokenSelector = ({ key={queryToken.address} hasToken={hasToken} addOrRemoveToken={addOrRemoveToken} - isSelected={queryToken.address === selected?.address} + isSelected={queryToken.symbol === selected?.symbol} /> ) : sortedTokenList?.length === 0 ? (

    From 29180174b12b605ef46fd523b7d75c38b0d47c55 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sat, 21 Sep 2024 13:33:23 +0800 Subject: [PATCH 39/46] fix: tron token selector styles --- .../tron/_common/constants/token-list.tsx | 16 +- .../tron/_common/lib/hooks/useTokenInfo.ts | 7 +- .../tron/_common/ui/General/TokenSelector.tsx | 166 ++++++++--- .../tron/_common/ui/Input/Search.tsx | 268 ------------------ 4 files changed, 136 insertions(+), 321 deletions(-) delete mode 100644 apps/web/src/app/(non-evm)/tron/_common/ui/Input/Search.tsx diff --git a/apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx b/apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx index 859679864a..9b51f0d2f8 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/constants/token-list.tsx @@ -122,6 +122,14 @@ const MAINNET_TOKENS: IToken[] = [ name: 'WINK', logoURI: 'https://static.tronscan.org/profile_images/JKtJTydD_400x400.jpg', }, + { + symbol: 'TUSD', + address: 'TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4', + decimals: 18, + name: 'TrueUSD', + logoURI: + 'https://static.tronscan.org/production/logo/TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4.png', + }, { symbol: 'USDT', address: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t', @@ -136,14 +144,6 @@ const MAINNET_TOKENS: IToken[] = [ name: 'JUST Stablecoin v1.0', logoURI: 'https://static.tronscan.org/production/logo/usdj.png', }, - { - symbol: 'TUSD', - address: 'TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4', - decimals: 18, - name: 'TrueUSD', - logoURI: - 'https://static.tronscan.org/production/logo/TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4.png', - }, { symbol: 'LTC', address: 'TR3DLthpnDdCGabhVDbD3VMsiJoCXY3bZd', diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts index 7165465517..182b036ccc 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts @@ -10,7 +10,10 @@ import { isAddress, } from '~tron/_common/lib/utils/helpers' -export const useTokenInfo = ({ tokenAddress }: { tokenAddress: string }) => { +export const useTokenInfo = ({ + tokenAddress, + enabled = true, +}: { tokenAddress: string; enabled?: boolean }) => { return useQuery({ queryKey: ['useTokenInfo2', { tokenAddress }], staleTime: Infinity, @@ -45,6 +48,6 @@ export const useTokenInfo = ({ tokenAddress }: { tokenAddress: string }) => { )?.logoURI ?? undefined, } }, - enabled: !!tokenAddress, + enabled: Boolean(enabled && tokenAddress), }) } diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx index ad481c0267..423b188534 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx @@ -1,4 +1,4 @@ -import { CheckCircleIcon } from '@heroicons/react/20/solid' +import { CheckCircleIcon, MagnifyingGlassIcon } from '@heroicons/react/20/solid' import { Badge, Button, @@ -9,8 +9,14 @@ import { DialogTitle, DialogTrigger, List, + SkeletonCircle, + SkeletonText, + TextField, + classNames, } from '@sushiswap/ui' -import { ReactNode, useCallback, useMemo, useState } from 'react' +import { CSSProperties, ReactNode, useCallback, useMemo, useState } from 'react' +import AutoSizer from 'react-virtualized-auto-sizer' +import { FixedSizeList } from 'react-window' import { DEFAULT_TOKEN_LIST, DEFAULT_TOKEN_LIST_WITH_KEY, @@ -18,8 +24,8 @@ import { import { useCustomTokens } from '~tron/_common/lib/hooks/useCustomTokens' import { useSortedTokenList } from '~tron/_common/lib/hooks/useSortedTokenList' import { useTokenInfo } from '~tron/_common/lib/hooks/useTokenInfo' +import { isAddress } from '~tron/_common/lib/utils/helpers' import { IToken } from '~tron/_common/types/token-type' -import { Search } from '../Input/Search' import { Icon } from './Icon' export const TokenSelector = ({ @@ -34,7 +40,10 @@ export const TokenSelector = ({ const [open, setOpen] = useState(false) const [query, setQuery] = useState('') const { customTokens, addOrRemoveToken, hasToken } = useCustomTokens() - const { data: queryToken } = useTokenInfo({ tokenAddress: query }) + const { data: queryToken, isLoading: isQueryTokenLoading } = useTokenInfo({ + tokenAddress: query, + enabled: isAddress(query), + }) const { data: sortedTokenList } = useSortedTokenList({ query, @@ -50,10 +59,33 @@ export const TokenSelector = ({ [onSelect], ) + const Row = useCallback( + ({ + index, + style, + }: { + index: number + style: CSSProperties + }) => { + return ( + + ) + }, + [selected, sortedTokenList, _onSelect, hasToken, addOrRemoveToken], + ) + return (

    {children} - + Select a token @@ -61,65 +93,110 @@ export const TokenSelector = ({ or address. -
    - +
    + +
    +
    +
    +
    + +
    + + +
    +
    -
    - - - {queryToken ? ( - - ) : sortedTokenList?.length === 0 ? ( -

    - No tokens found -

    - ) : ( - sortedTokenList?.map((_token) => ( - + + - )) +
    +
    +
    +
    +
    + {queryToken && ( + + )} + + {({ height }: { height: number }) => ( + + {Row} + )} - - -
    + + {sortedTokenList?.length === 0 && !queryToken && ( +
    +
    + + No tokens found on + TRON. + + + Did you try searching with the token address? + +
    +
    + )} +
    +
    ) } const TokenButton = ({ + style, token, selectToken, hasToken, addOrRemoveToken, isSelected, }: { - token: IToken + style?: CSSProperties + token?: IToken selectToken: (_token: IToken) => void hasToken?: (currency: IToken) => boolean isSelected: boolean addOrRemoveToken?: (type: 'add' | 'remove', currency: IToken[]) => void }) => { + if (!token) return null const isOnDefaultList = useMemo( () => DEFAULT_TOKEN_LIST.some((t) => t.address === token.address), [token], @@ -128,7 +205,10 @@ const TokenButton = ({ const isCustomAdded = hasToken?.(token) return ( -
    +
    } > - + ) : ( - + )}
    diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Input/Search.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Input/Search.tsx deleted file mode 100644 index a619064ecb..0000000000 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Input/Search.tsx +++ /dev/null @@ -1,268 +0,0 @@ -import { MagnifyingGlassIcon, XMarkIcon } from '@heroicons/react/24/outline' -import { classNames } from '@sushiswap/ui' -import { Loader } from '@sushiswap/ui' -import React, { - FC, - KeyboardEvent, - ReactElement, - forwardRef, - useCallback, - useEffect, - useState, -} from 'react' - -interface Search { - className?: string - id: string - input?(props: any): ReactElement | null - value: string - loading: boolean - onChange(val: string): void - size?: 'sm' | 'default' - delimiter?: string - placeholder?: string -} - -export const Search: FC = forwardRef( - function Search( - { - className, - id, - loading, - input: Input, - value, - onChange, - size = 'default', - delimiter, - placeholder, - }, - ref, - ) { - const [values, setValues] = useState({ - all: value.split(delimiter || ' '), - typed: '', - }) - const _onChange = useCallback( - (val: string) => { - if (val.slice(-1) === (delimiter || ' ')) { - setValues((prev) => ({ - typed: '', - all: [...prev.all, prev.typed], - })) - } else { - setValues((prev) => ({ - typed: val, - all: prev.all, - })) - } - }, - [delimiter], - ) - - const remove = useCallback((val: string) => { - setValues((prev) => ({ - typed: prev.typed, - all: prev.all.filter((_val) => _val !== val), - })) - }, []) - - const handleKeyDown = useCallback( - (event: KeyboardEvent) => { - if (event.key === 'Backspace') { - setValues((prev) => ({ - typed: prev.typed, - all: prev.all.slice(0, -1), - })) - } - if (event.key === 'Enter') { - setValues((prev) => ({ - typed: '', - all: [...prev.all, prev.typed], - })) - } - }, - [], - ) - - useEffect(() => { - if (delimiter) { - onChange( - `${values.typed} ${values.all - .filter((el) => el !== ' ' && el !== '') - .join(' ')}`, - ) - } - }, [delimiter, onChange, values]) - - if (delimiter) { - return ( -
    -
    - -
    - -
    - {values.all - .filter((el) => el !== ' ' && el !== '') - .map((el, i) => ( -
    remove(el)} - onClick={() => remove(el)} - key={i} - className="font-semibold text-gray-600 dark:text-slate-300 flex items-center text-sm rounded-full p-1 pl-2.5 bg-black/[0.08] dark:bg-white/[0.16] gap-1" - > - {el} -
    - -
    -
    - ))} -
    - _onChange(e.target.value)} - onKeyDown={handleKeyDown} - className={classNames( - 'truncate outline-none font-semibold w-full bg-transparent !p-0 placeholder:font-medium placeholder:text-gray-400 placeholder:dark:text-slate-500 text-gray-900 dark:text-slate-200', - )} - autoCorrect="off" - autoCapitalize="off" - spellCheck="false" - autoComplete="off" - /> - {(loading || value) && ( -
    - {loading ? ( -
    - -
    - ) : value ? ( -
    - setValues({ - all: [], - typed: '', - }) - } - onClick={() => - setValues({ - all: [], - typed: '', - }) - } - > - -
    - ) : ( - <> - )} -
    - )} -
    - ) - } - return ( -
    - - {Input ? ( - - ) : ( - onChange(e.target.value)} - className={classNames( - 'truncate outline-none font-semibold w-full bg-transparent !p-0 placeholder:font-medium placeholder:text-gray-400 placeholder:dark:text-slate-500 text-gray-900 dark:text-slate-200', - )} - autoCorrect="off" - autoCapitalize="off" - spellCheck="false" - autoComplete="off" - /> - )} - {(loading || value) && ( -
    - {loading ? ( -
    - -
    - ) : value ? ( -
    onChange('')} onClick={() => onChange('')}> - -
    - ) : ( - <> - )} -
    - )} -
    - ) - }, -) From defb3c6adab51e6b7caa0f1036a27c95b67ab761 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sat, 21 Sep 2024 15:22:30 +0800 Subject: [PATCH 40/46] fix: allow tron swap quotes when wallet not connected --- .../tron/_common/ui/Swap/ReviewSwapDialog.tsx | 58 +++++++++++++- .../ui/Swap/ReviewSwapDialogTrigger.tsx | 79 ++++--------------- 2 files changed, 70 insertions(+), 67 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx index caff48f4f6..52ddd029d4 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialog.tsx @@ -9,23 +9,26 @@ import { SkeletonCircle } from '@sushiswap/ui' import { Dialog, DialogClose, DialogContent, classNames } from '@sushiswap/ui' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' import Link from 'next/link' -import { useMemo, useRef } from 'react' +import { useEffect, useMemo, useRef } from 'react' import { formatPercent } from 'sushi/format' +import { usePriceImpact } from '~tron/_common/lib/hooks/usePriceImpact' +import { useReserves } from '~tron/_common/lib/hooks/useReserves' +import { useRoutes } from '~tron/_common/lib/hooks/useRoutes' import { truncateText } from '~tron/_common/lib/utils/formatters' import { getTronscanAddressLink } from '~tron/_common/lib/utils/tronscan-helpers' import { warningSeverity, warningSeverityClassName, } from '~tron/_common/lib/utils/warning-severity' -import { useSwapState } from '~tron/swap/swap-provider' +import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' import { Icon } from '../General/Icon' import { WalletConnector } from '../WalletConnector/WalletConnector' import { ReviewSwapDialogTrigger } from './ReviewSwapDialogTrigger' import { SwapButton } from './SwapButton' export const ReviewSwapDialog = () => { - const { token0, token1, amountIn, amountOut, priceImpactPercentage } = - useSwapState() + const { token0, token1, amountIn, amountOut } = useSwapState() + const { setRoute, setPriceImpactPercentage } = useSwapDispatch() const closeBtnRef = useRef(null) const { address, connected } = useWallet() const isConnected = address && connected @@ -52,6 +55,53 @@ export const ReviewSwapDialog = () => { return String(output) }, [amountOut, slippage, token0, token1, amountIn]) + const { data: routeData, isLoading: isLoadingRoutes } = useRoutes({ + token0, + token1, + }) + //these reserves are always going to be defined if a pair exists + const { data: reserves } = useReserves({ + pairAddress: routeData?.pairs?.[0], + token0, + token1, + }) + //these reserves are for is the swap needs an intermediate pair + const { data: reserves1 } = useReserves({ + pairAddress: routeData?.pairs?.[1], + token0, + token1, + }) + + //this number is always going to be defined if the reserves exists + const { data: priceImpactPercentage0 } = usePriceImpact({ + amount: amountIn, + token: token0, + reserves, + }) + + //this number is for the price impact of the second pair in a hop is needed + const { data: priceImpactPercentage1 } = usePriceImpact({ + amount: amountOut, + token: token1, + reserves: reserves1, + }) + + const priceImpactPercentage = + (priceImpactPercentage0 ?? 0) + (priceImpactPercentage1 ?? 0) + + useEffect(() => { + if (isLoadingRoutes) { + setRoute([]) + } + if (routeData && routeData.route.length > 0 && !isLoadingRoutes) { + setRoute(routeData.route) + } + }, [routeData, isLoadingRoutes, setRoute]) + + useEffect(() => { + setPriceImpactPercentage(priceImpactPercentage ?? 0) + }, [priceImpactPercentage, setPriceImpactPercentage]) + const severityClass = useMemo(() => { return warningSeverityClassName(warningSeverity(priceImpactPercentage)) }, [priceImpactPercentage]) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx index bd1f0bffb6..f4accb2345 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/ReviewSwapDialogTrigger.tsx @@ -1,22 +1,25 @@ import { Button, Checkbox, DialogTrigger } from '@sushiswap/ui' import { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks' -import { useEffect, useMemo, useState } from 'react' +import { useMemo, useState } from 'react' import { ROUTER_CONTRACT } from '~tron/_common/constants/contracts' import { useAllowance } from '~tron/_common/lib/hooks/useAllowance' -import { usePriceImpact } from '~tron/_common/lib/hooks/usePriceImpact' -import { useReserves } from '~tron/_common/lib/hooks/useReserves' -import { useRoutes } from '~tron/_common/lib/hooks/useRoutes' import { useTokenBalance } from '~tron/_common/lib/hooks/useTokenBalance' import { formatUnitsForInput } from '~tron/_common/lib/utils/formatters' import { getIfWrapOrUnwrap } from '~tron/_common/lib/utils/helpers' import { warningSeverity } from '~tron/_common/lib/utils/warning-severity' -import { useSwapDispatch, useSwapState } from '~tron/swap/swap-provider' +import { useSwapState } from '~tron/swap/swap-provider' import { ApproveToken } from '../Shared/ApproveToken' export const ReviewSwapDialogTrigger = () => { const [isChecked, setIsChecked] = useState(false) - const { token0, token1, amountIn, amountOut, isTxnPending } = useSwapState() - const { setPriceImpactPercentage, setRoute } = useSwapDispatch() + const { + token0, + token1, + amountIn, + isTxnPending, + priceImpactPercentage, + route, + } = useSwapState() const { address } = useWallet() const { data: allowanceAmount, refetch } = useAllowance({ tokenAddress: token0?.address as string, @@ -27,56 +30,6 @@ export const ReviewSwapDialogTrigger = () => { accountAddress: address, tokenAddress: token0.address, }) - const { data: routeData, isLoading: isLoadingRoutes } = useRoutes({ - token0, - token1, - }) - //these reserves are always going to be defined if a pair exists - const { data: reserves } = useReserves({ - pairAddress: routeData?.pairs?.[0], - token0, - token1, - }) - //these reserves are for is the swap needs an intermediate pair - const { data: reserves1 } = useReserves({ - pairAddress: routeData?.pairs?.[1], - token0, - token1, - }) - - //this number is always going to be defined if the reserves exists - const { data: priceImpactPercentage } = usePriceImpact({ - amount: amountIn, - token: token0, - reserves, - }) - - //this number is for the price impact of the second pair in a hop is needed - const { data: priceImpactPercentage1 } = usePriceImpact({ - amount: amountOut, - token: token1, - reserves: reserves1, - }) - - const priceImpactTotal = - (priceImpactPercentage ?? 0) + (priceImpactPercentage1 ?? 0) - - useEffect(() => { - if (isLoadingRoutes) { - setRoute([]) - } - if (routeData && routeData.route.length > 0 && !isLoadingRoutes) { - setRoute(routeData.route) - } - }, [routeData, isLoadingRoutes, setRoute]) - - const swapType = useMemo(() => { - return getIfWrapOrUnwrap(token0, token1) - }, [token0, token1]) - - useEffect(() => { - setPriceImpactPercentage(priceImpactTotal ?? 0) - }, [priceImpactTotal, setPriceImpactPercentage]) const refreshAllowance = async () => { await refetch() @@ -90,18 +43,18 @@ export const ReviewSwapDialogTrigger = () => { ) }, [tokenBalance, token0, amountIn, isLoading]) - const noRoutes = - swapType === 'swap' && - !isLoadingRoutes && - routeData && - routeData.route?.length === 0 + const swapType = useMemo(() => { + return getIfWrapOrUnwrap(token0, token1) + }, [token0, token1]) + + const noRoutes = swapType === 'swap' && route?.length === 0 const allowanceFormatted = formatUnitsForInput( allowanceAmount ?? '0', token0?.decimals, ) - const insufficientLiquidity = priceImpactTotal && priceImpactTotal >= 100 + const insufficientLiquidity = priceImpactPercentage >= 100 const buttonText = useMemo(() => { if (isTxnPending) { From cd6cf36365a5f0400d39ae911e150868f5513bff Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sun, 22 Sep 2024 14:55:43 +0800 Subject: [PATCH 41/46] fix: clear swap amount on token change --- .../simple-swap-provider.tsx | 9 +++++-- .../tron/_common/ui/Swap/AmountIn.tsx | 5 +--- .../app/(non-evm)/tron/swap/swap-provider.tsx | 26 ++++++++++++++++--- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/apps/web/src/app/(non-evm)/aptos/swap/ui/simple/simple-swap-provider/simple-swap-provider.tsx b/apps/web/src/app/(non-evm)/aptos/swap/ui/simple/simple-swap-provider/simple-swap-provider.tsx index 8853e663f1..7fb021dcf8 100644 --- a/apps/web/src/app/(non-evm)/aptos/swap/ui/simple/simple-swap-provider/simple-swap-provider.tsx +++ b/apps/web/src/app/(non-evm)/aptos/swap/ui/simple/simple-swap-provider/simple-swap-provider.tsx @@ -74,11 +74,16 @@ export const SimpleSwapProvider: FC = ({ children }) => { const reducer = (state: State, action: Actions) => { switch (action.type) { case 'setToken0': - return { ...state, token0: action.value } + return { ...state, token0: action.value, amount: '' } case 'setToken1': return { ...state, token1: action.value } case 'swapTokens': - return { ...state, token0: state.token1, token1: state.token0 } + return { + ...state, + token0: state.token1, + token1: state.token0, + amount: '', + } case 'setAmount': return { ...state, amount: action.value } case 'setSlippageAmount': diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx index 2cf36c66d6..6bcdd6eb28 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/Swap/AmountIn.tsx @@ -1,4 +1,3 @@ -import { useDebounce } from '@sushiswap/hooks' import { useEffect } from 'react' import { useAmountsOut } from '~tron/_common/lib/hooks/useAmountsOut' import { @@ -12,10 +11,8 @@ export const AmountIn = () => { const { token0, amountIn, token1 } = useSwapState() const { setToken0, setAmountIn, setAmountOut } = useSwapDispatch() - const debouncedAmountIn = useDebounce(amountIn, 500) - const { data: amountsOut } = useAmountsOut({ - amountIn: parseUnits(debouncedAmountIn, token0.decimals), + amountIn: parseUnits(amountIn, token0.decimals), }) useEffect(() => { diff --git a/apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx b/apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx index 44066d8eab..1369e4bf3d 100644 --- a/apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx +++ b/apps/web/src/app/(non-evm)/tron/swap/swap-provider.tsx @@ -46,19 +46,37 @@ function swapReducer(_state: State, action: Action) { case 'setToken0': { if (_state.token1.address === action.value.address) { //if token1 is the same as the new token0, swap them - return { ..._state, token1: _state.token0, token0: action.value } + return { + ..._state, + token1: _state.token0, + token0: action.value, + amountIn: '', + amountOut: '', + } } - return { ..._state, token0: action.value } + return { ..._state, token0: action.value, amountIn: '', amountOut: '' } } case 'setToken1': { if (_state.token0.address === action.value.address) { //if token0 is the same as the new token1, swap them - return { ..._state, token0: _state.token1, token1: action.value } + return { + ..._state, + token0: _state.token1, + token1: action.value, + amountIn: '', + amountOut: '', + } } return { ..._state, token1: action.value } } case 'swapTokens': { - return { ..._state, token0: _state.token1, token1: _state.token0 } + return { + ..._state, + token0: _state.token1, + token1: _state.token0, + amountIn: '', + amountOut: '', + } } case 'setIsTxnPending': { return { ..._state, isTxnPending: action.value } From 516b5401d9fc0933bebdfaa9ca96a47acc64fed3 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sun, 22 Sep 2024 15:13:38 +0800 Subject: [PATCH 42/46] fix: tron usTokenInfo --- .../src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts index 182b036ccc..ba356ab396 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts +++ b/apps/web/src/app/(non-evm)/tron/_common/lib/hooks/useTokenInfo.ts @@ -25,7 +25,7 @@ export const useTokenInfo = ({ return WTRX } - if (!isAddress(tokenAddress)) return null + if (!isAddress(tokenAddress)) throw new Error('invalid address') const foundInTokenList = DEFAULT_TOKEN_LIST.find( (i) => getValidTokenAddress(i.address).toLowerCase() === From 88cf5f2f0943dd0ba94765fe9eacd2184b35a9b5 Mon Sep 17 00:00:00 2001 From: LufyCZ Date: Mon, 30 Sep 2024 11:54:56 +0000 Subject: [PATCH 43/46] fix(apps/tron): use cloudinary for logo fetching --- .../app/(non-evm)/tron/_common/ui/General/Icon.tsx | 3 ++- .../tron/_common/ui/General/TokenSelector.tsx | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx index 52091e39df..3620d360d7 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/General/Icon.tsx @@ -1,3 +1,4 @@ +import { cloudinaryLogoFetchLoader } from '@sushiswap/ui' import Image from 'next/image' import { hashStringToColor } from '~tron/_common/lib/utils/formatters' import { IToken } from '~tron/_common/types/token-type' @@ -17,7 +18,7 @@ export const Icon = ({ currency, height = 40, width = 40 }: IconProps) => { className="relative flex shrink-0 overflow-hidden rounded-full" > src} + loader={cloudinaryLogoFetchLoader} src={currency.logoURI} alt={currency.symbol} height={height} diff --git a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx index 423b188534..335038ee05 100644 --- a/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx +++ b/apps/web/src/app/(non-evm)/tron/_common/ui/General/TokenSelector.tsx @@ -196,11 +196,16 @@ const TokenButton = ({ isSelected: boolean addOrRemoveToken?: (type: 'add' | 'remove', currency: IToken[]) => void }) => { + const isOnDefaultList = useMemo(() => { + if (!token) { + return true + } + + return DEFAULT_TOKEN_LIST.some((t) => t.address === token.address) + }, [token]) + if (!token) return null - const isOnDefaultList = useMemo( - () => DEFAULT_TOKEN_LIST.some((t) => t.address === token.address), - [token], - ) + const isNew = !hasToken?.(token) const isCustomAdded = hasToken?.(token) From cc6425a1993fc74a22fecb0f5eb9049711da3a8c Mon Sep 17 00:00:00 2001 From: Matthew Lilley Date: Mon, 30 Sep 2024 17:15:41 +0100 Subject: [PATCH 44/46] chore: disable tron in network selector and remove odd margins around trade header --- .vscode/extensions.json | 4 ---- .vscode/launch.json | 6 +++--- .../aptos/swap/ui/simple/simple-swap-header.tsx | 2 +- apps/web/src/app/(non-evm)/tron/swap/page.tsx | 3 +-- packages/ui/src/components/network-selector.tsx | 2 +- pnpm-lock.yaml | 16 ++++++---------- 6 files changed, 12 insertions(+), 21 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 28a76ad92d..008c81dbb6 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,14 +1,10 @@ { "recommendations": [ "dbaeumer.vscode-eslint", - "esbenp.prettier-vscode", "heybourn.headwind", "bradlc.vscode-tailwindcss", - "NomicFoundation.hardhat-solidity", "VisualStudioExptTeam.vscodeintellicode", - "wix.vscode-import-cost", "GraphQL.vscode-graphql", - "bierner.markdown-mermaid", "biomejs.biome" ] } diff --git a/.vscode/launch.json b/.vscode/launch.json index d32a0f6a77..b8ace22845 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,8 +5,8 @@ "name": "Next.js: debug server-side", "type": "node-terminal", "request": "launch", - "cwd": "${workspaceFolder}/apps/web", - "command": "npm run dev" + "command": "pnpm exec turbo run dev --filter web", + "cwd": "${workspaceFolder}/apps/web" }, { "name": "Next.js: debug client-side", @@ -18,8 +18,8 @@ "name": "Next.js: debug full stack", "type": "node", "request": "launch", - "cwd": "${workspaceFolder}/apps/web", "program": "${workspaceFolder}/node_modules/.bin/next", + "cwd": "${workspaceFolder}/apps/web", "runtimeArgs": ["--inspect"], "skipFiles": ["/**"], "serverReadyAction": { diff --git a/apps/web/src/app/(non-evm)/aptos/swap/ui/simple/simple-swap-header.tsx b/apps/web/src/app/(non-evm)/aptos/swap/ui/simple/simple-swap-header.tsx index 0841eea95e..b349e1e3d5 100644 --- a/apps/web/src/app/(non-evm)/aptos/swap/ui/simple/simple-swap-header.tsx +++ b/apps/web/src/app/(non-evm)/aptos/swap/ui/simple/simple-swap-header.tsx @@ -4,7 +4,7 @@ import { typographyVariants } from '@sushiswap/ui' export const SimpleSwapHeader = () => { return ( -
    +

    Trade

    ) diff --git a/apps/web/src/app/(non-evm)/tron/swap/page.tsx b/apps/web/src/app/(non-evm)/tron/swap/page.tsx index 24c3323778..1316550143 100644 --- a/apps/web/src/app/(non-evm)/tron/swap/page.tsx +++ b/apps/web/src/app/(non-evm)/tron/swap/page.tsx @@ -17,8 +17,7 @@ export default function SwapSimplePage() { return (
    -
    -
    +

    Trade

    diff --git a/packages/ui/src/components/network-selector.tsx b/packages/ui/src/components/network-selector.tsx index c299ad0003..91b94f732e 100644 --- a/packages/ui/src/components/network-selector.tsx +++ b/packages/ui/src/components/network-selector.tsx @@ -121,7 +121,7 @@ const NetworkSelector = ({ {showNonEvm ? ( <> - + {/* */} ) : null} {_networks diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d6fc80f6fa..6273fad30f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -953,10 +953,6 @@ importers: specifier: 5.5.4 version: 5.5.4 - packages/sushi/dist/_cjs: {} - - packages/sushi/dist/_esm: {} - packages/telemetry: devDependencies: '@tsconfig/esm': @@ -22676,7 +22672,7 @@ snapshots: nocache: 3.0.4 pretty-format: 26.6.2 serve-static: 1.15.0 - ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - encoding @@ -22937,7 +22933,7 @@ snapshots: '@react-three/fiber@8.16.2(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.24.4)(@babel/preset-env@7.24.4(@babel/core@7.24.4))(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(three@0.163.0)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.25.6 '@types/react-reconciler': 0.26.7 '@types/webxr': 0.5.15 base64-js: 1.5.1 @@ -27716,7 +27712,7 @@ snapshots: babel-plugin-macros@3.1.0: dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.25.6 cosmiconfig: 7.1.0 resolve: 1.22.8 optional: true @@ -33211,7 +33207,7 @@ snapshots: metro-runtime@0.80.8: dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.25.6 metro-source-map@0.80.8: dependencies: @@ -33310,7 +33306,7 @@ snapshots: source-map: 0.5.7 strip-ansi: 6.0.1 throat: 5.0.0 - ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) yargs: 17.7.2 transitivePeerDependencies: - bufferutil @@ -34921,7 +34917,7 @@ snapshots: react-devtools-core@4.28.5(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: shell-quote: 1.8.1 - ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - utf-8-validate From 1879373787c05aec17fe12bc1b00f8b3128c6590 Mon Sep 17 00:00:00 2001 From: Matthew Lilley Date: Mon, 30 Sep 2024 17:18:06 +0100 Subject: [PATCH 45/46] chore: make linter happy --- .../ui/src/components/network-selector.tsx | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/ui/src/components/network-selector.tsx b/packages/ui/src/components/network-selector.tsx index 91b94f732e..592e76ee5e 100644 --- a/packages/ui/src/components/network-selector.tsx +++ b/packages/ui/src/components/network-selector.tsx @@ -5,7 +5,7 @@ import { Chain, ChainId } from 'sushi/chain' import Link from 'next/link' import { NetworkIcon } from '../icons/NetworkIcon' -import { TronCircle } from '../icons/network' +// import { TronCircle } from '../icons/network/circle/TronCircle' import { AptosCircle } from '../icons/network/circle/AptosCircle' import { Command, @@ -79,18 +79,18 @@ function Aptos() { ) } -function Tron() { - return ( - - -
    - - Tron -
    -
    - - ) -} +// function Tron() { +// return ( +// +// +//
    +// +// Tron +//
    +//
    +// +// ) +// } const NetworkSelector = ({ showNonEvm = false, From eb4432be771b45583b28dab0bee9fafacab420bd Mon Sep 17 00:00:00 2001 From: Matthew Lilley Date: Mon, 30 Sep 2024 17:29:04 +0100 Subject: [PATCH 46/46] chore: lock loose dependencies --- apps/web/package.json | 36 ++++++++++---------- pnpm-lock.yaml | 76 +++++++++++++++++-------------------------- 2 files changed, 47 insertions(+), 65 deletions(-) diff --git a/apps/web/package.json b/apps/web/package.json index 8d85c60448..4512d676ff 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -16,7 +16,7 @@ "test:unit": "vitest --watch=false src" }, "dependencies": { - "@aptos-labs/ts-sdk": "^1.22.1", + "@aptos-labs/ts-sdk": "1.27.0", "@aptos-labs/wallet-adapter-core": "3.10.0", "@aptos-labs/wallet-adapter-react": "2.3.1", "@cloudinary/url-gen": "1.11.2", @@ -26,17 +26,17 @@ "@heroicons/react-v1": "npm:@heroicons/react@v1", "@hookform/resolvers": "3.3.1", "@layerzerolabs/scan-client": "0.0.6", - "@martianwallet/aptos-wallet-adapter": "^0.0.5", - "@msafe/aptos-wallet-adapter": "^1.1.3", + "@martianwallet/aptos-wallet-adapter": "0.0.5", + "@msafe/aptos-wallet-adapter": "1.1.3", "@next/bundle-analyzer": "14.2.11", "@octokit/auth-app": "4.0.7", "@orbs-network/twap-ui-sushiswap": "1.1.57", - "@pontem/wallet-adapter-plugin": "^0.2.1", + "@pontem/wallet-adapter-plugin": "0.2.1", "@radix-ui/react-slot": "1.0.2", "@rainbow-me/rainbowkit": "2.1.6", - "@rise-wallet/wallet-adapter": "^0.1.2", + "@rise-wallet/wallet-adapter": "0.1.2", "@sentry/nextjs": "8.30.0", - "@snapshot-labs/snapshot.js": "^0.9.8", + "@snapshot-labs/snapshot.js": "0.9.9", "@sushiswap/bonds-sdk": "workspace:*", "@sushiswap/client": "workspace:*", "@sushiswap/database": "workspace:*", @@ -63,18 +63,18 @@ "@vercel/speed-insights": "1.0.12", "@wagmi/connectors": "5.1.2", "@wagmi/core": "2.13.5", - "aptos": "^1.11.0", + "aptos": "1.21.0", "cors": "2.8.5", "d3": "7.8.4", "date-fns": "2.30.0", "echarts": "4.9.0", "echarts-for-react": "3.0.2", - "fewcha-plugin-wallet-adapter": "^0.1.3", + "fewcha-plugin-wallet-adapter": "0.1.3", "framer-motion": "7.10.3", - "lodash.frompairs": "^4.0.1", - "lodash.maxby": "^4.6.0", + "lodash.frompairs": "4.0.1", + "lodash.maxby": "4.6.0", "lodash.once": "4.1.1", - "lodash.uniqby": "^4.7.0", + "lodash.uniqby": "4.7.0", "lodash.zip": "4.2.0", "ms": "2.1.3", "nanoid": "4.0.0", @@ -82,7 +82,7 @@ "next-axiom": "1.5.0", "next-themes": "0.2.1", "octokit": "2.1.0", - "petra-plugin-wallet-adapter": "^0.4.5", + "petra-plugin-wallet-adapter": "0.4.5", "react": "18.2.0", "react-dom": "18.2.0", "react-dropzone": "14.2.3", @@ -109,11 +109,11 @@ "@tsconfig/next": "2.0.1", "@types/cors": "2.8.13", "@types/d3": "7.4.0", - "@types/echarts": "^4.9.22", - "@types/lodash.frompairs": "^4.0.9", - "@types/lodash.maxby": "^4.6.9", + "@types/echarts": "4.9.22", + "@types/lodash.frompairs": "4.0.9", + "@types/lodash.maxby": "4.6.9", "@types/lodash.once": "4.1.9", - "@types/lodash.uniqby": "^4.7.9", + "@types/lodash.uniqby": "4.7.9", "@types/lodash.zip": "4.2.9", "@types/ms": "0.7.34", "@types/node": "22", @@ -129,9 +129,9 @@ "eslint-config-sushi": "workspace:*", "postcss": "8.4.23", "prool": "0.0.16", - "schema-dts": "^1.1.2", + "schema-dts": "1.1.2", "tailwindcss": "3.3.2", - "tsx": "^4.16.5", + "tsx": "4.19.0", "typescript": "5.4.5", "unimported": "1.30.0", "vitest": "2.0.5" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6273fad30f..a41bba0f6a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -234,7 +234,7 @@ importers: apps/web: dependencies: '@aptos-labs/ts-sdk': - specifier: ^1.22.1 + specifier: 1.27.0 version: 1.27.0 '@aptos-labs/wallet-adapter-core': specifier: 3.10.0 @@ -264,10 +264,10 @@ importers: specifier: 0.0.6 version: 0.0.6(axios@1.6.8) '@martianwallet/aptos-wallet-adapter': - specifier: ^0.0.5 + specifier: 0.0.5 version: 0.0.5 '@msafe/aptos-wallet-adapter': - specifier: ^1.1.3 + specifier: 1.1.3 version: 1.1.3(patch_hash=ztcfam72g3tcfvfy23kjubyhqa)(@aptos-labs/ts-sdk@1.27.0)(@mizuwallet-sdk/core@1.3.0(@aptos-labs/ts-sdk@1.27.0)(graphql-request@7.0.1(graphql@16.6.0)))(@mizuwallet-sdk/protocol@0.0.1)(@wallet-standard/core@1.0.3)(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@next/bundle-analyzer': specifier: 14.2.11 @@ -279,7 +279,7 @@ importers: specifier: 1.1.57 version: 1.1.57(bufferutil@4.0.8)(encoding@0.1.13)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.24.4)(@babel/preset-env@7.24.4(@babel/core@7.24.4))(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(utf-8-validate@5.0.10) '@pontem/wallet-adapter-plugin': - specifier: ^0.2.1 + specifier: 0.2.1 version: 0.2.1 '@radix-ui/react-slot': specifier: 1.0.2 @@ -288,13 +288,13 @@ importers: specifier: 2.1.6 version: 2.1.6(@tanstack/react-query@5.51.16(react@18.2.0))(@types/react@18.2.14)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(viem@2.21.4(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(wagmi@2.12.10(@tanstack/query-core@5.51.16)(@tanstack/react-query@5.51.16(react@18.2.0))(@types/react@18.2.14)(@upstash/redis@1.22.1)(bufferutil@4.0.8)(encoding@0.1.13)(immer@9.0.21)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.24.4)(@babel/preset-env@7.24.4(@babel/core@7.24.4))(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.5.4)(utf-8-validate@5.0.10)(viem@2.21.4(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8)) '@rise-wallet/wallet-adapter': - specifier: ^0.1.2 + specifier: 0.1.2 version: 0.1.2 '@sentry/nextjs': specifier: 8.30.0 version: 8.30.0(@opentelemetry/api@1.9.0)(@opentelemetry/core@1.25.1(@opentelemetry/api@1.9.0))(@opentelemetry/instrumentation@0.53.0(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-trace-base@1.26.0(@opentelemetry/api@1.9.0))(encoding@0.1.13)(next@14.2.11(@babel/core@7.24.4)(@opentelemetry/api@1.9.0)(@playwright/test@1.45.0)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)(webpack@5.91.0) '@snapshot-labs/snapshot.js': - specifier: ^0.9.8 + specifier: 0.9.9 version: 0.9.9(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) '@sushiswap/bonds-sdk': specifier: workspace:* @@ -375,7 +375,7 @@ importers: specifier: 2.13.5 version: 2.13.5(@tanstack/query-core@5.51.16)(@types/react@18.2.14)(immer@9.0.21)(react@18.2.0)(typescript@5.5.4)(viem@2.21.4(bufferutil@4.0.8)(typescript@5.5.4)(utf-8-validate@5.0.10)(zod@3.23.8)) aptos: - specifier: ^1.11.0 + specifier: 1.21.0 version: 1.21.0 cors: specifier: 2.8.5 @@ -393,22 +393,22 @@ importers: specifier: 3.0.2 version: 3.0.2(echarts@4.9.0)(react@18.2.0) fewcha-plugin-wallet-adapter: - specifier: ^0.1.3 + specifier: 0.1.3 version: 0.1.3(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) framer-motion: specifier: 7.10.3 version: 7.10.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) lodash.frompairs: - specifier: ^4.0.1 + specifier: 4.0.1 version: 4.0.1 lodash.maxby: - specifier: ^4.6.0 + specifier: 4.6.0 version: 4.6.0 lodash.once: specifier: 4.1.1 version: 4.1.1 lodash.uniqby: - specifier: ^4.7.0 + specifier: 4.7.0 version: 4.7.0 lodash.zip: specifier: 4.2.0 @@ -432,7 +432,7 @@ importers: specifier: 2.1.0 version: 2.1.0(encoding@0.1.13) petra-plugin-wallet-adapter: - specifier: ^0.4.5 + specifier: 0.4.5 version: 0.4.5(@aptos-labs/ts-sdk@1.27.0)(aptos@1.21.0) react: specifier: 18.2.0 @@ -508,19 +508,19 @@ importers: specifier: 7.4.0 version: 7.4.0 '@types/echarts': - specifier: ^4.9.22 + specifier: 4.9.22 version: 4.9.22 '@types/lodash.frompairs': - specifier: ^4.0.9 + specifier: 4.0.9 version: 4.0.9 '@types/lodash.maxby': - specifier: ^4.6.9 + specifier: 4.6.9 version: 4.6.9 '@types/lodash.once': specifier: 4.1.9 version: 4.1.9 '@types/lodash.uniqby': - specifier: ^4.7.9 + specifier: 4.7.9 version: 4.7.9 '@types/lodash.zip': specifier: 4.2.9 @@ -568,14 +568,14 @@ importers: specifier: 0.0.16 version: 0.0.16 schema-dts: - specifier: ^1.1.2 + specifier: 1.1.2 version: 1.1.2(typescript@5.5.4) tailwindcss: specifier: 3.3.2 version: 3.3.2(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) tsx: - specifier: ^4.16.5 - version: 4.16.5 + specifier: 4.19.0 + version: 4.19.0 typescript: specifier: 5.5.4 version: 5.5.4 @@ -4148,6 +4148,7 @@ packages: '@mysten/sui.js@0.13.0': resolution: {integrity: sha512-8s4IYN6GH95Begjuy0Xr45vQyyVZZHx83g5hJOpT9o98kQgdjaO218UdqQRVoFt/TODpNsTaI5OlymlKCgFVTQ==} engines: {node: '>=16'} + deprecated: This package has been renamed to @mysten/sui, please update to use the renamed package. '@ndelangen/get-tarball@3.0.9': resolution: {integrity: sha512-9JKTEik4vq+yGosHYhZ1tiH/3WpUS0Nh0kej4Agndhox8pAdWhEx5knFVRcb/ya9knCRCs1rPxNrSXTDdfVqpA==} @@ -5967,9 +5968,6 @@ packages: '@scure/bip39@1.2.1': resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} - '@scure/bip39@1.3.0': - resolution: {integrity: sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==} - '@scure/bip39@1.4.0': resolution: {integrity: sha512-BEEm6p8IueV/ZTfQLp/0vhw4NPnT9oWf5+28nvmeUICjP99f4vr2d+qc7AVGDDtwRep6ifR43Yed9ERVmiITzw==} @@ -14822,6 +14820,7 @@ packages: rpc-websockets@7.11.0: resolution: {integrity: sha512-IkLYjayPv6Io8C/TdCL5gwgzd1hFz2vmBZrjMw/SPEXo51ETOhnzgS4Qy5GWi2JQN7HKHa66J3+2mv0fgNh/7w==} + deprecated: deprecate 7.11.0 rpc-websockets@9.0.4: resolution: {integrity: sha512-yWZWN0M+bivtoNLnaDbtny4XchdAIF5Q4g/ZsC5UC61Ckbp0QczwO8fg44rV3uYmY4WHd+EZQbn90W1d8ojzqQ==} @@ -15862,11 +15861,6 @@ packages: peerDependencies: typescript: 5.5.4 - tsx@4.16.5: - resolution: {integrity: sha512-ArsiAQHEW2iGaqZ8fTA1nX0a+lN5mNTyuGRRO6OW3H/Yno1y9/t1f9YOI1Cfoqz63VAthn++ZYcbDP7jPflc+A==} - engines: {node: '>=18.0.0'} - hasBin: true - tsx@4.19.0: resolution: {integrity: sha512-bV30kM7bsLZKZIOCHeMNVMJ32/LuJzLVajkQI/qf92J2Qr08ueLQvW00PUZGiuLPP760UINwupgUj8qrSCPUKg==} engines: {node: '>=18.0.0'} @@ -17125,10 +17119,10 @@ snapshots: dependencies: '@aptos-labs/aptos-cli': 0.2.0 '@aptos-labs/aptos-client': 0.1.0(patch_hash=t5ob2d47ycxvxflm53kwwzv4kq) - '@noble/curves': 1.4.0 + '@noble/curves': 1.6.0 '@noble/hashes': 1.5.0 '@scure/bip32': 1.4.0 - '@scure/bip39': 1.3.0 + '@scure/bip39': 1.4.0 eventemitter3: 5.0.1 form-data: 4.0.0 js-base64: 3.7.7 @@ -20291,7 +20285,7 @@ snapshots: '@json-rpc-tools/utils': 1.7.6 axios: 0.21.4 safe-json-utils: 1.1.1 - ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - debug @@ -20791,10 +20785,10 @@ snapshots: '@mysten/sui.js@0.13.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': dependencies: '@mysten/bcs': 0.3.0 - '@noble/hashes': 1.4.0 + '@noble/hashes': 1.5.0 '@noble/secp256k1': 1.7.1 '@scure/bip32': 1.4.0 - '@scure/bip39': 1.3.0 + '@scure/bip39': 1.4.0 bn.js: 5.2.1 buffer: 6.0.3 cross-fetch: 3.1.8(encoding@0.1.13) @@ -23121,11 +23115,6 @@ snapshots: '@scure/bip39@1.2.1': dependencies: '@noble/hashes': 1.3.3 - '@scure/base': 1.1.6 - - '@scure/bip39@1.3.0': - dependencies: - '@noble/hashes': 1.4.0 '@scure/base': 1.1.8 '@scure/bip39@1.4.0': @@ -32015,7 +32004,7 @@ snapshots: jayson@3.7.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: - '@types/connect': 3.4.35 + '@types/connect': 3.4.36 '@types/node': 12.20.55 '@types/ws': 7.4.7 JSONStream: 1.3.5 @@ -32023,11 +32012,11 @@ snapshots: delay: 5.0.0 es6-promisify: 5.0.0 eyes: 0.1.8 - isomorphic-ws: 4.0.1(ws@7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + isomorphic-ws: 4.0.1(ws@7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10)) json-stringify-safe: 5.0.1 lodash: 4.17.21 uuid: 8.3.2 - ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -36970,13 +36959,6 @@ snapshots: tslib: 1.14.1 typescript: 5.5.4 - tsx@4.16.5: - dependencies: - esbuild: 0.21.5 - get-tsconfig: 4.7.6 - optionalDependencies: - fsevents: 2.3.3 - tsx@4.19.0: dependencies: esbuild: 0.23.1