@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.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  OmnistonSwap2Protocol
3
- } from "./chunk-K2KBWGNL.js";
3
+ } from "./chunk-FMMBUGYB.js";
4
4
  import {
5
5
  TON_SWAP_PROTOCOL_LAYOUTS,
6
6
  TonSwapPayloadError,
@@ -10,7 +10,7 @@ import {
10
10
  inMemorySecretStore,
11
11
  omnistonProvider,
12
12
  validateEvmToTonOrderExtension
13
- } from "./chunk-W3AXGSX3.js";
13
+ } from "./chunk-3CGSN2T6.js";
14
14
  import {
15
15
  omniston
16
16
  } from "./chunk-QDXFC6BC.js";
package/dist/protocol.cjs CHANGED
@@ -423,6 +423,7 @@ function sameJetton(a, b) {
423
423
  }
424
424
 
425
425
  // src/provider.ts
426
+ var import_core4 = require("@anywalletkit/core");
426
427
  var EVM_CASE = {
427
428
  1: "ethereum",
428
429
  56: "bnb",
@@ -668,7 +669,7 @@ async function validateEvmToTonOrderExtension(extension, expected) {
668
669
  cursor += 3;
669
670
  const initialRateBump = readBigEndian(getter, cursor, 3);
670
671
  cursor += 3;
671
- const pointCount = Number(readBigEndian(getter, cursor, 1));
672
+ const pointCount = (0, import_core4.bigintToNumber)(readBigEndian(getter, cursor, 1));
672
673
  cursor += 1;
673
674
  if (pointCount !== 5) throw new Error("omniston: unsupported EVM auction profile");
674
675
  const points = [];
@@ -684,7 +685,7 @@ async function validateEvmToTonOrderExtension(extension, expected) {
684
685
  cursor += 2;
685
686
  const whitelistDiscount = readBigEndian(getter, cursor, 1);
686
687
  cursor += 1;
687
- const getterWhitelistCount = Number(readBigEndian(getter, cursor, 1));
688
+ const getterWhitelistCount = (0, import_core4.bigintToNumber)(readBigEndian(getter, cursor, 1));
688
689
  cursor += 1;
689
690
  if (getterWhitelistCount !== 1 || cursor + getterWhitelistCount * 10 !== getter.length) {
690
691
  throw new Error("omniston: malformed EVM amount-getter whitelist");
@@ -712,7 +713,7 @@ async function validateEvmToTonOrderExtension(extension, expected) {
712
713
  cursor += 1;
713
714
  const allowedTime = readBigEndian(post, cursor, 4);
714
715
  cursor += 4;
715
- const whitelistCount = Number(readBigEndian(post, cursor, 1));
716
+ const whitelistCount = (0, import_core4.bigintToNumber)(readBigEndian(post, cursor, 1));
716
717
  cursor += 1;
717
718
  if (whitelistCount !== 1 || cursor + whitelistCount * 12 + 160 !== post.length) {
718
719
  throw new Error("omniston: malformed EVM post-interaction whitelist");
@@ -1474,7 +1475,7 @@ function omnistonProvider(opts = {}) {
1474
1475
  const out = BigInt(q.outputUnits);
1475
1476
  const floor = requiredMin(q.outputUnits);
1476
1477
  if (out < floor) return null;
1477
- const tightened = Number((out - floor) * 1000000n / out);
1478
+ const tightened = (0, import_core4.bigintToNumber)((out - floor) * 1000000n / out);
1478
1479
  const again = await rfq(Math.max(0, Math.min(tightened, slippagePips)));
1479
1480
  const againSwap = again?.settlementData.$case === "swap" ? again.settlementData.value : null;
1480
1481
  if (!again || !againSwap) return null;