diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index e0043cd..c5eb8b5 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -7,10 +7,10 @@ on: jobs: test: - uses: rubilmax/ethers-maths/.github/workflows/test.yml@main + uses: rubilmax/evm-maths/.github/workflows/test.yml@main release: needs: test - uses: rubilmax/ethers-maths/.github/workflows/release.yml@main + uses: rubilmax/evm-maths/.github/workflows/release.yml@main secrets: inherit diff --git a/README.md b/README.md index 546a56e..5d419eb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ethers-maths +# evm-maths [![npm package][npm-img]][npm-url] [![Build Status][build-img]][build-url] @@ -8,16 +8,16 @@ [![Commitizen Friendly][commitizen-img]][commitizen-url] [![Semantic Release][semantic-release-img]][semantic-release-url] -> ➗ Useful ethers-based math libraries to ease your journey through off-chain fixed-point arithmetics +> ➗ Useful bigint math libraries to ease your journey through off-chain fixed-point arithmetics ## Install ```bash -npm install ethers-maths +npm install evm-maths ``` ```bash -yarn add ethers-maths +yarn add evm-maths ``` --- @@ -27,7 +27,7 @@ yarn add ethers-maths Just import the module and you'll benefit from an augmented, and typed, `BigInt` class! ```typescript -import "ethers-maths"; +import "evm-maths"; const WAD = BigInt.pow10(18); @@ -38,9 +38,9 @@ BigInt.from(WAD * 2n).rayMul(0.5e27); // WAD If you choose to avoid prototype pollution, you can always import specific utilities: ```typescript -import * as WadMath from "ethers-maths/lib/wad"; -import * as RayMath from "ethers-maths/lib/ray"; -import * as PercentMath from "ethers-maths/lib/percent"; +import * as WadMath from "evm-maths/lib/wad"; +import * as RayMath from "evm-maths/lib/ray"; +import * as PercentMath from "evm-maths/lib/percent"; ``` --- @@ -133,7 +133,7 @@ Returns whether the BigNumber is approximately close to the given BigNumber, wit ```typescript // only if you want to avoid BigNumber prototype pollution -import { approxEqAbs } from "ethers-maths/lib/utils"; +import { approxEqAbs } from "evm-maths/lib/utils"; // Returns whether the BigNumber is approximately close to the given BigNumber, within the given tolerance: true approxEqAbs(0, 1, "1"); @@ -147,7 +147,7 @@ Returns the minimum between input BigNumberish, as a BigInt ```typescript // only if you want to avoid BigInt prototype pollution -import { min } from "ethers-maths/lib/utils"; +import { min } from "evm-maths/lib/utils"; // Returns the minimum between input BigNumberish, as a BigInt: 0 min(0, 1, "2", ...); @@ -161,7 +161,7 @@ Returns the maximum between input BigNumberish, as a BigInt ```typescript // only if you want to avoid BigInt prototype pollution -import { max } from "ethers-maths/lib/utils"; +import { max } from "evm-maths/lib/utils"; // Returns the maximum between input BigNumberish, as a BigInt: 2 max(0, 1, "2", ...); @@ -175,7 +175,7 @@ Returns the sum of input BigNumberish array, as a BigInt ```typescript // only if you want to avoid BigInt prototype pollution -import { sum } from "ethers-maths/lib/utils"; +import { sum } from "evm-maths/lib/utils"; // Returns the sum of input BigNumberish array, as a BigInt: 3 sum([0, 1, "2"]); @@ -212,7 +212,7 @@ Returns a 1 followed by the input number of zeros (10 raised to the power of the ```typescript // only if you want to avoid BigInt prototype pollution -import { pow10 } from "ethers-maths/lib/utils"; +import { pow10 } from "evm-maths/lib/utils"; // Returns a 1 followed by the input number of zeros: 100 pow10(2); @@ -225,7 +225,7 @@ Performs a multiplication followed by a division, rounded half up ```typescript // only if you want to avoid BigInt prototype pollution -import { mulDivHalfUp } from "ethers-maths/lib/utils"; +import { mulDivHalfUp } from "evm-maths/lib/utils"; // 1.0 (in wad) * 1 / 1 = 1.0 (in wad) mulDivHalfUp(BigInt.WAD, 1, 1); @@ -238,7 +238,7 @@ Performs a multiplication followed by a division, rounded up ```typescript // only if you want to avoid BigInt prototype pollution -import { mulDivUp } from "ethers-maths/lib/utils"; +import { mulDivUp } from "evm-maths/lib/utils"; // 0.999999999999999999 * 1 / WAD = 1.0 (in wad, rounded up) mulDivUp(BigInt.WAD - 1n, 1, BigInt.WAD); @@ -251,7 +251,7 @@ Performs a multiplication followed by a division, rounded down ```typescript // only if you want to avoid BigInt prototype pollution -import { mulDivDown } from "ethers-maths/lib/utils"; +import { mulDivDown } from "evm-maths/lib/utils"; // 1.000000000000000001 * 1 / WAD = 1.0 (in wad, rounded down) mulDivDown(BigInt.WAD + 1n, 1, BigInt.WAD); @@ -270,7 +270,7 @@ _Most commonly used as the ERC20 token unit_ ```typescript // only if you want to avoid BigInt prototype pollution -import { WAD } from "ethers-maths/lib/constants"; +import { WAD } from "evm-maths/lib/constants"; // Returns a 1 followed by 18 zeros: 1000000000000000000 WAD; @@ -285,7 +285,7 @@ _Most commonly used as Aave's index unit_ ```typescript // only if you want to avoid BigInt prototype pollution -import { RAY } from "ethers-maths/lib/constants"; +import { RAY } from "evm-maths/lib/constants"; // Returns a 1 followed by 27 zeros: 1000000000000000000000000000 RAY; @@ -300,7 +300,7 @@ _Most commonly used as Aave's `PERCENTAGE_FACTOR`_ ```typescript // only if you want to avoid BigInt prototype pollution -import { PERCENT } from "ethers-maths/lib/constants"; +import { PERCENT } from "evm-maths/lib/constants"; // Returns a 1 followed by 4 zeros: 10000 PERCENT; @@ -313,7 +313,7 @@ Returns half of the common WAD unit, which is also known as `0.5 ether` in Solid ```typescript // only if you want to avoid BigInt prototype pollution -import { HALF_WAD } from "ethers-maths/lib/constants"; +import { HALF_WAD } from "evm-maths/lib/constants"; // Returns a 1 followed by 18 zeros: 1000000000000000000 HALF_WAD; @@ -326,7 +326,7 @@ Returns half of the common RAY unit, which is also known as `0.5e9 ether` in Sol ```typescript // only if you want to avoid BigInt prototype pollution -import { HALF_RAY } from "ethers-maths/lib/constants"; +import { HALF_RAY } from "evm-maths/lib/constants"; // Returns a 1 followed by 27 zeros: 1000000000000000000000000000 HALF_RAY; @@ -341,7 +341,7 @@ _Most commonly used as Aave's `HALF_PERCENTAGE_FACTOR`_ ```typescript // only if you want to avoid BigInt prototype pollution -import { HALF_PERCENT } from "ethers-maths/lib/constants"; +import { HALF_PERCENT } from "evm-maths/lib/constants"; // Returns a 1 followed by 4 zeros: 10000 HALF_PERCENT; @@ -836,16 +836,16 @@ Scales the percent-based BigInt up or down to the given scale defined by its num BigInt.RAY.percentToDecimals(27); // 1 RAY ``` -[build-img]: https://github.com/Rubilmax/ethers-maths/actions/workflows/release.yml/badge.svg -[build-url]: https://github.com/Rubilmax/ethers-maths/actions/workflows/release.yml -[test-img]: https://github.com/Rubilmax/ethers-maths/actions/workflows/test.yml/badge.svg -[test-url]: https://github.com/Rubilmax/ethers-maths/actions/workflows/test.yml -[downloads-img]: https://img.shields.io/npm/dt/ethers-maths -[downloads-url]: https://www.npmtrends.com/ethers-maths -[npm-img]: https://img.shields.io/npm/v/ethers-maths -[npm-url]: https://www.npmjs.com/package/ethers-maths -[issues-img]: https://img.shields.io/github/issues/Rubilmax/ethers-maths -[issues-url]: https://github.com/Rubilmax/ethers-maths/issues +[build-img]: https://github.com/Rubilmax/evm-maths/actions/workflows/release.yml/badge.svg +[build-url]: https://github.com/Rubilmax/evm-maths/actions/workflows/release.yml +[test-img]: https://github.com/Rubilmax/evm-maths/actions/workflows/test.yml/badge.svg +[test-url]: https://github.com/Rubilmax/evm-maths/actions/workflows/test.yml +[downloads-img]: https://img.shields.io/npm/dt/evm-maths +[downloads-url]: https://www.npmtrends.com/evm-maths +[npm-img]: https://img.shields.io/npm/v/evm-maths +[npm-url]: https://www.npmjs.com/package/evm-maths +[issues-img]: https://img.shields.io/github/issues/Rubilmax/evm-maths +[issues-url]: https://github.com/Rubilmax/evm-maths/issues [semantic-release-img]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg [semantic-release-url]: https://github.com/semantic-release/semantic-release [commitizen-img]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg diff --git a/package.json b/package.json index e8977c6..c222bae 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "ethers-maths", - "version": "5.0.0", - "description": "➗ Useful ethers-based math libraries to ease the journey through off-chain fixed-point arithmetics", + "name": "evm-maths", + "version": "1.0.0", + "description": "➗ Useful bigint math libraries to ease the journey through off-chain fixed-point arithmetics", "main": "lib/index.js", "files": [ "lib/*" @@ -17,7 +17,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/Rubilmax/ethers-maths.git" + "url": "git+https://github.com/Rubilmax/evm-maths.git" }, "license": "MIT", "author": { @@ -30,6 +30,8 @@ }, "keywords": [ "ethers", + "bigint", + "bignumber", "multicall", "rpc", "call", @@ -37,28 +39,22 @@ "smart contract" ], "bugs": { - "url": "https://github.com/Rubilmax/ethers-maths/issues" - }, - "homepage": "https://github.com/Rubilmax/ethers-maths#readme", - "dependencies": { - "ethers": "^6.0.0" + "url": "https://github.com/Rubilmax/evm-maths/issues" }, + "homepage": "https://github.com/Rubilmax/evm-maths#readme", "devDependencies": { "@jest/globals": "^29.7.0", "@trivago/prettier-plugin-sort-imports": "4.1.1", - "@types/jest": "^29.5.5", + "@types/jest": "^29.5.10", "commitizen": "^4.3.0", "conventional-changelog-conventionalcommits": "^5.0.0", "cz-conventional-changelog": "^3.3.0", "husky": "^8.0.3", "jest": "^29.7.0", "lint-staged": "^14.0.1", - "prettier": "^3.0.3", + "prettier": "^3.1.0", "ts-jest": "^29.1.1", - "typescript": "^5.2.2" - }, - "peerDependencies": { - "ethers": "^6.0.0" + "typescript": "^5.3.2" }, "config": { "commitizen": { diff --git a/src/comp.ts b/src/comp.ts index 77e1787..4ef740c 100644 --- a/src/comp.ts +++ b/src/comp.ts @@ -1,10 +1,9 @@ -import { BigNumberish, toBigInt } from "ethers"; import { WAD, WAD_SQUARED } from "./constants"; -export const compMul = (x: BigNumberish, other: BigNumberish) => { - return (toBigInt(x) * toBigInt(other)) / WAD; +export const compMul = (x: bigint, other: bigint) => { + return (x * other) / WAD; }; -export const compDiv = (x: BigNumberish, other: BigNumberish) => { - return (toBigInt(x) * WAD_SQUARED) / toBigInt(other) / WAD; +export const compDiv = (x: bigint, other: bigint) => { + return (x * WAD_SQUARED) / other / WAD; }; diff --git a/src/constants.ts b/src/constants.ts index 0c94393..5a9768f 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,8 +1,8 @@ import { pow10 } from "./utils"; -export const PERCENT = pow10(4); -export const WAD = pow10(18); -export const RAY = pow10(27); +export const PERCENT = pow10(4n); +export const WAD = pow10(18n); +export const RAY = pow10(27n); export const WAD_SQUARED = WAD ** 2n; export const HALF_PERCENT = PERCENT / 2n; diff --git a/src/format.ts b/src/format.ts index eda4284..a4f5b1f 100644 --- a/src/format.ts +++ b/src/format.ts @@ -1,32 +1,38 @@ -import { BigNumberish, formatUnits, toBigInt } from "ethers"; import { pow10 } from "./utils"; -export const format = (x: BigNumberish, decimals?: number, digits?: number) => { - const formatted = formatUnits(x, decimals); +export const format = (x: bigint, decimals: number = 18, digits?: number) => { + decimals = Math.floor(decimals); + digits = Math.floor(digits ?? decimals); - let dotIndex = formatted.indexOf("."); - if (dotIndex < 0) dotIndex = formatted.length; + if (decimals === 0) return x.toString(); - decimals = formatted.length - 1 - dotIndex; - digits ??= decimals; + let negative = ""; + if (x < 0n) { + negative = "-"; + x *= -1n; + } + + const abs = x.toString().padStart(decimals + 1, "0"); + + const length = abs.length; + const dotIndex = length - decimals; - return digits < decimals - ? formatted.slice(0, dotIndex + (digits > 0 ? digits + 1 : 0)) - : formatted + "0".repeat(digits - decimals); + let full = negative + abs.substring(0, dotIndex); + if (digits > 0) full += "." + abs.substring(dotIndex, dotIndex + digits).padEnd(digits, "0"); + + return full; }; -export const toFloat = (x: BigNumberish, decimals?: number) => { +export const toFloat = (x: bigint, decimals?: number) => { return parseFloat(format(x, decimals)); }; -export const toDecimals = (x: BigNumberish, decimals: number, scaleDecimals: number) => { - x = toBigInt(x); - +export const toDecimals = (x: bigint, decimals: number, scaleDecimals: number) => { if (decimals <= scaleDecimals) { - const ratio = pow10(scaleDecimals - decimals); + const ratio = pow10(BigInt(Math.floor(scaleDecimals - decimals))); return (x + ratio / 2n) / ratio; } - return x * pow10(decimals - scaleDecimals); + return x * pow10(BigInt(Math.floor(decimals - scaleDecimals))); }; diff --git a/src/index.ts b/src/index.ts index 8be1418..4bf4812 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,3 @@ -import { BigNumberish } from "ethers"; - import { PERCENT, RAY, HALF_PERCENT, HALF_RAY, HALF_WAD, WAD } from "./constants"; import { max, @@ -15,8 +13,6 @@ import { import { format, toFloat } from "./format"; import { compDiv, compMul } from "./comp"; import { - parsePercent, - formatPercent, percentAdd, percentAvg, percentDiv, @@ -34,10 +30,9 @@ import { percentToRay, percentToWad, toPercentFloat, + formatPercent, } from "./percent"; import { - parseWad, - formatWad, wadAdd, wadAvg, wadDiv, @@ -55,10 +50,9 @@ import { wadToRay, wadToPercent, toWadFloat, + formatWad, } from "./wad"; import { - parseRay, - formatRay, rayAdd, rayAvg, rayDiv, @@ -76,76 +70,77 @@ import { rayToWad, rayToPercent, toRayFloat, + formatRay, } from "./ray"; declare global { interface BigInt { - approxEqAbs: (other: BigNumberish, tolerance?: BigNumberish) => boolean; + approxEqAbs: (other: bigint, tolerance?: bigint) => boolean; abs: () => bigint; - min: (other: BigNumberish, ...others: BigNumberish[]) => bigint; - max: (other: BigNumberish, ...others: BigNumberish[]) => bigint; - sum: (others: BigNumberish[]) => bigint; + min: (other: bigint, ...others: bigint[]) => bigint; + max: (other: bigint, ...others: bigint[]) => bigint; + sum: (others: bigint[]) => bigint; format: (decimals?: number, digits?: number) => string; toFloat: (decimals?: number) => number; - mulDiv: (other: BigNumberish, scale: BigNumberish) => bigint; - mulDivUp: (other: BigNumberish, scale: BigNumberish) => bigint; - mulDivDown: (other: BigNumberish, scale: BigNumberish) => bigint; + mulDiv: (other: bigint, scale: bigint) => bigint; + mulDivUp: (other: bigint, scale: bigint) => bigint; + mulDivDown: (other: bigint, scale: bigint) => bigint; - compMul: (other: BigNumberish) => bigint; - compDiv: (other: BigNumberish) => bigint; + compMul: (other: bigint) => bigint; + compDiv: (other: bigint) => bigint; - percentAdd: (pct: BigNumberish) => bigint; - percentSub: (pct: BigNumberish) => bigint; - percentMul: (other: BigNumberish) => bigint; - percentMulUp: (other: BigNumberish) => bigint; - percentMulDown: (other: BigNumberish) => bigint; - percentDiv: (other: BigNumberish) => bigint; - percentDivUp: (other: BigNumberish) => bigint; - percentDivDown: (other: BigNumberish) => bigint; - percentAvg: (other: BigNumberish, pct: BigNumberish) => bigint; - percentPow: (exponent: BigNumberish) => bigint; - percentPowUp: (exponent: BigNumberish) => bigint; - percentPowDown: (exponent: BigNumberish) => bigint; - percentExpN: (exponent: BigNumberish) => bigint; + percentAdd: (pct: bigint) => bigint; + percentSub: (pct: bigint) => bigint; + percentMul: (other: bigint) => bigint; + percentMulUp: (other: bigint) => bigint; + percentMulDown: (other: bigint) => bigint; + percentDiv: (other: bigint) => bigint; + percentDivUp: (other: bigint) => bigint; + percentDivDown: (other: bigint) => bigint; + percentAvg: (other: bigint, pct: bigint) => bigint; + percentPow: (exponent: bigint) => bigint; + percentPowUp: (exponent: bigint) => bigint; + percentPowDown: (exponent: bigint) => bigint; + percentExpN: (exponent: bigint) => bigint; percentToDecimals: (decimals: number) => bigint; percentToWad: () => bigint; percentToRay: () => bigint; formatPercent: (digits?: number) => string; toPercentFloat: () => number; - wadAdd: (wad: BigNumberish) => bigint; - wadSub: (wad: BigNumberish) => bigint; - wadMul: (other: BigNumberish) => bigint; - wadMulUp: (other: BigNumberish) => bigint; - wadMulDown: (other: BigNumberish) => bigint; - wadDiv: (other: BigNumberish) => bigint; - wadDivUp: (other: BigNumberish) => bigint; - wadDivDown: (other: BigNumberish) => bigint; - wadAvg: (other: BigNumberish, wad: BigNumberish) => bigint; - wadPow: (exponent: BigNumberish) => bigint; - wadPowUp: (exponent: BigNumberish) => bigint; - wadPowDown: (exponent: BigNumberish) => bigint; - wadExpN: (exponent: BigNumberish) => bigint; + wadAdd: (wad: bigint) => bigint; + wadSub: (wad: bigint) => bigint; + wadMul: (other: bigint) => bigint; + wadMulUp: (other: bigint) => bigint; + wadMulDown: (other: bigint) => bigint; + wadDiv: (other: bigint) => bigint; + wadDivUp: (other: bigint) => bigint; + wadDivDown: (other: bigint) => bigint; + wadAvg: (other: bigint, wad: bigint) => bigint; + wadPow: (exponent: bigint) => bigint; + wadPowUp: (exponent: bigint) => bigint; + wadPowDown: (exponent: bigint) => bigint; + wadExpN: (exponent: bigint) => bigint; wadToDecimals: (decimals: number) => bigint; wadToPercent: () => bigint; wadToRay: () => bigint; formatWad: (digits?: number) => string; toWadFloat: () => number; - rayAdd: (ray: BigNumberish) => bigint; - raySub: (ray: BigNumberish) => bigint; - rayMul: (other: BigNumberish) => bigint; - rayMulUp: (other: BigNumberish) => bigint; - rayMulDown: (other: BigNumberish) => bigint; - rayDiv: (other: BigNumberish) => bigint; - rayDivUp: (other: BigNumberish) => bigint; - rayDivDown: (other: BigNumberish) => bigint; - rayAvg: (other: BigNumberish, ray: BigNumberish) => bigint; - rayPow: (exponent: BigNumberish) => bigint; - rayPowUp: (exponent: BigNumberish) => bigint; - rayPowDown: (exponent: BigNumberish) => bigint; - rayExpN: (exponent: BigNumberish) => bigint; + rayAdd: (ray: bigint) => bigint; + raySub: (ray: bigint) => bigint; + rayMul: (other: bigint) => bigint; + rayMulUp: (other: bigint) => bigint; + rayMulDown: (other: bigint) => bigint; + rayDiv: (other: bigint) => bigint; + rayDivUp: (other: bigint) => bigint; + rayDivDown: (other: bigint) => bigint; + rayAvg: (other: bigint, ray: bigint) => bigint; + rayPow: (exponent: bigint) => bigint; + rayPowUp: (exponent: bigint) => bigint; + rayPowDown: (exponent: bigint) => bigint; + rayExpN: (exponent: bigint) => bigint; rayToDecimals: (decimals: number) => bigint; rayToPercent: () => bigint; rayToWad: () => bigint; @@ -161,30 +156,27 @@ declare global { RAY: bigint; HALF_RAY: bigint; - min: (other: BigNumberish, ...others: BigNumberish[]) => bigint; - max: (other: BigNumberish, ...others: BigNumberish[]) => bigint; - sum: (others: BigNumberish[]) => bigint; + min: (other: bigint, ...others: bigint[]) => bigint; + max: (other: bigint, ...others: bigint[]) => bigint; + sum: (others: bigint[]) => bigint; - pow10: (power: BigNumberish) => bigint; - parsePercent: (value: string) => bigint; - parseWad: (value: string) => bigint; - parseRay: (value: string) => bigint; + pow10: (power: bigint) => bigint; } } -BigInt.prototype.approxEqAbs = function (y: BigNumberish, tolerance: BigNumberish = 0) { +BigInt.prototype.approxEqAbs = function (y: bigint, tolerance: bigint = 0n) { return approxEqAbs(this as bigint, y, tolerance); }; BigInt.prototype.abs = function () { return abs(this as bigint); }; -BigInt.prototype.min = function (y: BigNumberish, ...others: BigNumberish[]) { +BigInt.prototype.min = function (y: bigint, ...others: bigint[]) { return min(this as bigint, y, ...others); }; -BigInt.prototype.max = function (y: BigNumberish, ...others: BigNumberish[]) { +BigInt.prototype.max = function (y: bigint, ...others: bigint[]) { return max(this as bigint, y, ...others); }; -BigInt.prototype.sum = function (others: BigNumberish[]) { +BigInt.prototype.sum = function (others: bigint[]) { return sum(this as bigint, others); }; BigInt.prototype.format = function (decimals?: number, digits?: number) { @@ -194,60 +186,60 @@ BigInt.prototype.toFloat = function (decimals?: number) { return toFloat(this as bigint, decimals); }; -BigInt.prototype.mulDiv = function (other: BigNumberish, scale: BigNumberish) { +BigInt.prototype.mulDiv = function (other: bigint, scale: bigint) { return mulDivHalfUp(this as bigint, other, scale); }; -BigInt.prototype.mulDivUp = function (other: BigNumberish, scale: BigNumberish) { +BigInt.prototype.mulDivUp = function (other: bigint, scale: bigint) { return mulDivUp(this as bigint, other, scale); }; -BigInt.prototype.mulDivDown = function (other: BigNumberish, scale: BigNumberish) { +BigInt.prototype.mulDivDown = function (other: bigint, scale: bigint) { return mulDivDown(this as bigint, other, scale); }; -BigInt.prototype.compMul = function (other: BigNumberish) { +BigInt.prototype.compMul = function (other: bigint) { return compMul(this as bigint, other); }; -BigInt.prototype.compDiv = function (other: BigNumberish) { +BigInt.prototype.compDiv = function (other: bigint) { return compDiv(this as bigint, other); }; -BigInt.prototype.percentAdd = function (pct: BigNumberish) { +BigInt.prototype.percentAdd = function (pct: bigint) { return percentAdd(this as bigint, pct); }; -BigInt.prototype.percentSub = function (pct: BigNumberish) { +BigInt.prototype.percentSub = function (pct: bigint) { return percentSub(this as bigint, pct); }; -BigInt.prototype.percentMul = function (other: BigNumberish) { +BigInt.prototype.percentMul = function (other: bigint) { return percentMul(this as bigint, other); }; -BigInt.prototype.percentMulUp = function (other: BigNumberish) { +BigInt.prototype.percentMulUp = function (other: bigint) { return percentMulUp(this as bigint, other); }; -BigInt.prototype.percentMulDown = function (other: BigNumberish) { +BigInt.prototype.percentMulDown = function (other: bigint) { return percentMulDown(this as bigint, other); }; -BigInt.prototype.percentDiv = function (other: BigNumberish) { +BigInt.prototype.percentDiv = function (other: bigint) { return percentDiv(this as bigint, other); }; -BigInt.prototype.percentDivUp = function (other: BigNumberish) { +BigInt.prototype.percentDivUp = function (other: bigint) { return percentDivUp(this as bigint, other); }; -BigInt.prototype.percentDivDown = function (other: BigNumberish) { +BigInt.prototype.percentDivDown = function (other: bigint) { return percentDivDown(this as bigint, other); }; -BigInt.prototype.percentAvg = function (other: BigNumberish, pct: BigNumberish) { +BigInt.prototype.percentAvg = function (other: bigint, pct: bigint) { return percentAvg(this as bigint, other, pct); }; -BigInt.prototype.percentPow = function (exponent: BigNumberish) { +BigInt.prototype.percentPow = function (exponent: bigint) { return percentPow(this as bigint, exponent); }; -BigInt.prototype.percentPowUp = function (exponent: BigNumberish) { +BigInt.prototype.percentPowUp = function (exponent: bigint) { return percentPowUp(this as bigint, exponent); }; -BigInt.prototype.percentPowDown = function (exponent: BigNumberish) { +BigInt.prototype.percentPowDown = function (exponent: bigint) { return percentPowDown(this as bigint, exponent); }; -BigInt.prototype.percentExpN = function (N: BigNumberish) { +BigInt.prototype.percentExpN = function (N: bigint) { return percentExpN(this as bigint, N); }; BigInt.prototype.percentToDecimals = function (decimals: number) { @@ -266,43 +258,43 @@ BigInt.prototype.toPercentFloat = function () { return toPercentFloat(this as bigint); }; -BigInt.prototype.wadAdd = function (wad: BigNumberish) { +BigInt.prototype.wadAdd = function (wad: bigint) { return wadAdd(this as bigint, wad); }; -BigInt.prototype.wadSub = function (wad: BigNumberish) { +BigInt.prototype.wadSub = function (wad: bigint) { return wadSub(this as bigint, wad); }; -BigInt.prototype.wadMul = function (other: BigNumberish) { +BigInt.prototype.wadMul = function (other: bigint) { return wadMul(this as bigint, other); }; -BigInt.prototype.wadMulUp = function (other: BigNumberish) { +BigInt.prototype.wadMulUp = function (other: bigint) { return wadMulUp(this as bigint, other); }; -BigInt.prototype.wadMulDown = function (other: BigNumberish) { +BigInt.prototype.wadMulDown = function (other: bigint) { return wadMulDown(this as bigint, other); }; -BigInt.prototype.wadDiv = function (other: BigNumberish) { +BigInt.prototype.wadDiv = function (other: bigint) { return wadDiv(this as bigint, other); }; -BigInt.prototype.wadDivUp = function (other: BigNumberish) { +BigInt.prototype.wadDivUp = function (other: bigint) { return wadDivUp(this as bigint, other); }; -BigInt.prototype.wadDivDown = function (other: BigNumberish) { +BigInt.prototype.wadDivDown = function (other: bigint) { return wadDivDown(this as bigint, other); }; -BigInt.prototype.wadAvg = function (other: BigNumberish, wad: BigNumberish) { +BigInt.prototype.wadAvg = function (other: bigint, wad: bigint) { return wadAvg(this as bigint, other, wad); }; -BigInt.prototype.wadPow = function (exponent: BigNumberish) { +BigInt.prototype.wadPow = function (exponent: bigint) { return wadPow(this as bigint, exponent); }; -BigInt.prototype.wadPowUp = function (exponent: BigNumberish) { +BigInt.prototype.wadPowUp = function (exponent: bigint) { return wadPowUp(this as bigint, exponent); }; -BigInt.prototype.wadPowDown = function (exponent: BigNumberish) { +BigInt.prototype.wadPowDown = function (exponent: bigint) { return wadPowDown(this as bigint, exponent); }; -BigInt.prototype.wadExpN = function (N: BigNumberish) { +BigInt.prototype.wadExpN = function (N: bigint) { return wadExpN(this as bigint, N); }; BigInt.prototype.wadToDecimals = function (decimals: number) { @@ -321,43 +313,43 @@ BigInt.prototype.toWadFloat = function () { return toWadFloat(this as bigint); }; -BigInt.prototype.rayAdd = function (ray: BigNumberish) { +BigInt.prototype.rayAdd = function (ray: bigint) { return rayAdd(this as bigint, ray); }; -BigInt.prototype.raySub = function (ray: BigNumberish) { +BigInt.prototype.raySub = function (ray: bigint) { return raySub(this as bigint, ray); }; -BigInt.prototype.rayMul = function (other: BigNumberish) { +BigInt.prototype.rayMul = function (other: bigint) { return rayMul(this as bigint, other); }; -BigInt.prototype.rayMulUp = function (other: BigNumberish) { +BigInt.prototype.rayMulUp = function (other: bigint) { return rayMulUp(this as bigint, other); }; -BigInt.prototype.rayMulDown = function (other: BigNumberish) { +BigInt.prototype.rayMulDown = function (other: bigint) { return rayMulDown(this as bigint, other); }; -BigInt.prototype.rayDiv = function (other: BigNumberish) { +BigInt.prototype.rayDiv = function (other: bigint) { return rayDiv(this as bigint, other); }; -BigInt.prototype.rayDivUp = function (other: BigNumberish) { +BigInt.prototype.rayDivUp = function (other: bigint) { return rayDivUp(this as bigint, other); }; -BigInt.prototype.rayDivDown = function (other: BigNumberish) { +BigInt.prototype.rayDivDown = function (other: bigint) { return rayDivDown(this as bigint, other); }; -BigInt.prototype.rayAvg = function (other: BigNumberish, ray: BigNumberish) { +BigInt.prototype.rayAvg = function (other: bigint, ray: bigint) { return rayAvg(this as bigint, other, ray); }; -BigInt.prototype.rayPow = function (exponent: BigNumberish) { +BigInt.prototype.rayPow = function (exponent: bigint) { return rayPow(this as bigint, exponent); }; -BigInt.prototype.rayPowUp = function (exponent: BigNumberish) { +BigInt.prototype.rayPowUp = function (exponent: bigint) { return rayPowUp(this as bigint, exponent); }; -BigInt.prototype.rayPowDown = function (exponent: BigNumberish) { +BigInt.prototype.rayPowDown = function (exponent: bigint) { return rayPowDown(this as bigint, exponent); }; -BigInt.prototype.rayExpN = function (N: BigNumberish) { +BigInt.prototype.rayExpN = function (N: bigint) { return rayExpN(this as bigint, N); }; BigInt.prototype.rayToDecimals = function (decimals: number) { @@ -385,9 +377,6 @@ BigInt.HALF_RAY = HALF_RAY; BigInt.min = min; BigInt.max = max; -BigInt.sum = (others: BigNumberish[]) => sum(0, others); +BigInt.sum = (others: bigint[]) => sum(0n, others); BigInt.pow10 = pow10; -BigInt.parsePercent = parsePercent; -BigInt.parseWad = parseWad; -BigInt.parseRay = parseRay; diff --git a/src/percent.ts b/src/percent.ts index c6d7c70..3321666 100644 --- a/src/percent.ts +++ b/src/percent.ts @@ -1,78 +1,75 @@ -import { BigNumberish, parseUnits, toBigInt } from "ethers"; import { PERCENT } from "./constants"; import { avgHalfUp, expN, mulDivDown, mulDivHalfUp, mulDivUp, pow } from "./utils"; import { format, toDecimals, toFloat } from "./format"; -export const parsePercent = (value: string) => parseUnits(value, 2); - -export const percentAdd = (x: BigNumberish, percent: BigNumberish) => { - return percentMul(x, PERCENT + toBigInt(percent)); +export const percentAdd = (x: bigint, percent: bigint) => { + return percentMul(x, PERCENT + percent); }; -export const percentSub = (x: BigNumberish, percent: BigNumberish) => { - return percentMul(x, PERCENT - toBigInt(percent)); +export const percentSub = (x: bigint, percent: bigint) => { + return percentMul(x, PERCENT - percent); }; -export const percentMul = (x: BigNumberish, other: BigNumberish) => { +export const percentMul = (x: bigint, other: bigint) => { return mulDivHalfUp(x, other, PERCENT); }; -export const percentMulUp = (x: BigNumberish, other: BigNumberish) => { +export const percentMulUp = (x: bigint, other: bigint) => { return mulDivUp(x, other, PERCENT); }; -export const percentMulDown = (x: BigNumberish, other: BigNumberish) => { +export const percentMulDown = (x: bigint, other: bigint) => { return mulDivDown(x, other, PERCENT); }; -export const percentDiv = (x: BigNumberish, other: BigNumberish) => { +export const percentDiv = (x: bigint, other: bigint) => { return mulDivHalfUp(x, PERCENT, other); }; -export const percentDivUp = (x: BigNumberish, other: BigNumberish) => { +export const percentDivUp = (x: bigint, other: bigint) => { return mulDivUp(x, PERCENT, other); }; -export const percentDivDown = (x: BigNumberish, other: BigNumberish) => { +export const percentDivDown = (x: bigint, other: bigint) => { return mulDivDown(x, PERCENT, other); }; -export const percentAvg = (x: BigNumberish, other: BigNumberish, percent: BigNumberish) => { +export const percentAvg = (x: bigint, other: bigint, percent: bigint) => { return avgHalfUp(x, other, percent, PERCENT); }; -export const percentPow = (x: BigNumberish, exponent: BigNumberish) => { +export const percentPow = (x: bigint, exponent: bigint) => { return pow(x, exponent, PERCENT, mulDivHalfUp); }; -export const percentPowUp = (x: BigNumberish, exponent: BigNumberish) => { +export const percentPowUp = (x: bigint, exponent: bigint) => { return pow(x, exponent, PERCENT, mulDivUp); }; -export const percentPowDown = (x: BigNumberish, exponent: BigNumberish) => { +export const percentPowDown = (x: bigint, exponent: bigint) => { return pow(x, exponent, PERCENT, mulDivDown); }; -export const percentExpN = (x: BigNumberish, N: BigNumberish) => { +export const percentExpN = (x: bigint, N: bigint) => { return expN(x, N, PERCENT, mulDivDown); }; -export const percentToDecimals = (x: BigNumberish, decimals: number) => { +export const percentToDecimals = (x: bigint, decimals: number) => { return toDecimals(x, decimals, 4); }; -export const percentToRay = (x: BigNumberish) => { +export const percentToRay = (x: bigint) => { return percentToDecimals(x, 27); }; -export const percentToWad = (x: BigNumberish) => { +export const percentToWad = (x: bigint) => { return percentToDecimals(x, 18); }; -export const formatPercent = (x: BigNumberish, digits?: number) => { +export const formatPercent = (x: bigint, digits?: number) => { return format(x, 4, digits); }; -export const toPercentFloat = (x: BigNumberish) => { +export const toPercentFloat = (x: bigint) => { return toFloat(x, 4); }; diff --git a/src/ray.ts b/src/ray.ts index 166998c..62e3573 100644 --- a/src/ray.ts +++ b/src/ray.ts @@ -1,78 +1,75 @@ -import { BigNumberish, parseUnits, toBigInt } from "ethers"; import { RAY } from "./constants"; import { avgHalfUp, expN, mulDivDown, mulDivHalfUp, mulDivUp, pow } from "./utils"; import { format, toDecimals, toFloat } from "./format"; -export const parseRay = (value: string) => parseUnits(value, 27); - -export const rayAdd = (x: BigNumberish, ray: BigNumberish) => { - return rayMul(x, RAY + toBigInt(ray)); +export const rayAdd = (x: bigint, ray: bigint) => { + return rayMul(x, RAY + ray); }; -export const raySub = (x: BigNumberish, ray: BigNumberish) => { - return rayMul(x, RAY - toBigInt(ray)); +export const raySub = (x: bigint, ray: bigint) => { + return rayMul(x, RAY - ray); }; -export const rayMul = (x: BigNumberish, other: BigNumberish) => { +export const rayMul = (x: bigint, other: bigint) => { return mulDivHalfUp(x, other, RAY); }; -export const rayMulUp = (x: BigNumberish, other: BigNumberish) => { +export const rayMulUp = (x: bigint, other: bigint) => { return mulDivUp(x, other, RAY); }; -export const rayMulDown = (x: BigNumberish, other: BigNumberish) => { +export const rayMulDown = (x: bigint, other: bigint) => { return mulDivDown(x, other, RAY); }; -export const rayDiv = (x: BigNumberish, other: BigNumberish) => { +export const rayDiv = (x: bigint, other: bigint) => { return mulDivHalfUp(x, RAY, other); }; -export const rayDivUp = (x: BigNumberish, other: BigNumberish) => { +export const rayDivUp = (x: bigint, other: bigint) => { return mulDivUp(x, RAY, other); }; -export const rayDivDown = (x: BigNumberish, other: BigNumberish) => { +export const rayDivDown = (x: bigint, other: bigint) => { return mulDivDown(x, RAY, other); }; -export const rayAvg = (x: BigNumberish, other: BigNumberish, ray: BigNumberish) => { +export const rayAvg = (x: bigint, other: bigint, ray: bigint) => { return avgHalfUp(x, other, ray, RAY); }; -export const rayPow = (x: BigNumberish, exponent: BigNumberish) => { +export const rayPow = (x: bigint, exponent: bigint) => { return pow(x, exponent, RAY, mulDivHalfUp); }; -export const rayPowUp = (x: BigNumberish, exponent: BigNumberish) => { +export const rayPowUp = (x: bigint, exponent: bigint) => { return pow(x, exponent, RAY, mulDivUp); }; -export const rayPowDown = (x: BigNumberish, exponent: BigNumberish) => { +export const rayPowDown = (x: bigint, exponent: bigint) => { return pow(x, exponent, RAY, mulDivDown); }; -export const rayExpN = (x: BigNumberish, N: BigNumberish) => { +export const rayExpN = (x: bigint, N: bigint) => { return expN(x, N, RAY, mulDivDown); }; -export const rayToDecimals = (x: BigNumberish, decimals: number) => { +export const rayToDecimals = (x: bigint, decimals: number) => { return toDecimals(x, decimals, 27); }; -export const rayToPercent = (x: BigNumberish) => { +export const rayToPercent = (x: bigint) => { return rayToDecimals(x, 4); }; -export const rayToWad = (x: BigNumberish) => { +export const rayToWad = (x: bigint) => { return rayToDecimals(x, 18); }; -export const formatRay = (x: BigNumberish, digits?: number) => { +export const formatRay = (x: bigint, digits?: number) => { return format(x, 27, digits); }; -export const toRayFloat = (x: BigNumberish) => { +export const toRayFloat = (x: bigint) => { return toFloat(x, 27); }; diff --git a/src/utils.ts b/src/utils.ts index de4e0a9..c1ae9ae 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,98 +1,66 @@ -import { BigNumberish, toBigInt } from "ethers"; +export type MulDiv = (x: bigint, y: bigint, scale: bigint) => bigint; -export type MulDiv = (x: BigNumberish, y: BigNumberish, scale: BigNumberish) => bigint; - -export const pow10 = (power: BigNumberish) => toBigInt(10) ** toBigInt(power); - -export const approxEqAbs = (x: BigNumberish, y: BigNumberish, tolerance: BigNumberish = 0) => { - x = toBigInt(x); - y = toBigInt(y); - tolerance = toBigInt(tolerance); +export const pow10 = (power: bigint) => { + return 10n ** power; +}; +export const approxEqAbs = (x: bigint, y: bigint, tolerance: bigint = 0n) => { return abs(y - x) <= tolerance; }; -export const abs = (x: BigNumberish) => { - x = toBigInt(x); - +export const abs = (x: bigint) => { return x < 0n ? -x : x; }; -export const min = (x: BigNumberish, ...others: BigNumberish[]): bigint => { - x = toBigInt(x); - +export const min = (x: bigint, ...others: bigint[]): bigint => { if (others.length === 0) return x; - const y = toBigInt(others[0]); + const y = others[0]; return min(x > y ? y : x, ...others.slice(1)); }; -export const max = (x: BigNumberish, ...others: BigNumberish[]): bigint => { - x = toBigInt(x); - +export const max = (x: bigint, ...others: bigint[]): bigint => { if (others.length === 0) return x; - const y = toBigInt(others[0]); + const y = others[0]; return max(x > y ? x : y, ...others.slice(1)); }; -export const sum = (initialValue: BigNumberish, others: BigNumberish[]) => { - return others.reduce((acc, val) => acc + toBigInt(val), toBigInt(initialValue)); +export const sum = (initialValue: bigint, others: bigint[]) => { + return others.reduce((acc, val) => acc + val, initialValue); }; export const mulDivHalfUp: MulDiv = (x, y, scale) => { - x = toBigInt(x); - y = toBigInt(y); - scale = toBigInt(scale); - if (x === 0n || y === 0n) return toBigInt(0); + if (x === 0n || y === 0n) return 0n; return (x * y + scale / 2n) / scale; }; export const mulDivDown: MulDiv = (x, y, scale) => { - x = toBigInt(x); - y = toBigInt(y); - scale = toBigInt(scale); - if (x === 0n || y === 0n) return toBigInt(0); + if (x === 0n || y === 0n) return 0n; return (x * y) / scale; }; export const mulDivUp: MulDiv = (x, y, scale) => { - x = toBigInt(x); - y = toBigInt(y); - scale = toBigInt(scale); - if (x === 0n || y === 0n) return toBigInt(0); + if (x === 0n || y === 0n) return 0n; return (x * y + scale - 1n) / scale; }; -export const avgHalfUp = ( - x: BigNumberish, - y: BigNumberish, - pct: BigNumberish, - scale: BigNumberish, -) => { - x = toBigInt(x); - y = toBigInt(y); - pct = toBigInt(pct); - scale = toBigInt(scale); - - return (max(0, scale - pct) * x + min(scale, pct) * y + scale / 2n) / scale; -}; +export const avgHalfUp = (x: bigint, y: bigint, pct: bigint, scale: bigint) => + (max(0n, scale - pct) * x + min(scale, pct) * y + scale / 2n) / scale; export const pow = ( - x: BigNumberish, - exponent: BigNumberish, + x: bigint, + exponent: bigint, scale: bigint, mulDiv: MulDiv = mulDivHalfUp, ): bigint => { - exponent = toBigInt(exponent); - - if (exponent === 0n) return toBigInt(scale); - if (exponent === 1n) return toBigInt(x); + if (exponent === 0n) return scale; + if (exponent === 1n) return x; const xSquared = mulDiv(x, x, scale); if (exponent % 2n === 0n) return pow(xSquared, exponent / 2n, scale, mulDiv); @@ -100,19 +68,10 @@ export const pow = ( return mulDiv(x, pow(xSquared, (exponent - 1n) / 2n, scale, mulDiv), scale); }; -export const expN = ( - x: BigNumberish, - N: BigNumberish, - scale: BigNumberish, - mulDiv: MulDiv = mulDivDown, -) => { - x = toBigInt(x); - scale = toBigInt(scale); - N = toBigInt(N); - +export const expN = (x: bigint, N: bigint, scale: bigint, mulDiv: MulDiv = mulDivDown) => { let res = scale; let monomial = scale; - for (let k = toBigInt(1); k <= N; k++) { + for (let k = 1n; k <= N; k++) { monomial = mulDiv(monomial, x, k * scale); res += monomial; } @@ -121,41 +80,19 @@ export const expN = ( }; export const getConvertToAssets = ( - virtualAssets: BigNumberish, - virtualShares: BigNumberish, + virtualAssets: bigint, + virtualShares: bigint, mulDiv: MulDiv, ) => { - virtualAssets = toBigInt(virtualAssets); - virtualShares = toBigInt(virtualShares); - - return (shares: BigNumberish, totalAssets: BigNumberish, totalShares: BigNumberish) => { - totalAssets = toBigInt(totalAssets); - totalShares = toBigInt(totalShares); - - return mulDiv( - shares, - totalAssets + (virtualAssets as bigint), - totalShares + (virtualShares as bigint), - ); - }; + return (shares: bigint, totalAssets: bigint, totalShares: bigint) => + mulDiv(shares, totalAssets + virtualAssets, totalShares + virtualShares); }; export const getConvertToShares = ( - virtualAssets: BigNumberish, - virtualShares: BigNumberish, + virtualAssets: bigint, + virtualShares: bigint, mulDiv: MulDiv, ) => { - virtualAssets = toBigInt(virtualAssets); - virtualShares = toBigInt(virtualShares); - - return (assets: BigNumberish, totalAssets: BigNumberish, totalShares: BigNumberish) => { - totalAssets = toBigInt(totalAssets); - totalShares = toBigInt(totalShares); - - return mulDiv( - assets, - totalShares + (virtualShares as bigint), - totalAssets + (virtualAssets as bigint), - ); - }; + return (assets: bigint, totalAssets: bigint, totalShares: bigint) => + mulDiv(assets, totalShares + virtualShares, totalAssets + virtualAssets); }; diff --git a/src/wad.ts b/src/wad.ts index 8d9a7da..6bd75e4 100644 --- a/src/wad.ts +++ b/src/wad.ts @@ -1,78 +1,75 @@ -import { BigNumberish, parseUnits, toBigInt } from "ethers"; import { WAD } from "./constants"; import { avgHalfUp, expN, mulDivDown, mulDivHalfUp, mulDivUp, pow } from "./utils"; import { format, toDecimals, toFloat } from "./format"; -export const parseWad = (value: string) => parseUnits(value, 18); - -export const wadAdd = (x: BigNumberish, wad: BigNumberish) => { - return wadMul(x, WAD + toBigInt(wad)); +export const wadAdd = (x: bigint, wad: bigint) => { + return wadMul(x, WAD + wad); }; -export const wadSub = (x: BigNumberish, wad: BigNumberish) => { - return wadMul(x, WAD - toBigInt(wad)); +export const wadSub = (x: bigint, wad: bigint) => { + return wadMul(x, WAD - wad); }; -export const wadMul = (x: BigNumberish, other: BigNumberish) => { +export const wadMul = (x: bigint, other: bigint) => { return mulDivHalfUp(x, other, WAD); }; -export const wadMulUp = (x: BigNumberish, other: BigNumberish) => { +export const wadMulUp = (x: bigint, other: bigint) => { return mulDivUp(x, other, WAD); }; -export const wadMulDown = (x: BigNumberish, other: BigNumberish) => { +export const wadMulDown = (x: bigint, other: bigint) => { return mulDivDown(x, other, WAD); }; -export const wadDiv = (x: BigNumberish, other: BigNumberish) => { +export const wadDiv = (x: bigint, other: bigint) => { return mulDivHalfUp(x, WAD, other); }; -export const wadDivUp = (x: BigNumberish, other: BigNumberish) => { +export const wadDivUp = (x: bigint, other: bigint) => { return mulDivUp(x, WAD, other); }; -export const wadDivDown = (x: BigNumberish, other: BigNumberish) => { +export const wadDivDown = (x: bigint, other: bigint) => { return mulDivDown(x, WAD, other); }; -export const wadAvg = (x: BigNumberish, other: BigNumberish, wad: BigNumberish) => { +export const wadAvg = (x: bigint, other: bigint, wad: bigint) => { return avgHalfUp(x, other, wad, WAD); }; -export const wadPow = (x: BigNumberish, exponent: BigNumberish) => { +export const wadPow = (x: bigint, exponent: bigint) => { return pow(x, exponent, WAD, mulDivHalfUp); }; -export const wadPowUp = (x: BigNumberish, exponent: BigNumberish) => { +export const wadPowUp = (x: bigint, exponent: bigint) => { return pow(x, exponent, WAD, mulDivUp); }; -export const wadPowDown = (x: BigNumberish, exponent: BigNumberish) => { +export const wadPowDown = (x: bigint, exponent: bigint) => { return pow(x, exponent, WAD, mulDivDown); }; -export const wadExpN = (x: BigNumberish, N: BigNumberish) => { +export const wadExpN = (x: bigint, N: bigint) => { return expN(x, N, WAD, mulDivDown); }; -export const wadToDecimals = (x: BigNumberish, decimals: number) => { +export const wadToDecimals = (x: bigint, decimals: number) => { return toDecimals(x, decimals, 18); }; -export const wadToPercent = (x: BigNumberish) => { +export const wadToPercent = (x: bigint) => { return wadToDecimals(x, 4); }; -export const wadToRay = (x: BigNumberish) => { +export const wadToRay = (x: bigint) => { return wadToDecimals(x, 27); }; -export const formatWad = (x: BigNumberish, digits?: number) => { +export const formatWad = (x: bigint, digits?: number) => { return format(x, 18, digits); }; -export const toWadFloat = (x: BigNumberish) => { +export const toWadFloat = (x: bigint) => { return toFloat(x, 18); }; diff --git a/test/index.spec.ts b/test/index.spec.ts index 4c0f652..e455ac4 100644 --- a/test/index.spec.ts +++ b/test/index.spec.ts @@ -1,5 +1,3 @@ -import { toBigInt } from "ethers"; - import "../src"; const ZERO = "0"; @@ -8,28 +6,28 @@ const RAY = BigInt.RAY.toString(); const TWO_WAD = (BigInt.WAD * 2n).toString(); -describe("ethers-maths", () => { +describe("evm-maths", () => { it("should be approximately equal", async () => { - expect(toBigInt(0).approxEqAbs(1, 0)).toBeFalsy(); - expect(toBigInt(0).approxEqAbs(1, 1)).toBeTruthy(); + expect(0n.approxEqAbs(1n, 0n)).toBeFalsy(); + expect(0n.approxEqAbs(1n, 1n)).toBeTruthy(); }); it("should return the absolute value", async () => { - expect(toBigInt(1).abs()).toEqual(1n); - expect(toBigInt(-1).abs()).toEqual(1n); + expect(1n.abs()).toEqual(1n); + expect((-1n).abs()).toEqual(1n); }); it("should return minimum", async () => { - expect(BigInt.WAD.min(0).toString()).toEqual(ZERO); + expect(BigInt.WAD.min(0n).toString()).toEqual(ZERO); expect(BigInt.WAD.min(BigInt.RAY).toString()).toEqual(WAD); - expect(BigInt.WAD.min(BigInt.WAD + 1n, 0, BigInt.RAY).toString()).toEqual("0"); - expect(BigInt.min(BigInt.WAD + 1n, 0, BigInt.RAY).toString()).toEqual("0"); + expect(BigInt.WAD.min(BigInt.WAD + 1n, 0n, BigInt.RAY).toString()).toEqual("0"); + expect(BigInt.min(BigInt.WAD + 1n, 0n, BigInt.RAY).toString()).toEqual("0"); }); it("should return maximum", async () => { - expect(BigInt.WAD.max(0).toString()).toEqual(WAD); + expect(BigInt.WAD.max(0n).toString()).toEqual(WAD); expect(BigInt.WAD.max(BigInt.RAY).toString()).toEqual(RAY); - expect(BigInt.WAD.max(BigInt.WAD + 1n, 0, BigInt.RAY).toString()).toEqual(RAY); - expect(BigInt.max(BigInt.WAD + 1n, 0, BigInt.RAY).toString()).toEqual(RAY); + expect(BigInt.WAD.max(BigInt.WAD + 1n, 0n, BigInt.RAY).toString()).toEqual(RAY); + expect(BigInt.max(BigInt.WAD + 1n, 0n, BigInt.RAY).toString()).toEqual(RAY); }); it("should average", async () => { @@ -59,37 +57,37 @@ describe("ethers-maths", () => { it("should round half up on multiplication", async () => { expect((BigInt.PERCENT - 1n).percentMul(BigInt.PERCENT - 1n).toString()).toEqual( - (BigInt.PERCENT - 2n).toString() + (BigInt.PERCENT - 2n).toString(), ); expect((BigInt.WAD - 1n).wadMul(BigInt.WAD - 1n).toString()).toEqual( - (BigInt.WAD - 2n).toString() + (BigInt.WAD - 2n).toString(), ); expect((BigInt.RAY - 1n).rayMul(BigInt.RAY - 1n).toString()).toEqual( - (BigInt.RAY - 2n).toString() + (BigInt.RAY - 2n).toString(), ); }); it("should round up on multiplication", async () => { expect((BigInt.PERCENT - 1n).percentMulUp(BigInt.PERCENT - 1n).toString()).toEqual( - (BigInt.PERCENT - 1n).toString() + (BigInt.PERCENT - 1n).toString(), ); expect((BigInt.WAD - 1n).wadMulUp(BigInt.WAD - 1n).toString()).toEqual( - (BigInt.WAD - 1n).toString() + (BigInt.WAD - 1n).toString(), ); expect((BigInt.RAY - 1n).rayMulUp(BigInt.RAY - 1n).toString()).toEqual( - (BigInt.RAY - 1n).toString() + (BigInt.RAY - 1n).toString(), ); }); it("should round down on multiplication", async () => { - expect((BigInt.PERCENT - 1n).percentMulDown(1).toString()).toEqual("0"); - expect((BigInt.WAD - 1n).wadMulDown(1).toString()).toEqual("0"); - expect((BigInt.RAY - 1n).rayMulDown(1).toString()).toEqual("0"); + expect((BigInt.PERCENT - 1n).percentMulDown(1n).toString()).toEqual("0"); + expect((BigInt.WAD - 1n).wadMulDown(1n).toString()).toEqual("0"); + expect((BigInt.RAY - 1n).rayMulDown(1n).toString()).toEqual("0"); }); it("should round half up on division", async () => { expect(BigInt.PERCENT.percentDiv(BigInt.PERCENT - 1n).toString()).toEqual( - (BigInt.PERCENT + 1n).toString() + (BigInt.PERCENT + 1n).toString(), ); expect(BigInt.WAD.wadDiv(BigInt.WAD - 1n).toString()).toEqual((BigInt.WAD + 1n).toString()); expect(BigInt.RAY.rayDiv(BigInt.RAY - 1n).toString()).toEqual((BigInt.RAY + 1n).toString()); @@ -97,7 +95,7 @@ describe("ethers-maths", () => { it("should round up on division", async () => { expect(BigInt.PERCENT.percentDivUp(BigInt.PERCENT - 1n).toString()).toEqual( - (BigInt.PERCENT + 2n).toString() + (BigInt.PERCENT + 2n).toString(), ); expect(BigInt.WAD.wadDivUp(BigInt.WAD - 1n).toString()).toEqual((BigInt.WAD + 2n).toString()); expect(BigInt.RAY.rayDivUp(BigInt.RAY - 1n).toString()).toEqual((BigInt.RAY + 2n).toString()); @@ -105,7 +103,7 @@ describe("ethers-maths", () => { it("should round down on division", async () => { expect(BigInt.PERCENT.percentDivDown(BigInt.PERCENT - 1n).toString()).toEqual( - (BigInt.PERCENT + 1n).toString() + (BigInt.PERCENT + 1n).toString(), ); expect(BigInt.WAD.wadDivDown(BigInt.WAD - 1n).toString()).toEqual((BigInt.WAD + 1n).toString()); expect(BigInt.RAY.rayDivDown(BigInt.RAY - 1n).toString()).toEqual((BigInt.RAY + 1n).toString()); @@ -130,12 +128,12 @@ describe("ethers-maths", () => { }); it("should raise to the power of n", async () => { - expect((BigInt.PERCENT + BigInt.PERCENT).percentPow(2).formatPercent(1)).toEqual("4.0"); - expect((BigInt.PERCENT + BigInt.PERCENT).percentPow(3).formatPercent(1)).toEqual("8.0"); - expect((BigInt.WAD + BigInt.WAD).wadPow(2).formatWad(1)).toEqual("4.0"); - expect((BigInt.WAD + BigInt.WAD).wadPow(3).formatWad(1)).toEqual("8.0"); - expect((BigInt.RAY + BigInt.RAY).rayPow(2).formatRay(1)).toEqual("4.0"); - expect((BigInt.RAY + BigInt.RAY).rayPow(3).formatRay(1)).toEqual("8.0"); + expect((BigInt.PERCENT + BigInt.PERCENT).percentPow(2n).formatPercent(1)).toEqual("4.0"); + expect((BigInt.PERCENT + BigInt.PERCENT).percentPow(3n).formatPercent(1)).toEqual("8.0"); + expect((BigInt.WAD + BigInt.WAD).wadPow(2n).formatWad(1)).toEqual("4.0"); + expect((BigInt.WAD + BigInt.WAD).wadPow(3n).formatWad(1)).toEqual("8.0"); + expect((BigInt.RAY + BigInt.RAY).rayPow(2n).formatRay(1)).toEqual("4.0"); + expect((BigInt.RAY + BigInt.RAY).rayPow(3n).formatRay(1)).toEqual("8.0"); }); it("should scale decimals", async () => { diff --git a/yarn.lock b/yarn.lock index d5e8b49..c6ac595 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,11 +2,6 @@ # yarn lockfile v1 -"@adraffy/ens-normalize@1.9.2": - version "1.9.2" - resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.2.tgz#60111a5d9db45b2e5cbb6231b0bb8d97e8659316" - integrity sha512-0h+FrQDqe2Wn+IIGFkTCd4aAwTJ+7834Ek1COohCyV26AXhwQ7WQaz+4F/nLOeVl/3BtWHOHLPsq46V8YB46Eg== - "@ampproject/remapping@^2.2.0": version "2.2.1" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" @@ -15,35 +10,35 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.22.13": - version "7.22.13" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" - integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.5": + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" + integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== dependencies: - "@babel/highlight" "^7.22.13" + "@babel/highlight" "^7.23.4" chalk "^2.4.2" "@babel/compat-data@^7.22.9": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.20.tgz#8df6e96661209623f1975d66c35ffca66f3306d0" - integrity sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw== + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" + integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.20.tgz#e3d0eed84c049e2a2ae0a64d27b6a37edec385b7" - integrity sha512-Y6jd1ahLubuYweD/zJH+vvOY141v4f9igNQAQ+MBgq9JlHS2iTsZKn1aMsb3vGccZsXI16VzTBw52Xx0DWmtnA== + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.5.tgz#6e23f2acbcb77ad283c5ed141f824fd9f70101c7" + integrity sha512-Cwc2XjUrG4ilcfOw4wBAK+enbdgwAcAJCfGUItPBKR7Mjw4aEfAFYrLxeRp4jWgtNIKn3n2AlBOfwwafl+42/g== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.22.13" - "@babel/generator" "^7.22.15" + "@babel/code-frame" "^7.23.5" + "@babel/generator" "^7.23.5" "@babel/helper-compilation-targets" "^7.22.15" - "@babel/helper-module-transforms" "^7.22.20" - "@babel/helpers" "^7.22.15" - "@babel/parser" "^7.22.16" + "@babel/helper-module-transforms" "^7.23.3" + "@babel/helpers" "^7.23.5" + "@babel/parser" "^7.23.5" "@babel/template" "^7.22.15" - "@babel/traverse" "^7.22.20" - "@babel/types" "^7.22.19" - convert-source-map "^1.7.0" + "@babel/traverse" "^7.23.5" + "@babel/types" "^7.23.5" + convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.3" @@ -58,12 +53,12 @@ jsesc "^2.5.1" source-map "^0.5.0" -"@babel/generator@^7.17.3", "@babel/generator@^7.22.15", "@babel/generator@^7.7.2": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.15.tgz#1564189c7ec94cb8f77b5e8a90c4d200d21b2339" - integrity sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA== +"@babel/generator@^7.17.3", "@babel/generator@^7.23.5", "@babel/generator@^7.7.2": + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.5.tgz#17d0a1ea6b62f351d281350a5f80b87a810c4755" + integrity sha512-BPssCHrBD+0YrxviOa3QzpqwhNIXKEtOa2jQrm4FlmkC2apYgRnQcmPWiGZDlGxiNtltnUFolMe8497Esry+jA== dependencies: - "@babel/types" "^7.22.15" + "@babel/types" "^7.23.5" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" @@ -84,13 +79,13 @@ resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== -"@babel/helper-function-name@^7.16.7", "@babel/helper-function-name@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be" - integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ== +"@babel/helper-function-name@^7.16.7", "@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== dependencies: - "@babel/template" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" "@babel/helper-hoist-variables@^7.16.7", "@babel/helper-hoist-variables@^7.22.5": version "7.22.5" @@ -106,10 +101,10 @@ dependencies: "@babel/types" "^7.22.15" -"@babel/helper-module-transforms@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.20.tgz#da9edc14794babbe7386df438f3768067132f59e" - integrity sha512-dLT7JVWIUUxKOs1UnJUBR3S70YK+pKX6AbJgB2vMIvEkZkrfJDbYDJesnPshtKV4LhDOR3Oc5YULeDizRek+5A== +"@babel/helper-module-transforms@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" + integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== dependencies: "@babel/helper-environment-visitor" "^7.22.20" "@babel/helper-module-imports" "^7.22.15" @@ -136,43 +131,43 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-string-parser@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" - integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== +"@babel/helper-string-parser@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" + integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== -"@babel/helper-validator-identifier@^7.16.7", "@babel/helper-validator-identifier@^7.22.19", "@babel/helper-validator-identifier@^7.22.20": +"@babel/helper-validator-identifier@^7.16.7", "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== "@babel/helper-validator-option@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040" - integrity sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA== + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" + integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== -"@babel/helpers@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.15.tgz#f09c3df31e86e3ea0b7ff7556d85cdebd47ea6f1" - integrity sha512-7pAjK0aSdxOwR+CcYAqgWOGy5dcfvzsTIfFTb2odQqW47MDfv14UaJDY6eng8ylM2EaeKXdxaSWESbkmaQHTmw== +"@babel/helpers@^7.23.5": + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.5.tgz#52f522840df8f1a848d06ea6a79b79eefa72401e" + integrity sha512-oO7us8FzTEsG3U6ag9MfdF1iA/7Z6dz+MtFhifZk8C8o453rGJFFWUP1t+ULM9TUIAzC9uxXEiXjOiVMyd7QPg== dependencies: "@babel/template" "^7.22.15" - "@babel/traverse" "^7.22.15" - "@babel/types" "^7.22.15" + "@babel/traverse" "^7.23.5" + "@babel/types" "^7.23.5" -"@babel/highlight@^7.22.13": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" - integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== +"@babel/highlight@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" + integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== dependencies: "@babel/helper-validator-identifier" "^7.22.20" chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.17.3", "@babel/parser@^7.20.5", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.22.16": - version "7.22.16" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.16.tgz#180aead7f247305cce6551bea2720934e2fa2c95" - integrity sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.17.3", "@babel/parser@^7.20.5", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.5": + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.5.tgz#37dee97c4752af148e1d38c34b856b2507660563" + integrity sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -210,9 +205,9 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918" - integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz#8f2e4f8a9b5f9aa16067e142c1ac9cd9f810f473" + integrity sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -266,13 +261,13 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz#aac8d383b062c5072c647a31ef990c1d0af90272" - integrity sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz#24f460c85dbbc983cd2b9c4994178bcc01df958f" + integrity sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/template@^7.22.15", "@babel/template@^7.22.5", "@babel/template@^7.3.3": +"@babel/template@^7.22.15", "@babel/template@^7.3.3": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== @@ -297,19 +292,19 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@^7.22.15", "@babel/traverse@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.20.tgz#db572d9cb5c79e02d83e5618b82f6991c07584c9" - integrity sha512-eU260mPZbU7mZ0N+X10pxXhQFMGTeLb9eFS0mxehS8HZp9o1uSnFeWQuG1UPrlxgA7QoUzFhOnilHDp0AXCyHw== +"@babel/traverse@^7.23.5": + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.5.tgz#f546bf9aba9ef2b042c0e00d245990c15508e7ec" + integrity sha512-czx7Xy5a6sapWWRx61m1Ke1Ra4vczu1mCTtJam5zRTBOonfdJ+S/B6HYmGYu3fJtr8GGET3si6IhgWVBhJ/m8w== dependencies: - "@babel/code-frame" "^7.22.13" - "@babel/generator" "^7.22.15" + "@babel/code-frame" "^7.23.5" + "@babel/generator" "^7.23.5" "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.22.5" + "@babel/helper-function-name" "^7.23.0" "@babel/helper-hoist-variables" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.22.16" - "@babel/types" "^7.22.19" + "@babel/parser" "^7.23.5" + "@babel/types" "^7.23.5" debug "^4.1.0" globals "^11.1.0" @@ -321,13 +316,13 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" -"@babel/types@^7.0.0", "@babel/types@^7.17.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.3.3": - version "7.22.19" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.19.tgz#7425343253556916e440e662bb221a93ddb75684" - integrity sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg== +"@babel/types@^7.0.0", "@babel/types@^7.17.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.5", "@babel/types@^7.3.3": + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.5.tgz#48d730a00c95109fa4393352705954d74fb5b602" + integrity sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w== dependencies: - "@babel/helper-string-parser" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.19" + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -335,65 +330,56 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@commitlint/config-validator@^17.6.7": - version "17.6.7" - resolved "https://registry.yarnpkg.com/@commitlint/config-validator/-/config-validator-17.6.7.tgz#c664d42a1ecf5040a3bb0843845150f55734df41" - integrity sha512-vJSncmnzwMvpr3lIcm0I8YVVDJTzyjy7NZAeXbTXy+MPUdAr9pKyyg7Tx/ebOQ9kqzE6O9WT6jg2164br5UdsQ== +"@commitlint/config-validator@^18.4.3": + version "18.4.3" + resolved "https://registry.yarnpkg.com/@commitlint/config-validator/-/config-validator-18.4.3.tgz#cf71d36383cd5241e3b74097e7110514d5d43860" + integrity sha512-FPZZmTJBARPCyef9ohRC9EANiQEKSWIdatx5OlgeHKu878dWwpyeFauVkhzuBRJFcCA4Uvz/FDtlDKs008IHcA== dependencies: - "@commitlint/types" "^17.4.4" + "@commitlint/types" "^18.4.3" ajv "^8.11.0" -"@commitlint/execute-rule@^17.4.0": - version "17.4.0" - resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-17.4.0.tgz#4518e77958893d0a5835babe65bf87e2638f6939" - integrity sha512-LIgYXuCSO5Gvtc0t9bebAMSwd68ewzmqLypqI2Kke1rqOqqDbMpYcYfoPfFlv9eyLIh4jocHWwCK5FS7z9icUA== +"@commitlint/execute-rule@^18.4.3": + version "18.4.3" + resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-18.4.3.tgz#4dca5412dc8fdeb4210432961f209d9eb65008f5" + integrity sha512-t7FM4c+BdX9WWZCPrrbV5+0SWLgT3kCq7e7/GhHCreYifg3V8qyvO127HF796vyFql75n4TFF+5v1asOOWkV1Q== "@commitlint/load@>6.1.1": - version "17.7.1" - resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-17.7.1.tgz#0723b11723a20043a304a74960602dead89b5cdd" - integrity sha512-S/QSOjE1ztdogYj61p6n3UbkUvweR17FQ0zDbNtoTLc+Hz7vvfS7ehoTMQ27hPSjVBpp7SzEcOQu081RLjKHJQ== - dependencies: - "@commitlint/config-validator" "^17.6.7" - "@commitlint/execute-rule" "^17.4.0" - "@commitlint/resolve-extends" "^17.6.7" - "@commitlint/types" "^17.4.4" - "@types/node" "20.4.7" + version "18.4.3" + resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-18.4.3.tgz#de156698ddf6e9719ecc49159890834490f61bff" + integrity sha512-v6j2WhvRQJrcJaj5D+EyES2WKTxPpxENmNpNG3Ww8MZGik3jWRXtph0QTzia5ZJyPh2ib5aC/6BIDymkUUM58Q== + dependencies: + "@commitlint/config-validator" "^18.4.3" + "@commitlint/execute-rule" "^18.4.3" + "@commitlint/resolve-extends" "^18.4.3" + "@commitlint/types" "^18.4.3" + "@types/node" "^18.11.9" chalk "^4.1.0" - cosmiconfig "^8.0.0" - cosmiconfig-typescript-loader "^4.0.0" + cosmiconfig "^8.3.6" + cosmiconfig-typescript-loader "^5.0.0" lodash.isplainobject "^4.0.6" lodash.merge "^4.6.2" lodash.uniq "^4.5.0" resolve-from "^5.0.0" - ts-node "^10.8.1" - typescript "^4.6.4 || ^5.0.0" -"@commitlint/resolve-extends@^17.6.7": - version "17.6.7" - resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-17.6.7.tgz#9c53a4601c96ab2dd20b90fb35c988639307735d" - integrity sha512-PfeoAwLHtbOaC9bGn/FADN156CqkFz6ZKiVDMjuC2N5N0740Ke56rKU7Wxdwya8R8xzLK9vZzHgNbuGhaOVKIg== +"@commitlint/resolve-extends@^18.4.3": + version "18.4.3" + resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-18.4.3.tgz#741c42381ea48f4624209bfc0da0a15b5fba75b5" + integrity sha512-30sk04LZWf8+SDgJrbJCjM90gTg2LxsD9cykCFeFu+JFHvBFq5ugzp2eO/DJGylAdVaqxej3c7eTSE64hR/lnw== dependencies: - "@commitlint/config-validator" "^17.6.7" - "@commitlint/types" "^17.4.4" + "@commitlint/config-validator" "^18.4.3" + "@commitlint/types" "^18.4.3" import-fresh "^3.0.0" lodash.mergewith "^4.6.2" resolve-from "^5.0.0" resolve-global "^1.0.0" -"@commitlint/types@^17.4.4": - version "17.4.4" - resolved "https://registry.yarnpkg.com/@commitlint/types/-/types-17.4.4.tgz#1416df936e9aad0d6a7bbc979ecc31e55dade662" - integrity sha512-amRN8tRLYOsxRr6mTnGGGvB5EmW/4DDjLMgiwK3CCVEmN6Sr/6xePGEpWaspKkckILuUORCwe6VfDBw6uj4axQ== +"@commitlint/types@^18.4.3": + version "18.4.3" + resolved "https://registry.yarnpkg.com/@commitlint/types/-/types-18.4.3.tgz#bb50de49330ddff2adcc8ccabb840c8e660336b3" + integrity sha512-cvzx+vtY/I2hVBZHCLrpoh+sA0hfuzHwDc+BAFPimYLjJkpHnghQM+z8W/KyLGkygJh3BtI3xXXq+dKjnSWEmA== dependencies: chalk "^4.1.0" -"@cspotcode/source-map-support@^0.8.0": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== - dependencies: - "@jridgewell/trace-mapping" "0.3.9" - "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -611,7 +597,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": +"@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== @@ -626,32 +612,14 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.19" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz#f8a3249862f91be48d3127c3cfe992f79b4b8811" - integrity sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw== + version "0.3.20" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" + integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== dependencies: "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@noble/hashes@1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" - integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== - -"@noble/secp256k1@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" - integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== - "@sinclair/typebox@^0.27.8": version "0.27.8" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" @@ -683,30 +651,10 @@ javascript-natural-sort "0.7.1" lodash "^4.17.21" -"@tsconfig/node10@^1.0.7": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" - integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== - -"@tsconfig/node12@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" - integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== - -"@tsconfig/node14@^1.0.0": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" - integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== - -"@tsconfig/node16@^1.0.2": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" - integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== - "@types/babel__core@^7.1.14": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.2.tgz#215db4f4a35d710256579784a548907237728756" - integrity sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA== + version "7.20.5" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" + integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== dependencies: "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" @@ -715,108 +663,92 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.6.5" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.5.tgz#281f4764bcbbbc51fdded0f25aa587b4ce14da95" - integrity sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w== + version "7.6.7" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.7.tgz#a7aebf15c7bc0eb9abd638bdb5c0b8700399c9d0" + integrity sha512-6Sfsq+EaaLrw4RmdFWE9Onp63TOUue71AWb4Gpa6JxzgTYtimbM086WnYTy2U67AofR++QKCo08ZP6pwx8YFHQ== dependencies: "@babel/types" "^7.0.0" "@types/babel__template@*": - version "7.4.2" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.2.tgz#843e9f1f47c957553b0c374481dc4772921d6a6b" - integrity sha512-/AVzPICMhMOMYoSx9MoKpGDKdBRsIXMNByh1PXSZoa+v6ZoLa8xxtsT/uLQ/NJm0XVAWl/BvId4MlDeXJaeIZQ== + version "7.4.4" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.4.tgz#5672513701c1b2199bc6dad636a9d7491586766f" + integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.2.tgz#4ddf99d95cfdd946ff35d2b65c978d9c9bf2645d" - integrity sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw== + version "7.20.4" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.4.tgz#ec2c06fed6549df8bc0eb4615b683749a4a92e1b" + integrity sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA== dependencies: "@babel/types" "^7.20.7" "@types/graceful-fs@^4.1.3": - version "4.1.7" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.7.tgz#30443a2e64fd51113bc3e2ba0914d47109695e2a" - integrity sha512-MhzcwU8aUygZroVwL2jeYk6JisJrPl/oov/gsgGCue9mkgl9wjGbzReYQClxiUgFDnib9FuHqTndccKeZKxTRw== + version "4.1.9" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" + integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== dependencies: "@types/node" "*" "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" - integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" + integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== "@types/istanbul-lib-report@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" - integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz#53047614ae72e19fc0401d872de3ae2b4ce350bf" + integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== dependencies: "@types/istanbul-lib-coverage" "*" "@types/istanbul-reports@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" - integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz#0f03e3d2f670fbdac586e34b433783070cc16f54" + integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^29.5.5": - version "29.5.5" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.5.tgz#727204e06228fe24373df9bae76b90f3e8236a2a" - integrity sha512-ebylz2hnsWR9mYvmBFbXJXr+33UPc4+ZdxyDXh5w0FlPBTfCVN3wPL+kuOiQt3xvrK419v7XWeAs+AeOksafXg== +"@types/jest@^29.5.10": + version "29.5.10" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.10.tgz#a10fc5bab9e426081c12b2ef73d24d4f0c9b7f50" + integrity sha512-tE4yxKEphEyxj9s4inideLHktW/x6DwesIwWZ9NN1FKf9zbJYsnhBoA9vrHA/IuIOKwPa5PcFBNV4lpMIOEzyQ== dependencies: expect "^29.0.0" pretty-format "^29.0.0" "@types/node@*": - version "20.6.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.3.tgz#5b763b321cd3b80f6b8dde7a37e1a77ff9358dd9" - integrity sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA== - -"@types/node@18.15.13": - version "18.15.13" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" - integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== + version "20.10.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.0.tgz#16ddf9c0a72b832ec4fcce35b8249cf149214617" + integrity sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ== + dependencies: + undici-types "~5.26.4" -"@types/node@20.4.7": - version "20.4.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.7.tgz#74d323a93f1391a63477b27b9aec56669c98b2ab" - integrity sha512-bUBrPjEry2QUTsnuEjzjbS7voGWCc30W0qzgMf90GPeDGFRakvrz47ju+oqDAKCXLUCe39u57/ORMl/O/04/9g== +"@types/node@^18.11.9": + version "18.18.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.13.tgz#ae0f76c0bfe79d8fad0f910b78ae3e59b333c6e8" + integrity sha512-vXYZGRrSCreZmq1rEjMRLXJhiy8MrIeVasx+PCVlP414N7CJLHnMf+juVvjdprHyH+XRy3zKZLHeNueOpJCn0g== + dependencies: + undici-types "~5.26.4" "@types/stack-utils@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" - integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" + integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== "@types/yargs-parser@*": - version "21.0.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" - integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== + version "21.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" + integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== "@types/yargs@^17.0.8": - version "17.0.24" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.24.tgz#b3ef8d50ad4aa6aecf6ddc97c580a00f5aa11902" - integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== + version "17.0.32" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.32.tgz#030774723a2f7faafebf645f4e5a48371dca6229" + integrity sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog== dependencies: "@types/yargs-parser" "*" -acorn-walk@^8.1.1: - version "8.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" - integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== - -acorn@^8.4.1: - version "8.10.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" - integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== - -aes-js@4.0.0-beta.5: - version "4.0.0-beta.5" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873" - integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q== - ajv@^8.11.0: version "8.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" @@ -883,11 +815,6 @@ anymatch@^3.0.3: normalize-path "^3.0.0" picomatch "^2.0.4" -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1005,14 +932,14 @@ braces@^3.0.2: fill-range "^7.0.1" browserslist@^4.21.9: - version "4.21.10" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.10.tgz#dbbac576628c13d3b2231332cb2ec5a46e015bb0" - integrity sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ== + version "4.22.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.1.tgz#ba91958d1a59b87dab6fed8dfbcb3da5e2e9c619" + integrity sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ== dependencies: - caniuse-lite "^1.0.30001517" - electron-to-chromium "^1.4.477" + caniuse-lite "^1.0.30001541" + electron-to-chromium "^1.4.535" node-releases "^2.0.13" - update-browserslist-db "^1.0.11" + update-browserslist-db "^1.0.13" bs-logger@0.x: version "0.2.6" @@ -1061,10 +988,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001517: - version "1.0.30001538" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001538.tgz#9dbc6b9af1ff06b5eb12350c2012b3af56744f3f" - integrity sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw== +caniuse-lite@^1.0.30001541: + version "1.0.30001565" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001565.tgz#a528b253c8a2d95d2b415e11d8b9942acc100c4f" + integrity sha512-xrE//a3O7TP0vaJ8ikzkD2c2NgcVUvsEe2IvFTntV4Yd1Z9FVzh+gW+enX96L0psrbaFMcVcH2l90xNuGDWc8w== chalk@5.3.0: version "5.3.0" @@ -1099,9 +1026,9 @@ chardet@^0.7.0: integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== ci-info@^3.2.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" - integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== + version "3.9.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== cjs-module-lexer@^1.0.0: version "1.2.3" @@ -1123,9 +1050,9 @@ cli-cursor@^4.0.0: restore-cursor "^4.0.0" cli-spinners@^2.5.0: - version "2.9.1" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.1.tgz#9c0b9dad69a6d47cbb4333c14319b060ed395a35" - integrity sha512-jHgecW0pxkonBJdrKsqxgRX9AcG+u/5k0Q7WPDfi8AogLAdwxEkyYYNWwZ5GvVFoFx2uiY1eNcSK00fh+1+FyQ== + version "2.9.2" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.2.tgz#1773a8f4b9c4d6ac31563df53b3fc1d79462fe41" + integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg== cli-truncate@^3.1.0: version "3.1.0" @@ -1245,22 +1172,19 @@ conventional-commit-types@^3.0.0: resolved "https://registry.yarnpkg.com/conventional-commit-types/-/conventional-commit-types-3.0.0.tgz#7c9214e58eae93e85dd66dbfbafe7e4fffa2365b" integrity sha512-SmmCYnOniSsAa9GqWOeLqc179lfr5TRu5b4QFDkbsrJ5TZjPJx85wtOr3zn+1dbeNiXDKGPbZ72IKbPhLXh/Lg== -convert-source-map@^1.6.0, convert-source-map@^1.7.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" - integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== - convert-source-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -cosmiconfig-typescript-loader@^4.0.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.4.0.tgz#f3feae459ea090f131df5474ce4b1222912319f9" - integrity sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw== +cosmiconfig-typescript-loader@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-5.0.0.tgz#0d3becfe022a871f7275ceb2397d692e06045dc8" + integrity sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA== + dependencies: + jiti "^1.19.1" -cosmiconfig@^8.0.0: +cosmiconfig@^8.3.6: version "8.3.6" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.3.6.tgz#060a2b871d66dba6c8538ea1118ba1ac16f5fae3" integrity sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA== @@ -1283,11 +1207,6 @@ create-jest@^29.7.0: jest-util "^29.7.0" prompts "^2.0.1" -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -1360,11 +1279,6 @@ diff-sequences@^29.6.3: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - dot-prop@^5.1.0: version "5.3.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" @@ -1377,10 +1291,10 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== -electron-to-chromium@^1.4.477: - version "1.4.526" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.526.tgz#1bcda5f2b8238e497c20fcdb41af5da907a770e2" - integrity sha512-tjjTMjmZAx1g6COrintLTa2/jcafYKxKoiEkdQOrVdbLaHh2wCt2nsAF8ZHweezkrP+dl/VG9T5nabcYoo0U5Q== +electron-to-chromium@^1.4.535: + version "1.4.596" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.596.tgz#6752d1aa795d942d49dfc5d3764d6ea283fab1d7" + integrity sha512-zW3zbZ40Icb2BCWjm47nxwcFGYlIgdXkAx85XDO7cyky9J4QQfq8t0W19/TLZqq3JPQXtlv8BPIGmfa9Jb4scg== emittery@^0.13.1: version "0.13.1" @@ -1424,19 +1338,6 @@ esprima@^4.0.0: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -ethers@^6.0.0: - version "6.7.1" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.7.1.tgz#9c65e8b5d8e9ad77b7e8cf1c46099892cfafad49" - integrity sha512-qX5kxIFMfg1i+epfgb0xF4WM7IqapIIu50pOJ17aebkxxa4BacW5jFrQRmCJpDEg2ZK2oNtR5QjrQ1WDBF29dA== - dependencies: - "@adraffy/ens-normalize" "1.9.2" - "@noble/hashes" "1.1.2" - "@noble/secp256k1" "1.7.1" - "@types/node" "18.15.13" - aes-js "4.0.0-beta.5" - tslib "2.4.0" - ws "8.5.0" - eventemitter3@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" @@ -1586,10 +1487,10 @@ fsevents@^2.3.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== gensync@^1.0.0-beta.2: version "1.0.0-beta.2" @@ -1670,12 +1571,12 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== +hasown@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" + integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== dependencies: - function-bind "^1.1.1" + function-bind "^1.1.2" homedir-polyfill@^1.0.1: version "1.0.3" @@ -1782,11 +1683,11 @@ is-arrayish@^0.2.1: integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== is-core-module@^2.13.0: - version "2.13.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db" - integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== + version "2.13.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" + integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== dependencies: - has "^1.0.3" + hasown "^2.0.0" is-extglob@^2.1.1: version "2.1.1" @@ -1861,9 +1762,9 @@ isexe@^2.0.0: integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" - integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== + version "3.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" + integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== istanbul-lib-instrument@^5.0.4: version "5.2.1" @@ -1877,9 +1778,9 @@ istanbul-lib-instrument@^5.0.4: semver "^6.3.0" istanbul-lib-instrument@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.0.tgz#7a8af094cbfff1d5bb280f62ce043695ae8dd5b8" - integrity sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw== + version "6.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz#71e87707e8041428732518c6fb5211761753fbdf" + integrity sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA== dependencies: "@babel/core" "^7.12.3" "@babel/parser" "^7.14.7" @@ -2276,6 +2177,11 @@ jest@^29.7.0: import-local "^3.0.2" jest-cli "^29.7.0" +jiti@^1.19.1: + version "1.21.0" + resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.0.tgz#7c97f8fe045724e136a397f7340475244156105d" + integrity sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q== + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -2460,7 +2366,7 @@ make-dir@^4.0.0: dependencies: semver "^7.5.3" -make-error@1.x, make-error@^1.1.1: +make-error@1.x: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -2702,10 +2608,10 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -prettier@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" - integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== +prettier@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.0.tgz#c6d16474a5f764ea1a4a373c593b779697744d5e" + integrity sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw== pretty-format@^29.0.0, pretty-format@^29.7.0: version "29.7.0" @@ -2725,14 +2631,14 @@ prompts@^2.0.1: sisteransi "^1.0.5" punycode@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" - integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== pure-rand@^6.0.0: - version "6.0.3" - resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.3.tgz#3c9e6b53c09e52ac3cedffc85ab7c1c7094b38cb" - integrity sha512-KddyFewCsO0j3+np81IQ+SweXLDnDQTs5s67BOnrYmYe/yNmUhttQyGsYzy8yUnoljGAQ9sl38YB4vH8ur7Y+w== + version "6.0.4" + resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.4.tgz#50b737f6a925468679bff00ad20eade53f37d5c7" + integrity sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA== q@^1.5.1: version "1.5.1" @@ -2801,9 +2707,9 @@ resolve.exports@^2.0.0: integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== resolve@^1.20.0: - version "1.22.6" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.6.tgz#dd209739eca3aef739c626fea1b4f3c506195362" - integrity sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw== + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== dependencies: is-core-module "^2.13.0" path-parse "^1.0.7" @@ -3079,30 +2985,6 @@ ts-jest@^29.1.1: semver "^7.5.3" yargs-parser "^21.0.1" -ts-node@^10.8.1: - version "10.9.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" - integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== - dependencies: - "@cspotcode/source-map-support" "^0.8.0" - "@tsconfig/node10" "^1.0.7" - "@tsconfig/node12" "^1.0.7" - "@tsconfig/node14" "^1.0.0" - "@tsconfig/node16" "^1.0.2" - acorn "^8.4.1" - acorn-walk "^8.1.1" - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - v8-compile-cache-lib "^3.0.1" - yn "3.1.1" - -tslib@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== - tslib@^2.1.0: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" @@ -3123,20 +3005,25 @@ type-fest@^1.0.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== -"typescript@^4.6.4 || ^5.0.0", typescript@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" - integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== +typescript@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.2.tgz#00d1c7c1c46928c5845c1ee8d0cc2791031d4c43" + integrity sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ== + +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + version "2.0.1" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" + integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== -update-browserslist-db@^1.0.11: - version "1.0.12" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.12.tgz#868ce670ac09b4a4d4c86b608701c0dee2dc41cd" - integrity sha512-tE1smlR58jxbFMtrMpFNRmsrOXlpNXss965T1CrpwuZUzUAg/TBQc94SpyhDLSzrqrJS9xTRBthnZAGcE1oaxg== +update-browserslist-db@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" + integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== dependencies: escalade "^3.1.1" picocolors "^1.0.0" @@ -3153,19 +3040,14 @@ util-deprecate@^1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -v8-compile-cache-lib@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== - v8-to-istanbul@^9.0.1: - version "9.1.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz#1b83ed4e397f58c85c266a570fc2558b5feb9265" - integrity sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA== + version "9.2.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz#2ed7644a245cddd83d4e087b9b33b3e62dfd10ad" + integrity sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA== dependencies: "@jridgewell/trace-mapping" "^0.3.12" "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^1.6.0" + convert-source-map "^2.0.0" walker@^1.0.8: version "1.0.8" @@ -3231,11 +3113,6 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" -ws@8.5.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f" - integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg== - y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -3274,11 +3151,6 @@ yargs@^17.3.1: y18n "^5.0.5" yargs-parser "^21.1.1" -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"