@t2000/cli 10.27.1 → 10.27.2
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 +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -30191,11 +30191,21 @@ var T2000 = class _T2000 extends import_index2.default {
|
|
|
30191
30191
|
const rawAmount = BigInt(Math.floor(params.amount * 10 ** fromDecimals));
|
|
30192
30192
|
let route;
|
|
30193
30193
|
if (params.serializedRoute) {
|
|
30194
|
-
|
|
30194
|
+
let s = params.serializedRoute;
|
|
30195
|
+
const nested = s.serializedRoute;
|
|
30196
|
+
if (nested && typeof nested === "object" && typeof nested.fromCoinType === "string" && nested.routerData) {
|
|
30197
|
+
s = nested;
|
|
30198
|
+
}
|
|
30199
|
+
if (typeof s.fromCoinType !== "string" || typeof s.toCoinType !== "string") {
|
|
30200
|
+
throw new T2000Error(
|
|
30201
|
+
"SWAP_ROUTE_MISMATCH",
|
|
30202
|
+
"serializedRoute is not the object t2000 quoted \u2014 it is missing fromCoinType/toCoinType. Pass quote.serializedRoute exactly as the quote returned it (not the whole quote response), or omit serializedRoute to discover a fresh route."
|
|
30203
|
+
);
|
|
30204
|
+
}
|
|
30195
30205
|
if (!verifyCetusRouteCoinMatch2(s, { fromCoinType: fromType, toCoinType: toType })) {
|
|
30196
30206
|
throw new T2000Error(
|
|
30197
30207
|
"SWAP_ROUTE_MISMATCH",
|
|
30198
|
-
`The quoted route is for ${s.fromCoinType} -> ${s.toCoinType}, not ${
|
|
30208
|
+
`The quoted route is for ${s.fromCoinType} -> ${s.toCoinType}, not ${fromType} -> ${toType}. Re-quote and pass the new serializedRoute.`
|
|
30199
30209
|
);
|
|
30200
30210
|
}
|
|
30201
30211
|
if (s.byAmountIn !== byAmountIn || BigInt(s.amountIn) !== rawAmount) {
|