@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/{chunk-W3AXGSX3.js → chunk-3CGSN2T6.js} +6 -5
- package/dist/chunk-3CGSN2T6.js.map +1 -0
- package/dist/{chunk-K2KBWGNL.js → chunk-FMMBUGYB.js} +2 -2
- package/dist/index.cjs +5 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/protocol.cjs +5 -4
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.js +2 -2
- package/dist/provider.cjs +5 -4
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.js +1 -1
- package/dist/validators.cjs +36 -34
- package/dist/validators.cjs.map +1 -1
- package/dist/validators.js +6 -4
- package/dist/validators.js.map +1 -1
- package/package.json +10 -7
- package/dist/chunk-W3AXGSX3.js.map +0 -1
- /package/dist/{chunk-K2KBWGNL.js.map → chunk-FMMBUGYB.js.map} +0 -0
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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;
|