@anywalletkit/protocol-swap2-omniston 0.2.2 → 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/protocol.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  OmnistonSwap2Protocol
3
- } from "./chunk-K2KBWGNL.js";
4
- import "./chunk-W3AXGSX3.js";
3
+ } from "./chunk-FMMBUGYB.js";
4
+ import "./chunk-3CGSN2T6.js";
5
5
  import "./chunk-QDXFC6BC.js";
6
6
  import "./chunk-AIWAM7BS.js";
7
7
  export {
package/dist/provider.cjs CHANGED
@@ -427,6 +427,7 @@ function sameJetton(a, b) {
427
427
  }
428
428
 
429
429
  // src/provider.ts
430
+ var import_core4 = require("@anywalletkit/core");
430
431
  var EVM_CASE = {
431
432
  1: "ethereum",
432
433
  56: "bnb",
@@ -672,7 +673,7 @@ async function validateEvmToTonOrderExtension(extension, expected) {
672
673
  cursor += 3;
673
674
  const initialRateBump = readBigEndian(getter, cursor, 3);
674
675
  cursor += 3;
675
- const pointCount = Number(readBigEndian(getter, cursor, 1));
676
+ const pointCount = (0, import_core4.bigintToNumber)(readBigEndian(getter, cursor, 1));
676
677
  cursor += 1;
677
678
  if (pointCount !== 5) throw new Error("omniston: unsupported EVM auction profile");
678
679
  const points = [];
@@ -688,7 +689,7 @@ async function validateEvmToTonOrderExtension(extension, expected) {
688
689
  cursor += 2;
689
690
  const whitelistDiscount = readBigEndian(getter, cursor, 1);
690
691
  cursor += 1;
691
- const getterWhitelistCount = Number(readBigEndian(getter, cursor, 1));
692
+ const getterWhitelistCount = (0, import_core4.bigintToNumber)(readBigEndian(getter, cursor, 1));
692
693
  cursor += 1;
693
694
  if (getterWhitelistCount !== 1 || cursor + getterWhitelistCount * 10 !== getter.length) {
694
695
  throw new Error("omniston: malformed EVM amount-getter whitelist");
@@ -716,7 +717,7 @@ async function validateEvmToTonOrderExtension(extension, expected) {
716
717
  cursor += 1;
717
718
  const allowedTime = readBigEndian(post, cursor, 4);
718
719
  cursor += 4;
719
- const whitelistCount = Number(readBigEndian(post, cursor, 1));
720
+ const whitelistCount = (0, import_core4.bigintToNumber)(readBigEndian(post, cursor, 1));
720
721
  cursor += 1;
721
722
  if (whitelistCount !== 1 || cursor + whitelistCount * 12 + 160 !== post.length) {
722
723
  throw new Error("omniston: malformed EVM post-interaction whitelist");
@@ -1478,7 +1479,7 @@ function omnistonProvider(opts = {}) {
1478
1479
  const out = BigInt(q.outputUnits);
1479
1480
  const floor = requiredMin(q.outputUnits);
1480
1481
  if (out < floor) return null;
1481
- const tightened = Number((out - floor) * 1000000n / out);
1482
+ const tightened = (0, import_core4.bigintToNumber)((out - floor) * 1000000n / out);
1482
1483
  const again = await rfq(Math.max(0, Math.min(tightened, slippagePips)));
1483
1484
  const againSwap = again?.settlementData.$case === "swap" ? again.settlementData.value : null;
1484
1485
  if (!again || !againSwap) return null;