@anywalletkit/protocol-swap2-omniston 0.2.3 → 0.2.5

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.
package/dist/index.cjs CHANGED
@@ -436,6 +436,7 @@ function sameJetton(a, b) {
436
436
  }
437
437
 
438
438
  // src/provider.ts
439
+ var import_core4 = require("@anywalletkit/core");
439
440
  var EVM_CASE = {
440
441
  1: "ethereum",
441
442
  56: "bnb",
@@ -681,7 +682,7 @@ async function validateEvmToTonOrderExtension(extension, expected) {
681
682
  cursor += 3;
682
683
  const initialRateBump = readBigEndian(getter, cursor, 3);
683
684
  cursor += 3;
684
- const pointCount = Number(readBigEndian(getter, cursor, 1));
685
+ const pointCount = (0, import_core4.bigintToNumber)(readBigEndian(getter, cursor, 1));
685
686
  cursor += 1;
686
687
  if (pointCount !== 5) throw new Error("omniston: unsupported EVM auction profile");
687
688
  const points = [];
@@ -697,7 +698,7 @@ async function validateEvmToTonOrderExtension(extension, expected) {
697
698
  cursor += 2;
698
699
  const whitelistDiscount = readBigEndian(getter, cursor, 1);
699
700
  cursor += 1;
700
- const getterWhitelistCount = Number(readBigEndian(getter, cursor, 1));
701
+ const getterWhitelistCount = (0, import_core4.bigintToNumber)(readBigEndian(getter, cursor, 1));
701
702
  cursor += 1;
702
703
  if (getterWhitelistCount !== 1 || cursor + getterWhitelistCount * 10 !== getter.length) {
703
704
  throw new Error("omniston: malformed EVM amount-getter whitelist");
@@ -725,7 +726,7 @@ async function validateEvmToTonOrderExtension(extension, expected) {
725
726
  cursor += 1;
726
727
  const allowedTime = readBigEndian(post, cursor, 4);
727
728
  cursor += 4;
728
- const whitelistCount = Number(readBigEndian(post, cursor, 1));
729
+ const whitelistCount = (0, import_core4.bigintToNumber)(readBigEndian(post, cursor, 1));
729
730
  cursor += 1;
730
731
  if (whitelistCount !== 1 || cursor + whitelistCount * 12 + 160 !== post.length) {
731
732
  throw new Error("omniston: malformed EVM post-interaction whitelist");
@@ -1487,7 +1488,7 @@ function omnistonProvider(opts = {}) {
1487
1488
  const out = BigInt(q.outputUnits);
1488
1489
  const floor = requiredMin(q.outputUnits);
1489
1490
  if (out < floor) return null;
1490
- const tightened = Number((out - floor) * 1000000n / out);
1491
+ const tightened = (0, import_core4.bigintToNumber)((out - floor) * 1000000n / out);
1491
1492
  const again = await rfq(Math.max(0, Math.min(tightened, slippagePips)));
1492
1493
  const againSwap = again?.settlementData.$case === "swap" ? again.settlementData.value : null;
1493
1494
  if (!again || !againSwap) return null;