@cetusprotocol/aggregator-sdk 1.1.0 → 1.1.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.d.mts +12 -27
- package/dist/index.d.ts +12 -27
- package/dist/index.js +6 -8
- package/dist/index.mjs +6 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -152,29 +152,6 @@ type DeepbookV3ConfigResponse = {
|
|
|
152
152
|
msg: string;
|
|
153
153
|
data: DeepbookV3Config;
|
|
154
154
|
};
|
|
155
|
-
interface SwapInPoolsParams$1 {
|
|
156
|
-
from: string;
|
|
157
|
-
target: string;
|
|
158
|
-
amount: BN;
|
|
159
|
-
byAmountIn: boolean;
|
|
160
|
-
pools: string[];
|
|
161
|
-
}
|
|
162
|
-
interface SwapInPoolsResult {
|
|
163
|
-
isExceed: boolean;
|
|
164
|
-
routeData?: RouterData;
|
|
165
|
-
}
|
|
166
|
-
type BuildRouterSwapParams = {
|
|
167
|
-
routers: Router[];
|
|
168
|
-
amountIn: BN;
|
|
169
|
-
amountOut: BN;
|
|
170
|
-
byAmountIn: boolean;
|
|
171
|
-
slippage: number;
|
|
172
|
-
fromCoinType: string;
|
|
173
|
-
targetCoinType: string;
|
|
174
|
-
partner?: string;
|
|
175
|
-
isMergeTragetCoin?: boolean;
|
|
176
|
-
refreshAllCoins?: boolean;
|
|
177
|
-
};
|
|
178
155
|
type PathV2 = {
|
|
179
156
|
id: string;
|
|
180
157
|
a2b: boolean;
|
|
@@ -223,7 +200,7 @@ declare class AggregatorConfig {
|
|
|
223
200
|
|
|
224
201
|
declare function getRouterResult(endpoint: string, apiKey: string, params: FindRouterParams, overlayFee: number, overlayFeeReceiver: string): Promise<RouterDataV3 | null>;
|
|
225
202
|
declare function getDeepbookV3Config(endpoint: string): Promise<DeepbookV3ConfigResponse | null>;
|
|
226
|
-
declare function processFlattenRoutes(routerData: RouterDataV3
|
|
203
|
+
declare function processFlattenRoutes(routerData: RouterDataV3): ProcessedRouterData;
|
|
227
204
|
|
|
228
205
|
interface Extends {
|
|
229
206
|
deepbookv3DeepFee?: TransactionObjectArgument;
|
|
@@ -336,7 +313,7 @@ declare class AggregatorClient {
|
|
|
336
313
|
findRouters(params: FindRouterParams): Promise<RouterDataV3 | null>;
|
|
337
314
|
executeFlexibleInputSwap(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, expectedAmountOut: string, amountLimit: string, pythPriceIDs: Map<string, string>, partner?: string, deepbookv3DeepFee?: TransactionObjectArgument, packages?: Map<string, string>): Promise<void>;
|
|
338
315
|
newDexRouterV3(provider: string, pythPriceIDs: Map<string, string>, partner?: string): DexRouter;
|
|
339
|
-
expectInputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, expectAmountOut: string, amountOutLimit: string, pythPriceIDs: Map<string, string>,
|
|
316
|
+
expectInputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, expectAmountOut: string, amountOutLimit: string, pythPriceIDs: Map<string, string>, partner?: string): TransactionObjectArgument;
|
|
340
317
|
expectOutputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, amountOut: string, _amountLimit: string, // it will set when build inputcoin
|
|
341
318
|
partner?: string): TransactionObjectArgument;
|
|
342
319
|
routerSwap(params: BuildRouterSwapParamsV3): Promise<TransactionObjectArgument>;
|
|
@@ -766,6 +743,15 @@ declare class AggregatorError extends Error {
|
|
|
766
743
|
static isAggregatorErrorCode(e: any, code: AggregatorErrorCode): boolean;
|
|
767
744
|
}
|
|
768
745
|
|
|
746
|
+
type BuildRouterSwapParams = {
|
|
747
|
+
routers: Router[];
|
|
748
|
+
byAmountIn: boolean;
|
|
749
|
+
inputCoin: TransactionObjectArgument;
|
|
750
|
+
slippage: number;
|
|
751
|
+
txb: Transaction;
|
|
752
|
+
partner?: string;
|
|
753
|
+
deepbookv3DeepFee?: TransactionObjectArgument;
|
|
754
|
+
};
|
|
769
755
|
type BuildFastRouterSwapParams = {
|
|
770
756
|
routers: Router[];
|
|
771
757
|
byAmountIn: boolean;
|
|
@@ -791,7 +777,6 @@ type BuildFastRouterSwapParamsV2 = {
|
|
|
791
777
|
refreshAllCoins?: boolean;
|
|
792
778
|
payDeepFeeAmount?: number;
|
|
793
779
|
};
|
|
794
|
-
|
|
795
780
|
interface PythConfig {
|
|
796
781
|
wormholeStateId: string;
|
|
797
782
|
pythStateId: string;
|
|
@@ -918,4 +903,4 @@ declare class CoinUtils {
|
|
|
918
903
|
static calculateTotalBalance(coins: CoinAsset[]): bigint;
|
|
919
904
|
}
|
|
920
905
|
|
|
921
|
-
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, type BigNumber, type BuildCoinResult, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, CETUS, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CETUS_V3_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, type CoinAsset, CoinInfoAddress, CoinStoreAddress, CoinUtils, type ComparisonResult, ConfigErrorCode, DEEPBOOKV2, DEEPBOOKV3, DEEPBOOK_CLOB_V2_MODULE, DEEPBOOK_CUSTODIAN_V2_MODULE, DEEPBOOK_DEX, DEEPBOOK_MODULE, DEEPBOOK_PACKAGE_ID, DEEPBOOK_PUBLISHED_AT, DEEPBOOK_V3_DEEP_FEE_TYPES, DEFAULT_AGG_V2_ENDPOINT, DEFAULT_AGG_V3_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, type FindRouterParams, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, type FlattenedPath, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, type GasMetrics, type GetOrCreateAccountCapResult, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAINNET_AFTERMATH_INSURANCE_FUND_ID, MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, MAINNET_AFTERMATH_REFERRAL_VAULT_ID, MAINNET_AFTERMATH_REGISTRY_ID, MAINNET_AFTERMATH_TREASURY_ID, MAINNET_CETUS_GLOBAL_CONFIG_ID, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, type Package, type Path, type PathV2, type PreSwapLpChangeParams, type ProcessedRouterData, type PythConfig, REPAY_FLASH_SWAP_A2B_FUNC, REPAY_FLASH_SWAP_B2A_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_A2B_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_B2A_FUNC, RepayFalshSwapFunc, RepayFlashSwapWithPartnerFunc, type Router, type RouterData, type RouterDataV2, type RouterError, type RouterV2, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiObjectIdType, type SuiResource, type SuiStructTag, type SuiTxArg, SuiZeroCoinFn, type SwapGasAnalysis, type SwapInPoolsParams
|
|
906
|
+
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, type BigNumber, type BuildCoinResult, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, CETUS, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CETUS_V3_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, type CoinAsset, CoinInfoAddress, CoinStoreAddress, CoinUtils, type ComparisonResult, ConfigErrorCode, DEEPBOOKV2, DEEPBOOKV3, DEEPBOOK_CLOB_V2_MODULE, DEEPBOOK_CUSTODIAN_V2_MODULE, DEEPBOOK_DEX, DEEPBOOK_MODULE, DEEPBOOK_PACKAGE_ID, DEEPBOOK_PUBLISHED_AT, DEEPBOOK_V3_DEEP_FEE_TYPES, DEFAULT_AGG_V2_ENDPOINT, DEFAULT_AGG_V3_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, type FindRouterParams, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, type FlattenedPath, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, type GasMetrics, type GetOrCreateAccountCapResult, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAINNET_AFTERMATH_INSURANCE_FUND_ID, MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, MAINNET_AFTERMATH_REFERRAL_VAULT_ID, MAINNET_AFTERMATH_REGISTRY_ID, MAINNET_AFTERMATH_TREASURY_ID, MAINNET_CETUS_GLOBAL_CONFIG_ID, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, type Package, type Path, type PathV2, type PreSwapLpChangeParams, type ProcessedRouterData, type PythConfig, REPAY_FLASH_SWAP_A2B_FUNC, REPAY_FLASH_SWAP_B2A_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_A2B_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_B2A_FUNC, RepayFalshSwapFunc, RepayFlashSwapWithPartnerFunc, type Router, type RouterData, type RouterDataV2, type RouterDataV3, type RouterError, type RouterV2, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiObjectIdType, type SuiResource, type SuiStructTag, type SuiTxArg, SuiZeroCoinFn, type SwapGasAnalysis, type SwapInPoolsParams, type SwapInPoolsResultV3, TEN_POW_NINE, TESTNET_AFTERMATH_INSURANCE_FUND_ID, TESTNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, TESTNET_AFTERMATH_REFERRAL_VAULT_ID, TESTNET_AFTERMATH_REGISTRY_ID, TESTNET_AFTERMATH_TREASURY_ID, TESTNET_CETUS_GLOBAL_CONFIG_ID, TESTNET_FLOWX_AMM_CONTAINER_ID, TRANSFER_ACCOUNT_CAP, TRANSFER_OR_DESTORY_COIN_FUNC, TURBOS, TURBOS_DEX, TURBOS_MODULE, TURBOS_VERSIONED, TWO, TransactionErrorCode, TypesErrorCode, U128, U64_MAX, U64_MAX_BN, UTILS_MODULE, VOLO, ZERO, buildInputCoin, calculateGasEfficiency, calculatePriceImpact, checkInvalidSuiAddress, compareCoins, compareGasMetrics, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, isValidDowngradeUuid6, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -152,29 +152,6 @@ type DeepbookV3ConfigResponse = {
|
|
|
152
152
|
msg: string;
|
|
153
153
|
data: DeepbookV3Config;
|
|
154
154
|
};
|
|
155
|
-
interface SwapInPoolsParams$1 {
|
|
156
|
-
from: string;
|
|
157
|
-
target: string;
|
|
158
|
-
amount: BN;
|
|
159
|
-
byAmountIn: boolean;
|
|
160
|
-
pools: string[];
|
|
161
|
-
}
|
|
162
|
-
interface SwapInPoolsResult {
|
|
163
|
-
isExceed: boolean;
|
|
164
|
-
routeData?: RouterData;
|
|
165
|
-
}
|
|
166
|
-
type BuildRouterSwapParams = {
|
|
167
|
-
routers: Router[];
|
|
168
|
-
amountIn: BN;
|
|
169
|
-
amountOut: BN;
|
|
170
|
-
byAmountIn: boolean;
|
|
171
|
-
slippage: number;
|
|
172
|
-
fromCoinType: string;
|
|
173
|
-
targetCoinType: string;
|
|
174
|
-
partner?: string;
|
|
175
|
-
isMergeTragetCoin?: boolean;
|
|
176
|
-
refreshAllCoins?: boolean;
|
|
177
|
-
};
|
|
178
155
|
type PathV2 = {
|
|
179
156
|
id: string;
|
|
180
157
|
a2b: boolean;
|
|
@@ -223,7 +200,7 @@ declare class AggregatorConfig {
|
|
|
223
200
|
|
|
224
201
|
declare function getRouterResult(endpoint: string, apiKey: string, params: FindRouterParams, overlayFee: number, overlayFeeReceiver: string): Promise<RouterDataV3 | null>;
|
|
225
202
|
declare function getDeepbookV3Config(endpoint: string): Promise<DeepbookV3ConfigResponse | null>;
|
|
226
|
-
declare function processFlattenRoutes(routerData: RouterDataV3
|
|
203
|
+
declare function processFlattenRoutes(routerData: RouterDataV3): ProcessedRouterData;
|
|
227
204
|
|
|
228
205
|
interface Extends {
|
|
229
206
|
deepbookv3DeepFee?: TransactionObjectArgument;
|
|
@@ -336,7 +313,7 @@ declare class AggregatorClient {
|
|
|
336
313
|
findRouters(params: FindRouterParams): Promise<RouterDataV3 | null>;
|
|
337
314
|
executeFlexibleInputSwap(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, expectedAmountOut: string, amountLimit: string, pythPriceIDs: Map<string, string>, partner?: string, deepbookv3DeepFee?: TransactionObjectArgument, packages?: Map<string, string>): Promise<void>;
|
|
338
315
|
newDexRouterV3(provider: string, pythPriceIDs: Map<string, string>, partner?: string): DexRouter;
|
|
339
|
-
expectInputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, expectAmountOut: string, amountOutLimit: string, pythPriceIDs: Map<string, string>,
|
|
316
|
+
expectInputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, expectAmountOut: string, amountOutLimit: string, pythPriceIDs: Map<string, string>, partner?: string): TransactionObjectArgument;
|
|
340
317
|
expectOutputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, amountOut: string, _amountLimit: string, // it will set when build inputcoin
|
|
341
318
|
partner?: string): TransactionObjectArgument;
|
|
342
319
|
routerSwap(params: BuildRouterSwapParamsV3): Promise<TransactionObjectArgument>;
|
|
@@ -766,6 +743,15 @@ declare class AggregatorError extends Error {
|
|
|
766
743
|
static isAggregatorErrorCode(e: any, code: AggregatorErrorCode): boolean;
|
|
767
744
|
}
|
|
768
745
|
|
|
746
|
+
type BuildRouterSwapParams = {
|
|
747
|
+
routers: Router[];
|
|
748
|
+
byAmountIn: boolean;
|
|
749
|
+
inputCoin: TransactionObjectArgument;
|
|
750
|
+
slippage: number;
|
|
751
|
+
txb: Transaction;
|
|
752
|
+
partner?: string;
|
|
753
|
+
deepbookv3DeepFee?: TransactionObjectArgument;
|
|
754
|
+
};
|
|
769
755
|
type BuildFastRouterSwapParams = {
|
|
770
756
|
routers: Router[];
|
|
771
757
|
byAmountIn: boolean;
|
|
@@ -791,7 +777,6 @@ type BuildFastRouterSwapParamsV2 = {
|
|
|
791
777
|
refreshAllCoins?: boolean;
|
|
792
778
|
payDeepFeeAmount?: number;
|
|
793
779
|
};
|
|
794
|
-
|
|
795
780
|
interface PythConfig {
|
|
796
781
|
wormholeStateId: string;
|
|
797
782
|
pythStateId: string;
|
|
@@ -918,4 +903,4 @@ declare class CoinUtils {
|
|
|
918
903
|
static calculateTotalBalance(coins: CoinAsset[]): bigint;
|
|
919
904
|
}
|
|
920
905
|
|
|
921
|
-
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, type BigNumber, type BuildCoinResult, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, CETUS, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CETUS_V3_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, type CoinAsset, CoinInfoAddress, CoinStoreAddress, CoinUtils, type ComparisonResult, ConfigErrorCode, DEEPBOOKV2, DEEPBOOKV3, DEEPBOOK_CLOB_V2_MODULE, DEEPBOOK_CUSTODIAN_V2_MODULE, DEEPBOOK_DEX, DEEPBOOK_MODULE, DEEPBOOK_PACKAGE_ID, DEEPBOOK_PUBLISHED_AT, DEEPBOOK_V3_DEEP_FEE_TYPES, DEFAULT_AGG_V2_ENDPOINT, DEFAULT_AGG_V3_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, type FindRouterParams, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, type FlattenedPath, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, type GasMetrics, type GetOrCreateAccountCapResult, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAINNET_AFTERMATH_INSURANCE_FUND_ID, MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, MAINNET_AFTERMATH_REFERRAL_VAULT_ID, MAINNET_AFTERMATH_REGISTRY_ID, MAINNET_AFTERMATH_TREASURY_ID, MAINNET_CETUS_GLOBAL_CONFIG_ID, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, type Package, type Path, type PathV2, type PreSwapLpChangeParams, type ProcessedRouterData, type PythConfig, REPAY_FLASH_SWAP_A2B_FUNC, REPAY_FLASH_SWAP_B2A_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_A2B_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_B2A_FUNC, RepayFalshSwapFunc, RepayFlashSwapWithPartnerFunc, type Router, type RouterData, type RouterDataV2, type RouterError, type RouterV2, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiObjectIdType, type SuiResource, type SuiStructTag, type SuiTxArg, SuiZeroCoinFn, type SwapGasAnalysis, type SwapInPoolsParams
|
|
906
|
+
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, type BigNumber, type BuildCoinResult, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, CETUS, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CETUS_V3_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, type CoinAsset, CoinInfoAddress, CoinStoreAddress, CoinUtils, type ComparisonResult, ConfigErrorCode, DEEPBOOKV2, DEEPBOOKV3, DEEPBOOK_CLOB_V2_MODULE, DEEPBOOK_CUSTODIAN_V2_MODULE, DEEPBOOK_DEX, DEEPBOOK_MODULE, DEEPBOOK_PACKAGE_ID, DEEPBOOK_PUBLISHED_AT, DEEPBOOK_V3_DEEP_FEE_TYPES, DEFAULT_AGG_V2_ENDPOINT, DEFAULT_AGG_V3_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, type FindRouterParams, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, type FlattenedPath, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, type GasMetrics, type GetOrCreateAccountCapResult, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAINNET_AFTERMATH_INSURANCE_FUND_ID, MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, MAINNET_AFTERMATH_REFERRAL_VAULT_ID, MAINNET_AFTERMATH_REGISTRY_ID, MAINNET_AFTERMATH_TREASURY_ID, MAINNET_CETUS_GLOBAL_CONFIG_ID, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, type Package, type Path, type PathV2, type PreSwapLpChangeParams, type ProcessedRouterData, type PythConfig, REPAY_FLASH_SWAP_A2B_FUNC, REPAY_FLASH_SWAP_B2A_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_A2B_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_B2A_FUNC, RepayFalshSwapFunc, RepayFlashSwapWithPartnerFunc, type Router, type RouterData, type RouterDataV2, type RouterDataV3, type RouterError, type RouterV2, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiObjectIdType, type SuiResource, type SuiStructTag, type SuiTxArg, SuiZeroCoinFn, type SwapGasAnalysis, type SwapInPoolsParams, type SwapInPoolsResultV3, TEN_POW_NINE, TESTNET_AFTERMATH_INSURANCE_FUND_ID, TESTNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, TESTNET_AFTERMATH_REFERRAL_VAULT_ID, TESTNET_AFTERMATH_REGISTRY_ID, TESTNET_AFTERMATH_TREASURY_ID, TESTNET_CETUS_GLOBAL_CONFIG_ID, TESTNET_FLOWX_AMM_CONTAINER_ID, TRANSFER_ACCOUNT_CAP, TRANSFER_OR_DESTORY_COIN_FUNC, TURBOS, TURBOS_DEX, TURBOS_MODULE, TURBOS_VERSIONED, TWO, TransactionErrorCode, TypesErrorCode, U128, U64_MAX, U64_MAX_BN, UTILS_MODULE, VOLO, ZERO, buildInputCoin, calculateGasEfficiency, calculatePriceImpact, checkInvalidSuiAddress, compareCoins, compareGasMetrics, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, isValidDowngradeUuid6, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|
package/dist/index.js
CHANGED
|
@@ -3426,7 +3426,7 @@ var AGGREGATOR_V3_CONFIG = {
|
|
|
3426
3426
|
};
|
|
3427
3427
|
|
|
3428
3428
|
// src/api.ts
|
|
3429
|
-
var SDK_VERSION =
|
|
3429
|
+
var SDK_VERSION = 1010102;
|
|
3430
3430
|
function parseRouterResponse(data, byAmountIn) {
|
|
3431
3431
|
let packages = /* @__PURE__ */ new Map();
|
|
3432
3432
|
if (data.packages) {
|
|
@@ -3660,7 +3660,7 @@ function getDeepbookV3Config(endpoint) {
|
|
|
3660
3660
|
}
|
|
3661
3661
|
});
|
|
3662
3662
|
}
|
|
3663
|
-
function processFlattenRoutes(routerData
|
|
3663
|
+
function processFlattenRoutes(routerData) {
|
|
3664
3664
|
const paths = routerData.paths;
|
|
3665
3665
|
const fromCoinType = paths[0].from;
|
|
3666
3666
|
const targetCoinType = paths[paths.length - 1].target;
|
|
@@ -3674,11 +3674,12 @@ function processFlattenRoutes(routerData, fixable = false) {
|
|
|
3674
3674
|
const seenTokens = /* @__PURE__ */ new Map();
|
|
3675
3675
|
for (let i = flattenedPaths.length - 1; i >= 0; i--) {
|
|
3676
3676
|
const { from } = flattenedPaths[i].path;
|
|
3677
|
-
if (
|
|
3677
|
+
if (!seenTokens.has(from)) {
|
|
3678
3678
|
seenTokens.set(from, true);
|
|
3679
3679
|
flattenedPaths[i].isLastUseOfIntermediateToken = true;
|
|
3680
3680
|
}
|
|
3681
3681
|
}
|
|
3682
|
+
console.log("flattenedPaths", flattenedPaths);
|
|
3682
3683
|
return {
|
|
3683
3684
|
quoteID: routerData.quoteID || "",
|
|
3684
3685
|
amountIn: routerData.amountIn,
|
|
@@ -8363,11 +8364,11 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
8363
8364
|
);
|
|
8364
8365
|
}
|
|
8365
8366
|
}
|
|
8366
|
-
expectInputSwapV3(txb, inputCoin, routerData, expectAmountOut, amountOutLimit, pythPriceIDs,
|
|
8367
|
+
expectInputSwapV3(txb, inputCoin, routerData, expectAmountOut, amountOutLimit, pythPriceIDs, partner) {
|
|
8367
8368
|
if (routerData.quoteID == null) {
|
|
8368
8369
|
throw new Error(CLIENT_CONFIG.ERRORS.QUOTE_ID_REQUIRED);
|
|
8369
8370
|
}
|
|
8370
|
-
const processedData = processFlattenRoutes(routerData
|
|
8371
|
+
const processedData = processFlattenRoutes(routerData);
|
|
8371
8372
|
const swapCtx = newSwapContext(
|
|
8372
8373
|
{
|
|
8373
8374
|
quoteID: processedData.quoteID,
|
|
@@ -8550,7 +8551,6 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
8550
8551
|
amountOut.toString(),
|
|
8551
8552
|
amountLimit.toString(),
|
|
8552
8553
|
priceInfoObjectIds,
|
|
8553
|
-
fixable,
|
|
8554
8554
|
partner != null ? partner : this.partner
|
|
8555
8555
|
);
|
|
8556
8556
|
} else {
|
|
@@ -8665,8 +8665,6 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
8665
8665
|
expectedAmountOut.toString(),
|
|
8666
8666
|
amountLimit.toString(),
|
|
8667
8667
|
priceInfoObjectIds,
|
|
8668
|
-
true,
|
|
8669
|
-
// fixable
|
|
8670
8668
|
partner != null ? partner : this.partner
|
|
8671
8669
|
);
|
|
8672
8670
|
} else {
|
package/dist/index.mjs
CHANGED
|
@@ -3420,7 +3420,7 @@ var AGGREGATOR_V3_CONFIG = {
|
|
|
3420
3420
|
};
|
|
3421
3421
|
|
|
3422
3422
|
// src/api.ts
|
|
3423
|
-
var SDK_VERSION =
|
|
3423
|
+
var SDK_VERSION = 1010102;
|
|
3424
3424
|
function parseRouterResponse(data, byAmountIn) {
|
|
3425
3425
|
let packages = /* @__PURE__ */ new Map();
|
|
3426
3426
|
if (data.packages) {
|
|
@@ -3654,7 +3654,7 @@ function getDeepbookV3Config(endpoint) {
|
|
|
3654
3654
|
}
|
|
3655
3655
|
});
|
|
3656
3656
|
}
|
|
3657
|
-
function processFlattenRoutes(routerData
|
|
3657
|
+
function processFlattenRoutes(routerData) {
|
|
3658
3658
|
const paths = routerData.paths;
|
|
3659
3659
|
const fromCoinType = paths[0].from;
|
|
3660
3660
|
const targetCoinType = paths[paths.length - 1].target;
|
|
@@ -3668,11 +3668,12 @@ function processFlattenRoutes(routerData, fixable = false) {
|
|
|
3668
3668
|
const seenTokens = /* @__PURE__ */ new Map();
|
|
3669
3669
|
for (let i = flattenedPaths.length - 1; i >= 0; i--) {
|
|
3670
3670
|
const { from } = flattenedPaths[i].path;
|
|
3671
|
-
if (
|
|
3671
|
+
if (!seenTokens.has(from)) {
|
|
3672
3672
|
seenTokens.set(from, true);
|
|
3673
3673
|
flattenedPaths[i].isLastUseOfIntermediateToken = true;
|
|
3674
3674
|
}
|
|
3675
3675
|
}
|
|
3676
|
+
console.log("flattenedPaths", flattenedPaths);
|
|
3676
3677
|
return {
|
|
3677
3678
|
quoteID: routerData.quoteID || "",
|
|
3678
3679
|
amountIn: routerData.amountIn,
|
|
@@ -8357,11 +8358,11 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
8357
8358
|
);
|
|
8358
8359
|
}
|
|
8359
8360
|
}
|
|
8360
|
-
expectInputSwapV3(txb, inputCoin, routerData, expectAmountOut, amountOutLimit, pythPriceIDs,
|
|
8361
|
+
expectInputSwapV3(txb, inputCoin, routerData, expectAmountOut, amountOutLimit, pythPriceIDs, partner) {
|
|
8361
8362
|
if (routerData.quoteID == null) {
|
|
8362
8363
|
throw new Error(CLIENT_CONFIG.ERRORS.QUOTE_ID_REQUIRED);
|
|
8363
8364
|
}
|
|
8364
|
-
const processedData = processFlattenRoutes(routerData
|
|
8365
|
+
const processedData = processFlattenRoutes(routerData);
|
|
8365
8366
|
const swapCtx = newSwapContext(
|
|
8366
8367
|
{
|
|
8367
8368
|
quoteID: processedData.quoteID,
|
|
@@ -8544,7 +8545,6 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
8544
8545
|
amountOut.toString(),
|
|
8545
8546
|
amountLimit.toString(),
|
|
8546
8547
|
priceInfoObjectIds,
|
|
8547
|
-
fixable,
|
|
8548
8548
|
partner != null ? partner : this.partner
|
|
8549
8549
|
);
|
|
8550
8550
|
} else {
|
|
@@ -8659,8 +8659,6 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
8659
8659
|
expectedAmountOut.toString(),
|
|
8660
8660
|
amountLimit.toString(),
|
|
8661
8661
|
priceInfoObjectIds,
|
|
8662
|
-
true,
|
|
8663
|
-
// fixable
|
|
8664
8662
|
partner != null ? partner : this.partner
|
|
8665
8663
|
);
|
|
8666
8664
|
} else {
|