@chainflip/utils 2.2.0-alpha.5 → 2.2.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -464,7 +464,7 @@ const parseSemver = (version) => {
464
464
  };
465
465
  };
466
466
  const parseBlockSpecId = (blockVersion) => {
467
- const stringVersion = /@(\d+)$/.exec(blockVersion)?.[1];
467
+ const stringVersion = /@?(\d+)$/.exec(blockVersion)?.[1];
468
468
  require_assertion.assert(stringVersion, `Could not parse spec version from blockVersion: ${blockVersion}`);
469
469
  const digitCount = Math.ceil(stringVersion.length / 3);
470
470
  const paddedVersion = stringVersion.padStart(digitCount * 3, "0");
@@ -463,7 +463,7 @@ const parseSemver = (version) => {
463
463
  };
464
464
  };
465
465
  const parseBlockSpecId = (blockVersion) => {
466
- const stringVersion = /@(\d+)$/.exec(blockVersion)?.[1];
466
+ const stringVersion = /@?(\d+)$/.exec(blockVersion)?.[1];
467
467
  assert(stringVersion, `Could not parse spec version from blockVersion: ${blockVersion}`);
468
468
  const digitCount = Math.ceil(stringVersion.length / 3);
469
469
  const paddedVersion = stringVersion.padStart(digitCount * 3, "0");
package/dist/lending.cjs CHANGED
@@ -17,7 +17,7 @@ const calculateBorrowPowerUsedBps = ({ totalBorrowAmountUsd, totalCollateralBala
17
17
  };
18
18
  const calculateTotalEffectiveBorrowableAmount = ({ totalAmount, totalAvailableAmount, utilisationCapBps }) => {
19
19
  const totalBorrowedAmount = totalAmount - totalAvailableAmount;
20
- const totalEffectiveBorrowableAmount = new bignumber_js.default(totalAmount).multipliedBy(utilisationCapBps ?? 1e4).div(1e4).toFixed();
20
+ const totalEffectiveBorrowableAmount = new bignumber_js.default(totalAmount).multipliedBy(utilisationCapBps ?? 1e4).div(1e4).toFixed(0);
21
21
  return require_number.bigintMax(BigInt(totalEffectiveBorrowableAmount) - totalBorrowedAmount, 0n);
22
22
  };
23
23
 
package/dist/lending.mjs CHANGED
@@ -14,7 +14,7 @@ const calculateBorrowPowerUsedBps = ({ totalBorrowAmountUsd, totalCollateralBala
14
14
  };
15
15
  const calculateTotalEffectiveBorrowableAmount = ({ totalAmount, totalAvailableAmount, utilisationCapBps }) => {
16
16
  const totalBorrowedAmount = totalAmount - totalAvailableAmount;
17
- const totalEffectiveBorrowableAmount = new BigNumber(totalAmount).multipliedBy(utilisationCapBps ?? 1e4).div(1e4).toFixed();
17
+ const totalEffectiveBorrowableAmount = new BigNumber(totalAmount).multipliedBy(utilisationCapBps ?? 1e4).div(1e4).toFixed(0);
18
18
  return bigintMax(BigInt(totalEffectiveBorrowableAmount) - totalBorrowedAmount, 0n);
19
19
  };
20
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainflip/utils",
3
- "version": "2.2.0-alpha.5",
3
+ "version": "2.2.0-alpha.7",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",