@t2000/cli 1.26.0 → 1.27.1
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-GGXOFR5Y.js → chunk-V5GSOFGJ.js} +15 -3
- package/dist/{chunk-GGXOFR5Y.js.map → chunk-V5GSOFGJ.js.map} +1 -1
- package/dist/{dist-X5FWXI7K.js → dist-KIMZRUQE.js} +6 -2
- package/dist/{dist-ZB7UNB3B.js → dist-TUAS5C2A.js} +12 -3
- package/dist/{dist-ZB7UNB3B.js.map → dist-TUAS5C2A.js.map} +1 -1
- package/dist/index.js +3 -3
- package/package.json +3 -3
- /package/dist/{dist-X5FWXI7K.js.map → dist-KIMZRUQE.js.map} +0 -0
|
@@ -16716,6 +16716,7 @@ __export(cetus_swap_exports, {
|
|
|
16716
16716
|
deserializeCetusRoute: () => deserializeCetusRoute,
|
|
16717
16717
|
findSwapRoute: () => findSwapRoute,
|
|
16718
16718
|
isCetusRouteFresh: () => isCetusRouteFresh,
|
|
16719
|
+
isPrecomputedRouteCompatibleWithProviders: () => isPrecomputedRouteCompatibleWithProviders,
|
|
16719
16720
|
resolveTokenType: () => resolveTokenType,
|
|
16720
16721
|
serializeCetusRoute: () => serializeCetusRoute,
|
|
16721
16722
|
simulateSwap: () => simulateSwap,
|
|
@@ -16832,6 +16833,14 @@ function getClient(walletAddress, overlayFee) {
|
|
|
16832
16833
|
clientCache.set(key, client);
|
|
16833
16834
|
return client;
|
|
16834
16835
|
}
|
|
16836
|
+
function isPrecomputedRouteCompatibleWithProviders(route, providers) {
|
|
16837
|
+
if (!providers || providers.length === 0) return true;
|
|
16838
|
+
const allowed = new Set(providers);
|
|
16839
|
+
for (const path of route.routerData.paths) {
|
|
16840
|
+
if (!allowed.has(path.provider)) return false;
|
|
16841
|
+
}
|
|
16842
|
+
return true;
|
|
16843
|
+
}
|
|
16835
16844
|
async function findSwapRoute(params) {
|
|
16836
16845
|
const client = getClient(params.walletAddress, params.overlayFee);
|
|
16837
16846
|
const findParams = {
|
|
@@ -16909,7 +16918,7 @@ async function addSwapToTx(tx, client, address, input) {
|
|
|
16909
16918
|
}
|
|
16910
16919
|
let route;
|
|
16911
16920
|
let usedPrecomputedRoute = false;
|
|
16912
|
-
if (input.precomputedRoute && input.precomputedRoute.amountIn === effectiveRaw.toString() && input.precomputedRoute.byAmountIn === byAmountIn) {
|
|
16921
|
+
if (input.precomputedRoute && input.precomputedRoute.amountIn === effectiveRaw.toString() && input.precomputedRoute.byAmountIn === byAmountIn && isPrecomputedRouteCompatibleWithProviders(input.precomputedRoute, input.providers)) {
|
|
16913
16922
|
route = input.precomputedRoute;
|
|
16914
16923
|
usedPrecomputedRoute = true;
|
|
16915
16924
|
} else {
|
|
@@ -24047,7 +24056,8 @@ async function getSwapQuote(params) {
|
|
|
24047
24056
|
from: fromType,
|
|
24048
24057
|
to: toType,
|
|
24049
24058
|
amount: rawAmount,
|
|
24050
|
-
byAmountIn
|
|
24059
|
+
byAmountIn,
|
|
24060
|
+
providers: params.providers
|
|
24051
24061
|
});
|
|
24052
24062
|
if (!route) throw new T2000Error("SWAP_FAILED", `No swap route found for ${params.from} -> ${params.to}.`);
|
|
24053
24063
|
if (route.insufficientLiquidity) {
|
|
@@ -24253,6 +24263,8 @@ export {
|
|
|
24253
24263
|
ContactManager,
|
|
24254
24264
|
T2000,
|
|
24255
24265
|
buildHarvestRewardsTx,
|
|
24266
|
+
SPONSORED_PYTH_DEPENDENT_PROVIDERS,
|
|
24267
|
+
getSponsoredSwapProviders,
|
|
24256
24268
|
WRITE_APPENDER_REGISTRY,
|
|
24257
24269
|
deriveAllowedAddressesFromPtb,
|
|
24258
24270
|
composeTx,
|
|
@@ -24295,4 +24307,4 @@ axios/dist/node/axios.cjs:
|
|
|
24295
24307
|
@scure/bip39/index.js:
|
|
24296
24308
|
(*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
|
|
24297
24309
|
*/
|
|
24298
|
-
//# sourceMappingURL=chunk-
|
|
24310
|
+
//# sourceMappingURL=chunk-V5GSOFGJ.js.map
|