@cetusprotocol/aggregator-sdk 0.2.0 → 0.2.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/bun.lockb +0 -0
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +308 -207
- package/dist/index.mjs +307 -208
- package/dist/src/api.d.ts +8 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/msafe.d.ts +2 -0
- package/package.json +1 -1
- package/src/api.ts +124 -35
- package/src/client.ts +7 -2
- package/src/transaction/cetus.ts +3 -2
- package/src/transaction/swap.ts +3 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/msafe.ts +31 -0
- package/tests/router.test.ts +93 -2
package/bun.lockb
CHANGED
|
Binary file
|
package/dist/index.d.mts
CHANGED
|
@@ -144,6 +144,9 @@ declare function fixSuiObjectId(value: string): string;
|
|
|
144
144
|
declare function patchFixSuiObjectId(data: any): void;
|
|
145
145
|
declare function createTarget(packageName: string, moduleName: string, functionName: string): `${string}::${string}::${string}`;
|
|
146
146
|
|
|
147
|
+
declare const dealWithFastRouterSwapParamsForMsafe: (data: any) => any;
|
|
148
|
+
declare const restituteMsafeFastRouterSwapParams: (data: any) => any;
|
|
149
|
+
|
|
147
150
|
declare const ZERO: BN;
|
|
148
151
|
declare const ONE: BN;
|
|
149
152
|
declare const TWO: BN;
|
|
@@ -162,11 +165,19 @@ interface FindRouterParams {
|
|
|
162
165
|
splitFactor?: number;
|
|
163
166
|
splitCount?: number;
|
|
164
167
|
providers?: string[];
|
|
168
|
+
liquidityChanges?: PreSwapLpChangeParams[];
|
|
169
|
+
}
|
|
170
|
+
interface PreSwapLpChangeParams {
|
|
171
|
+
poolID: string;
|
|
172
|
+
ticklower: number;
|
|
173
|
+
tickUpper: number;
|
|
174
|
+
deltaLiquidity: number;
|
|
165
175
|
}
|
|
166
176
|
type ExtendedDetails = {
|
|
167
177
|
aftermathPoolFlatness?: number;
|
|
168
178
|
aftermathLpSupplyType?: string;
|
|
169
179
|
turbosFeeType?: string;
|
|
180
|
+
afterSqrtPrice?: string;
|
|
170
181
|
};
|
|
171
182
|
type Path = {
|
|
172
183
|
id: string;
|
|
@@ -209,4 +220,4 @@ declare enum Env {
|
|
|
209
220
|
Testnet = 1
|
|
210
221
|
}
|
|
211
222
|
|
|
212
|
-
export { AFSUI, AFTERMATH, AggregatorClient, type AggregatorResponse, type BuildFastRouterSwapParams, type BuildRouterSwapParams, CETUS, CLOCK_ADDRESS, DEEPBOOKV2, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, type FindRouterParams, HAEDAL, KRIYA, KRIYAV3, ONE, type Path, type Router, type RouterData, type RouterError, type SwapInPoolsParams, type SwapInPoolsResult, TEN_POW_NINE, TURBOS, TWO, U128, U64_MAX, U64_MAX_BN, VOLO, ZERO, composeType, createTarget, extractAddressFromType, extractStructTagFromType, fixSuiObjectId, getRouterResult, isSortedSymbols, normalizeCoinType, parseRouterResponse, patchFixSuiObjectId };
|
|
223
|
+
export { AFSUI, AFTERMATH, AggregatorClient, type AggregatorResponse, type BuildFastRouterSwapParams, type BuildRouterSwapParams, CETUS, CLOCK_ADDRESS, DEEPBOOKV2, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, type FindRouterParams, HAEDAL, KRIYA, KRIYAV3, ONE, type Path, type PreSwapLpChangeParams, type Router, type RouterData, type RouterError, type SwapInPoolsParams, type SwapInPoolsResult, TEN_POW_NINE, TURBOS, TWO, U128, U64_MAX, U64_MAX_BN, VOLO, ZERO, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, extractAddressFromType, extractStructTagFromType, fixSuiObjectId, getRouterResult, isSortedSymbols, normalizeCoinType, parseRouterResponse, patchFixSuiObjectId, restituteMsafeFastRouterSwapParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -144,6 +144,9 @@ declare function fixSuiObjectId(value: string): string;
|
|
|
144
144
|
declare function patchFixSuiObjectId(data: any): void;
|
|
145
145
|
declare function createTarget(packageName: string, moduleName: string, functionName: string): `${string}::${string}::${string}`;
|
|
146
146
|
|
|
147
|
+
declare const dealWithFastRouterSwapParamsForMsafe: (data: any) => any;
|
|
148
|
+
declare const restituteMsafeFastRouterSwapParams: (data: any) => any;
|
|
149
|
+
|
|
147
150
|
declare const ZERO: BN;
|
|
148
151
|
declare const ONE: BN;
|
|
149
152
|
declare const TWO: BN;
|
|
@@ -162,11 +165,19 @@ interface FindRouterParams {
|
|
|
162
165
|
splitFactor?: number;
|
|
163
166
|
splitCount?: number;
|
|
164
167
|
providers?: string[];
|
|
168
|
+
liquidityChanges?: PreSwapLpChangeParams[];
|
|
169
|
+
}
|
|
170
|
+
interface PreSwapLpChangeParams {
|
|
171
|
+
poolID: string;
|
|
172
|
+
ticklower: number;
|
|
173
|
+
tickUpper: number;
|
|
174
|
+
deltaLiquidity: number;
|
|
165
175
|
}
|
|
166
176
|
type ExtendedDetails = {
|
|
167
177
|
aftermathPoolFlatness?: number;
|
|
168
178
|
aftermathLpSupplyType?: string;
|
|
169
179
|
turbosFeeType?: string;
|
|
180
|
+
afterSqrtPrice?: string;
|
|
170
181
|
};
|
|
171
182
|
type Path = {
|
|
172
183
|
id: string;
|
|
@@ -209,4 +220,4 @@ declare enum Env {
|
|
|
209
220
|
Testnet = 1
|
|
210
221
|
}
|
|
211
222
|
|
|
212
|
-
export { AFSUI, AFTERMATH, AggregatorClient, type AggregatorResponse, type BuildFastRouterSwapParams, type BuildRouterSwapParams, CETUS, CLOCK_ADDRESS, DEEPBOOKV2, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, type FindRouterParams, HAEDAL, KRIYA, KRIYAV3, ONE, type Path, type Router, type RouterData, type RouterError, type SwapInPoolsParams, type SwapInPoolsResult, TEN_POW_NINE, TURBOS, TWO, U128, U64_MAX, U64_MAX_BN, VOLO, ZERO, composeType, createTarget, extractAddressFromType, extractStructTagFromType, fixSuiObjectId, getRouterResult, isSortedSymbols, normalizeCoinType, parseRouterResponse, patchFixSuiObjectId };
|
|
223
|
+
export { AFSUI, AFTERMATH, AggregatorClient, type AggregatorResponse, type BuildFastRouterSwapParams, type BuildRouterSwapParams, CETUS, CLOCK_ADDRESS, DEEPBOOKV2, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, type FindRouterParams, HAEDAL, KRIYA, KRIYAV3, ONE, type Path, type PreSwapLpChangeParams, type Router, type RouterData, type RouterError, type SwapInPoolsParams, type SwapInPoolsResult, TEN_POW_NINE, TURBOS, TWO, U128, U64_MAX, U64_MAX_BN, VOLO, ZERO, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, extractAddressFromType, extractStructTagFromType, fixSuiObjectId, getRouterResult, isSortedSymbols, normalizeCoinType, parseRouterResponse, patchFixSuiObjectId, restituteMsafeFastRouterSwapParams };
|