@cetusprotocol/aggregator-sdk 0.0.0-experimental-20250625194009 → 0.0.0-experimental-20250625194659
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 +4 -10
- package/dist/index.mjs +4 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7714,8 +7714,8 @@ function parseRouterResponse(data, byAmountIn) {
|
|
|
7714
7714
|
version
|
|
7715
7715
|
};
|
|
7716
7716
|
}),
|
|
7717
|
-
amountIn: new import_bn5.default(
|
|
7718
|
-
amountOut: new import_bn5.default(
|
|
7717
|
+
amountIn: new import_bn5.default(route.amount_in.toString()),
|
|
7718
|
+
amountOut: new import_bn5.default(route.amount_out.toString()),
|
|
7719
7719
|
initialPrice: new decimal_default(route.initial_price.toString())
|
|
7720
7720
|
};
|
|
7721
7721
|
}),
|
|
@@ -7825,7 +7825,7 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
|
|
|
7825
7825
|
};
|
|
7826
7826
|
}
|
|
7827
7827
|
console.log("sdk getRouterResult \u{1F680} ~ response:", response);
|
|
7828
|
-
const
|
|
7828
|
+
const data = yield response.text().then((text) => {
|
|
7829
7829
|
const bigNumbers = [];
|
|
7830
7830
|
const regex = /"([^"]+)"\s*:\s*(\d{16,})/g;
|
|
7831
7831
|
const matches = text.matchAll(regex);
|
|
@@ -7844,13 +7844,7 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
|
|
|
7844
7844
|
console.log("\u5B89\u5168\u89E3\u6790\u7684\u6570\u636E:", data2);
|
|
7845
7845
|
return data2;
|
|
7846
7846
|
});
|
|
7847
|
-
console.log("sdk getRouterResult \u{1F680} ~
|
|
7848
|
-
const blob = yield response.blob().then((blob2) => blob2.text()).then((rawText) => {
|
|
7849
|
-
console.log("sdk getRouterResult\u539F\u59CB\u54CD\u5E94\u6587\u672C:", rawText);
|
|
7850
|
-
return rawText;
|
|
7851
|
-
});
|
|
7852
|
-
console.log("sdk getRouterResult \u{1F680} ~ blob:", blob);
|
|
7853
|
-
const data = yield response.json();
|
|
7847
|
+
console.log("sdk getRouterResult \u{1F680} ~ data:", data);
|
|
7854
7848
|
console.log("sdk getRouterResult \u{1F680} ~ data:", data);
|
|
7855
7849
|
const insufficientLiquidity = data.msg === "liquidity is not enough";
|
|
7856
7850
|
if (data.msg && data.msg.indexOf("HoneyPot scam") > -1) {
|
package/dist/index.mjs
CHANGED
|
@@ -7712,8 +7712,8 @@ function parseRouterResponse(data, byAmountIn) {
|
|
|
7712
7712
|
version
|
|
7713
7713
|
};
|
|
7714
7714
|
}),
|
|
7715
|
-
amountIn: new import_bn5.default(
|
|
7716
|
-
amountOut: new import_bn5.default(
|
|
7715
|
+
amountIn: new import_bn5.default(route.amount_in.toString()),
|
|
7716
|
+
amountOut: new import_bn5.default(route.amount_out.toString()),
|
|
7717
7717
|
initialPrice: new decimal_default(route.initial_price.toString())
|
|
7718
7718
|
};
|
|
7719
7719
|
}),
|
|
@@ -7823,7 +7823,7 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
|
|
|
7823
7823
|
};
|
|
7824
7824
|
}
|
|
7825
7825
|
console.log("sdk getRouterResult \u{1F680} ~ response:", response);
|
|
7826
|
-
const
|
|
7826
|
+
const data = yield response.text().then((text) => {
|
|
7827
7827
|
const bigNumbers = [];
|
|
7828
7828
|
const regex = /"([^"]+)"\s*:\s*(\d{16,})/g;
|
|
7829
7829
|
const matches = text.matchAll(regex);
|
|
@@ -7842,13 +7842,7 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
|
|
|
7842
7842
|
console.log("\u5B89\u5168\u89E3\u6790\u7684\u6570\u636E:", data2);
|
|
7843
7843
|
return data2;
|
|
7844
7844
|
});
|
|
7845
|
-
console.log("sdk getRouterResult \u{1F680} ~
|
|
7846
|
-
const blob = yield response.blob().then((blob2) => blob2.text()).then((rawText) => {
|
|
7847
|
-
console.log("sdk getRouterResult\u539F\u59CB\u54CD\u5E94\u6587\u672C:", rawText);
|
|
7848
|
-
return rawText;
|
|
7849
|
-
});
|
|
7850
|
-
console.log("sdk getRouterResult \u{1F680} ~ blob:", blob);
|
|
7851
|
-
const data = yield response.json();
|
|
7845
|
+
console.log("sdk getRouterResult \u{1F680} ~ data:", data);
|
|
7852
7846
|
console.log("sdk getRouterResult \u{1F680} ~ data:", data);
|
|
7853
7847
|
const insufficientLiquidity = data.msg === "liquidity is not enough";
|
|
7854
7848
|
if (data.msg && data.msg.indexOf("HoneyPot scam") > -1) {
|