From eca84e56b1072550201e98e9f8cfbed765db69e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ribeiro?= Date: Tue, 28 May 2024 16:17:26 -0300 Subject: [PATCH] rename bleu-fi to bleu everywhere --- .eslintrc.js | 2 +- .npmrc | 2 +- README.md | 8 +- apps/balancer-tools/next.config.js | 4 +- apps/balancer-tools/package.json | 18 +- apps/balancer-tools/seed.ts | 2 +- .../utils/calculateDepthCost.test.tsx | 14 +- .../src/app/apr/(components)/Breadcrumb.tsx | 10 +- .../app/apr/(components)/HeaderEndButton.tsx | 10 +- .../apr/(components)/HomeOverviewCards.tsx | 6 +- .../apr/(components)/MoreFiltersButton.tsx | 4 +- .../app/apr/(components)/OverviewCards.tsx | 2 +- .../app/apr/(components)/PoolListTable.tsx | 6 +- .../app/apr/(components)/TokenFilterInput.tsx | 6 +- .../app/apr/(components)/TopPoolsChart.tsx | 14 +- .../(utils)/fetchAvgDataForPoolIdDateRange.ts | 34 +- .../(utils)/fetchDataForPoolIdDateRange.ts | 66 +- .../src/app/apr/(utils)/fetchForDateRange.ts | 48 +- .../apr/(utils)/getBALPriceForDateRange.ts | 10 +- .../src/app/apr/(utils)/getFilteredUrl.ts | 16 +- .../src/app/apr/(utils)/validate.ts | 22 +- apps/balancer-tools/src/app/apr/page.tsx | 10 +- .../HistoricalCharts/HistoricalChart.tsx | 4 +- .../pool/(components)/PoolOverviewCards.tsx | 8 +- .../app/apr/pool/[network]/[poolId]/page.tsx | 22 +- .../src/app/apr/pool/[network]/page.tsx | 4 +- .../(components)/ConfirmCheckpointsDialog.tsx | 8 +- .../(components)/GaugesTable.tsx | 6 +- .../gaugescheckpointer/[network]/layout.tsx | 2 +- .../app/gaugescheckpointer/[network]/page.tsx | 8 +- .../src/app/gaugescheckpointer/layout.tsx | 2 +- .../(components)/BatchWithdrawButton.tsx | 2 +- .../(components)/TokenSelect.tsx | 16 +- .../(components)/TokenTable.tsx | 6 +- .../[network]/[operationKind]/all/page.tsx | 2 +- .../[operationKind]/all/withdrawAll.tsx | 8 +- .../[network]/[operationKind]/page.tsx | 2 +- .../token/[tokenAddress]/page.tsx | 4 +- .../app/internalmanager/[network]/layout.tsx | 2 +- .../src/app/internalmanager/layout.tsx | 2 +- apps/balancer-tools/src/app/layout.tsx | 2 +- .../(components)/OwnedPoolsSidebarItems.tsx | 8 +- .../src/app/metadata/[network]/layout.tsx | 2 +- .../MetadataAttributesTable/Actions.tsx | 2 +- .../TransactionModal.tsx | 4 +- .../MetadataAttributesTable/index.tsx | 4 +- .../metadata/[network]/pool/[poolId]/page.tsx | 2 +- .../src/app/metadata/layout.tsx | 2 +- .../(components)/Curves/ImpactCurve.tsx | 48 +- .../(components)/Curves/SwapCurve.tsx | 56 +- .../poolsimulator/(components)/DepthCost.tsx | 50 +- .../(components)/SwapSimulator.tsx | 20 +- .../poolsimulator/(components)/TokenTable.tsx | 2 +- .../src/app/poolsimulator/(types)/index.ts | 6 +- .../src/app/poolsimulator/(utils)/index.ts | 36 +- .../(workers)/impact-curve-calculation.ts | 12 +- .../(workers)/swap-curve-calculation.ts | 24 +- .../src/components/AlertCard.tsx | 6 +- apps/balancer-tools/src/components/Footer.tsx | 2 +- apps/balancer-tools/src/components/Header.tsx | 2 +- .../SearchPoolForm/filterPoolInput.ts | 2 +- .../src/components/SearchPoolForm/index.tsx | 10 +- .../src/components/SupportedChain.tsx | 2 +- .../src/components/WalletNotConnected.tsx | 2 +- .../src/components/ui/date-range-picker.tsx | 32 +- .../src/contexts/AdminToolsContext.tsx | 2 +- .../contexts/GaugesCheckpointerContext.tsx | 8 +- .../src/contexts/InternalManagerContext.tsx | 8 +- .../src/contexts/PoolSimulatorContext.tsx | 24 +- apps/balancer-tools/src/contexts/networks.tsx | 4 +- .../gaugeschecpointer/useTransactionStatus.ts | 4 +- .../internalmanager/useCheckAllowance.ts | 2 +- .../internalmanager/useManageUserBalance.ts | 14 +- .../internalmanager/useTransactionStatus.ts | 4 +- .../src/hooks/useTransaction.ts | 4 +- .../balancer-tools/src/lib/eclp-derivative.ts | 2 +- apps/balancer-tools/src/lib/gql.ts | 14 +- apps/balancer-tools/src/lib/gql/client.ts | 16 +- apps/balancer-tools/src/lib/gql/server.ts | 16 +- apps/balancer-tools/src/lib/schema.ts | 18 +- .../src/utils/refetchRequest.ts | 2 +- .../balancer-tools/src/wagmi/readBalToMint.ts | 4 +- .../src/wagmi/readTokenAllowance.ts | 2 +- .../wagmi/writeCheckpointMultipleGauges.ts | 8 +- .../src/wagmi/writeManageUserBalance.ts | 4 +- .../src/wagmi/writeTokenApproval.ts | 2 +- apps/balancer-tools/tsconfig.json | 2 +- apps/cow-amm-deployer/next.config.js | 2 +- apps/cow-amm-deployer/package.json | 10 +- .../(components)/BalancerPriceInformation.tsx | 4 +- .../(components)/CustomPriceInformation.tsx | 2 +- .../(components)/PoolCompositionTable.tsx | 4 +- .../app/amms/[id]/(components)/TokenInfo.tsx | 2 +- .../UniswapV2PriceInformation.tsx | 4 +- .../src/app/amms/[id]/page.tsx | 6 +- .../src/app/new/(components)/AmmForm.tsx | 12 +- .../src/components/AlertCard.tsx | 4 +- .../src/components/Footer.tsx | 2 +- .../src/components/HomeWrapper.tsx | 10 +- apps/cow-amm-deployer/src/lib/cowExplorer.ts | 2 +- apps/cow-amm-deployer/src/lib/gqlBalancer.ts | 14 +- apps/cow-amm-deployer/src/lib/gqlSushi.ts | 8 +- apps/cow-amm-deployer/src/lib/gqlUniswapV2.ts | 6 +- .../src/lib/orderBookApi/fetchCowOrder.ts | 4 +- .../src/lib/orderBookApi/fetchNativePrice.ts | 4 +- apps/cow-amm-deployer/src/lib/schema.ts | 20 +- apps/cow-amm-deployer/src/lib/tokenUtils.ts | 2 +- apps/cow-amm-deployer/tsconfig.json | 2 +- apps/cow-tools/next.config.js | 2 +- apps/cow-tools/package.json | 10 +- .../(components)/OrderTable/TableRowOrder.tsx | 6 +- .../OrderTable/TableRowTransaction.tsx | 34 +- .../(components)/OrderTable/TokenInfo.tsx | 4 +- .../OrderTable/TransactionInfo.tsx | 10 +- .../(components)/SingleOrderForm/Header.tsx | 2 +- .../(components)/SingleOrderForm/Overview.tsx | 10 +- .../SingleOrderForm/PriceChecker.tsx | 60 +- .../PriceCheckerConfirmation.tsx | 2 +- .../(components)/SingleOrderForm/Summary.tsx | 10 +- .../milkman/(components)/TransactionCard.tsx | 6 +- .../app/milkman/[network]/HomePageWrapper.tsx | 2 +- .../src/app/milkman/[network]/layout.tsx | 2 +- .../app/milkman/[network]/order/new/page.tsx | 2 +- .../src/app/milkman/[network]/page.tsx | 2 +- apps/cow-tools/src/app/milkman/layout.tsx | 2 +- apps/cow-tools/src/app/milkman/page.tsx | 4 +- .../src/app/milkman/utils/cowExplorer.ts | 2 +- apps/cow-tools/src/components/AlertCard.tsx | 6 +- apps/cow-tools/src/components/Footer.tsx | 2 +- apps/cow-tools/src/contexts/networks.tsx | 4 +- .../src/hooks/useUserMilkmanTransactions.ts | 62 +- apps/cow-tools/src/lib/cow/fetchCowOrder.ts | 4 +- apps/cow-tools/src/lib/encode.ts | 36 +- apps/cow-tools/src/lib/fetchExpectedOut.ts | 8 +- apps/cow-tools/src/lib/fetchTokenInfo.ts | 4 +- apps/cow-tools/src/lib/fetchTokenUsdPrice.ts | 6 +- apps/cow-tools/src/lib/schema.ts | 22 +- apps/cow-tools/src/lib/transactionFactory.ts | 4 +- apps/cow-tools/tsconfig.json | 2 +- apps/gyro-eclp-api/poetry.lock | 2 +- apps/gyro-eclp-api/pyproject.toml | 6 +- apps/pool-metadata/contracts/package.json | 6 +- apps/pool-metadata/contracts/tsconfig.json | 2 +- apps/pool-metadata/subgraph/package.json | 6 +- apps/pool-metadata/subgraph/tsconfig.json | 2 +- package.json | 10 +- packages/balancer-apr/package.json | 6 +- .../src/lib/balancer/emissions.ts | 10 +- .../balancer-apr/src/lib/balancer/gauges.ts | 10 +- .../balancer-apr/src/lib/defillama/index.ts | 12 +- .../src/lib/etl/extract/extractBlocks.ts | 38 +- .../lib/etl/extract/extractGaugesSnapshot.ts | 8 +- .../lib/etl/extract/extractPoolSnapshots.ts | 10 +- .../src/lib/etl/extract/fetchTokenPrices.ts | 26 +- .../src/lib/etl/extract/getRates.ts | 24 +- .../etl/load/calculatePoolRewardsSnapshots.ts | 2 +- .../etl/load/calculateTokenWeightSnapshots.ts | 36 +- .../src/lib/etl/load/loadBalEmission.ts | 4 +- packages/balancer-apr/tsconfig.json | 2 +- packages/eslint-config/package.json | 4 +- packages/gql/codegen.ts | 10 +- packages/gql/package.json | 6 +- .../gql/src/balancer-api-v3/index.server.ts | 2 +- packages/gql/src/balancer-api-v3/index.ts | 2 +- .../gql/src/balancer-gauges/index.server.ts | 2 +- packages/gql/src/balancer-gauges/index.ts | 2 +- .../balancer-pools-metadata/index.server.ts | 2 +- .../gql/src/balancer-pools-metadata/index.ts | 2 +- packages/gql/src/balancer/index.server.ts | 2 +- packages/gql/src/balancer/index.ts | 2 +- packages/gql/src/sushi/index.server.ts | 2 +- packages/gql/src/sushi/index.ts | 2 +- packages/gql/src/uniswap-v2/index.server.ts | 2 +- packages/gql/src/uniswap-v2/index.ts | 2 +- packages/gql/tsconfig.json | 2 +- packages/math-poolsimulator/package.json | 6 +- packages/math-poolsimulator/tsconfig.json | 2 +- packages/tsconfig/package.json | 2 +- packages/utils/package.json | 4 +- packages/utils/tsconfig.json | 2 +- pnpm-lock.yaml | 25222 +++++++++------- 181 files changed, 14860 insertions(+), 12026 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 9751bfd16..aae80b27f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,3 +1,3 @@ /* eslint-env node */ -module.exports = require("@bleu-fi/eslint-config"); +module.exports = require("@bleu/eslint-config"); diff --git a/.npmrc b/.npmrc index d0a8f90fa..8b32e3cc6 100644 --- a/.npmrc +++ b/.npmrc @@ -4,6 +4,6 @@ strict-peer-dependencies=false ; Yarn Node Linker node-linker=node-modules -; Scoped Registry Configuration for bleu-fi +; Scoped Registry Configuration for bleu @bleu:registry=https://npm.pkg.github.com //npm.pkg.github.com/:_authToken=${NPM_TOKEN} diff --git a/README.md b/README.md index 3939b2ae7..50036ea75 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ A Safe App to interact to create milkman orders on CoW Protocol. ## Repository Structure -The project uses a monorepo structure. See the repo's [wiki](https://github.com/bleu-fi/monorepo/wiki) to find more detail about each project structure. +The project uses a monorepo structure. See the repo's [wiki](https://github.com/bleu/monorepo/wiki) to find more detail about each project structure. ## Pre-requisites @@ -76,8 +76,8 @@ foundryup If you encounter any issues or need assistance: -1. Review our [wiki](https://github.com/bleu-fi/monorepo/wiki) -2. Check [open issues](https://github.com/bleu-fi/monorepo/issues) or create a new one. +1. Review our [wiki](https://github.com/bleu/monorepo/wiki) +2. Check [open issues](https://github.com/bleu/monorepo/issues) or create a new one. 3. Reach out to us at [balancer@bleu.studio](mailto:balancer@bleu.studio). ## Contributors @@ -86,7 +86,7 @@ A heartfelt thanks to all who've contributed: - **Nichollas Rennah** and **Marcos Tullyo**: Initial designs and development of for the metadata app. -Wish to be listed? Make a contribution and [open an issue](https://github.com/bleu-fi/monorepo/issues/new) or send a pull request. +Wish to be listed? Make a contribution and [open an issue](https://github.com/bleu/monorepo/issues/new) or send a pull request. ## Contributing diff --git a/apps/balancer-tools/next.config.js b/apps/balancer-tools/next.config.js index 4e20d7b12..67bcfe2de 100644 --- a/apps/balancer-tools/next.config.js +++ b/apps/balancer-tools/next.config.js @@ -8,7 +8,7 @@ const moduleExports = { // Add the "@sentry/profiling-node" to serverComponentsExternalPackages. serverComponentsExternalPackages: ["@sentry/profiling-node"], }, - transpilePackages: ["@bleu-fi/gql"], + transpilePackages: ["@bleu/gql"], reactStrictMode: true, swcMinify: true, /** @@ -86,5 +86,5 @@ module.exports = withSentryConfig( // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, - }, + } ); diff --git a/apps/balancer-tools/package.json b/apps/balancer-tools/package.json index 1d44533b0..c82071434 100644 --- a/apps/balancer-tools/package.json +++ b/apps/balancer-tools/package.json @@ -1,15 +1,15 @@ { - "name": "@bleu-fi/balancer-tools", + "name": "@bleu/balancer-tools", "version": "0.0.0", "private": true, "scripts": { - "build": "pnpm --filter=\"@bleu-fi/balancer-apr\" build && next build", + "build": "pnpm --filter=\"@bleu/balancer-apr\" build && next build", "build:prepare:gql": "cd ../../ && pnpm run -C=packages/gql graphql:update-types", "build:prepare:wagmi": "pnpm run wagmi", "build:prepare": "pnpm npm-run-all -l --parallel 'build:prepare:gql'", "dev": "pnpm npm-run-all -l --parallel dev:**", "dev:next": "next dev", - "dev:get-pools": "pnpm --filter=\"@bleu-fi/balancer-apr\" build", + "dev:get-pools": "pnpm --filter=\"@bleu/balancer-apr\" build", "start": "next start", "wagmi": "wagmi generate", "wagmi:watch": "wagmi generate --watch", @@ -19,10 +19,10 @@ "test:watch": "pnpm exec jest --watchAll --verbose" }, "dependencies": { - "@bleu-fi/balancer-apr": "workspace:^", - "@bleu-fi/gql": "workspace:*", - "@bleu-fi/math-poolsimulator": "workspace:*", - "@bleu-fi/tsconfig": "workspace:*", + "@bleu/balancer-apr": "workspace:^", + "@bleu/gql": "workspace:*", + "@bleu/math-poolsimulator": "workspace:*", + "@bleu/tsconfig": "workspace:*", "@hookform/resolvers": "3.3.2", "@radix-ui/colors": "^3.0.0", "@radix-ui/react-accordion": "^1.1.2", @@ -75,8 +75,8 @@ "zod": "^3.22.4" }, "devDependencies": { - "@bleu-fi/eslint-config": "workspace:^", - "@bleu-fi/utils": "workspace:^", + "@bleu/eslint-config": "workspace:^", + "@bleu/utils": "workspace:^", "@testing-library/jest-dom": "6.1.6", "@testing-library/react": "^14.1.2", "@testing-library/user-event": "14.5.2", diff --git a/apps/balancer-tools/seed.ts b/apps/balancer-tools/seed.ts index 25388ef70..30efd1d5c 100644 --- a/apps/balancer-tools/seed.ts +++ b/apps/balancer-tools/seed.ts @@ -1,3 +1,3 @@ -import { runETLs } from "@bleu-fi/balancer-apr"; +import { runETLs } from "@bleu/balancer-apr"; runETLs(); diff --git a/apps/balancer-tools/src/__tests__/utils/calculateDepthCost.test.tsx b/apps/balancer-tools/src/__tests__/utils/calculateDepthCost.test.tsx index a49de4f10..7e568829d 100644 --- a/apps/balancer-tools/src/__tests__/utils/calculateDepthCost.test.tsx +++ b/apps/balancer-tools/src/__tests__/utils/calculateDepthCost.test.tsx @@ -1,5 +1,5 @@ -import { AMM } from "@bleu-fi/math-poolsimulator/src"; -import { PoolPairData } from "@bleu-fi/math-poolsimulator/src/types"; +import { AMM } from "@bleu/math-poolsimulator/src"; +import { PoolPairData } from "@bleu/math-poolsimulator/src/types"; import { calculateDepthCost } from "#/app/poolsimulator/(components)/DepthCost"; import { PoolTypeEnum } from "#/app/poolsimulator/(types)"; @@ -37,7 +37,7 @@ describe("calculateDepthCost for Gyro2", () => { beforeAll(async () => { const mockAmmPromise = await convertAnalysisDataToAMM( - mockAnalysisDataGyro2, + mockAnalysisDataGyro2 ); if (!mockAmmPromise) throw new Error("Failed to convert mock analysis data to AMM"); @@ -55,7 +55,7 @@ describe("calculateDepthCost for Gyro2", () => { "out", mockAnalysisDataGyro2, mockAmm, - mockAnalysisDataGyro2.poolType, + mockAnalysisDataGyro2.poolType ); expect(result.type).toBe("price limit"); @@ -70,7 +70,7 @@ describe("calculateDepthCost for Gyro2", () => { "in", mockAnalysisDataGyro2, mockAmm, - mockAnalysisDataGyro2.poolType, + mockAnalysisDataGyro2.poolType ); expect(result.type).toBe("2% of price change"); @@ -94,7 +94,7 @@ describe("calculateDepthCost for MetaStable", () => { beforeAll(async () => { const mockAmmPromise = await convertAnalysisDataToAMM( - mockAnalysisDataMetaStable, + mockAnalysisDataMetaStable ); if (!mockAmmPromise) throw new Error("Failed to convert mock analysis data to AMM"); @@ -108,7 +108,7 @@ describe("calculateDepthCost for MetaStable", () => { "in", mockAnalysisDataMetaStable, mockAmm, - mockAnalysisDataMetaStable.poolType, + mockAnalysisDataMetaStable.poolType ); expect(result.type).toBe("2% of price change"); diff --git a/apps/balancer-tools/src/app/apr/(components)/Breadcrumb.tsx b/apps/balancer-tools/src/app/apr/(components)/Breadcrumb.tsx index 6e81b5630..ad889c64e 100644 --- a/apps/balancer-tools/src/app/apr/(components)/Breadcrumb.tsx +++ b/apps/balancer-tools/src/app/apr/(components)/Breadcrumb.tsx @@ -1,8 +1,8 @@ "use client"; -import { Pool } from "@bleu-fi/balancer-apr/src/lib/balancer/gauges"; -import { Network } from "@bleu-fi/utils"; -import { parseMMDDYYYYToDate } from "@bleu-fi/utils/date"; +import { Pool } from "@bleu/balancer-apr/src/lib/balancer/gauges"; +import { Network } from "@bleu/utils"; +import { parseMMDDYYYYToDate } from "@bleu/utils/date"; import { ChevronRightIcon, ClipboardIcon, @@ -107,7 +107,7 @@ export default function Breadcrumb() { link={generatePoolPageLink( parseMMDDYYYYToDate(searchParams.get("startAt")) as Date, parseMMDDYYYYToDate(searchParams.get("endAt")) as Date, - { network }, + { network } )} > {network} @@ -124,7 +124,7 @@ export default function Breadcrumb() {
diff --git a/apps/balancer-tools/src/app/apr/(components)/HeaderEndButton.tsx b/apps/balancer-tools/src/app/apr/(components)/HeaderEndButton.tsx index e61db7f2a..3d495f09a 100644 --- a/apps/balancer-tools/src/app/apr/(components)/HeaderEndButton.tsx +++ b/apps/balancer-tools/src/app/apr/(components)/HeaderEndButton.tsx @@ -1,7 +1,7 @@ "use client"; -import { capitalize, networkIdFor, networksOnBalancer } from "@bleu-fi/utils"; -import { formatDateToMMDDYYYY, parseMMDDYYYYToDate } from "@bleu-fi/utils/date"; +import { capitalize, networkIdFor, networksOnBalancer } from "@bleu/utils"; +import { formatDateToMMDDYYYY, parseMMDDYYYYToDate } from "@bleu/utils/date"; import { MagnifyingGlassIcon } from "@radix-ui/react-icons"; import { useParams, @@ -43,8 +43,8 @@ export default function HeaderEndButton() { parseMMDDYYYYToDate(startAtParam as string) as Date, parseMMDDYYYYToDate(endAtParam as string) as Date, null, - poolId, - ), + poolId + ) ); }; const avaliableNetworks = Object.keys(networksOnBalancer).map((key) => ({ @@ -77,7 +77,7 @@ export default function HeaderEndButton() { } = values; handleDateUpdate( formatDateToMMDDYYYY(from), - formatDateToMMDDYYYY(to as Date), + formatDateToMMDDYYYY(to as Date) ); }} initialDateFrom={startAtParam ?? undefined} diff --git a/apps/balancer-tools/src/app/apr/(components)/HomeOverviewCards.tsx b/apps/balancer-tools/src/app/apr/(components)/HomeOverviewCards.tsx index 44e6ead58..92f73b2ff 100644 --- a/apps/balancer-tools/src/app/apr/(components)/HomeOverviewCards.tsx +++ b/apps/balancer-tools/src/app/apr/(components)/HomeOverviewCards.tsx @@ -1,6 +1,6 @@ -import * as balEmissions from "@bleu-fi/balancer-apr/src/lib/balancer/emissions"; -import { dateToEpoch } from "@bleu-fi/utils/date"; -import { formatNumber } from "@bleu-fi/utils/formatNumber"; +import * as balEmissions from "@bleu/balancer-apr/src/lib/balancer/emissions"; +import { dateToEpoch } from "@bleu/utils/date"; +import { formatNumber } from "@bleu/utils/formatNumber"; import { getBALPriceForDateRange } from "../(utils)/getBALPriceForDateRange"; import OverviewCards, { getDatesDetails } from "./OverviewCards"; diff --git a/apps/balancer-tools/src/app/apr/(components)/MoreFiltersButton.tsx b/apps/balancer-tools/src/app/apr/(components)/MoreFiltersButton.tsx index 5983993c6..815103b4d 100644 --- a/apps/balancer-tools/src/app/apr/(components)/MoreFiltersButton.tsx +++ b/apps/balancer-tools/src/app/apr/(components)/MoreFiltersButton.tsx @@ -1,6 +1,6 @@ "use client"; -import { capitalize, networksOnBalancer } from "@bleu-fi/utils"; +import { capitalize, networksOnBalancer } from "@bleu/utils"; import * as Accordion from "@radix-ui/react-accordion"; import { MixerHorizontalIcon } from "@radix-ui/react-icons"; import * as Popover from "@radix-ui/react-popover"; @@ -135,7 +135,7 @@ export function MoreFiltersButton() { } return count; }, 0), - [selectedAttributes], + [selectedAttributes] ); return ( diff --git a/apps/balancer-tools/src/app/apr/(components)/OverviewCards.tsx b/apps/balancer-tools/src/app/apr/(components)/OverviewCards.tsx index b2b3b9cef..5b80297d0 100644 --- a/apps/balancer-tools/src/app/apr/(components)/OverviewCards.tsx +++ b/apps/balancer-tools/src/app/apr/(components)/OverviewCards.tsx @@ -1,4 +1,4 @@ -import { formatDate } from "@bleu-fi/utils"; +import { formatDate } from "@bleu/utils"; import { KPI } from "./KPI"; diff --git a/apps/balancer-tools/src/app/apr/(components)/PoolListTable.tsx b/apps/balancer-tools/src/app/apr/(components)/PoolListTable.tsx index 2ebd2e90d..a124b69e4 100644 --- a/apps/balancer-tools/src/app/apr/(components)/PoolListTable.tsx +++ b/apps/balancer-tools/src/app/apr/(components)/PoolListTable.tsx @@ -1,6 +1,6 @@ "use client"; -import { formatNumber } from "@bleu-fi/utils/formatNumber"; +import { formatNumber } from "@bleu/utils/formatNumber"; import { ChevronDownIcon, DashIcon, @@ -72,7 +72,7 @@ export function PoolListTable({ params.set("sort", accessor); return params.toString(); }, - [searchParams], + [searchParams] ); const loadMorePools = async () => { @@ -279,7 +279,7 @@ function APRHover({ apr }: { apr: APRwithoutBreakdown }) { function OrderIcon( searchParams: ReadonlyURLSearchParams, - fieldName: keyof PoolStats, + fieldName: keyof PoolStats ) { if (searchParams.get("sort") !== fieldName) return ; diff --git a/apps/balancer-tools/src/app/apr/(components)/TokenFilterInput.tsx b/apps/balancer-tools/src/app/apr/(components)/TokenFilterInput.tsx index 1807bd744..9ba147c3b 100644 --- a/apps/balancer-tools/src/app/apr/(components)/TokenFilterInput.tsx +++ b/apps/balancer-tools/src/app/apr/(components)/TokenFilterInput.tsx @@ -1,6 +1,6 @@ "use client"; -import POOLS_WITH_LIVE_GAUGES from "@bleu-fi/balancer-apr/src/lib/balancer/data/voting-gauges.json"; +import POOLS_WITH_LIVE_GAUGES from "@bleu/balancer-apr/src/lib/balancer/data/voting-gauges.json"; import { useRouter, useSearchParams } from "next/navigation"; import { MultiSelectDropdown } from "./MultiSelectDropdown"; @@ -8,8 +8,8 @@ import { MultiSelectDropdown } from "./MultiSelectDropdown"; const AVALIABLE_TOKENS = [ ...new Set( POOLS_WITH_LIVE_GAUGES.flatMap((pool) => - pool.tokens.map((token) => token.symbol), - ), + pool.tokens.map((token) => token.symbol) + ) ), ]; diff --git a/apps/balancer-tools/src/app/apr/(components)/TopPoolsChart.tsx b/apps/balancer-tools/src/app/apr/(components)/TopPoolsChart.tsx index e73ef987c..f29b54d9c 100644 --- a/apps/balancer-tools/src/app/apr/(components)/TopPoolsChart.tsx +++ b/apps/balancer-tools/src/app/apr/(components)/TopPoolsChart.tsx @@ -1,6 +1,6 @@ "use client"; -import { formatDate } from "@bleu-fi/utils"; +import { formatDate } from "@bleu/utils"; import { greenDarkA } from "@radix-ui/colors"; import { useRouter } from "next/navigation"; import { Data, PlotMouseEvent, PlotType } from "plotly.js"; @@ -27,7 +27,7 @@ export default function TopPoolsChart({ result.tokens .map( (t) => - `${t.symbol}${t.weight ? `-${(t.weight! * 100).toFixed()}%` : ""}`, + `${t.symbol}${t.weight ? `-${(t.weight! * 100).toFixed()}%` : ""}` ) .join(" "), `${result.apr.total.toFixed()}% APR`, @@ -35,15 +35,15 @@ export default function TopPoolsChart({ const longestyAxisLabelLength = Math.max( ...yAxisLabels.map( - ([tokenNames, aprLabel]) => tokenNames.length + aprLabel.length, - ), + ([tokenNames, aprLabel]) => tokenNames.length + aprLabel.length + ) ); const paddedYAxisLabels = yAxisLabels.map(([tokenNames, aprValue]) => [ tokenNames.padEnd(longestyAxisLabelLength - aprValue.length, " "), aprValue, - ].join(" "), + ].join(" ") ); const chartData: Data = { @@ -65,7 +65,7 @@ export default function TopPoolsChart({ startAt, endAt, null, - clickedRoundData.poolId, + clickedRoundData.poolId ); router.push(poolRedirectURL); } @@ -75,7 +75,7 @@ export default function TopPoolsChart({ `sum(${yieldTokenApr.value})`.as( - "yieldValueSum", + "yieldValueSum" ), }) .from(yieldTokenApr) @@ -30,7 +30,7 @@ export async function fetchAvgDataForPoolIdDateRange( poolExternalId: rewardsTokenApr.poolExternalId, timestamp: rewardsTokenApr.timestamp, rewardValueSum: sql`sum(${rewardsTokenApr.value})`.as( - "rewardValueSum", + "rewardValueSum" ), }) .from(rewardsTokenApr) @@ -41,11 +41,11 @@ export async function fetchAvgDataForPoolIdDateRange( poolExternalId: poolSnapshots.poolExternalId, avgApr: sql`cast(sum(coalesce(${swapFeeApr.value},0) + coalesce(${vebalApr.value},0) + coalesce(${yieldAprSum.yieldValueSum},0) + coalesce(${rewardAprSum.rewardValueSum},0)) / count(${poolSnapshots.timestamp}) as decimal)`.as( - "avgApr", + "avgApr" ), avgLiquidity: sql`cast(sum(${poolSnapshots.liquidity}) / count(${poolSnapshots.timestamp}) as decimal)`.as( - "avgLiquidity", + "avgLiquidity" ), }) .from(poolSnapshots) @@ -53,35 +53,35 @@ export async function fetchAvgDataForPoolIdDateRange( swapFeeApr, and( eq(poolSnapshots.poolExternalId, swapFeeApr.poolExternalId), - eq(poolSnapshots.timestamp, swapFeeApr.timestamp), - ), + eq(poolSnapshots.timestamp, swapFeeApr.timestamp) + ) ) .fullJoin( vebalApr, and( eq(vebalApr.poolExternalId, poolSnapshots.poolExternalId), - eq(vebalApr.timestamp, poolSnapshots.timestamp), - ), + eq(vebalApr.timestamp, poolSnapshots.timestamp) + ) ) .fullJoin( yieldAprSum, and( eq(yieldAprSum.poolExternalId, poolSnapshots.poolExternalId), - eq(yieldAprSum.timestamp, poolSnapshots.timestamp), - ), + eq(yieldAprSum.timestamp, poolSnapshots.timestamp) + ) ) .fullJoin( rewardAprSum, and( eq(rewardAprSum.poolExternalId, poolSnapshots.poolExternalId), - eq(rewardAprSum.timestamp, poolSnapshots.timestamp), - ), + eq(rewardAprSum.timestamp, poolSnapshots.timestamp) + ) ) .where( and( between(poolSnapshots.timestamp, startDate, endDate), - eq(poolSnapshots.poolExternalId, poolId), - ), + eq(poolSnapshots.poolExternalId, poolId) + ) ) .groupBy(poolSnapshots.poolExternalId); diff --git a/apps/balancer-tools/src/app/apr/(utils)/fetchDataForPoolIdDateRange.ts b/apps/balancer-tools/src/app/apr/(utils)/fetchDataForPoolIdDateRange.ts index 7a5c62440..c25ede3d3 100644 --- a/apps/balancer-tools/src/app/apr/(utils)/fetchDataForPoolIdDateRange.ts +++ b/apps/balancer-tools/src/app/apr/(utils)/fetchDataForPoolIdDateRange.ts @@ -1,4 +1,4 @@ -import { db } from "@bleu-fi/balancer-apr/src/db"; +import { db } from "@bleu/balancer-apr/src/db"; import { pools, poolSnapshots, @@ -8,8 +8,8 @@ import { tokens, vebalApr, yieldTokenApr, -} from "@bleu-fi/balancer-apr/src/db/schema"; -import { dateToEpoch, formatDateToMMDDYYYY } from "@bleu-fi/utils/date"; +} from "@bleu/balancer-apr/src/db/schema"; +import { dateToEpoch, formatDateToMMDDYYYY } from "@bleu/utils/date"; import { and, between, eq, sql } from "drizzle-orm"; import { PoolStatsResults } from "./fetchDataTypes"; @@ -18,14 +18,14 @@ import { PoolTypeEnum } from "./types"; export async function fetchDataForPoolIdDateRange( poolId: string, startDate: Date, - endDate: Date, + endDate: Date ): Promise { const yieldAprSum = db .select({ poolExternalId: yieldTokenApr.poolExternalId, timestamp: yieldTokenApr.timestamp, yieldValueSum: sql`sum(${yieldTokenApr.value})`.as( - "yieldValueSum", + "yieldValueSum" ), }) .from(yieldTokenApr) @@ -49,14 +49,14 @@ export async function fetchDataForPoolIdDateRange( poolExternalId: rewardsTokenApr.poolExternalId, timestamp: rewardsTokenApr.timestamp, rewardValueSum: sql`sum(${rewardsTokenApr.value})`.as( - "rewardValueSum", + "rewardValueSum" ), }) .from(rewardsTokenApr) .where( sql.raw( - `rewards_token_apr.period_end - rewards_token_apr.timestamp > interval '1 day'`, - ), + `rewards_token_apr.period_end - rewards_token_apr.timestamp > interval '1 day'` + ) ) .groupBy(rewardsTokenApr.poolExternalId, rewardsTokenApr.timestamp) .as("rewardAprSum"); @@ -78,8 +78,8 @@ export async function fetchDataForPoolIdDateRange( tokens, and( eq(tokens.address, rewardsTokenApr.tokenAddress), - eq(pools.networkSlug, tokens.networkSlug), - ), + eq(pools.networkSlug, tokens.networkSlug) + ) ) .as("rewardAprToken"); @@ -105,36 +105,36 @@ export async function fetchDataForPoolIdDateRange( swapFeeApr, and( eq(poolSnapshots.poolExternalId, swapFeeApr.poolExternalId), - eq(poolSnapshots.timestamp, swapFeeApr.timestamp), - ), + eq(poolSnapshots.timestamp, swapFeeApr.timestamp) + ) ) .fullJoin( vebalApr, and( eq(vebalApr.poolExternalId, poolSnapshots.poolExternalId), - eq(vebalApr.timestamp, poolSnapshots.timestamp), - ), + eq(vebalApr.timestamp, poolSnapshots.timestamp) + ) ) .fullJoin( yieldAprSum, and( eq(yieldAprSum.poolExternalId, poolSnapshots.poolExternalId), - eq(yieldAprSum.timestamp, poolSnapshots.timestamp), - ), + eq(yieldAprSum.timestamp, poolSnapshots.timestamp) + ) ) .fullJoin( rewardAprSum, and( eq(rewardAprSum.poolExternalId, poolSnapshots.poolExternalId), - eq(rewardAprSum.timestamp, poolSnapshots.timestamp), - ), + eq(rewardAprSum.timestamp, poolSnapshots.timestamp) + ) ) .leftJoin(pools, eq(pools.externalId, poolSnapshots.poolExternalId)) .where( and( between(poolSnapshots.timestamp, startDate, endDate), - eq(poolSnapshots.poolExternalId, poolId), - ), + eq(poolSnapshots.poolExternalId, poolId) + ) ) .orderBy(poolSnapshots.timestamp); @@ -151,14 +151,14 @@ export async function fetchDataForPoolIdDateRange( poolSnapshots, and( eq(poolSnapshots.poolExternalId, yieldAprToken.poolExternalId), - eq(poolSnapshots.timestamp, yieldAprToken.timestamp), - ), + eq(poolSnapshots.timestamp, yieldAprToken.timestamp) + ) ) .where( and( between(yieldAprToken.timestamp, startDate, endDate), - eq(poolSnapshots.poolExternalId, poolId), - ), + eq(poolSnapshots.poolExternalId, poolId) + ) ); const rewardAprByToken = await db @@ -175,17 +175,17 @@ export async function fetchDataForPoolIdDateRange( and( eq(poolSnapshots.poolExternalId, rewardAprToken.poolExternalId), eq(poolSnapshots.timestamp, rewardAprToken.timestamp), - eq(poolSnapshots.networkSlug, rewardAprToken.networkSlug), - ), + eq(poolSnapshots.networkSlug, rewardAprToken.networkSlug) + ) ) .where( and( between(rewardAprToken.timestamp, startDate, endDate), sql.raw( - `"rewardAprToken".period_end - "rewardAprToken".timestamp > interval '1 day'`, + `"rewardAprToken".period_end - "rewardAprToken".timestamp > interval '1 day'` ), - eq(rewardAprToken.poolExternalId, poolId), - ), + eq(rewardAprToken.poolExternalId, poolId) + ) ); const poolsTokens = await db @@ -200,8 +200,8 @@ export async function fetchDataForPoolIdDateRange( tokens, and( eq(poolTokens.networkSlug, tokens.networkSlug), - eq(tokens.address, poolTokens.tokenAddress), - ), + eq(tokens.address, poolTokens.tokenAddress) + ) ) .where(eq(poolTokens.poolExternalId, poolId)); @@ -220,12 +220,12 @@ export async function fetchDataForPoolIdDateRange( const yieldAprByDate = yieldAprByToken.filter( (yieldApr) => - dateToEpoch(yieldApr.timestamp) === dateToEpoch(pool.timestamp), + dateToEpoch(yieldApr.timestamp) === dateToEpoch(pool.timestamp) ); const rewardAprByDate = rewardAprByToken.filter( (rewardApr) => - dateToEpoch(rewardApr.timestamp) === dateToEpoch(pool.timestamp), + dateToEpoch(rewardApr.timestamp) === dateToEpoch(pool.timestamp) ); return { diff --git a/apps/balancer-tools/src/app/apr/(utils)/fetchForDateRange.ts b/apps/balancer-tools/src/app/apr/(utils)/fetchForDateRange.ts index 20440a770..7c3a4d912 100644 --- a/apps/balancer-tools/src/app/apr/(utils)/fetchForDateRange.ts +++ b/apps/balancer-tools/src/app/apr/(utils)/fetchForDateRange.ts @@ -1,6 +1,6 @@ /* eslint-disable no-console */ -import { db } from "@bleu-fi/balancer-apr/src/db"; +import { db } from "@bleu/balancer-apr/src/db"; import { pools, poolSnapshots, @@ -10,7 +10,7 @@ import { tokens as tokensTable, vebalApr, yieldTokenApr, -} from "@bleu-fi/balancer-apr/src/db/schema"; +} from "@bleu/balancer-apr/src/db/schema"; import { and, asc, @@ -79,7 +79,7 @@ export async function fetchDataForDateRange({ poolExternalId: rewardsTokenApr.poolExternalId, timestamp: rewardsTokenApr.timestamp, rewardValueSum: sql`sum(${rewardsTokenApr.value})`.as( - "rewardValueSum", + "rewardValueSum" ), }) .from(rewardsTokenApr) @@ -109,24 +109,24 @@ export async function fetchDataForDateRange({ avgApr: avgApr.as("avgApr"), avgFeeApr: sql`cast(sum(${swapFeeApr.value}) / count(${poolSnapshots.id}) as decimal)`.as( - "avgFeeApr", + "avgFeeApr" ), avgVebalApr: sql`cast(sum(${vebalApr.value}) / count(${poolSnapshots.id}) as decimal)`.as( - "avgVebalApr", + "avgVebalApr" ), avgVolume: sql`cast(sum(${poolSnapshots.swapVolume}) / count(${poolSnapshots.id}) as decimal)`.as( - "avgVolume", + "avgVolume" ), avgLiquidity: avgLiquidity.as("avgLiquidity"), avgYieldTokenApr: sql`cast(sum(coalesce(${yieldAprSum.yieldValueSum},0)) / count(${poolSnapshots.id}) as decimal)`.as( - "avgYieldTokenApr", + "avgYieldTokenApr" ), avgRewardTokenApr: sql`cast(sum(coalesce(${rewardAprSum.rewardValueSum},0)) / count(${poolSnapshots.id}) as decimal)`.as( - "avgRewardTokenApr", + "avgRewardTokenApr" ), }) .from(poolSnapshots) @@ -134,34 +134,34 @@ export async function fetchDataForDateRange({ swapFeeApr, and( eq(poolSnapshots.poolExternalId, swapFeeApr.poolExternalId), - eq(poolSnapshots.timestamp, swapFeeApr.timestamp), - ), + eq(poolSnapshots.timestamp, swapFeeApr.timestamp) + ) ) .fullJoin( vebalApr, and( eq(vebalApr.poolExternalId, poolSnapshots.poolExternalId), - eq(vebalApr.timestamp, poolSnapshots.timestamp), - ), + eq(vebalApr.timestamp, poolSnapshots.timestamp) + ) ) .fullJoin( yieldAprSum, and( eq(yieldAprSum.poolExternalId, poolSnapshots.poolExternalId), - eq(yieldAprSum.timestamp, poolSnapshots.timestamp), - ), + eq(yieldAprSum.timestamp, poolSnapshots.timestamp) + ) ) .fullJoin( rewardAprSum, and( eq(rewardAprSum.poolExternalId, poolSnapshots.poolExternalId), - eq(rewardAprSum.timestamp, poolSnapshots.timestamp), - ), + eq(rewardAprSum.timestamp, poolSnapshots.timestamp) + ) ) .innerJoin(pools, eq(pools.externalId, poolSnapshots.poolExternalId)) .innerJoin( poolTokens, - eq(poolTokens.poolExternalId, poolSnapshots.poolExternalId), + eq(poolTokens.poolExternalId, poolSnapshots.poolExternalId) ) .innerJoin(tokensTable, eq(tokensTable.address, poolTokens.tokenAddress)) .where( @@ -176,14 +176,14 @@ export async function fetchDataForDateRange({ : true) as SQLWrapper, (typesArray?.length ? inArray(pools.poolType, typesArray) - : true) as SQLWrapper, - ), + : true) as SQLWrapper + ) ) .groupBy( poolSnapshots.poolExternalId, pools.networkSlug, pools.symbol, - pools.poolType, + pools.poolType ) .orderBy(orderBy) .having(gt(avgApr, 0)) @@ -203,17 +203,17 @@ export async function fetchDataForDateRange({ tokensTable, and( eq(tokensTable.address, poolTokens.tokenAddress), - eq(tokensTable.networkSlug, poolTokens.networkSlug), - ), + eq(tokensTable.networkSlug, poolTokens.networkSlug) + ) ) .where( // @ts-expect-error orderedPoolAprForDate?.length ? inArray( poolTokens.poolExternalId, - orderedPoolAprForDate.map((p) => p.poolExternalId as string), + orderedPoolAprForDate.map((p) => p.poolExternalId as string) ) - : true, + : true ); const returnData = orderedPoolAprForDate.map((pool) => { diff --git a/apps/balancer-tools/src/app/apr/(utils)/getBALPriceForDateRange.ts b/apps/balancer-tools/src/app/apr/(utils)/getBALPriceForDateRange.ts index c7a1c517e..782f04a83 100644 --- a/apps/balancer-tools/src/app/apr/(utils)/getBALPriceForDateRange.ts +++ b/apps/balancer-tools/src/app/apr/(utils)/getBALPriceForDateRange.ts @@ -1,6 +1,6 @@ -import { db } from "@bleu-fi/balancer-apr/src/db"; -import { tokenPrices } from "@bleu-fi/balancer-apr/src/db/schema"; -import { formatNumber } from "@bleu-fi/utils/formatNumber"; +import { db } from "@bleu/balancer-apr/src/db"; +import { tokenPrices } from "@bleu/balancer-apr/src/db/schema"; +import { formatNumber } from "@bleu/utils/formatNumber"; import { and, between, eq, sql } from "drizzle-orm"; const BAL_TOKEN_ADDRESS = "0xba100000625a3754423978a60c9317c58a424e3d"; @@ -17,8 +17,8 @@ export async function getBALPriceForDateRange(startAt: Date, endAt: Date) { .where( and( eq(tokenPrices.tokenAddress, BAL_TOKEN_ADDRESS), - between(tokenPrices.timestamp, startAt, endAt), - ), + between(tokenPrices.timestamp, startAt, endAt) + ) ) .groupBy(tokenPrices.tokenAddress) .execute(); diff --git a/apps/balancer-tools/src/app/apr/(utils)/getFilteredUrl.ts b/apps/balancer-tools/src/app/apr/(utils)/getFilteredUrl.ts index e1d85b338..174e579e2 100644 --- a/apps/balancer-tools/src/app/apr/(utils)/getFilteredUrl.ts +++ b/apps/balancer-tools/src/app/apr/(utils)/getFilteredUrl.ts @@ -1,6 +1,6 @@ -import { Pool } from "@bleu-fi/balancer-apr/src/lib/balancer/gauges"; -import { networkFor } from "@bleu-fi/utils"; -import { formatDateToMMDDYYYY } from "@bleu-fi/utils/date"; +import { Pool } from "@bleu/balancer-apr/src/lib/balancer/gauges"; +import { networkFor } from "@bleu/utils"; +import { formatDateToMMDDYYYY } from "@bleu/utils/date"; import { SearchParams } from "../page"; @@ -34,7 +34,7 @@ function getFilterDataFromParams(searchParams: SearchParams) { // Convert values for each property if needed const convertedParams = Object.fromEntries( - Object.entries(rest).map(([key, value]) => [key, convert(key, value)]), + Object.entries(rest).map(([key, value]) => [key, convert(key, value)]) ); // Merge the converted params with default values @@ -52,7 +52,7 @@ function getFilterDataFromParams(searchParams: SearchParams) { function generateQueryParams( startAt: Date, endAt: Date, - searchParams?: SearchParams | null, + searchParams?: SearchParams | null ) { const filteredData = getFilterDataFromParams(searchParams ?? {}); const uniqueKeys = new Set(["startAt", "endAt"]); @@ -69,7 +69,7 @@ function generateQueryParams( .join("&"); return `startAt=${formatDateToMMDDYYYY(startAt)}&endAt=${formatDateToMMDDYYYY( - endAt, + endAt )}&${params}`; } @@ -78,14 +78,14 @@ export function generatePoolPageLink( endAt: Date, searchParams?: SearchParams | null, poolId?: string, - network?: string, + network?: string ) { const queryParams = generateQueryParams(startAt, endAt, searchParams); if (poolId) { return `/apr/pool/${ network || networkFor(new Pool(poolId).network) }/${poolId}?startAt=${formatDateToMMDDYYYY( - startAt, + startAt )}&endAt=${formatDateToMMDDYYYY(endAt)}`; } else { return `/apr?${queryParams}`; diff --git a/apps/balancer-tools/src/app/apr/(utils)/validate.ts b/apps/balancer-tools/src/app/apr/(utils)/validate.ts index 7edfd384b..306a3165e 100644 --- a/apps/balancer-tools/src/app/apr/(utils)/validate.ts +++ b/apps/balancer-tools/src/app/apr/(utils)/validate.ts @@ -1,7 +1,7 @@ -import POOLS_WITHOUT_GAUGES from "@bleu-fi/balancer-apr/src/lib/balancer/data/pools-without-gauge.json"; -import POOLS_WITH_LIVE_GAUGES from "@bleu-fi/balancer-apr/src/lib/balancer/data/voting-gauges.json"; -import { Network, networksOnBalancer } from "@bleu-fi/utils"; -import { parseMMDDYYYYToDate } from "@bleu-fi/utils/date"; +import POOLS_WITHOUT_GAUGES from "@bleu/balancer-apr/src/lib/balancer/data/pools-without-gauge.json"; +import POOLS_WITH_LIVE_GAUGES from "@bleu/balancer-apr/src/lib/balancer/data/voting-gauges.json"; +import { Network, networksOnBalancer } from "@bleu/utils"; +import { parseMMDDYYYYToDate } from "@bleu/utils/date"; import { z } from "zod"; import { PoolTypeNames } from "./types"; @@ -15,8 +15,8 @@ export const areSupportedNetwork = (value?: string | undefined) => .split(",") .every((val) => Object.values(networksOnBalancer).includes( - val.toLowerCase().trim() as Network, - ), + val.toLowerCase().trim() as Network + ) ); export const areSupportedTypes = (value?: string | undefined) => @@ -31,7 +31,7 @@ const DateSchema = OptionalNullableDate.refine( (date) => date === null || (!isNaN(date.getTime()) && date >= minDate && date <= currentDate), - { message: "Invalid date" }, + { message: "Invalid date" } ); export const QueryParamsPagesSchema = z @@ -40,14 +40,14 @@ export const QueryParamsPagesSchema = z (poolId) => !poolId || POOLS_WITH_LIVE_GAUGES.some( - (g) => g.id.toLowerCase() === poolId?.toLowerCase(), + (g) => g.id.toLowerCase() === poolId?.toLowerCase() ) || //@ts-ignore POOLS_WITHOUT_GAUGES.some( //@ts-ignore - (p) => p.id.toLowerCase() === poolId?.toLowerCase(), + (p) => p.id.toLowerCase() === poolId?.toLowerCase() ), - { message: "Pool with ID not found" }, + { message: "Pool with ID not found" } ), startAt: DateSchema, endAt: DateSchema, @@ -67,5 +67,5 @@ export const QueryParamsPagesSchema = z }, { message: "Both startAt and endAt must be provided together", - }, + } ); diff --git a/apps/balancer-tools/src/app/apr/page.tsx b/apps/balancer-tools/src/app/apr/page.tsx index e029a449d..7cf10fd81 100644 --- a/apps/balancer-tools/src/app/apr/page.tsx +++ b/apps/balancer-tools/src/app/apr/page.tsx @@ -1,4 +1,4 @@ -import { SECONDS_IN_DAY } from "@bleu-fi/utils/date"; +import { SECONDS_IN_DAY } from "@bleu/utils/date"; import { redirect } from "next/navigation"; import { Suspense } from "react"; @@ -32,17 +32,17 @@ export default async function Page({ const parsedParams = QueryParamsPagesSchema.safeParse(searchParams); if (!parsedParams.success) { const oneDayAgoFormated = new Date( - new Date().getTime() - SECONDS_IN_DAY * 1000, + new Date().getTime() - SECONDS_IN_DAY * 1000 ); const fourDaysAgoDateFormated = new Date( - new Date().getTime() - 4 * SECONDS_IN_DAY * 1000, + new Date().getTime() - 4 * SECONDS_IN_DAY * 1000 ); return redirect( generatePoolPageLink( fourDaysAgoDateFormated, oneDayAgoFormated, - searchParams, - ), + searchParams + ) ); } const { startAt: startDate, endAt: endDate } = parsedParams.data; diff --git a/apps/balancer-tools/src/app/apr/pool/(components)/HistoricalCharts/HistoricalChart.tsx b/apps/balancer-tools/src/app/apr/pool/(components)/HistoricalCharts/HistoricalChart.tsx index 47cc66c0d..5002a3705 100644 --- a/apps/balancer-tools/src/app/apr/pool/(components)/HistoricalCharts/HistoricalChart.tsx +++ b/apps/balancer-tools/src/app/apr/pool/(components)/HistoricalCharts/HistoricalChart.tsx @@ -1,6 +1,6 @@ "use client"; -import { formatDate } from "@bleu-fi/utils"; +import { formatDate } from "@bleu/utils"; import { blueDark } from "@radix-ui/colors"; import { Data } from "plotly.js"; import { useState } from "react"; @@ -48,7 +48,7 @@ export default function HistoricalChartWrapper({ aprChartData, feeChartData, tvlChartData, - volumeChartData, + volumeChartData ); const createdAt = Object.values(results.perDay[0])[0].externalCreatedAt; diff --git a/apps/balancer-tools/src/app/apr/pool/(components)/PoolOverviewCards.tsx b/apps/balancer-tools/src/app/apr/pool/(components)/PoolOverviewCards.tsx index 2e9122267..5da869d97 100644 --- a/apps/balancer-tools/src/app/apr/pool/(components)/PoolOverviewCards.tsx +++ b/apps/balancer-tools/src/app/apr/pool/(components)/PoolOverviewCards.tsx @@ -1,6 +1,6 @@ -import { db } from "@bleu-fi/balancer-apr/src/db"; -import { pools } from "@bleu-fi/balancer-apr/src/db/schema"; -import { formatDate } from "@bleu-fi/utils"; +import { db } from "@bleu/balancer-apr/src/db"; +import { pools } from "@bleu/balancer-apr/src/db/schema"; +import { formatDate } from "@bleu/utils"; import { eq } from "drizzle-orm"; import OverviewCards, { @@ -56,7 +56,7 @@ export default async function PoolOverviewCards({ content: formatAPR(results.poolAverage.avgApr), }, ...getDatesDetails(startAt, endAt), - ], + ] ); return ; diff --git a/apps/balancer-tools/src/app/apr/pool/[network]/[poolId]/page.tsx b/apps/balancer-tools/src/app/apr/pool/[network]/[poolId]/page.tsx index 67b906b08..cbe80b48f 100644 --- a/apps/balancer-tools/src/app/apr/pool/[network]/[poolId]/page.tsx +++ b/apps/balancer-tools/src/app/apr/pool/[network]/[poolId]/page.tsx @@ -1,6 +1,6 @@ -import { db } from "@bleu-fi/balancer-apr/src/db"; -import { pools } from "@bleu-fi/balancer-apr/src/db/schema"; -import { SECONDS_IN_DAY } from "@bleu-fi/utils/date"; +import { db } from "@bleu/balancer-apr/src/db"; +import { pools } from "@bleu/balancer-apr/src/db/schema"; +import { SECONDS_IN_DAY } from "@bleu/utils/date"; import { eq } from "drizzle-orm"; import { Metadata, ResolvingMetadata } from "next"; import { redirect } from "next/navigation"; @@ -26,7 +26,7 @@ type Props = { export async function generateMetadata( { params }: Props, - parent: ResolvingMetadata, + parent: ResolvingMetadata ): Promise { const externalId = params.poolId; @@ -61,17 +61,17 @@ export default async function Page({ if (!parsedParams.success) { const oneDayAgoFormated = new Date( - new Date().getTime() - SECONDS_IN_DAY * 1000, + new Date().getTime() - SECONDS_IN_DAY * 1000 ); const threeDaysAgoDateFormated = new Date( - new Date().getTime() - 3 * SECONDS_IN_DAY * 1000, + new Date().getTime() - 3 * SECONDS_IN_DAY * 1000 ); return redirect( generatePoolPageLink( threeDaysAgoDateFormated, oneDayAgoFormated, - searchParams, - ), + searchParams + ) ); } @@ -83,7 +83,7 @@ export default async function Page({ const poolData = await fetchDataForPoolIdDateRange( poolId, startAtDate, - endAtDate, + endAtDate ); const actualNetwork = Object.values(poolData.perDay[0])[0].network; @@ -97,8 +97,8 @@ export default async function Page({ ...searchParams, }, poolId, - actualNetwork, - ), + actualNetwork + ) ); } diff --git a/apps/balancer-tools/src/app/apr/pool/[network]/page.tsx b/apps/balancer-tools/src/app/apr/pool/[network]/page.tsx index 318956edf..2d4aafc9f 100644 --- a/apps/balancer-tools/src/app/apr/pool/[network]/page.tsx +++ b/apps/balancer-tools/src/app/apr/pool/[network]/page.tsx @@ -1,4 +1,4 @@ -import { SECONDS_IN_DAY } from "@bleu-fi/utils/date"; +import { SECONDS_IN_DAY } from "@bleu/utils/date"; import { redirect } from "next/navigation"; import { generatePoolPageLink } from "../../(utils)/getFilteredUrl"; @@ -18,6 +18,6 @@ export default function Page({ searchParams }: { searchParams: SearchParams }) { } return redirect( - generatePoolPageLink(startAtDate as Date, endAtDate as Date, searchParams), + generatePoolPageLink(startAtDate as Date, endAtDate as Date, searchParams) ); } diff --git a/apps/balancer-tools/src/app/gaugescheckpointer/(components)/ConfirmCheckpointsDialog.tsx b/apps/balancer-tools/src/app/gaugescheckpointer/(components)/ConfirmCheckpointsDialog.tsx index 541950c3a..c24debc90 100644 --- a/apps/balancer-tools/src/app/gaugescheckpointer/(components)/ConfirmCheckpointsDialog.tsx +++ b/apps/balancer-tools/src/app/gaugescheckpointer/(components)/ConfirmCheckpointsDialog.tsx @@ -1,5 +1,5 @@ -import { NetworkChainId, NetworkFromNetworkChainId } from "@bleu-fi/utils"; -import { formatNumber } from "@bleu-fi/utils/formatNumber"; +import { NetworkChainId, NetworkFromNetworkChainId } from "@bleu/utils"; +import { formatNumber } from "@bleu/utils/formatNumber"; import { ArrowTopRightIcon } from "@radix-ui/react-icons"; import Link from "next/link"; import { FieldValues, useForm } from "react-hook-form"; @@ -34,11 +34,11 @@ export function ConfirmCheckpointsDialog({ 2, "decimal", "standard", - 0.01, + 0.01 ); const anyArbitrumGauge = selectedGauges.some( - (gauge) => gauge.votingOption.chain === "ARBITRUM", + (gauge) => gauge.votingOption.chain === "ARBITRUM" ); async function onSubmit(data: FieldValues) { diff --git a/apps/balancer-tools/src/app/gaugescheckpointer/(components)/GaugesTable.tsx b/apps/balancer-tools/src/app/gaugescheckpointer/(components)/GaugesTable.tsx index 13bee084e..714f42d95 100644 --- a/apps/balancer-tools/src/app/gaugescheckpointer/(components)/GaugesTable.tsx +++ b/apps/balancer-tools/src/app/gaugescheckpointer/(components)/GaugesTable.tsx @@ -1,6 +1,6 @@ "use client"; -import { NetworkChainId, NetworkFromNetworkChainId } from "@bleu-fi/utils"; -import { formatNumber } from "@bleu-fi/utils/formatNumber"; +import { NetworkChainId, NetworkFromNetworkChainId } from "@bleu/utils"; +import { formatNumber } from "@bleu/utils/formatNumber"; import { ArrowTopRightIcon } from "@radix-ui/react-icons"; import { capitalize } from "lodash"; import Link from "next/link"; @@ -40,7 +40,7 @@ export function GaugesTable({ } const gaugeItemsSortedByBalToMint = gaugeItems.sort( - (a, b) => (b.balToMint || 0) - (a.balToMint || 0), + (a, b) => (b.balToMint || 0) - (a.balToMint || 0) ); return ( diff --git a/apps/balancer-tools/src/app/gaugescheckpointer/[network]/layout.tsx b/apps/balancer-tools/src/app/gaugescheckpointer/[network]/layout.tsx index 87c09050b..8b39beb60 100644 --- a/apps/balancer-tools/src/app/gaugescheckpointer/[network]/layout.tsx +++ b/apps/balancer-tools/src/app/gaugescheckpointer/[network]/layout.tsx @@ -1,6 +1,6 @@ "use client"; -import { Network, networkIdFor } from "@bleu-fi/utils"; +import { Network, networkIdFor } from "@bleu/utils"; import { useContext, useEffect } from "react"; import { NetworksContext } from "#/contexts/networks"; diff --git a/apps/balancer-tools/src/app/gaugescheckpointer/[network]/page.tsx b/apps/balancer-tools/src/app/gaugescheckpointer/[network]/page.tsx index d8d05c677..00ccb3c8c 100644 --- a/apps/balancer-tools/src/app/gaugescheckpointer/[network]/page.tsx +++ b/apps/balancer-tools/src/app/gaugescheckpointer/[network]/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { VeBalGetVotingListQuery } from "@bleu-fi/gql/src/balancer-api-v3/__generated__/Ethereum"; +import { VeBalGetVotingListQuery } from "@bleu/gql/src/balancer-api-v3/__generated__/Ethereum"; import { PlusIcon } from "@radix-ui/react-icons"; import { useEffect, useState } from "react"; @@ -36,7 +36,7 @@ export default function page() { function votingListFilter( votingOption: ArrElement< GetDeepProp - >, + > ) { const currentTimestamp = Math.floor(Date.now() / 1000); return ( @@ -48,7 +48,7 @@ export default function page() { const [gaugeItems, setGaugeItems] = useState([]); async function updateGaugeItems( - votingOptions: GetDeepProp, + votingOptions: GetDeepProp ) { setLoading(true); @@ -56,7 +56,7 @@ export default function page() { const balToMinOnEachGauge = await Promise.all( votingOptionsFiltered?.map(async (votingOption) => { return readBalToMint(votingOption); - }), + }) ); const newGaugeItems = votingOptionsFiltered.map((votingOption, index) => { return { diff --git a/apps/balancer-tools/src/app/gaugescheckpointer/layout.tsx b/apps/balancer-tools/src/app/gaugescheckpointer/layout.tsx index 43c7cd77b..d49fa36d8 100644 --- a/apps/balancer-tools/src/app/gaugescheckpointer/layout.tsx +++ b/apps/balancer-tools/src/app/gaugescheckpointer/layout.tsx @@ -1,6 +1,6 @@ "use client"; -import { Network } from "@bleu-fi/utils"; +import { Network } from "@bleu/utils"; import * as React from "react"; import { useNetwork } from "wagmi"; diff --git a/apps/balancer-tools/src/app/internalmanager/(components)/BatchWithdrawButton.tsx b/apps/balancer-tools/src/app/internalmanager/(components)/BatchWithdrawButton.tsx index 77078a626..9d360330b 100644 --- a/apps/balancer-tools/src/app/internalmanager/(components)/BatchWithdrawButton.tsx +++ b/apps/balancer-tools/src/app/internalmanager/(components)/BatchWithdrawButton.tsx @@ -1,4 +1,4 @@ -import { Address } from "@bleu-fi/utils"; +import { Address } from "@bleu/utils"; import { MinusIcon } from "@radix-ui/react-icons"; import { useAccount, useNetwork } from "wagmi"; diff --git a/apps/balancer-tools/src/app/internalmanager/(components)/TokenSelect.tsx b/apps/balancer-tools/src/app/internalmanager/(components)/TokenSelect.tsx index 57b45fec2..673fa1c09 100644 --- a/apps/balancer-tools/src/app/internalmanager/(components)/TokenSelect.tsx +++ b/apps/balancer-tools/src/app/internalmanager/(components)/TokenSelect.tsx @@ -1,11 +1,7 @@ "use client"; -import { SingleInternalBalanceQuery } from "@bleu-fi/gql/src/balancer/__generated__/Ethereum"; -import { - Address, - addressRegex, - buildBlockExplorerTokenURL, -} from "@bleu-fi/utils"; +import { SingleInternalBalanceQuery } from "@bleu/gql/src/balancer/__generated__/Ethereum"; +import { Address, addressRegex, buildBlockExplorerTokenURL } from "@bleu/utils"; import { ChevronDownIcon, MagnifyingGlassIcon } from "@radix-ui/react-icons"; import { erc20ABI, fetchBalance, multicall } from "@wagmi/core"; import Image from "next/image"; @@ -109,7 +105,7 @@ function TokenModal({ const internalBalancesTokenAdresses = internalBalanceData?.user ?.userInternalBalances ? internalBalanceData.user.userInternalBalances.map((token) => - token.tokenInfo?.address.toLowerCase(), + token.tokenInfo?.address.toLowerCase() ) : []; @@ -142,7 +138,7 @@ function TokenModal({ const data = await multicall({ contracts: tokensContracts }); const walletBalanceData = tokenAdresses.map((tokenAddress, index) => { const token = tokenList.find( - (obj) => obj.address.toLowerCase() === tokenAddress.toLowerCase(), + (obj) => obj.address.toLowerCase() === tokenAddress.toLowerCase() ); const { result } = data[index]; return { @@ -159,7 +155,7 @@ function TokenModal({ const internalBalance = internalBalanceData?.user?.userInternalBalances?.find( (internalBalanceInfo) => - internalBalanceInfo.tokenInfo?.address === token.tokenAddress, + internalBalanceInfo.tokenInfo?.address === token.tokenAddress ); if (internalBalance && internalBalance.tokenInfo) { @@ -323,7 +319,7 @@ function TokenRow({ classNames="hover:bg-blue4 hover:cursor-pointer" onClick={() => { router.push( - `/internalmanager/${chainName}/${operationKind}/token/${token.tokenAddress}`, + `/internalmanager/${chainName}/${operationKind}/token/${token.tokenAddress}` ); }} > diff --git a/apps/balancer-tools/src/app/internalmanager/(components)/TokenTable.tsx b/apps/balancer-tools/src/app/internalmanager/(components)/TokenTable.tsx index 86b546060..de3bf21b4 100644 --- a/apps/balancer-tools/src/app/internalmanager/(components)/TokenTable.tsx +++ b/apps/balancer-tools/src/app/internalmanager/(components)/TokenTable.tsx @@ -1,7 +1,7 @@ "use client"; -import { InternalBalanceQuery } from "@bleu-fi/gql/src/balancer/__generated__/Ethereum"; -import { Address } from "@bleu-fi/utils"; -import { formatNumber } from "@bleu-fi/utils/formatNumber"; +import { InternalBalanceQuery } from "@bleu/gql/src/balancer/__generated__/Ethereum"; +import { Address } from "@bleu/utils"; +import { formatNumber } from "@bleu/utils/formatNumber"; import { MinusCircledIcon, PlusCircledIcon, diff --git a/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/all/page.tsx b/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/all/page.tsx index 4c29d8eaf..ec0fbaf9b 100644 --- a/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/all/page.tsx +++ b/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/all/page.tsx @@ -1,4 +1,4 @@ -import { Network } from "@bleu-fi/utils"; +import { Network } from "@bleu/utils"; import { LinkComponent } from "#/components/Link"; import { operationKindType } from "#/lib/internal-balance-helper"; diff --git a/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/all/withdrawAll.tsx b/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/all/withdrawAll.tsx index 75bfa5519..03357cc1c 100644 --- a/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/all/withdrawAll.tsx +++ b/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/all/withdrawAll.tsx @@ -1,6 +1,6 @@ "use client"; -import { InternalBalanceQuery } from "@bleu-fi/gql/src/balancer/__generated__/Ethereum"; -import { Address, networkFor } from "@bleu-fi/utils"; +import { InternalBalanceQuery } from "@bleu/gql/src/balancer/__generated__/Ethereum"; +import { Address, networkFor } from "@bleu/utils"; import { zodResolver } from "@hookform/resolvers/zod"; import { ArrowLeftIcon } from "@radix-ui/react-icons"; import Image from "next/image"; @@ -127,7 +127,7 @@ export function WithdrawAll() { ( token: ArrElement< GetDeepProp - >, + > ) => ( @@ -160,7 +160,7 @@ export function WithdrawAll() {
- ), + ) )} diff --git a/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/page.tsx b/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/page.tsx index 21fb0ea22..7cf884635 100644 --- a/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/page.tsx +++ b/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { Address, Network, NetworkChainId, networkFor } from "@bleu-fi/utils"; +import { Address, Network, NetworkChainId, networkFor } from "@bleu/utils"; import { ArrowLeftIcon } from "@radix-ui/react-icons"; import { useEffect } from "react"; import { useAccount, useNetwork } from "wagmi"; diff --git a/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/token/[tokenAddress]/page.tsx b/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/token/[tokenAddress]/page.tsx index 1a6e8e646..b9a124ae6 100644 --- a/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/token/[tokenAddress]/page.tsx +++ b/apps/balancer-tools/src/app/internalmanager/[network]/[operationKind]/token/[tokenAddress]/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { SingleInternalBalanceQuery } from "@bleu-fi/gql/src/balancer/__generated__/Ethereum"; +import { SingleInternalBalanceQuery } from "@bleu/gql/src/balancer/__generated__/Ethereum"; import { Address, addressRegex, @@ -8,7 +8,7 @@ import { Network, NetworkChainId, networkFor, -} from "@bleu-fi/utils"; +} from "@bleu/utils"; import { zodResolver } from "@hookform/resolvers/zod"; import { ArrowLeftIcon } from "@radix-ui/react-icons"; import { useEffect, useState } from "react"; diff --git a/apps/balancer-tools/src/app/internalmanager/[network]/layout.tsx b/apps/balancer-tools/src/app/internalmanager/[network]/layout.tsx index 87c09050b..8b39beb60 100644 --- a/apps/balancer-tools/src/app/internalmanager/[network]/layout.tsx +++ b/apps/balancer-tools/src/app/internalmanager/[network]/layout.tsx @@ -1,6 +1,6 @@ "use client"; -import { Network, networkIdFor } from "@bleu-fi/utils"; +import { Network, networkIdFor } from "@bleu/utils"; import { useContext, useEffect } from "react"; import { NetworksContext } from "#/contexts/networks"; diff --git a/apps/balancer-tools/src/app/internalmanager/layout.tsx b/apps/balancer-tools/src/app/internalmanager/layout.tsx index a8daf05f9..4fb6a4f79 100644 --- a/apps/balancer-tools/src/app/internalmanager/layout.tsx +++ b/apps/balancer-tools/src/app/internalmanager/layout.tsx @@ -1,6 +1,6 @@ "use client"; -import { Network } from "@bleu-fi/utils"; +import { Network } from "@bleu/utils"; import * as React from "react"; import { useNetwork } from "wagmi"; diff --git a/apps/balancer-tools/src/app/layout.tsx b/apps/balancer-tools/src/app/layout.tsx index 7ad9bb8bf..5da143326 100644 --- a/apps/balancer-tools/src/app/layout.tsx +++ b/apps/balancer-tools/src/app/layout.tsx @@ -18,7 +18,7 @@ export default function Layout({ children }: { children: React.ReactNode }) { {children}