diff --git a/testData/.eslintignore b/testData/.eslintignore new file mode 100644 index 0000000..f06235c --- /dev/null +++ b/testData/.eslintignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/testData/.eslintrc.cjs b/testData/.eslintrc.cjs new file mode 100644 index 0000000..cdc7d19 --- /dev/null +++ b/testData/.eslintrc.cjs @@ -0,0 +1,6 @@ +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint', 'prettier'], + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], +}; diff --git a/testData/.prettierrc b/testData/.prettierrc new file mode 100644 index 0000000..c3fc280 --- /dev/null +++ b/testData/.prettierrc @@ -0,0 +1,7 @@ +{ + "printWidth": 80, + "tabWidth": 4, + "singleQuote": true, + "bracketSpacing": true, + "semi": true +} diff --git a/testData/bun.lockb b/testData/bun.lockb index 2cc56a0..f3d097c 100755 Binary files a/testData/bun.lockb and b/testData/bun.lockb differ diff --git a/testData/package.json b/testData/package.json index 402ff0e..b864a0b 100644 --- a/testData/package.json +++ b/testData/package.json @@ -3,7 +3,14 @@ "module": "index.ts", "type": "module", "devDependencies": { - "bun-types": "latest" + "@types/bun": "^1.1.6", + "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/parser": "^7.17.0", + "bun-types": "latest", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3" }, "peerDependencies": { "typescript": "^5.0.0" @@ -14,6 +21,9 @@ }, "scripts": { "generate": "bun index.ts false", - "generate:overwrite": "bun index.ts true" + "generate:overwrite": "bun index.ts true", + "format": "prettier --config .prettierrc 'src/**/*.ts' --write", + "lint": "eslint ./src --ext .ts", + "lint:fix": "eslint ./src --ext .ts --fix" } } \ No newline at end of file diff --git a/testData/src/generatePoolTestData.ts b/testData/src/generatePoolTestData.ts index d0f857d..ba758b2 100644 --- a/testData/src/generatePoolTestData.ts +++ b/testData/src/generatePoolTestData.ts @@ -1,57 +1,68 @@ -import type { TestInput, TestOutput } from "./types"; -import { getSwaps } from "./getSwaps"; -import { getPool } from "./getPool"; -import { getAddLiquiditys } from "./getAdds"; -import { getRemoveLiquiditys } from "./getRemoves"; +import type { TestInput, TestOutput } from './types'; +import { getSwaps } from './getSwaps'; +import { getPool } from './getPool'; +import { getAddLiquiditys } from './getAdds'; +import { getRemoveLiquiditys } from './getRemoves'; export async function generatePoolTestData( - input: TestInput, - overwrite = false, + input: TestInput, + overwrite = false, ) { - const path = `./testData/${input.chainId}-${input.blockNumber}-${input.testName}.json`; - if (!overwrite) { - const file = Bun.file(path); - if (await file.exists()) { - console.log("File already exists and overwrite set to false.", path); - return; - } - } - console.log("Generating test data with input:\n", input); - const testData = await fetchTestData(input); - console.log("Saving test data to: ", path); - await Bun.write(path, JSON.stringify(testData, null, 4)); - console.log("Complete"); + const path = `./testData/${input.chainId}-${input.blockNumber}-${input.testName}.json`; + if (!overwrite) { + const file = Bun.file(path); + if (await file.exists()) { + console.log( + 'File already exists and overwrite set to false.', + path, + ); + return; + } + } + console.log('Generating test data with input:\n', input); + const testData = await fetchTestData(input); + console.log('Saving test data to: ', path); + await Bun.write(path, JSON.stringify(testData, null, 4)); + console.log('Complete'); } async function fetchTestData(input: TestInput): Promise { - const { rpcUrl, chainId, poolAddress, poolType, blockNumber, adds, swaps, removes } = - input; - const pool = await getPool( - rpcUrl, - chainId, - blockNumber, - poolType, - poolAddress, - ); - const swapResults = await getSwaps(swaps, rpcUrl, chainId, poolAddress); - const addResults = await getAddLiquiditys( - adds, - rpcUrl, - chainId, - poolAddress, - poolType, - ); - const removeResults = await getRemoveLiquiditys( - removes, - rpcUrl, - chainId, - poolAddress, - poolType - ) - return { - swaps: swapResults, - adds: addResults, - removes: removeResults, - pool, - }; + const { + rpcUrl, + chainId, + poolAddress, + poolType, + blockNumber, + adds, + swaps, + removes, + } = input; + const pool = await getPool( + rpcUrl, + chainId, + blockNumber, + poolType, + poolAddress, + ); + const swapResults = await getSwaps(swaps, rpcUrl, chainId, poolAddress); + const addResults = await getAddLiquiditys( + adds, + rpcUrl, + chainId, + poolAddress, + poolType, + ); + const removeResults = await getRemoveLiquiditys( + removes, + rpcUrl, + chainId, + poolAddress, + poolType, + ); + return { + swaps: swapResults, + adds: addResults, + removes: removeResults, + pool, + }; } diff --git a/testData/src/getAdds.ts b/testData/src/getAdds.ts index fcb6838..84168d3 100644 --- a/testData/src/getAdds.ts +++ b/testData/src/getAdds.ts @@ -1,116 +1,116 @@ import { - AddLiquidityKind, - type AddLiquidityInput, - AddLiquidity, - OnChainProvider, - type AddLiquidityQueryOutput, -} from "@balancer/sdk"; -import type { Address } from "viem"; + AddLiquidityKind, + type AddLiquidityInput, + AddLiquidity, + OnChainProvider, + type AddLiquidityQueryOutput, +} from '@balancer/sdk'; +import type { Address } from 'viem'; type AddTestInputProportional = { - kind: AddLiquidityKind.Proportional; - inputAmountsRaw: bigint[]; - tokens: Address[]; - decimals: number[]; + kind: AddLiquidityKind.Proportional; + inputAmountsRaw: bigint[]; + tokens: Address[]; + decimals: number[]; }; type AddTestInputSingleToken = { - kind: AddLiquidityKind.SingleToken; - bptOutRaw: bigint; - tokenIn: Address; - decimals: number; + kind: AddLiquidityKind.SingleToken; + bptOutRaw: bigint; + tokenIn: Address; + decimals: number; }; export type AddTestInput = AddTestInputProportional | AddTestInputSingleToken; export type AddLiquidityResult = { - kind: AddLiquidityKind; - inputAmountsRaw: string[]; - bptOutRaw: string; + kind: AddLiquidityKind; + inputAmountsRaw: string[]; + bptOutRaw: string; }; function getInput( - addTestInput: AddTestInput, - chainId: number, - rpcUrl: string, + addTestInput: AddTestInput, + chainId: number, + rpcUrl: string, ): AddLiquidityInput { - const { kind } = addTestInput; - if (kind === AddLiquidityKind.Proportional) { - const amounts = addTestInput.inputAmountsRaw.map((a, i) => ({ - rawAmount: a, - decimals: addTestInput.decimals[i], - address: addTestInput.tokens[i], - })); - const addLiquidityInput: AddLiquidityInput = { - amountsIn: amounts, - chainId, - rpcUrl, - kind: AddLiquidityKind.Unbalanced, - }; - return addLiquidityInput; - // biome-ignore lint/style/noUselessElse: - } else if (kind === AddLiquidityKind.SingleToken) { - const bptAmount = { - rawAmount: addTestInput.bptOutRaw, - decimals: addTestInput.decimals, - address: addTestInput.tokenIn, - }; - const addLiquidityInput: AddLiquidityInput = { - bptOut: bptAmount, - tokenIn: addTestInput.tokenIn, - chainId, - rpcUrl, - kind: AddLiquidityKind.SingleToken, - }; - return addLiquidityInput; - // biome-ignore lint/style/noUselessElse: - } else throw new Error("No support for Custom AddLiquidity kinds"); + const { kind } = addTestInput; + if (kind === AddLiquidityKind.Proportional) { + const amounts = addTestInput.inputAmountsRaw.map((a, i) => ({ + rawAmount: a, + decimals: addTestInput.decimals[i], + address: addTestInput.tokens[i], + })); + const addLiquidityInput: AddLiquidityInput = { + amountsIn: amounts, + chainId, + rpcUrl, + kind: AddLiquidityKind.Unbalanced, + }; + return addLiquidityInput; + // biome-ignore lint/style/noUselessElse: + } else if (kind === AddLiquidityKind.SingleToken) { + const bptAmount = { + rawAmount: addTestInput.bptOutRaw, + decimals: addTestInput.decimals, + address: addTestInput.tokenIn, + }; + const addLiquidityInput: AddLiquidityInput = { + bptOut: bptAmount, + tokenIn: addTestInput.tokenIn, + chainId, + rpcUrl, + kind: AddLiquidityKind.SingleToken, + }; + return addLiquidityInput; + // biome-ignore lint/style/noUselessElse: + } else throw new Error('No support for Custom AddLiquidity kinds'); } async function queryAddLiquidity( - rpcUrl: string, - chainId: number, - poolAddress: Address, - poolType: string, - addTestInput: AddTestInput, + rpcUrl: string, + chainId: number, + poolAddress: Address, + poolType: string, + addTestInput: AddTestInput, ): Promise { - const addLiquidityInput = getInput(addTestInput, chainId, rpcUrl); - // Onchain provider is used to fetch pool state - const onchainProvider = new OnChainProvider(rpcUrl, chainId); - const poolState = await onchainProvider.pools.fetchPoolState( - poolAddress, - poolType, - ); - // Simulate addLiquidity to get the amount of BPT out - const addLiquidity = new AddLiquidity(); - return await addLiquidity.query(addLiquidityInput, poolState); + const addLiquidityInput = getInput(addTestInput, chainId, rpcUrl); + // Onchain provider is used to fetch pool state + const onchainProvider = new OnChainProvider(rpcUrl, chainId); + const poolState = await onchainProvider.pools.fetchPoolState( + poolAddress, + poolType, + ); + // Simulate addLiquidity to get the amount of BPT out + const addLiquidity = new AddLiquidity(); + return await addLiquidity.query(addLiquidityInput, poolState); } export async function getAddLiquiditys( - addTestInputs: AddTestInput[], - rpcUrl: string, - chainId: number, - poolAddress: Address, - poolType: string, + addTestInputs: AddTestInput[], + rpcUrl: string, + chainId: number, + poolAddress: Address, + poolType: string, ): Promise { - if (!addTestInputs) return undefined; - const results: AddLiquidityResult[] = []; - console.log("Querying adds..."); - for (const addTestInput of addTestInputs) { - // TODO - put this in a multicall? - const result = await queryAddLiquidity( - rpcUrl, - chainId, - poolAddress, - poolType, - addTestInput, - ); - results.push({ - kind: addTestInput.kind, - inputAmountsRaw: result.amountsIn.map((a) => a.amount.toString()), - bptOutRaw: result.bptOut.amount.toString(), - }); - } - console.log("Done"); - return results; + if (!addTestInputs) return undefined; + const results: AddLiquidityResult[] = []; + console.log('Querying adds...'); + for (const addTestInput of addTestInputs) { + // TODO - put this in a multicall? + const result = await queryAddLiquidity( + rpcUrl, + chainId, + poolAddress, + poolType, + addTestInput, + ); + results.push({ + kind: addTestInput.kind, + inputAmountsRaw: result.amountsIn.map((a) => a.amount.toString()), + bptOutRaw: result.bptOut.amount.toString(), + }); + } + console.log('Done'); + return results; } diff --git a/testData/src/getPool.ts b/testData/src/getPool.ts index e65ee28..a5f45e0 100644 --- a/testData/src/getPool.ts +++ b/testData/src/getPool.ts @@ -1,33 +1,33 @@ -import type { Address } from "viem"; -import { WeightedPool } from "./weightedPool"; -import { StablePool } from "./stablePool"; -import type { PoolBase } from "./types"; +import type { Address } from 'viem'; +import { WeightedPool } from './weightedPool'; +import { StablePool } from './stablePool'; +import type { PoolBase } from './types'; export async function getPool( - rpcUrl: string, - chainId: number, - blockNumber: number, - poolType: string, - poolAddress: Address, + rpcUrl: string, + chainId: number, + blockNumber: number, + poolType: string, + poolAddress: Address, ): Promise { - // Find onchain data fetching via pool type - const poolData = { - Weighted: new WeightedPool(rpcUrl, chainId), - Stable: new StablePool(rpcUrl, chainId), - }; - if (!poolData[poolType]) throw new Error("getPool: Unsupported pool type"); + // Find onchain data fetching via pool type + const poolData = { + Weighted: new WeightedPool(rpcUrl, chainId), + Stable: new StablePool(rpcUrl, chainId), + }; + if (!poolData[poolType]) throw new Error('getPool: Unsupported pool type'); - console.log("Fetching pool data..."); - const immutable = await poolData[poolType].fetchImmutableData(poolAddress); - const mutable = await poolData[poolType].fetchMutableData(poolAddress); - console.log("Done"); + console.log('Fetching pool data...'); + const immutable = await poolData[poolType].fetchImmutableData(poolAddress); + const mutable = await poolData[poolType].fetchMutableData(poolAddress); + console.log('Done'); - return { - chainId, - blockNumber, - poolType, - poolAddress, - ...immutable, - ...mutable, - }; + return { + chainId, + blockNumber, + poolType, + poolAddress, + ...immutable, + ...mutable, + }; } diff --git a/testData/src/getRemoves.ts b/testData/src/getRemoves.ts index ac7527f..cf6bf75 100644 --- a/testData/src/getRemoves.ts +++ b/testData/src/getRemoves.ts @@ -1,141 +1,144 @@ import { - RemoveLiquidityKind, - RemoveLiquidity, - OnChainProvider, - type RemoveLiquidityQueryOutput, - type RemoveLiquidityInput, - type RemoveLiquidityProportionalInput, - type RemoveLiquiditySingleTokenExactInInput, - type RemoveLiquiditySingleTokenExactOutInput, -} from "@balancer/sdk"; -import type { Address } from "viem"; + RemoveLiquidityKind, + RemoveLiquidity, + OnChainProvider, + type RemoveLiquidityQueryOutput, + type RemoveLiquidityInput, + type RemoveLiquidityProportionalInput, + type RemoveLiquiditySingleTokenExactInInput, + type RemoveLiquiditySingleTokenExactOutInput, +} from '@balancer/sdk'; +import type { Address } from 'viem'; type RemoveTestInputProportional = { - bpt: Address; - kind: RemoveLiquidityKind.Proportional; - bptInRaw: bigint; + bpt: Address; + kind: RemoveLiquidityKind.Proportional; + bptInRaw: bigint; }; type RemoveTestInputSingleTokenExactIn = { - bpt: Address; - token: Address; - kind: RemoveLiquidityKind.SingleTokenExactIn; - bptInRaw: bigint; + bpt: Address; + token: Address; + kind: RemoveLiquidityKind.SingleTokenExactIn; + bptInRaw: bigint; }; type RemoveTestInputSingleTokenExactOut = { - token: Address; - kind: RemoveLiquidityKind.SingleTokenExactOut; - amountOutRaw: bigint; - decimals: number + token: Address; + kind: RemoveLiquidityKind.SingleTokenExactOut; + amountOutRaw: bigint; + decimals: number; }; -export type RemoveTestInput = RemoveTestInputProportional | RemoveTestInputSingleTokenExactIn | RemoveTestInputSingleTokenExactOut; +export type RemoveTestInput = + | RemoveTestInputProportional + | RemoveTestInputSingleTokenExactIn + | RemoveTestInputSingleTokenExactOut; export type RemoveLiquidityResult = { - kind: RemoveLiquidityKind; - amountsOutRaw: string[]; - bptInRaw: string; + kind: RemoveLiquidityKind; + amountsOutRaw: string[]; + bptInRaw: string; }; function getInput( - removeTestInput: RemoveTestInput, - chainId: number, - rpcUrl: string, + removeTestInput: RemoveTestInput, + chainId: number, + rpcUrl: string, ): RemoveLiquidityInput { - const { kind } = removeTestInput; + const { kind } = removeTestInput; - if (kind === RemoveLiquidityKind.Proportional) { - const bptIn = { - rawAmount: removeTestInput.bptInRaw, - decimals: 18, - address: removeTestInput.bpt, - }; - const removeLiquidityInput: RemoveLiquidityProportionalInput = { - chainId, - rpcUrl, - bptIn, - kind: RemoveLiquidityKind.Proportional, - }; - return removeLiquidityInput; - // biome-ignore lint/style/noUselessElse: - } else if (kind === RemoveLiquidityKind.SingleTokenExactIn) { - const bptIn = { - rawAmount: removeTestInput.bptInRaw, - decimals: 18, - address: removeTestInput.bpt, - }; - const removeLiquidityInput: RemoveLiquiditySingleTokenExactInInput = { - chainId, - rpcUrl, - tokenOut: removeTestInput.token, - kind: RemoveLiquidityKind.SingleTokenExactIn, - bptIn, - }; - return removeLiquidityInput; - // biome-ignore lint/style/noUselessElse: - } else if (kind === RemoveLiquidityKind.SingleTokenExactOut) { - const amountOut = { - rawAmount: removeTestInput.amountOutRaw, - decimals: removeTestInput.decimals, - address: removeTestInput.token, - }; - const removeLiquidityInput: RemoveLiquiditySingleTokenExactOutInput = { - chainId, - rpcUrl, - kind: RemoveLiquidityKind.SingleTokenExactOut, - amountOut, - }; - return removeLiquidityInput; - } - // biome-ignore lint/style/noUselessElse: - else throw new Error("No support for Custom AddLiquidity kinds"); + if (kind === RemoveLiquidityKind.Proportional) { + const bptIn = { + rawAmount: removeTestInput.bptInRaw, + decimals: 18, + address: removeTestInput.bpt, + }; + const removeLiquidityInput: RemoveLiquidityProportionalInput = { + chainId, + rpcUrl, + bptIn, + kind: RemoveLiquidityKind.Proportional, + }; + return removeLiquidityInput; + // biome-ignore lint/style/noUselessElse: + } else if (kind === RemoveLiquidityKind.SingleTokenExactIn) { + const bptIn = { + rawAmount: removeTestInput.bptInRaw, + decimals: 18, + address: removeTestInput.bpt, + }; + const removeLiquidityInput: RemoveLiquiditySingleTokenExactInInput = { + chainId, + rpcUrl, + tokenOut: removeTestInput.token, + kind: RemoveLiquidityKind.SingleTokenExactIn, + bptIn, + }; + return removeLiquidityInput; + // biome-ignore lint/style/noUselessElse: + } else if (kind === RemoveLiquidityKind.SingleTokenExactOut) { + const amountOut = { + rawAmount: removeTestInput.amountOutRaw, + decimals: removeTestInput.decimals, + address: removeTestInput.token, + }; + const removeLiquidityInput: RemoveLiquiditySingleTokenExactOutInput = { + chainId, + rpcUrl, + kind: RemoveLiquidityKind.SingleTokenExactOut, + amountOut, + }; + return removeLiquidityInput; + } + // biome-ignore lint/style/noUselessElse: + else throw new Error('No support for Custom AddLiquidity kinds'); } async function queryRemoveLiquidity( - rpcUrl: string, - chainId: number, - poolAddress: Address, - poolType: string, - removeTestInput: RemoveTestInput, + rpcUrl: string, + chainId: number, + poolAddress: Address, + poolType: string, + removeTestInput: RemoveTestInput, ): Promise { - const removeLiquidityInput = getInput(removeTestInput, chainId, rpcUrl); - // Onchain provider is used to fetch pool state - const onchainProvider = new OnChainProvider(rpcUrl, chainId); - const poolState = await onchainProvider.pools.fetchPoolState( - poolAddress, - poolType, - ); - // Simulate addLiquidity to get the amount of BPT out - const removeLiquidity = new RemoveLiquidity(); - return await removeLiquidity.query(removeLiquidityInput, poolState); + const removeLiquidityInput = getInput(removeTestInput, chainId, rpcUrl); + // Onchain provider is used to fetch pool state + const onchainProvider = new OnChainProvider(rpcUrl, chainId); + const poolState = await onchainProvider.pools.fetchPoolState( + poolAddress, + poolType, + ); + // Simulate addLiquidity to get the amount of BPT out + const removeLiquidity = new RemoveLiquidity(); + return await removeLiquidity.query(removeLiquidityInput, poolState); } export async function getRemoveLiquiditys( - removeTestInputs: RemoveTestInput[], - rpcUrl: string, - chainId: number, - poolAddress: Address, - poolType: string, + removeTestInputs: RemoveTestInput[], + rpcUrl: string, + chainId: number, + poolAddress: Address, + poolType: string, ): Promise { - if (!removeTestInputs) return undefined; - const results: RemoveLiquidityResult[] = []; - console.log("Querying removes..."); - for (const removeTestInput of removeTestInputs) { - // TODO - put this in a multicall? - const result = await queryRemoveLiquidity( - rpcUrl, - chainId, - poolAddress, - poolType, - removeTestInput, - ); - results.push({ - kind: removeTestInput.kind, - amountsOutRaw: result.amountsOut.map((a) => a.amount.toString()), - bptInRaw: result.bptIn.amount.toString(), - }); - } - console.log("Done"); - return results; + if (!removeTestInputs) return undefined; + const results: RemoveLiquidityResult[] = []; + console.log('Querying removes...'); + for (const removeTestInput of removeTestInputs) { + // TODO - put this in a multicall? + const result = await queryRemoveLiquidity( + rpcUrl, + chainId, + poolAddress, + poolType, + removeTestInput, + ); + results.push({ + kind: removeTestInput.kind, + amountsOutRaw: result.amountsOut.map((a) => a.amount.toString()), + bptInRaw: result.bptIn.amount.toString(), + }); + } + console.log('Done'); + return results; } diff --git a/testData/src/getSwaps.ts b/testData/src/getSwaps.ts index 5c92829..218cafc 100644 --- a/testData/src/getSwaps.ts +++ b/testData/src/getSwaps.ts @@ -1,84 +1,90 @@ -import type { Address } from "viem"; +import type { Address } from 'viem'; import { - SwapKind, - Swap, - type SwapInput as SdkSwapInput, - type ExactInQueryOutput, - type ExactOutQueryOutput, -} from "@balancer/sdk"; + SwapKind, + Swap, + type SwapInput as SdkSwapInput, + type ExactInQueryOutput, + type ExactOutQueryOutput, +} from '@balancer/sdk'; export type SwapInput = { - swapKind: SwapKind; - amountRaw: bigint; - tokenIn: Address; - tokenOut: Address; + swapKind: SwapKind; + amountRaw: bigint; + tokenIn: Address; + tokenOut: Address; }; -export type SwapResult = Omit & { - amountRaw: string; - outputRaw: string; +export type SwapResult = Omit & { + amountRaw: string; + outputRaw: string; }; async function querySwap( - chainId: number, - poolAddress: Address, - rpcUrl: string, - swap: SwapInput, + chainId: number, + poolAddress: Address, + rpcUrl: string, + swap: SwapInput, ): Promise { - const swapInput: SdkSwapInput = { - chainId: chainId, - swapKind: swap.swapKind, - paths: [ - { - pools: [poolAddress], - tokens: [ - { - address: swap.tokenIn, - decimals: 18, - }, // tokenIn - { - address: swap.tokenOut, - decimals: 18, - }, // tokenOut - ], - vaultVersion: 3 as const, - inputAmountRaw: - swap.swapKind === SwapKind.GivenIn ? BigInt(swap.amountRaw) : 0n, - outputAmountRaw: - swap.swapKind === SwapKind.GivenOut ? BigInt(swap.amountRaw) : 0n, - }, - ], - }; - const sdkSwap = new Swap(swapInput); - let result = 0n; - if (swap.swapKind === SwapKind.GivenIn) { - const queryResult = (await sdkSwap.query(rpcUrl)) as ExactInQueryOutput; - result = queryResult.expectedAmountOut.amount; - } else { - const queryResult = (await sdkSwap.query(rpcUrl)) as ExactOutQueryOutput; - result = queryResult.expectedAmountIn.amount; - } - return result; + const swapInput: SdkSwapInput = { + chainId: chainId, + swapKind: swap.swapKind, + paths: [ + { + pools: [poolAddress], + tokens: [ + { + address: swap.tokenIn, + decimals: 18, + }, // tokenIn + { + address: swap.tokenOut, + decimals: 18, + }, // tokenOut + ], + vaultVersion: 3 as const, + inputAmountRaw: + swap.swapKind === SwapKind.GivenIn + ? BigInt(swap.amountRaw) + : 0n, + outputAmountRaw: + swap.swapKind === SwapKind.GivenOut + ? BigInt(swap.amountRaw) + : 0n, + }, + ], + }; + const sdkSwap = new Swap(swapInput); + let result = 0n; + if (swap.swapKind === SwapKind.GivenIn) { + const queryResult = (await sdkSwap.query(rpcUrl)) as ExactInQueryOutput; + result = queryResult.expectedAmountOut.amount; + } else { + const queryResult = (await sdkSwap.query( + rpcUrl, + )) as ExactOutQueryOutput; + result = queryResult.expectedAmountIn.amount; + } + return result; } export async function getSwaps( - swapTestInputs: SwapInput[], - rpcUrl: string, - chainId: number, - poolAddress: Address, + swapTestInputs: SwapInput[], + rpcUrl: string, + chainId: number, + poolAddress: Address, ): Promise { - if (!swapTestInputs) return undefined; - const results: SwapResult[] = []; - console.log("Querying swaps..."); - for (const swap of swapTestInputs) { - // get swap. TODO - put this in a multicall? - const result = await querySwap(chainId, poolAddress, rpcUrl, swap); - results.push({ - ...swap, - amountRaw: swap.amountRaw.toString(), - outputRaw: result.toString(), - }); - } - console.log("Done"); - return results; + if (!swapTestInputs) return undefined; + const results: SwapResult[] = []; + console.log('Querying swaps...'); + for (const swap of swapTestInputs) { + // get swap. TODO - put this in a multicall? + const result = await querySwap(chainId, poolAddress, rpcUrl, swap); + results.push({ + ...swap, + amountRaw: swap.amountRaw.toString(), + outputRaw: result.toString(), + }); + } + console.log('Done'); + return results; } diff --git a/testData/src/stablePool.ts b/testData/src/stablePool.ts index 64dcfa0..dcde422 100644 --- a/testData/src/stablePool.ts +++ b/testData/src/stablePool.ts @@ -1,118 +1,118 @@ import { - type PublicClient, - createPublicClient, - http, - type Address, - parseAbi, - type Chain, -} from "viem"; -import { CHAINS, VAULT_V3, vaultExtensionV3Abi } from "@balancer/sdk"; + type PublicClient, + createPublicClient, + http, + type Address, + parseAbi, + type Chain, +} from 'viem'; +import { CHAINS, VAULT_V3, vaultExtensionV3Abi } from '@balancer/sdk'; import type { - StableImmutable, - StableMutable, -} from "../../typescript/src/stable/data"; + StableImmutable, + StableMutable, +} from '../../typescript/src/stable/data'; type TransformBigintToString = { - [K in keyof T]: T[K] extends bigint - ? string - : T[K] extends bigint[] - ? string[] - : T[K]; + [K in keyof T]: T[K] extends bigint + ? string + : T[K] extends bigint[] + ? string[] + : T[K]; }; export class StablePool { - client: PublicClient; - vault: Address; + client: PublicClient; + vault: Address; - constructor( - public rpcUrl: string, - public chainId: number, - ) { - this.client = createPublicClient({ - transport: http(this.rpcUrl), - chain: CHAINS[this.chainId] as Chain, - }); - this.vault = VAULT_V3[this.chainId]; - } + constructor( + public rpcUrl: string, + public chainId: number, + ) { + this.client = createPublicClient({ + transport: http(this.rpcUrl), + chain: CHAINS[this.chainId] as Chain, + }); + this.vault = VAULT_V3[this.chainId]; + } - async fetchImmutableData( - address: Address, - ): Promise> { - const poolTokensCall = { - address: this.vault, - abi: vaultExtensionV3Abi, - functionName: "getPoolTokenInfo", - args: [address], - } as const; - const tokenRatesCall = { - address: this.vault, - abi: vaultExtensionV3Abi, - functionName: "getPoolTokenRates", - args: [address], - } as const; - const multicallResult = await this.client.multicall({ - contracts: [poolTokensCall, tokenRatesCall], - allowFailure: false, - }); - return { - tokens: multicallResult[0][0].map((token) => token), - scalingFactors: multicallResult[1][0].map((sf) => sf.toString()), - }; - } + async fetchImmutableData( + address: Address, + ): Promise> { + const poolTokensCall = { + address: this.vault, + abi: vaultExtensionV3Abi, + functionName: 'getPoolTokenInfo', + args: [address], + } as const; + const tokenRatesCall = { + address: this.vault, + abi: vaultExtensionV3Abi, + functionName: 'getPoolTokenRates', + args: [address], + } as const; + const multicallResult = await this.client.multicall({ + contracts: [poolTokensCall, tokenRatesCall], + allowFailure: false, + }); + return { + tokens: multicallResult[0][0].map((token) => token), + scalingFactors: multicallResult[1][0].map((sf) => sf.toString()), + }; + } - async fetchMutableData( - address: Address, - ): Promise> { - const staticSwapFeeCall = { - address: this.vault, - abi: vaultExtensionV3Abi, - functionName: "getStaticSwapFeePercentage", - args: [address], - } as const; - const totalSupplyCall = { - address: this.vault, - abi: parseAbi([ - "function totalSupply(address token) external view returns (uint256)", - ]), - functionName: "totalSupply", - args: [address], - } as const; - const liveBalancesCall = { - address: this.vault, - abi: vaultExtensionV3Abi, - functionName: "getCurrentLiveBalances", - args: [address], - } as const; - const tokenRatesCall = { - address: this.vault, - abi: vaultExtensionV3Abi, - functionName: "getPoolTokenRates", - args: [address], - } as const; - const amplificationParameterCall = { - address, - abi: parseAbi([ - "function getAmplificationParameter() external view returns (uint256 value, bool isUpdating, uint256 precision)", - ]), - functionName: "getAmplificationParameter", - } as const; + async fetchMutableData( + address: Address, + ): Promise> { + const staticSwapFeeCall = { + address: this.vault, + abi: vaultExtensionV3Abi, + functionName: 'getStaticSwapFeePercentage', + args: [address], + } as const; + const totalSupplyCall = { + address: this.vault, + abi: parseAbi([ + 'function totalSupply(address token) external view returns (uint256)', + ]), + functionName: 'totalSupply', + args: [address], + } as const; + const liveBalancesCall = { + address: this.vault, + abi: vaultExtensionV3Abi, + functionName: 'getCurrentLiveBalances', + args: [address], + } as const; + const tokenRatesCall = { + address: this.vault, + abi: vaultExtensionV3Abi, + functionName: 'getPoolTokenRates', + args: [address], + } as const; + const amplificationParameterCall = { + address, + abi: parseAbi([ + 'function getAmplificationParameter() external view returns (uint256 value, bool isUpdating, uint256 precision)', + ]), + functionName: 'getAmplificationParameter', + } as const; - const multicallResult = await this.client.multicall({ - contracts: [ - staticSwapFeeCall, - totalSupplyCall, - liveBalancesCall, - tokenRatesCall, - amplificationParameterCall, - ], - allowFailure: false, - }); - return { - swapFee: multicallResult[0].toString(), - totalSupply: multicallResult[1].toString(), - balancesLiveScaled18: multicallResult[2].map((b) => b.toString()), - tokenRates: multicallResult[3][1].map((b) => b.toString()), - amp: multicallResult[4][0].toString(), - }; - } + const multicallResult = await this.client.multicall({ + contracts: [ + staticSwapFeeCall, + totalSupplyCall, + liveBalancesCall, + tokenRatesCall, + amplificationParameterCall, + ], + allowFailure: false, + }); + return { + swapFee: multicallResult[0].toString(), + totalSupply: multicallResult[1].toString(), + balancesLiveScaled18: multicallResult[2].map((b) => b.toString()), + tokenRates: multicallResult[3][1].map((b) => b.toString()), + amp: multicallResult[4][0].toString(), + }; + } } diff --git a/testData/src/types.ts b/testData/src/types.ts index 66b55d1..003f3fb 100644 --- a/testData/src/types.ts +++ b/testData/src/types.ts @@ -1,35 +1,35 @@ -import type { Address } from "viem"; -import type { AddLiquidityResult, AddTestInput } from "./getAdds"; -import type { SwapResult, SwapInput } from "./getSwaps"; -import type { RemoveLiquidityResult, RemoveTestInput } from "./getRemoves"; +import type { Address } from 'viem'; +import type { AddLiquidityResult, AddTestInput } from './getAdds'; +import type { SwapResult, SwapInput } from './getSwaps'; +import type { RemoveLiquidityResult, RemoveTestInput } from './getRemoves'; export type PoolBase = { - chainId: number; - blockNumber: number; - poolType: string; - poolAddress: Address; + chainId: number; + blockNumber: number; + poolType: string; + poolAddress: Address; }; // Read from main test config file export type Config = { - poolTests: PoolTestConfig[]; + poolTests: PoolTestConfig[]; }; // Each pool/chain/block has its own set of swap/add/remove tests type PoolTestConfig = PoolBase & { - testName: string; - swaps: SwapInput[]; - adds: AddTestInput[]; - removes: RemoveTestInput[]; + testName: string; + swaps: SwapInput[]; + adds: AddTestInput[]; + removes: RemoveTestInput[]; }; export type TestInput = PoolTestConfig & { - rpcUrl: string; + rpcUrl: string; }; export type TestOutput = { - pool: PoolBase; - swaps: SwapResult[] | undefined; - adds: AddLiquidityResult[] | undefined; - removes: RemoveLiquidityResult[] | undefined; + pool: PoolBase; + swaps: SwapResult[] | undefined; + adds: AddLiquidityResult[] | undefined; + removes: RemoveLiquidityResult[] | undefined; }; diff --git a/testData/src/weightedPool.ts b/testData/src/weightedPool.ts index 9a05d2a..7f52521 100644 --- a/testData/src/weightedPool.ts +++ b/testData/src/weightedPool.ts @@ -1,122 +1,118 @@ import { - type PublicClient, - createPublicClient, - http, - type Address, - parseAbi, - type Chain, -} from "viem"; -import { - CHAINS, - VAULT_V3, - vaultExtensionV3Abi, -} from "@balancer/sdk"; + type PublicClient, + createPublicClient, + http, + type Address, + parseAbi, + type Chain, +} from 'viem'; +import { CHAINS, VAULT_V3, vaultExtensionV3Abi } from '@balancer/sdk'; import type { - WeightedImmutable, - WeightedMutable, -} from "../../typescript/src/weighted/data"; + WeightedImmutable, + WeightedMutable, +} from '../../typescript/src/weighted/data'; type TransformBigintToString = { - [K in keyof T]: T[K] extends bigint - ? string - : T[K] extends bigint[] - ? string[] - : T[K]; + [K in keyof T]: T[K] extends bigint + ? string + : T[K] extends bigint[] + ? string[] + : T[K]; }; export class WeightedPool { - client: PublicClient; - vault: Address; + client: PublicClient; + vault: Address; - constructor( - public rpcUrl: string, - public chainId: number, - ) { - this.client = createPublicClient({ - transport: http(this.rpcUrl), - chain: CHAINS[this.chainId] as Chain, - }); - this.vault = VAULT_V3[this.chainId]; - } + constructor( + public rpcUrl: string, + public chainId: number, + ) { + this.client = createPublicClient({ + transport: http(this.rpcUrl), + chain: CHAINS[this.chainId] as Chain, + }); + this.vault = VAULT_V3[this.chainId]; + } - async fetchImmutableData( - address: Address, - ): Promise> { - const poolTokensCall = { - address: this.vault, - abi: vaultExtensionV3Abi, - functionName: "getPoolTokenInfo", - args: [address], - } as const; - const tokenRatesCall = { - address: this.vault, - abi: vaultExtensionV3Abi, - functionName: "getPoolTokenRates", - args: [address], - } as const; - const tokenWeightsCall = { - address, - abi: parseAbi([ - "function getNormalizedWeights() external view returns (uint256[] memory)", - ]), - functionName: "getNormalizedWeights", - } as const; + async fetchImmutableData( + address: Address, + ): Promise> { + const poolTokensCall = { + address: this.vault, + abi: vaultExtensionV3Abi, + functionName: 'getPoolTokenInfo', + args: [address], + } as const; + const tokenRatesCall = { + address: this.vault, + abi: vaultExtensionV3Abi, + functionName: 'getPoolTokenRates', + args: [address], + } as const; + const tokenWeightsCall = { + address, + abi: parseAbi([ + 'function getNormalizedWeights() external view returns (uint256[] memory)', + ]), + functionName: 'getNormalizedWeights', + } as const; - const multicallResult = await this.client.multicall({ - contracts: [poolTokensCall, tokenRatesCall, tokenWeightsCall], - allowFailure: false, - }); - return { - tokens: multicallResult[0][0].map((token) => token), - scalingFactors: multicallResult[1][0].map((sf) => sf.toString()), - weights: multicallResult[2].map((w) => w.toString()), - }; - } + const multicallResult = await this.client.multicall({ + contracts: [poolTokensCall, tokenRatesCall, tokenWeightsCall], + allowFailure: false, + }); + return { + tokens: multicallResult[0][0].map((token) => token), + scalingFactors: multicallResult[1][0].map((sf) => sf.toString()), + weights: multicallResult[2].map((w) => w.toString()), + }; + } - async fetchMutableData( - address: Address, - ): Promise> { - const staticSwapFeeCall = { - address: this.vault, - abi: vaultExtensionV3Abi, - functionName: "getStaticSwapFeePercentage", - args: [address], - } as const; - const totalSupplyCall = { - address: this.vault, - abi: parseAbi([ - "function totalSupply(address token) external view returns (uint256)", - ]), - functionName: "totalSupply", - args: [address], - } as const; - const liveBalancesCall = { - address: this.vault, - abi: vaultExtensionV3Abi, - functionName: "getCurrentLiveBalances", - args: [address], - } as const; - const tokenRatesCall = { - address: this.vault, - abi: vaultExtensionV3Abi, - functionName: "getPoolTokenRates", - args: [address], - } as const; + async fetchMutableData( + address: Address, + ): Promise> { + const staticSwapFeeCall = { + address: this.vault, + abi: vaultExtensionV3Abi, + functionName: 'getStaticSwapFeePercentage', + args: [address], + } as const; + const totalSupplyCall = { + address: this.vault, + abi: parseAbi([ + 'function totalSupply(address token) external view returns (uint256)', + ]), + functionName: 'totalSupply', + args: [address], + } as const; + const liveBalancesCall = { + address: this.vault, + abi: vaultExtensionV3Abi, + functionName: 'getCurrentLiveBalances', + args: [address], + } as const; + const tokenRatesCall = { + address: this.vault, + abi: vaultExtensionV3Abi, + functionName: 'getPoolTokenRates', + args: [address], + } as const; - const multicallResult = await this.client.multicall({ - contracts: [ - staticSwapFeeCall, - totalSupplyCall, - liveBalancesCall, - tokenRatesCall - ], - allowFailure: false, - }); - return { - swapFee: multicallResult[0].toString(), - totalSupply: multicallResult[1].toString(), - balancesLiveScaled18: multicallResult[2].map((b) => b.toString()), - tokenRates: multicallResult[3][1].map((b) => b.toString()), - }; - } + const multicallResult = await this.client.multicall({ + contracts: [ + staticSwapFeeCall, + totalSupplyCall, + liveBalancesCall, + tokenRatesCall, + ], + allowFailure: false, + }); + return { + swapFee: multicallResult[0].toString(), + totalSupply: multicallResult[1].toString(), + balancesLiveScaled18: multicallResult[2].map((b) => b.toString()), + tokenRates: multicallResult[3][1].map((b) => b.toString()), + }; + } } diff --git a/testData/tsconfig.json b/testData/tsconfig.json index 65b2991..6728972 100644 --- a/testData/tsconfig.json +++ b/testData/tsconfig.json @@ -15,9 +15,6 @@ "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "allowJs": true, - "types": [ - "bun-types" // add Bun global - ] }, "files": [ "../typescript/src/weighted/data.ts", diff --git a/typescript/.eslintignore b/typescript/.eslintignore new file mode 100644 index 0000000..f06235c --- /dev/null +++ b/typescript/.eslintignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/typescript/.eslintrc.js b/typescript/.eslintrc.js new file mode 100644 index 0000000..cdc7d19 --- /dev/null +++ b/typescript/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint', 'prettier'], + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], +}; diff --git a/typescript/.prettierrc b/typescript/.prettierrc new file mode 100644 index 0000000..c3fc280 --- /dev/null +++ b/typescript/.prettierrc @@ -0,0 +1,7 @@ +{ + "printWidth": 80, + "tabWidth": 4, + "singleQuote": true, + "bracketSpacing": true, + "semi": true +} diff --git a/typescript/biome.json b/typescript/biome.json deleted file mode 100644 index 5d2eb7a..0000000 --- a/typescript/biome.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/1.4.1/schema.json", - "files": { - "ignore": ["./node_modules", "dist", "pnpm-lock.yaml", "./local"] - }, - "organizeImports": { - "ignore": ["."] - }, - "formatter": { - "enabled": true, - "indentStyle": "space", - "indentWidth": 4, - "lineWidth": 80 - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true, - "correctness": { - "noUnusedVariables": "error" - }, - "complexity": { - "noForEach": "off", - "noStaticOnlyClass": "off" - }, - "performance": { - "noDelete": "off" - }, - "style": { - "noNonNullAssertion": "off", - "useShorthandArrayType": "error", - "noUselessElse": "off" - }, - "suspicious": { - "noArrayIndexKey": "off", - "noExplicitAny": "off" - } - } - }, - "javascript": { - "formatter": { - "quoteStyle": "single", - "trailingComma": "all", - "semicolons": "always" - } - } -} diff --git a/typescript/package.json b/typescript/package.json index bd2a14a..18e4253 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -19,20 +19,25 @@ ], "scripts": { "build": "tsup", - "format": "biome format --write .", - "lint": "dpdm -T ./src && biome check .", - "lint:fix": "biome check . --apply", + "format": "prettier --config .prettierrc 'src/**/*.ts' --write", + "lint": "dpdm -T ./src && eslint ./src --ext .ts", + "lint:fix": "eslint ./src --ext .ts --fix", "test": "vitest dev", "test:ci": "vitest run", "changeset": "changeset", "changeset:release": "pnpm build && changeset publish" }, "devDependencies": { - "@biomejs/biome": "^1.5.2", "@changesets/cli": "^2.27.1", "@types/node": "^18.19.7", + "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/parser": "^7.17.0", "dotenv": "^16.3.1", "dpdm": "^3.14.0", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", "ts-node": "^10.9.2", "tsup": "^8.0.1", "typescript": "^5.3.3", diff --git a/typescript/pnpm-lock.yaml b/typescript/pnpm-lock.yaml index b992280..42c908f 100644 --- a/typescript/pnpm-lock.yaml +++ b/typescript/pnpm-lock.yaml @@ -5,21 +5,36 @@ settings: excludeLinksFromLockfile: false devDependencies: - '@biomejs/biome': - specifier: ^1.5.2 - version: 1.5.2 '@changesets/cli': specifier: ^2.27.1 version: 2.27.1 '@types/node': specifier: ^18.19.7 version: 18.19.7 + '@typescript-eslint/eslint-plugin': + specifier: ^7.17.0 + version: 7.17.0(@typescript-eslint/parser@7.17.0)(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/parser': + specifier: ^7.17.0 + version: 7.17.0(eslint@8.57.0)(typescript@5.3.3) dotenv: specifier: ^16.3.1 version: 16.3.1 dpdm: specifier: ^3.14.0 version: 3.14.0 + eslint: + specifier: ^8.56.0 + version: 8.57.0 + eslint-config-prettier: + specifier: ^9.1.0 + version: 9.1.0(eslint@8.57.0) + eslint-plugin-prettier: + specifier: ^5.2.1 + version: 5.2.1(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.3.3) + prettier: + specifier: ^3.3.3 + version: 3.3.3 ts-node: specifier: ^10.9.2 version: 10.9.2(@types/node@18.19.7)(typescript@5.3.3) @@ -68,94 +83,6 @@ packages: regenerator-runtime: 0.14.1 dev: true - /@biomejs/biome@1.5.2: - resolution: {integrity: sha512-LhycxGQBQLmfv6M3e4tMfn/XKcUWyduDYOlCEBrHXJ2mMth2qzYt1JWypkWp+XmU/7Hl2dKvrP4mZ5W44+nWZw==} - engines: {node: '>=14.*'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@biomejs/cli-darwin-arm64': 1.5.2 - '@biomejs/cli-darwin-x64': 1.5.2 - '@biomejs/cli-linux-arm64': 1.5.2 - '@biomejs/cli-linux-arm64-musl': 1.5.2 - '@biomejs/cli-linux-x64': 1.5.2 - '@biomejs/cli-linux-x64-musl': 1.5.2 - '@biomejs/cli-win32-arm64': 1.5.2 - '@biomejs/cli-win32-x64': 1.5.2 - dev: true - - /@biomejs/cli-darwin-arm64@1.5.2: - resolution: {integrity: sha512-3JVl08aHKsPyf0XL9SEj1lssIMmzOMAn2t1zwZKBiy/mcZdb0vuyMSTM5haMQ/90wEmrkYN7zux777PHEGrGiw==} - engines: {node: '>=14.*'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@biomejs/cli-darwin-x64@1.5.2: - resolution: {integrity: sha512-QAPW9rZb/AgucUx+ogMg+9eJNipQDqvabktC5Tx4Aqb/mFzS6eDqNP7O0SbGz3DtC5Y2LATEj6o6zKIQ4ZT+3w==} - engines: {node: '>=14.*'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@biomejs/cli-linux-arm64-musl@1.5.2: - resolution: {integrity: sha512-Z29SjaOyO4QfajplNXSjLx17S79oPN42D094zjE24z7C7p3NxvLhKLygtSP9emgaXkcoESe2chOzF4IrGy/rlg==} - engines: {node: '>=14.*'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@biomejs/cli-linux-arm64@1.5.2: - resolution: {integrity: sha512-fVLrUgIlo05rO4cNu+Py5EwwmXnXhWH+8KrNlWkr2weMYjq85SihUsuWWKpmqU+bUVR+m5gwfcIXZVWYVCJMHw==} - engines: {node: '>=14.*'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@biomejs/cli-linux-x64-musl@1.5.2: - resolution: {integrity: sha512-ZolquPEjWYUmGeERS8svHOOT7OXEeoriPnV8qptgWJmYF9EO9HUGRn1UtCvdVziDYK+u1A7PxjOdkY1B00ty5A==} - engines: {node: '>=14.*'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@biomejs/cli-linux-x64@1.5.2: - resolution: {integrity: sha512-ixqJtUHtF0ho1+1DTZQLAEwHGSqvmvHhAAFXZQoaSdABn+IcITYExlFVA3bGvASy/xtPjRhTx42hVwPtLwMHwg==} - engines: {node: '>=14.*'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@biomejs/cli-win32-arm64@1.5.2: - resolution: {integrity: sha512-DN4cXSAoFTdjOoh7f+JITj1uQgQSXt+1pVea9bFrpbgip+ZwkONqQq+jUcmFMMehbp9LuiVtNXFz/ReHn6FY7A==} - engines: {node: '>=14.*'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@biomejs/cli-win32-x64@1.5.2: - resolution: {integrity: sha512-YvWWXZmk936FdrXqc2jcP6rfsXsNBIs9MKBQQoVXIihwNNRiAaBD9Iwa/ouU1b7Zxq2zETgeuRewVJickFuVOw==} - engines: {node: '>=14.*'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@changesets/apply-release-plan@7.0.1: resolution: {integrity: sha512-aPdSq/R++HOyfEeBGjEe6LNG8gs0KMSyRETD/J2092OkNq8mOioAxyKjMbvVUdzgr/HTawzMOz7lfw339KnsCA==} dependencies: @@ -553,6 +480,65 @@ packages: dev: true optional: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.57.0): + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.57.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@eslint-community/regexpp@4.11.0: + resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: true + + /@eslint/eslintrc@2.1.4: + resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 9.6.1 + globals: 13.24.0 + ignore: 5.3.1 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@eslint/js@8.57.0: + resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /@humanwhocodes/config-array@0.11.14: + resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} + engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead + dependencies: + '@humanwhocodes/object-schema': 2.0.3 + debug: 4.3.4 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@humanwhocodes/module-importer@1.0.1: + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + dev: true + + /@humanwhocodes/object-schema@2.0.3: + resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + deprecated: Use @eslint/object-schema instead + dev: true + /@isaacs/cliui@8.0.2: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -657,6 +643,11 @@ packages: dev: true optional: true + /@pkgr/core@0.1.1: + resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} + engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + dev: true + /@rollup/rollup-android-arm-eabi@4.17.2: resolution: {integrity: sha512-NM0jFxY8bB8QLkoKxIQeObCaDlJKewVlIEkuyYKm5An1tdVZ966w2+MPQ2l8LBZLjR+SgyV+nRkTIunzOYBMLQ==} cpu: [arm] @@ -831,6 +822,137 @@ packages: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} dev: true + /@typescript-eslint/eslint-plugin@7.17.0(@typescript-eslint/parser@7.17.0)(eslint@8.57.0)(typescript@5.3.3): + resolution: {integrity: sha512-pyiDhEuLM3PuANxH7uNYan1AaFs5XE0zw1hq69JBvGvE7gSuEoQl1ydtEe/XQeoC3GQxLXyOVa5kNOATgM638A==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + '@typescript-eslint/parser': ^7.0.0 + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.11.0 + '@typescript-eslint/parser': 7.17.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 7.17.0 + '@typescript-eslint/type-utils': 7.17.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/utils': 7.17.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 7.17.0 + eslint: 8.57.0 + graphemer: 1.4.0 + ignore: 5.3.1 + natural-compare: 1.4.0 + ts-api-utils: 1.3.0(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/parser@7.17.0(eslint@8.57.0)(typescript@5.3.3): + resolution: {integrity: sha512-puiYfGeg5Ydop8eusb/Hy1k7QmOU6X3nvsqCgzrB2K4qMavK//21+PzNE8qeECgNOIoertJPUC1SpegHDI515A==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 7.17.0 + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/typescript-estree': 7.17.0(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 7.17.0 + debug: 4.3.4 + eslint: 8.57.0 + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/scope-manager@7.17.0: + resolution: {integrity: sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/visitor-keys': 7.17.0 + dev: true + + /@typescript-eslint/type-utils@7.17.0(eslint@8.57.0)(typescript@5.3.3): + resolution: {integrity: sha512-XD3aaBt+orgkM/7Cei0XNEm1vwUxQ958AOLALzPlbPqb8C1G8PZK85tND7Jpe69Wualri81PLU+Zc48GVKIMMA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 7.17.0(typescript@5.3.3) + '@typescript-eslint/utils': 7.17.0(eslint@8.57.0)(typescript@5.3.3) + debug: 4.3.4 + eslint: 8.57.0 + ts-api-utils: 1.3.0(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/types@7.17.0: + resolution: {integrity: sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==} + engines: {node: ^18.18.0 || >=20.0.0} + dev: true + + /@typescript-eslint/typescript-estree@7.17.0(typescript@5.3.3): + resolution: {integrity: sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/visitor-keys': 7.17.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.4 + semver: 7.6.2 + ts-api-utils: 1.3.0(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/utils@7.17.0(eslint@8.57.0)(typescript@5.3.3): + resolution: {integrity: sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@typescript-eslint/scope-manager': 7.17.0 + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/typescript-estree': 7.17.0(typescript@5.3.3) + eslint: 8.57.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/visitor-keys@7.17.0: + resolution: {integrity: sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==} + engines: {node: ^18.18.0 || >=20.0.0} + dependencies: + '@typescript-eslint/types': 7.17.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@ungap/structured-clone@1.2.0: + resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + dev: true + /@vitest/expect@1.2.0: resolution: {integrity: sha512-H+2bHzhyvgp32o7Pgj2h9RTHN0pgYaoi26Oo3mE+dCi1PAqV31kIIVfTbqMO3Bvshd5mIrJLc73EwSRrbol9Lw==} dependencies: @@ -870,6 +992,14 @@ packages: pretty-format: 29.7.0 dev: true + /acorn-jsx@5.3.2(acorn@8.12.1): + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 8.12.1 + dev: true + /acorn-walk@8.3.2: resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} engines: {node: '>=0.4.0'} @@ -881,6 +1011,21 @@ packages: hasBin: true dev: true + /acorn@8.12.1: + resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + /ajv@6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + dev: true + /ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} @@ -942,6 +1087,10 @@ packages: sprintf-js: 1.0.3 dev: true + /argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + dev: true + /array-buffer-byte-length@1.0.1: resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} engines: {node: '>= 0.4'} @@ -1023,6 +1172,13 @@ packages: readable-stream: 3.6.2 dev: true + /brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + /brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} dependencies: @@ -1075,6 +1231,11 @@ packages: set-function-length: 1.2.2 dev: true + /callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + dev: true + /camelcase-keys@6.2.2: resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} engines: {node: '>=8'} @@ -1209,6 +1370,10 @@ packages: engines: {node: '>= 6'} dev: true + /concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true + /confbox@0.1.7: resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} dev: true @@ -1315,6 +1480,10 @@ packages: type-detect: 4.0.8 dev: true + /deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + dev: true + /defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} dependencies: @@ -1361,6 +1530,13 @@ packages: path-type: 4.0.0 dev: true + /doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + dependencies: + esutils: 2.0.3 + dev: true + /dotenv@16.3.1: resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} engines: {node: '>=12'} @@ -1541,18 +1717,146 @@ packages: engines: {node: '>=0.8.0'} dev: true + /escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + dev: true + + /eslint-config-prettier@9.1.0(eslint@8.57.0): + resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + dependencies: + eslint: 8.57.0 + dev: true + + /eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.3.3): + resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + '@types/eslint': '>=8.0.0' + eslint: '>=8.0.0' + eslint-config-prettier: '*' + prettier: '>=3.0.0' + peerDependenciesMeta: + '@types/eslint': + optional: true + eslint-config-prettier: + optional: true + dependencies: + eslint: 8.57.0 + eslint-config-prettier: 9.1.0(eslint@8.57.0) + prettier: 3.3.3 + prettier-linter-helpers: 1.0.0 + synckit: 0.9.1 + dev: true + + /eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: true + + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /eslint@8.57.0: + resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/regexpp': 4.11.0 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.57.0 + '@humanwhocodes/config-array': 0.11.14 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.0 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.6.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 + ignore: 5.3.1 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.4 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + + /espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) + eslint-visitor-keys: 3.4.3 + dev: true + /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true dev: true + /esquery@1.6.0: + resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + dev: true + + /esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + dependencies: + estraverse: 5.3.0 + dev: true + + /estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + dev: true + /estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} dependencies: '@types/estree': 1.0.5 dev: true + /esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: true + /execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -1596,6 +1900,14 @@ packages: tmp: 0.0.33 dev: true + /fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + dev: true + + /fast-diff@1.3.0: + resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} + dev: true + /fast-glob@3.3.2: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} @@ -1607,12 +1919,27 @@ packages: micromatch: 4.0.6 dev: true + /fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: true + + /fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + dev: true + /fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} dependencies: reusify: 1.0.4 dev: true + /file-entry-cache@6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flat-cache: 3.2.0 + dev: true + /fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -1643,6 +1970,19 @@ packages: pkg-dir: 4.2.0 dev: true + /flat-cache@3.2.0: + resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flatted: 3.3.1 + keyv: 4.5.4 + rimraf: 3.0.2 + dev: true + + /flatted@3.3.1: + resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + dev: true + /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: @@ -1684,6 +2024,10 @@ packages: universalify: 0.1.2 dev: true + /fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true + /fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -1756,6 +2100,13 @@ packages: is-glob: 4.0.3 dev: true + /glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + dependencies: + is-glob: 4.0.3 + dev: true + /glob@10.3.15: resolution: {integrity: sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==} engines: {node: '>=16 || 14 >=14.18'} @@ -1768,6 +2119,25 @@ packages: path-scurry: 1.11.1 dev: true + /glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.20.2 + dev: true + /globalthis@1.0.4: resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} engines: {node: '>= 0.4'} @@ -1802,6 +2172,10 @@ packages: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} dev: true + /graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: true + /hard-rejection@2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} engines: {node: '>=6'} @@ -1885,11 +2259,32 @@ packages: engines: {node: '>= 4'} dev: true + /import-fresh@3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: true + + /imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + dev: true + /indent-string@4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} dev: true + /inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true @@ -2000,6 +2395,11 @@ packages: engines: {node: '>=0.12.0'} dev: true + /is-path-inside@3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + dev: true + /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} @@ -2108,10 +2508,29 @@ packages: esprima: 4.0.1 dev: true + /js-yaml@4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + dependencies: + argparse: 2.0.1 + dev: true + + /json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + dev: true + /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} dev: true + /json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + dev: true + + /json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + dev: true + /jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: @@ -2126,6 +2545,12 @@ packages: graceful-fs: 4.2.11 dev: true + /keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + dependencies: + json-buffer: 3.0.1 + dev: true + /kind-of@6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} @@ -2136,6 +2561,14 @@ packages: engines: {node: '>=6'} dev: true + /levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + /lilconfig@3.1.1: resolution: {integrity: sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==} engines: {node: '>=14'} @@ -2182,6 +2615,10 @@ packages: p-locate: 5.0.0 dev: true + /lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + dev: true + /lodash.sortby@4.7.0: resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} dev: true @@ -2285,6 +2722,12 @@ packages: engines: {node: '>=4'} dev: true + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + /minimatch@9.0.4: resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} engines: {node: '>=16 || 14 >=14.17'} @@ -2338,6 +2781,10 @@ packages: hasBin: true dev: true + /natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: true + /normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: @@ -2390,6 +2837,12 @@ packages: object-keys: 1.1.1 dev: true + /once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: true + /onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} @@ -2404,6 +2857,18 @@ packages: mimic-fn: 4.0.0 dev: true + /optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} + engines: {node: '>= 0.8.0'} + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.5 + dev: true + /ora@5.4.1: resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} engines: {node: '>=10'} @@ -2480,6 +2945,13 @@ packages: engines: {node: '>=6'} dev: true + /parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + dependencies: + callsites: 3.1.0 + dev: true + /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -2495,6 +2967,11 @@ packages: engines: {node: '>=8'} dev: true + /path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: true + /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} @@ -2610,12 +3087,30 @@ packages: which-pm: 2.0.0 dev: true + /prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + dev: true + + /prettier-linter-helpers@1.0.0: + resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} + engines: {node: '>=6.0.0'} + dependencies: + fast-diff: 1.3.0 + dev: true + /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} hasBin: true dev: true + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + engines: {node: '>=14'} + hasBin: true + dev: true + /pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -2723,6 +3218,11 @@ packages: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} dev: true + /resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + dev: true + /resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} @@ -2750,6 +3250,14 @@ packages: engines: {iojs: '>=1.0.0', node: '>=0.10.0'} dev: true + /rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + dependencies: + glob: 7.2.3 + dev: true + /rollup@4.17.2: resolution: {integrity: sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -3057,6 +3565,11 @@ packages: min-indent: 1.0.1 dev: true + /strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + dev: true + /strip-literal@1.3.0: resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==} dependencies: @@ -3096,11 +3609,23 @@ packages: engines: {node: '>= 0.4'} dev: true + /synckit@0.9.1: + resolution: {integrity: sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==} + engines: {node: ^14.18.0 || >=16.0.0} + dependencies: + '@pkgr/core': 0.1.1 + tslib: 2.6.2 + dev: true + /term-size@2.2.1: resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} engines: {node: '>=8'} dev: true + /text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + dev: true + /thenify-all@1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} engines: {node: '>=0.8'} @@ -3158,6 +3683,15 @@ packages: engines: {node: '>=8'} dev: true + /ts-api-utils@1.3.0(typescript@5.3.3): + resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' + dependencies: + typescript: 5.3.3 + dev: true + /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true @@ -3250,6 +3784,13 @@ packages: yargs: 17.7.2 dev: true + /type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + dev: true + /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} @@ -3260,6 +3801,11 @@ packages: engines: {node: '>=10'} dev: true + /type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + dev: true + /type-fest@0.6.0: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} @@ -3347,6 +3893,12 @@ packages: engines: {node: '>= 10.0.0'} dev: true + /uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + dependencies: + punycode: 2.3.1 + dev: true + /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true @@ -3551,6 +4103,11 @@ packages: stackback: 0.0.2 dev: true + /word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + dev: true + /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -3578,6 +4135,10 @@ packages: strip-ansi: 7.1.0 dev: true + /wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true + /y18n@4.0.3: resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} dev: true diff --git a/typescript/src/buffer/index.ts b/typescript/src/buffer/index.ts index ffb8830..610eda5 100644 --- a/typescript/src/buffer/index.ts +++ b/typescript/src/buffer/index.ts @@ -1,2 +1,2 @@ export * from './data'; -export * from './erc4626BufferWrapOrUnwrap'; \ No newline at end of file +export * from './erc4626BufferWrapOrUnwrap'; diff --git a/typescript/src/stable/stablePool.ts b/typescript/src/stable/stablePool.ts index 8b292bd..c2a0b18 100644 --- a/typescript/src/stable/stablePool.ts +++ b/typescript/src/stable/stablePool.ts @@ -15,9 +15,7 @@ import { export class Stable implements PoolBase { public amp: bigint; - constructor(poolState: { - amp: bigint; - }) { + constructor(poolState: { amp: bigint }) { this.amp = poolState.amp; } @@ -28,14 +26,23 @@ export class Stable implements PoolBase { indexIn, indexOut, tokenRates, - scalingFactors + scalingFactors, } = maxSwapParams; if (swapKind === SwapKind.GivenIn) - return MathSol.divDownFixed(MathSol.mulDownFixed( - balancesLiveScaled18[indexOut], - MathSol.divDownFixed(tokenRates[indexOut], tokenRates[indexIn]), - ), scalingFactors[indexIn]); - return MathSol.divDownFixed(balancesLiveScaled18[indexOut], scalingFactors[indexOut]); + return MathSol.divDownFixed( + MathSol.mulDownFixed( + balancesLiveScaled18[indexOut], + MathSol.divDownFixed( + tokenRates[indexOut], + tokenRates[indexIn], + ), + ), + scalingFactors[indexIn], + ); + return MathSol.divDownFixed( + balancesLiveScaled18[indexOut], + scalingFactors[indexOut], + ); } onSwap(swapParams: SwapParams): bigint { diff --git a/typescript/src/vault/types.ts b/typescript/src/vault/types.ts index c7b37c9..6da3270 100644 --- a/typescript/src/vault/types.ts +++ b/typescript/src/vault/types.ts @@ -1,6 +1,6 @@ -import { BufferState } from "../buffer"; -import { StableState } from "../stable"; -import { WeightedState } from "../weighted"; +import { BufferState } from '../buffer'; +import { StableState } from '../stable'; +import { WeightedState } from '../weighted'; export type PoolState = WeightedState | StableState | BufferState; diff --git a/typescript/src/vault/vault.ts b/typescript/src/vault/vault.ts index 84f6dfd..99ea26d 100644 --- a/typescript/src/vault/vault.ts +++ b/typescript/src/vault/vault.ts @@ -22,8 +22,7 @@ import { SwapParams, } from './types'; - - +// eslint-disable-next-line @typescript-eslint/no-explicit-any type PoolClassConstructor = new (..._args: any[]) => PoolBase; type PoolClasses = Readonly>; diff --git a/typescript/src/weighted/weightedPool.ts b/typescript/src/weighted/weightedPool.ts index f2761d1..a622d5f 100644 --- a/typescript/src/weighted/weightedPool.ts +++ b/typescript/src/weighted/weightedPool.ts @@ -17,22 +17,26 @@ import { export class Weighted implements PoolBase { public normalizedWeights: bigint[]; - constructor(poolState: { - weights: bigint[]; - }) { + constructor(poolState: { weights: bigint[] }) { this.normalizedWeights = poolState.weights; } getMaxSwapAmount(swapParams: MaxSwapParams): bigint { if (swapParams.swapKind === SwapKind.GivenIn) - return MathSol.divDownFixed(MathSol.mulDownFixed( - swapParams.balancesLiveScaled18[swapParams.indexIn], - _MAX_IN_RATIO, - ), swapParams.scalingFactors[swapParams.indexIn]); - return MathSol.divDownFixed(MathSol.mulDownFixed( - swapParams.balancesLiveScaled18[swapParams.indexOut], - _MAX_OUT_RATIO, - ), swapParams.scalingFactors[swapParams.indexOut]); + return MathSol.divDownFixed( + MathSol.mulDownFixed( + swapParams.balancesLiveScaled18[swapParams.indexIn], + _MAX_IN_RATIO, + ), + swapParams.scalingFactors[swapParams.indexIn], + ); + return MathSol.divDownFixed( + MathSol.mulDownFixed( + swapParams.balancesLiveScaled18[swapParams.indexOut], + _MAX_OUT_RATIO, + ), + swapParams.scalingFactors[swapParams.indexOut], + ); } onSwap(swapParams: SwapParams): bigint {