@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/README.md +11 -0
- 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/protocol.js
CHANGED
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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;
|