@anywalletkit/protocol-swap2-omniston 0.2.3 → 0.2.4

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.
@@ -313,6 +313,7 @@ function sameJetton(a, b) {
313
313
  }
314
314
 
315
315
  // src/provider.ts
316
+ import { bigintToNumber } from "@anywalletkit/core";
316
317
  var EVM_CASE = {
317
318
  1: "ethereum",
318
319
  56: "bnb",
@@ -558,7 +559,7 @@ async function validateEvmToTonOrderExtension(extension, expected) {
558
559
  cursor += 3;
559
560
  const initialRateBump = readBigEndian(getter, cursor, 3);
560
561
  cursor += 3;
561
- const pointCount = Number(readBigEndian(getter, cursor, 1));
562
+ const pointCount = bigintToNumber(readBigEndian(getter, cursor, 1));
562
563
  cursor += 1;
563
564
  if (pointCount !== 5) throw new Error("omniston: unsupported EVM auction profile");
564
565
  const points = [];
@@ -574,7 +575,7 @@ async function validateEvmToTonOrderExtension(extension, expected) {
574
575
  cursor += 2;
575
576
  const whitelistDiscount = readBigEndian(getter, cursor, 1);
576
577
  cursor += 1;
577
- const getterWhitelistCount = Number(readBigEndian(getter, cursor, 1));
578
+ const getterWhitelistCount = bigintToNumber(readBigEndian(getter, cursor, 1));
578
579
  cursor += 1;
579
580
  if (getterWhitelistCount !== 1 || cursor + getterWhitelistCount * 10 !== getter.length) {
580
581
  throw new Error("omniston: malformed EVM amount-getter whitelist");
@@ -602,7 +603,7 @@ async function validateEvmToTonOrderExtension(extension, expected) {
602
603
  cursor += 1;
603
604
  const allowedTime = readBigEndian(post, cursor, 4);
604
605
  cursor += 4;
605
- const whitelistCount = Number(readBigEndian(post, cursor, 1));
606
+ const whitelistCount = bigintToNumber(readBigEndian(post, cursor, 1));
606
607
  cursor += 1;
607
608
  if (whitelistCount !== 1 || cursor + whitelistCount * 12 + 160 !== post.length) {
608
609
  throw new Error("omniston: malformed EVM post-interaction whitelist");
@@ -1364,7 +1365,7 @@ function omnistonProvider(opts = {}) {
1364
1365
  const out = BigInt(q.outputUnits);
1365
1366
  const floor = requiredMin(q.outputUnits);
1366
1367
  if (out < floor) return null;
1367
- const tightened = Number((out - floor) * 1000000n / out);
1368
+ const tightened = bigintToNumber((out - floor) * 1000000n / out);
1368
1369
  const again = await rfq(Math.max(0, Math.min(tightened, slippagePips)));
1369
1370
  const againSwap = again?.settlementData.$case === "swap" ? again.settlementData.value : null;
1370
1371
  if (!again || !againSwap) return null;
@@ -2145,4 +2146,4 @@ export {
2145
2146
  validateEvmToTonOrderExtension,
2146
2147
  omnistonProvider
2147
2148
  };
2148
- //# sourceMappingURL=chunk-W3AXGSX3.js.map
2149
+ //# sourceMappingURL=chunk-3CGSN2T6.js.map