@minswap/noodles-sdk 0.0.4 → 0.0.7
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/README.md +5 -0
- package/dist/index.cjs +1596 -0
- package/dist/index.d.ts +908 -0
- package/dist/index.js +1421 -0
- package/package.json +1 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,908 @@
|
|
|
1
|
+
import { Coin } from '@flowx-finance/sdk';
|
|
2
|
+
import type { CoinStruct } from '@mysten/sui/client';
|
|
3
|
+
import type { GetRoutesResult } from '@flowx-finance/sdk';
|
|
4
|
+
import { MemezPumpSDK } from '@interest-protocol/memez-fun-sdk';
|
|
5
|
+
import type { MoveStruct } from '@mysten/sui/client';
|
|
6
|
+
import type { Quote } from '@naviprotocol/astros-aggregator-sdk';
|
|
7
|
+
import type { QuoteResponse } from '@7kprotocol/sdk-ts';
|
|
8
|
+
import type { RouterCompleteTradeRoute } from 'aftermath-ts-sdk';
|
|
9
|
+
import type { RouterDataV3 } from '@cetusprotocol/aggregator-sdk';
|
|
10
|
+
import { SuiClient } from '@mysten/sui/client';
|
|
11
|
+
import { Transaction } from '@mysten/sui/transactions';
|
|
12
|
+
import type { TransactionArgument } from '@mysten/sui/transactions';
|
|
13
|
+
import { TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
14
|
+
import { TransactionResult } from '@mysten/sui/transactions';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Adapter to make SuiClient v1.38 compatible with libraries expecting v1.34
|
|
18
|
+
* This works around TypeScript type incompatibilities between versions
|
|
19
|
+
*/
|
|
20
|
+
export declare function adaptSuiClient(client: SuiClient): SuiClient;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Adapter to make Transaction v1.38 compatible with libraries expecting v1.34
|
|
24
|
+
* This works around TypeScript type incompatibilities between versions
|
|
25
|
+
*/
|
|
26
|
+
export declare function adaptTransaction(transaction: Transaction): Transaction;
|
|
27
|
+
|
|
28
|
+
export declare function addGasFee(params: {
|
|
29
|
+
inheritTx?: Transaction;
|
|
30
|
+
sender: string;
|
|
31
|
+
feeAmount: bigint;
|
|
32
|
+
suiInputAmount?: bigint;
|
|
33
|
+
}): Promise<Transaction>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Aftermath DEX aggregator client for routing trades across multiple pools
|
|
37
|
+
*/
|
|
38
|
+
export declare class AftermathAggregator {
|
|
39
|
+
/** Configuration settings for the aggregator */
|
|
40
|
+
private _config;
|
|
41
|
+
/** Aftermath SDK client instance (lazy-loaded on first use) */
|
|
42
|
+
private _aftermathClient;
|
|
43
|
+
/** Sui blockchain client */
|
|
44
|
+
private _suiClient;
|
|
45
|
+
/**
|
|
46
|
+
* Creates a new AftermathAggregator instance
|
|
47
|
+
* @param config - Aggregator configuration including optional API settings
|
|
48
|
+
* @param suiClient - Sui client for blockchain interactions
|
|
49
|
+
*/
|
|
50
|
+
constructor(config: AftermathAggregatorConfig, suiClient: SuiClient);
|
|
51
|
+
/**
|
|
52
|
+
* Lazy-loads and returns the Aftermath client, initializing it on first use
|
|
53
|
+
* Handles authentication if API key is provided in config
|
|
54
|
+
* @returns Promise resolving to initialized Aftermath client
|
|
55
|
+
*/
|
|
56
|
+
private aftermathClient;
|
|
57
|
+
/**
|
|
58
|
+
* Finds the optimal trade route for swapping tokens
|
|
59
|
+
* @param params - Trade route parameters
|
|
60
|
+
* @param params.coinInAmount - Amount of input token to swap
|
|
61
|
+
* @param params.coinInType - Type/address of input token
|
|
62
|
+
* @param params.coinOutType - Type/address of output token
|
|
63
|
+
* @returns Promise resolving to complete trade route with pricing and path information
|
|
64
|
+
*/
|
|
65
|
+
getTradeRoute({ coinInAmount, coinInType, coinOutType, tradeFee, }: GetTradeRouteRequest_2): Promise<RouterCompleteTradeRoute>;
|
|
66
|
+
/**
|
|
67
|
+
* Builds a transaction for executing a trade route
|
|
68
|
+
* @param params - Transaction parameters
|
|
69
|
+
* @param params.completeRoute - Complete trade route from getTradeRoute()
|
|
70
|
+
* @param params.walletAddress - Address of the wallet executing the trade
|
|
71
|
+
* @param params.slippage - Maximum acceptable slippage (e.g., 0.01 for 1%)
|
|
72
|
+
* @returns Promise resolving to built transaction bytes ready for signing and execution
|
|
73
|
+
*/
|
|
74
|
+
getTransaction({ completeRoute, walletAddress, slippage }: GetTransactionRequest_2): Promise<Uint8Array>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export declare namespace AftermathAggregator {
|
|
78
|
+
export function toCommonTradeRoutes(tradeRoute: RouterCompleteTradeRoute): FinalTradeRoute | null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Configuration options for the Aftermath aggregator
|
|
83
|
+
*/
|
|
84
|
+
export declare type AftermathAggregatorConfig = {
|
|
85
|
+
/** Default trade fee settings applied to each trade */
|
|
86
|
+
defaultTradeFee: TradeFeeOptions;
|
|
87
|
+
/** Optional API key for authenticated Aftermath API access */
|
|
88
|
+
aftermathApiKey?: string;
|
|
89
|
+
/** Optional custom Aftermath API endpoint (defaults to MAINNET if not provided) */
|
|
90
|
+
aftermathApiEndpoint?: string;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Astros DEX aggregator client for routing trades across multiple pools
|
|
95
|
+
* Provides access to liquidity aggregation from various DEX protocols
|
|
96
|
+
*/
|
|
97
|
+
export declare class AstrosAggregator {
|
|
98
|
+
/** Configuration settings for the aggregator */
|
|
99
|
+
private _config;
|
|
100
|
+
/** Sui blockchain client */
|
|
101
|
+
private _suiClient;
|
|
102
|
+
/**
|
|
103
|
+
* Creates a new AstrosAggregator instance
|
|
104
|
+
* @param config - Aggregator configuration including optional fee settings
|
|
105
|
+
* @param suiClient - Sui client for blockchain interactions
|
|
106
|
+
*/
|
|
107
|
+
constructor(config: AstrosAggregatorConfig, suiClient: SuiClient);
|
|
108
|
+
/**
|
|
109
|
+
* Finds the optimal trade route for swapping tokens using Astros aggregator
|
|
110
|
+
* @param params - Trade route parameters
|
|
111
|
+
* @param params.coinInAmount - Amount of input token to swap
|
|
112
|
+
* @param params.coinInType - Type/address of input token
|
|
113
|
+
* @param params.coinOutType - Type/address of output token
|
|
114
|
+
* @returns Promise resolving to quote with pricing and route information, or null if no route found
|
|
115
|
+
*/
|
|
116
|
+
getTradeRoute({ coinInAmount, coinInType, coinOutType, tradeFee, }: GetTradeRouteRequest_3): Promise<Quote | null>;
|
|
117
|
+
/**
|
|
118
|
+
* Merges multiple coin objects into a single coin for trading
|
|
119
|
+
* Optimizes coin usage by merging smaller coins into larger ones
|
|
120
|
+
* @param txb - Transaction builder instance
|
|
121
|
+
* @param coins - Array of coin objects to merge
|
|
122
|
+
* @param amount - Required amount for the trade
|
|
123
|
+
* @returns Transaction object reference for the merged coin
|
|
124
|
+
*/
|
|
125
|
+
private returnMergedCoins;
|
|
126
|
+
/**
|
|
127
|
+
* Builds a transaction for executing a trade route from Astros aggregator
|
|
128
|
+
* @param params - Transaction parameters
|
|
129
|
+
* @param params.completeRoute - Complete quote from getTradeRoute() (aliased as quote)
|
|
130
|
+
* @param params.walletAddress - Address of the wallet executing the trade
|
|
131
|
+
* @param params.slippage - Maximum acceptable slippage (e.g., 0.01 for 1%)
|
|
132
|
+
* @returns Promise resolving to built transaction bytes ready for signing and execution
|
|
133
|
+
*/
|
|
134
|
+
getTransaction({ completeRoute: quote, walletAddress, slippage, tradeFee, }: GetTransactionRequest_3): Promise<Uint8Array>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export declare namespace AstrosAggregator {
|
|
138
|
+
export function toCommonTradeRoutes(tradeRoute: Quote, coinInType: string, coinOutType: string): FinalTradeRoute | null;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Configuration options for the Astros aggregator
|
|
143
|
+
*/
|
|
144
|
+
export declare type AstrosAggregatorConfig = {
|
|
145
|
+
/** Default trade fee settings applied to each trade */
|
|
146
|
+
defaultTradeFee: TradeFeeOptions;
|
|
147
|
+
/** Optional API key for Astros aggregator access */
|
|
148
|
+
astrosApiKey?: string;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Individual trade path within a route
|
|
153
|
+
*/
|
|
154
|
+
export declare type AstrosTradePath = {
|
|
155
|
+
/** Unique identifier for the path */
|
|
156
|
+
id: string;
|
|
157
|
+
/** Type of the trade path */
|
|
158
|
+
type: string;
|
|
159
|
+
/** Liquidity provider name */
|
|
160
|
+
provider: string;
|
|
161
|
+
/** Source token type */
|
|
162
|
+
from: string;
|
|
163
|
+
/** Target token type */
|
|
164
|
+
target: string;
|
|
165
|
+
/** Direction flag for A to B trade */
|
|
166
|
+
a2b: boolean;
|
|
167
|
+
/** Trade direction */
|
|
168
|
+
direction: boolean;
|
|
169
|
+
/** Fee rate for this path */
|
|
170
|
+
fee_rate: number;
|
|
171
|
+
/** Lot size for the trade */
|
|
172
|
+
lot_size: number;
|
|
173
|
+
/** Input amount for this path */
|
|
174
|
+
amount_in: number;
|
|
175
|
+
/** Output amount for this path */
|
|
176
|
+
amount_out: number;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Trade route information from Astros aggregator
|
|
181
|
+
*/
|
|
182
|
+
export declare type AstrosTradeRoute = {
|
|
183
|
+
/** Array of trade paths in the route */
|
|
184
|
+
path: AstrosTradePath[];
|
|
185
|
+
/** Total input amount */
|
|
186
|
+
amount_in: number;
|
|
187
|
+
/** Total output amount */
|
|
188
|
+
amount_out: number;
|
|
189
|
+
/** Initial price for the trade */
|
|
190
|
+
initial_price: number;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export declare type BalanceContent = {
|
|
194
|
+
balance: string;
|
|
195
|
+
id: {
|
|
196
|
+
id: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export declare const BASE_BPS = 10000;
|
|
201
|
+
|
|
202
|
+
export declare namespace BlastFunConstants {
|
|
203
|
+
const PACKAGE_ID_V4 = "0x7e6aa6e179466ab2814425a780b122575296d011119fa69d27f289f5a28814bd";
|
|
204
|
+
const MEMEZ_AV_OBJECT_ID = "0x2319e3e76dfad73d8f4684bdbf42be4f32d8ce4521dd61becc8261dc918d82c0";
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* @deprecated Use `BlastFunSDKCalculation` instead.
|
|
209
|
+
*/
|
|
210
|
+
export declare namespace BlastFunCustomCalculation {
|
|
211
|
+
export function getCurveAmountAfterBuy(params: GetCurveAmountAfterBuyParams): Promise<bigint>;
|
|
212
|
+
export function getSuiAmountAfterSell(params: GetSuiAmountAfterSellParams): Promise<bigint>;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* @deprecated Use `BlastFunSDKTransaction` instead.
|
|
217
|
+
*/
|
|
218
|
+
export declare namespace BlastFunCustomTransaction {
|
|
219
|
+
export function getAllowedVersions(_tx?: Transaction): Promise<TransactionResult>;
|
|
220
|
+
export function buildBuyTx(params: BuildSwapTxParams): Promise<BuildTxResult>;
|
|
221
|
+
export function buildSellTx(params: BuildSwapTxParams): Promise<BuildTxResult>;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export declare namespace BlastFunPackage {
|
|
225
|
+
export namespace MemezFun {
|
|
226
|
+
export type MemezFun = {
|
|
227
|
+
inner_state: string;
|
|
228
|
+
public_key: number[];
|
|
229
|
+
ipx_meme_coin_treasury: string;
|
|
230
|
+
};
|
|
231
|
+
export function isSniperProtectedMemezFun(poolId: string): Promise<boolean>;
|
|
232
|
+
}
|
|
233
|
+
export namespace MemezDistributor {
|
|
234
|
+
export type Recipient = {
|
|
235
|
+
address: string;
|
|
236
|
+
bps: MoveObjectStruct<Bps.BPS>;
|
|
237
|
+
};
|
|
238
|
+
export type Distributor = {
|
|
239
|
+
recipients: MoveObjectStruct<Recipient>[];
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
export namespace MemezFees {
|
|
243
|
+
export type FeeValue = {
|
|
244
|
+
pos0: string;
|
|
245
|
+
pos1: MoveObjectStruct<MemezDistributor.Distributor>;
|
|
246
|
+
};
|
|
247
|
+
export type FeePercentage = {
|
|
248
|
+
pos0: MoveObjectStruct<Bps.BPS>;
|
|
249
|
+
pos1: MoveObjectStruct<MemezDistributor.Distributor>;
|
|
250
|
+
};
|
|
251
|
+
export type FeeMoveStruct = MoveEnumObjectStruct<FeeValue, "Value"> | MoveEnumObjectStruct<FeePercentage, "Percentage">;
|
|
252
|
+
export function takeWithDiscount(fee: FeeMoveStruct, amount: bigint, discountBps: Bps.BPS): bigint;
|
|
253
|
+
export function calculateWithDiscount(fee: FeeMoveStruct, discountBps: Bps.BPS, amount: bigint): bigint;
|
|
254
|
+
}
|
|
255
|
+
export namespace MemezBurner {
|
|
256
|
+
export type MemezBurner = {
|
|
257
|
+
fee: MoveObjectStruct<Bps.BPS>;
|
|
258
|
+
target_liquidity: string;
|
|
259
|
+
};
|
|
260
|
+
export function calculate(burner: MemezBurner, poolMemeBalance: bigint): Bps.BPS;
|
|
261
|
+
}
|
|
262
|
+
export namespace MemezConstantProduct {
|
|
263
|
+
export type MemezConstantProduct = {
|
|
264
|
+
meme_balance: string;
|
|
265
|
+
quote_balance: string;
|
|
266
|
+
virtual_liquidity: string;
|
|
267
|
+
quote_swap_fee: MemezFees.FeeMoveStruct;
|
|
268
|
+
meme_swap_fee: MemezFees.FeeMoveStruct;
|
|
269
|
+
meme_referrer_fee: MoveObjectStruct<Bps.BPS>;
|
|
270
|
+
quote_referrer_fee: MoveObjectStruct<Bps.BPS>;
|
|
271
|
+
burner: MoveObjectStruct<MemezBurner.MemezBurner>;
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
export namespace MemezPump {
|
|
275
|
+
export type PumpState = {
|
|
276
|
+
constant_product: MoveObjectStruct<MemezConstantProduct.MemezConstantProduct>;
|
|
277
|
+
};
|
|
278
|
+
export function getPumpState(memezFun: MemezFun.MemezFun): Promise<PumpState>;
|
|
279
|
+
export function pump(pumpState: PumpState, quoteAmount: bigint): bigint;
|
|
280
|
+
export function dump(pumpState: PumpState, memeAmount: bigint): bigint;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export declare namespace BlastFunSDKCalculation {
|
|
285
|
+
export function getCurveAmountAfterBuy(params: GetCurveAmountAfterBuyParams): Promise<bigint>;
|
|
286
|
+
export function getSuiAmountAfterSell(params: GetSuiAmountAfterSellParams): Promise<bigint>;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export declare namespace BlastFunSDKTransaction {
|
|
290
|
+
export function buildBuyTx(params: BuildSwapTxParams): Promise<BuildTxResult>;
|
|
291
|
+
export function buildSellTx(params: BuildSwapTxParams): Promise<BuildTxResult>;
|
|
292
|
+
export function getBuyTransaction({ coinInAmount, coinInType, coinOutType, poolId, slippage, walletAddress, tradeFee }: GetTradeTransactionRequest, suiClient: SuiClient): Promise<Uint8Array>;
|
|
293
|
+
export function getSellTransaction({ coinInAmount, coinInType, coinOutType, poolId, slippage, walletAddress, tradeFee }: GetTradeTransactionRequest, suiClient: SuiClient): Promise<Uint8Array>;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export declare const BLUEFIN_PACKAGE_ID = "0x62412b7268c35f3808336aee57a52836501f40b8ba5d936f8ad275e672befd04";
|
|
297
|
+
|
|
298
|
+
export declare namespace BluefinTx {
|
|
299
|
+
export function transferOrDestroyZeroCoin(tx: Transaction, coinType: string, coin: TransactionArgument, address: string): void;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export declare namespace Bps {
|
|
303
|
+
export type BPS = {
|
|
304
|
+
pos0: string;
|
|
305
|
+
};
|
|
306
|
+
export function calcUp(bps: BPS, amount: bigint): bigint;
|
|
307
|
+
export function sub(lhs: BPS, rhs: BPS): BPS;
|
|
308
|
+
export function value(bps: BPS): bigint;
|
|
309
|
+
export function new_(bps: number | string | bigint): BPS;
|
|
310
|
+
export function assertOverflow(bps: number | string | bigint): bigint;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export declare type BuildSwapTxParams = CommonTxParams & {
|
|
314
|
+
inputAmount: string;
|
|
315
|
+
minAmountOut: string;
|
|
316
|
+
inCoinType: string;
|
|
317
|
+
outCoinType: string;
|
|
318
|
+
poolId: string;
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
export declare type BuildTxResult = {
|
|
322
|
+
tx: Transaction;
|
|
323
|
+
coinOut?: TransactionObjectArgument;
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Cetus DEX aggregator client for routing trades across multiple pools
|
|
328
|
+
* Cetus is a concentrated liquidity protocol that provides efficient trading
|
|
329
|
+
*/
|
|
330
|
+
export declare class CetusAggregator {
|
|
331
|
+
/** Configuration settings for the aggregator */
|
|
332
|
+
private _config;
|
|
333
|
+
/** Sui blockchain client */
|
|
334
|
+
private _suiClient;
|
|
335
|
+
/** Cetus aggregator client instance (lazy-loaded) */
|
|
336
|
+
private _cetusClient;
|
|
337
|
+
/**
|
|
338
|
+
* Creates a new CetusAggregator instance
|
|
339
|
+
* @param config - Aggregator configuration including fee settings and optional API credentials
|
|
340
|
+
* @param suiClient - Sui client for blockchain interactions
|
|
341
|
+
*/
|
|
342
|
+
constructor(config: CetusAggregatorConfig, suiClient: SuiClient);
|
|
343
|
+
/**
|
|
344
|
+
* Lazy-loads and returns the Cetus aggregator client, initializing it on first use
|
|
345
|
+
* Configures the client with overlay fees, API credentials, and partner information
|
|
346
|
+
* @param walletAddress - Optional wallet address for signing transactions
|
|
347
|
+
* @param tradeFee - Optional custom trade fee settings for this client instance
|
|
348
|
+
* @returns Initialized Cetus AggregatorClient instance
|
|
349
|
+
*/
|
|
350
|
+
private cetusClient;
|
|
351
|
+
/**
|
|
352
|
+
* Finds the optimal trade route for swapping tokens using Cetus aggregator
|
|
353
|
+
* @param params - Trade route parameters
|
|
354
|
+
* @param params.coinInAmount - Amount of input token to swap
|
|
355
|
+
* @param params.coinInType - Type/address of input token
|
|
356
|
+
* @param params.coinOutType - Type/address of output token
|
|
357
|
+
* @returns Promise resolving to router data with pricing and route information, or null if no route found
|
|
358
|
+
*/
|
|
359
|
+
getTradeRoute({ coinInAmount, coinInType, coinOutType, tradeFee, }: GetTradeRouteRequest_4): Promise<RouterDataV3 | null>;
|
|
360
|
+
/**
|
|
361
|
+
* Builds a transaction for executing a trade route from Cetus aggregator
|
|
362
|
+
* @param params - Transaction parameters
|
|
363
|
+
* @param params.completeRoute - Complete router data from getTradeRoute() (aliased as routers)
|
|
364
|
+
* @param params.walletAddress - Address of the wallet executing the trade
|
|
365
|
+
* @param params.slippage - Maximum acceptable slippage (e.g., 0.01 for 1%)
|
|
366
|
+
* @returns Promise resolving to built transaction bytes ready for signing and execution
|
|
367
|
+
*/
|
|
368
|
+
getTransaction({ completeRoute: routers, walletAddress, slippage, tradeFee, }: GetTransactionRequest_4): Promise<Uint8Array>;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export declare namespace CetusAggregator {
|
|
372
|
+
export function toCommonTradeRoutes(tradeRoute: RouterDataV3, coinInType: string, coinOutType: string): FinalTradeRoute | null;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Configuration options for the Cetus aggregator
|
|
377
|
+
*/
|
|
378
|
+
export declare type CetusAggregatorConfig = {
|
|
379
|
+
/** Default trade fee settings applied to each trade */
|
|
380
|
+
defaultTradeFee: TradeFeeOptions;
|
|
381
|
+
/** Optional API key for Cetus aggregator access */
|
|
382
|
+
cetusApiKey?: string;
|
|
383
|
+
/** Optional custom Cetus API endpoint */
|
|
384
|
+
cetusApiEndpoint?: string;
|
|
385
|
+
/** Optional partner ID for Cetus integration */
|
|
386
|
+
cetusPartnerId?: string;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
export declare const CLOCK_OBJECT_ID = "0x0000000000000000000000000000000000000000000000000000000000000006";
|
|
390
|
+
|
|
391
|
+
export declare interface CommonTxParams {
|
|
392
|
+
/** User address */
|
|
393
|
+
accountAddress: string;
|
|
394
|
+
/** Commission for frontend, ex: 0.01 (1%) */
|
|
395
|
+
frontendFee?: number | string;
|
|
396
|
+
/** Frontend fee recipient address */
|
|
397
|
+
frontendFeeRecipient?: string;
|
|
398
|
+
/**
|
|
399
|
+
* Give Flexibility to insert custom commands before or after swap
|
|
400
|
+
* @example
|
|
401
|
+
* ```typescript
|
|
402
|
+
* const rawTx = new Transaction();
|
|
403
|
+
* // Add custom commands to rawTx
|
|
404
|
+
* rawTx.moveCall({
|
|
405
|
+
* target: "0x2222222::example::claim",
|
|
406
|
+
* arguments: [],
|
|
407
|
+
* });
|
|
408
|
+
* const { tx, coinOut } = await buildTx({
|
|
409
|
+
* quoteResponse,
|
|
410
|
+
* accountAddress,
|
|
411
|
+
* slippage,
|
|
412
|
+
* commission,
|
|
413
|
+
* extendTx: {
|
|
414
|
+
* tx: rawTx,
|
|
415
|
+
* coinIn: rawTx.object(coinObjectId),
|
|
416
|
+
* },
|
|
417
|
+
* });
|
|
418
|
+
* // add more commands after the swap if needed, and remember to consume the coinOut object
|
|
419
|
+
* tx.transferObjects([coinOut], tx.pure.address(accountAddress));
|
|
420
|
+
* ```
|
|
421
|
+
*/
|
|
422
|
+
extendTx?: {
|
|
423
|
+
tx: Transaction;
|
|
424
|
+
coinIn?: TransactionObjectArgument;
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* If true, indicates that the transaction is sponsored and its gas object should not be modified.
|
|
428
|
+
* In this case, the gas object is expected to be already set up correctly for the sponsored transaction.
|
|
429
|
+
*/
|
|
430
|
+
isSponsored?: boolean;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Alternative: Create a proxy that ensures compatibility
|
|
435
|
+
*/
|
|
436
|
+
export declare function createCompatibleSuiClient(client: SuiClient): LegacySuiClient;
|
|
437
|
+
|
|
438
|
+
export declare type FinalTradeRoute = {
|
|
439
|
+
coinIn: string;
|
|
440
|
+
coinOut: string;
|
|
441
|
+
amountIn: bigint;
|
|
442
|
+
amountOut: bigint;
|
|
443
|
+
routes: TradeRoute[];
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* FlowX DEX aggregator client for routing trades across multiple pools
|
|
448
|
+
* FlowX provides liquidity aggregation and optimized routing for Sui ecosystem
|
|
449
|
+
*/
|
|
450
|
+
export declare class FlowXAggregator {
|
|
451
|
+
/** Configuration settings for the aggregator */
|
|
452
|
+
private _config;
|
|
453
|
+
/** Sui blockchain client */
|
|
454
|
+
private _suiClient;
|
|
455
|
+
/**
|
|
456
|
+
* Creates a new FlowXAggregator instance
|
|
457
|
+
* @param config - Aggregator configuration including fee settings and optional API key
|
|
458
|
+
* @param suiClient - Sui client for blockchain interactions
|
|
459
|
+
*/
|
|
460
|
+
constructor(config: FlowXAggregatorConfig, suiClient: SuiClient);
|
|
461
|
+
/**
|
|
462
|
+
* Creates a commission configuration for FlowX trades
|
|
463
|
+
* @param coinInType - Type/address of the input coin for commission calculation
|
|
464
|
+
* @param tradeFee - Optional custom trade fee settings for this commission
|
|
465
|
+
* @returns Commission instance configured with fee recipient, percentage, and coin type
|
|
466
|
+
*/
|
|
467
|
+
private getCommission;
|
|
468
|
+
/**
|
|
469
|
+
* Finds the optimal trade route for swapping tokens using FlowX aggregator
|
|
470
|
+
* @param params - Trade route parameters
|
|
471
|
+
* @param params.coinInAmount - Amount of input token to swap
|
|
472
|
+
* @param params.coinInType - Type/address of input token
|
|
473
|
+
* @param params.coinOutType - Type/address of output token
|
|
474
|
+
* @returns Promise resolving to routes result with pricing and path information, or null if no route found
|
|
475
|
+
*/
|
|
476
|
+
getTradeRoute({ coinInAmount, coinInType, coinOutType, tradeFee, }: GetTradeRouteRequest_5): Promise<GetRoutesResult<Coin, Coin> | null>;
|
|
477
|
+
/**
|
|
478
|
+
* Builds a transaction for executing a trade route from FlowX aggregator
|
|
479
|
+
* @param params - Transaction parameters
|
|
480
|
+
* @param params.walletAddress - Address of the wallet executing the trade
|
|
481
|
+
* @param params.completeRoute - Complete routes result from getTradeRoute()
|
|
482
|
+
* @param params.slippage - Maximum acceptable slippage (e.g., 0.01 for 1%)
|
|
483
|
+
* @returns Promise resolving to built transaction bytes ready for signing and execution
|
|
484
|
+
*/
|
|
485
|
+
getTransaction({ walletAddress, completeRoute, slippage, tradeFee, }: GetTransactionRequest_5): Promise<Uint8Array>;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export declare namespace FlowXAggregator {
|
|
489
|
+
export function toCommonTradeRoutes(tradeRoute: GetRoutesResult<Coin, Coin>): FinalTradeRoute | null;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Configuration options for the FlowX aggregator
|
|
494
|
+
*/
|
|
495
|
+
export declare type FlowXAggregatorConfig = {
|
|
496
|
+
/** Default trade fee settings applied to each trade */
|
|
497
|
+
defaultTradeFee: TradeFeeOptions;
|
|
498
|
+
/** Optional API key for FlowX aggregator access */
|
|
499
|
+
flowxApiKey?: string;
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
export declare function getAmountAfterFee(amount: bigint | string, fee?: string | number): bigint;
|
|
503
|
+
|
|
504
|
+
export declare const getCoinObjectIdsByAmount: (address: string, amount: string, coinType: string) => Promise<{
|
|
505
|
+
objectIds: string[];
|
|
506
|
+
objectCoins: CoinStruct[];
|
|
507
|
+
balance: string;
|
|
508
|
+
}>;
|
|
509
|
+
|
|
510
|
+
export declare type GetCurveAmountAfterBuyParams = {
|
|
511
|
+
suiAmount: bigint;
|
|
512
|
+
poolId: string;
|
|
513
|
+
frontendFee?: number | string;
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
export declare function getMemezPumpSDK(): MemezPumpSDK;
|
|
517
|
+
|
|
518
|
+
export declare function getMoveObject(objectId: string): Promise<MoveObject>;
|
|
519
|
+
|
|
520
|
+
export declare function getMoveObjectContent(objectId: string): Promise<MoveStruct>;
|
|
521
|
+
|
|
522
|
+
export declare function getNeededGasFee(tx: Transaction, sender: string, bufferPercent: number): Promise<bigint>;
|
|
523
|
+
|
|
524
|
+
declare type GetSplitCoinForTx = {
|
|
525
|
+
account: string;
|
|
526
|
+
amount: string;
|
|
527
|
+
splits: string[];
|
|
528
|
+
coinType: string;
|
|
529
|
+
inheritTx?: Transaction;
|
|
530
|
+
inspecTransaction?: boolean;
|
|
531
|
+
isSponsored?: boolean;
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
export declare function getSplitCoinForTx(params: GetSplitCoinForTx): Promise<{
|
|
535
|
+
tx: Transaction;
|
|
536
|
+
coinData: TransactionResult;
|
|
537
|
+
}>;
|
|
538
|
+
|
|
539
|
+
export declare function getSplitCoinsAfterFee(amount: string, fee: string | number): string[];
|
|
540
|
+
|
|
541
|
+
export declare type GetSuiAmountAfterSellParams = {
|
|
542
|
+
curveAmount: bigint;
|
|
543
|
+
poolId: string;
|
|
544
|
+
frontendFee?: number | string;
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
export declare function getSuiClient(): SuiClient;
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Request parameters for getting a trade route
|
|
551
|
+
*/
|
|
552
|
+
declare type GetTradeRouteRequest = {
|
|
553
|
+
/** Amount of input coin to trade (in smallest unit) */
|
|
554
|
+
coinInAmount: bigint;
|
|
555
|
+
/** Type/address of the input coin */
|
|
556
|
+
coinInType: string;
|
|
557
|
+
/** Type/address of the output coin */
|
|
558
|
+
coinOutType: string;
|
|
559
|
+
/** Custom trade fee for this request, if not provided, the default trade fee will be applied */
|
|
560
|
+
tradeFee?: TradeFeeOptions;
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Request parameters for getting a trade route
|
|
565
|
+
*/
|
|
566
|
+
declare type GetTradeRouteRequest_2 = {
|
|
567
|
+
/** Amount of input coin to trade (in smallest unit) */
|
|
568
|
+
coinInAmount: bigint;
|
|
569
|
+
/** Type/address of the input coin */
|
|
570
|
+
coinInType: string;
|
|
571
|
+
/** Type/address of the output coin */
|
|
572
|
+
coinOutType: string;
|
|
573
|
+
/** Custom trade fee for this request, if not provided, the default trade fee will be applied */
|
|
574
|
+
tradeFee?: TradeFeeOptions;
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Request parameters for getting a trade route
|
|
579
|
+
*/
|
|
580
|
+
declare type GetTradeRouteRequest_3 = {
|
|
581
|
+
/** Amount of input coin to trade (in smallest unit) */
|
|
582
|
+
coinInAmount: bigint;
|
|
583
|
+
/** Type/address of the input coin */
|
|
584
|
+
coinInType: string;
|
|
585
|
+
/** Type/address of the output coin */
|
|
586
|
+
coinOutType: string;
|
|
587
|
+
/** Custom trade fee for this request, if not provided, the default trade fee will be applied */
|
|
588
|
+
tradeFee?: TradeFeeOptions;
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Request parameters for getting a trade route
|
|
593
|
+
*/
|
|
594
|
+
declare type GetTradeRouteRequest_4 = {
|
|
595
|
+
/** Amount of input coin to trade (in smallest unit) */
|
|
596
|
+
coinInAmount: bigint;
|
|
597
|
+
/** Type/address of the input coin */
|
|
598
|
+
coinInType: string;
|
|
599
|
+
/** Type/address of the output coin */
|
|
600
|
+
coinOutType: string;
|
|
601
|
+
/** Custom trade fee for this request, if not provided, the default trade fee will be applied */
|
|
602
|
+
tradeFee?: TradeFeeOptions;
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Request parameters for getting a trade route
|
|
607
|
+
*/
|
|
608
|
+
declare type GetTradeRouteRequest_5 = {
|
|
609
|
+
/** Amount of input coin to trade (in smallest unit) */
|
|
610
|
+
coinInAmount: bigint;
|
|
611
|
+
/** Type/address of the input coin */
|
|
612
|
+
coinInType: string;
|
|
613
|
+
/** Type/address of the output coin */
|
|
614
|
+
coinOutType: string;
|
|
615
|
+
/** Custom trade fee for this request, if not provided, the default trade fee will be applied */
|
|
616
|
+
tradeFee?: TradeFeeOptions;
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
export declare type GetTradeTransactionRequest = {
|
|
620
|
+
/** Amount of input coin to trade (in smallest unit) */
|
|
621
|
+
coinInAmount: bigint;
|
|
622
|
+
/** Type/address of the input coin */
|
|
623
|
+
coinInType: string;
|
|
624
|
+
/** Type/address of the output coin */
|
|
625
|
+
coinOutType: string;
|
|
626
|
+
/** Wallet address that will execute the transaction */
|
|
627
|
+
walletAddress: string;
|
|
628
|
+
/** Slippage tolerance as decimal (e.g., 0.01 for 1%) */
|
|
629
|
+
slippage: number;
|
|
630
|
+
/** Custom trade fee for this request, if not provided, the default trade fee will be applied */
|
|
631
|
+
tradeFee?: TradeFeeOptions;
|
|
632
|
+
/** The bonding curve Pool ID */
|
|
633
|
+
poolId: string;
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Request parameters for getting a transaction
|
|
638
|
+
*/
|
|
639
|
+
declare type GetTransactionRequest = {
|
|
640
|
+
/** Wallet address that will execute the transaction */
|
|
641
|
+
walletAddress: string;
|
|
642
|
+
/** Complete quote response from 7K Protocol */
|
|
643
|
+
completeRoute: QuoteResponse;
|
|
644
|
+
/** Slippage tolerance (e.g., 0.01 for 1%) */
|
|
645
|
+
slippage: number;
|
|
646
|
+
/** Custom trade fee for this request, if not provided, the default trade fee will be applied */
|
|
647
|
+
tradeFee?: TradeFeeOptions;
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Request parameters for getting a transaction
|
|
652
|
+
*/
|
|
653
|
+
declare type GetTransactionRequest_2 = {
|
|
654
|
+
/** Wallet address that will execute the transaction */
|
|
655
|
+
walletAddress: string;
|
|
656
|
+
/** Complete trade route from Aftermath router */
|
|
657
|
+
completeRoute: RouterCompleteTradeRoute;
|
|
658
|
+
/** Slippage tolerance (e.g., 0.01 for 1%) */
|
|
659
|
+
slippage: number;
|
|
660
|
+
};
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Request parameters for getting a transaction
|
|
664
|
+
*/
|
|
665
|
+
declare type GetTransactionRequest_3 = {
|
|
666
|
+
/** Wallet address that will execute the transaction */
|
|
667
|
+
walletAddress: string;
|
|
668
|
+
/** Complete quote from Astros aggregator */
|
|
669
|
+
completeRoute: Quote;
|
|
670
|
+
/** Slippage tolerance (e.g., 0.01 for 1%) */
|
|
671
|
+
slippage: number;
|
|
672
|
+
/** Custom trade fee for this request, if not provided, the default trade fee will be applied */
|
|
673
|
+
tradeFee?: TradeFeeOptions;
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Request parameters for getting a transaction
|
|
678
|
+
*/
|
|
679
|
+
declare type GetTransactionRequest_4 = {
|
|
680
|
+
/** Wallet address that will execute the transaction */
|
|
681
|
+
walletAddress: string;
|
|
682
|
+
/** Complete router data from Cetus aggregator */
|
|
683
|
+
completeRoute: RouterDataV3;
|
|
684
|
+
/** Slippage tolerance (e.g., 0.01 for 1%) */
|
|
685
|
+
slippage: number;
|
|
686
|
+
/** Custom trade fee for this request, if not provided, the default trade fee will be applied */
|
|
687
|
+
tradeFee?: TradeFeeOptions;
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Request parameters for getting a transaction
|
|
692
|
+
*/
|
|
693
|
+
declare type GetTransactionRequest_5 = {
|
|
694
|
+
/** Wallet address that will execute the transaction */
|
|
695
|
+
walletAddress: string;
|
|
696
|
+
/** Complete routes result from FlowX aggregator */
|
|
697
|
+
completeRoute: GetRoutesResult<Coin, Coin>;
|
|
698
|
+
/** Slippage tolerance (e.g., 0.01 for 1%) */
|
|
699
|
+
slippage: number;
|
|
700
|
+
/** Custom trade fee for this request, if not provided, the default trade fee will be applied */
|
|
701
|
+
tradeFee?: TradeFeeOptions;
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
declare type LegacySuiClient = SuiClient;
|
|
705
|
+
|
|
706
|
+
export declare namespace MathUtils {
|
|
707
|
+
export namespace U64 {
|
|
708
|
+
export function mulDivUp(a: bigint, b: bigint, c: bigint): bigint;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
export declare namespace MoonbagsCalculation {
|
|
713
|
+
export function getCurveAmountAfterBuy(params: GetCurveAmountAfterBuyParams): Promise<bigint>;
|
|
714
|
+
export function getSuiAmountAfterSell(params: GetSuiAmountAfterSellParams): Promise<bigint>;
|
|
715
|
+
export function getUsedSuiForTx(params: {
|
|
716
|
+
suiAmount: bigint;
|
|
717
|
+
frontendFee?: number | string;
|
|
718
|
+
}): Promise<bigint>;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
export declare namespace MoonbagsConstants {
|
|
722
|
+
const PACKAGE_ID = "0xb8df325010942634a4afb3db3901ee215546af43a4ec4af781e7213b0bba7290";
|
|
723
|
+
const CONFIG_OBJECT_ID = "0x74aecf86067c6913960ba4925333aefd2b1f929cafca7e21fd55a8f244b70499";
|
|
724
|
+
const LOCK_CONFIG_OBJECT_ID = "0xfb09822d9808980abd04c51321adb850701f5f55535c6206658ef4d910c3e9be";
|
|
725
|
+
const BURN_MANAGER_OBJECT_ID = "0x1d94aa32518d0cb00f9de6ed60d450c9a2090761f326752ffad06b2e9404f845";
|
|
726
|
+
const POOLS_OBJECT_ID = "0xf699e7f2276f5c9a75944b37a0c5b5d9ddfd2471bf6242483b03ab2887d198d0";
|
|
727
|
+
const GLOBAL_CONFIG_OBJECT_ID = "0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f";
|
|
728
|
+
const FEE_DENOMINATOR: bigint;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
export declare namespace MoonbagsPackage {
|
|
732
|
+
export namespace Curves {
|
|
733
|
+
export function calculateAddLiquidityCost(tokenIn: bigint, tokenReserve: bigint, tokenAmount: bigint): bigint;
|
|
734
|
+
export function calculateRemoveLiquidityReturn(tokenIn: bigint, tokenReserve: bigint, tokenRemoved: bigint): bigint;
|
|
735
|
+
export function calculateTokenAmountReceived(tokenIn: bigint, tokenReserve: bigint, tokenOutReserve: bigint): bigint;
|
|
736
|
+
}
|
|
737
|
+
export namespace Moonbags {
|
|
738
|
+
export type Configuration = {
|
|
739
|
+
platform_fee: string;
|
|
740
|
+
};
|
|
741
|
+
export type Pool = {
|
|
742
|
+
id: {
|
|
743
|
+
id: string;
|
|
744
|
+
};
|
|
745
|
+
virtual_sui_reserves: string;
|
|
746
|
+
virtual_token_reserves: string;
|
|
747
|
+
remain_token_reserves: MoveObjectStruct<BalanceContent>;
|
|
748
|
+
real_sui_reserves: MoveObjectStruct<BalanceContent>;
|
|
749
|
+
};
|
|
750
|
+
export type DynamicVirtualTokenReserves = {
|
|
751
|
+
id: {
|
|
752
|
+
id: string;
|
|
753
|
+
};
|
|
754
|
+
name: number[];
|
|
755
|
+
value: string;
|
|
756
|
+
};
|
|
757
|
+
export function getDynamicVirtualTokenReserves(poolId: string): Promise<bigint | undefined>;
|
|
758
|
+
export function buyExactInReturnsWithLock(params: {
|
|
759
|
+
inputAmount: bigint;
|
|
760
|
+
amountIn: bigint;
|
|
761
|
+
pool: Pool;
|
|
762
|
+
config: Configuration;
|
|
763
|
+
dynamicVirtualTokenReserves: bigint | undefined;
|
|
764
|
+
}): {
|
|
765
|
+
receivedCurve: bigint;
|
|
766
|
+
receivedSui: bigint;
|
|
767
|
+
};
|
|
768
|
+
export function sellReturns(params: {
|
|
769
|
+
amountIn: bigint;
|
|
770
|
+
pool: Pool;
|
|
771
|
+
config: Configuration;
|
|
772
|
+
}): {
|
|
773
|
+
receivedCurve: bigint;
|
|
774
|
+
receivedSui: bigint;
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
export declare namespace MoonbagsTransaction {
|
|
780
|
+
export function buildBuyTx(params: BuildSwapTxParams): Promise<BuildTxResult>;
|
|
781
|
+
export function buildSellTx(params: BuildSwapTxParams): Promise<BuildTxResult>;
|
|
782
|
+
export function getBuyTransaction({ coinInAmount, coinInType, coinOutType, poolId, slippage, walletAddress, tradeFee }: GetTradeTransactionRequest, suiClient: SuiClient): Promise<Uint8Array>;
|
|
783
|
+
export function getSellTransaction({ coinInAmount, coinInType, coinOutType, poolId, slippage, walletAddress, tradeFee }: GetTradeTransactionRequest, suiClient: SuiClient): Promise<Uint8Array>;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
export declare type MoveEnumObjectStruct<Content, Variant extends string = string> = MoveObjectStruct<Content> & {
|
|
787
|
+
variant: Variant;
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
export declare type MoveObject = {
|
|
791
|
+
dataType: "moveObject";
|
|
792
|
+
fields: MoveStruct;
|
|
793
|
+
hasPublicTransfer: boolean;
|
|
794
|
+
type: string;
|
|
795
|
+
};
|
|
796
|
+
|
|
797
|
+
export declare type MoveObjectStruct<Content> = {
|
|
798
|
+
type: string;
|
|
799
|
+
fields: Content;
|
|
800
|
+
};
|
|
801
|
+
|
|
802
|
+
export declare const NATIVE_USDC_TOKEN_TYPE = "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* 7K Protocol DEX aggregator client for routing trades across multiple pools
|
|
806
|
+
* 7K Protocol aggregates liquidity from various DEXs to find optimal trade routes
|
|
807
|
+
*/
|
|
808
|
+
export declare class SevenKAggregator {
|
|
809
|
+
/** Configuration settings for the aggregator */
|
|
810
|
+
private _config;
|
|
811
|
+
/** Sui blockchain client */
|
|
812
|
+
private _suiClient;
|
|
813
|
+
/**
|
|
814
|
+
* Creates a new SevenKAggregator instance
|
|
815
|
+
* @param config - Aggregator configuration including fee settings and optional API key
|
|
816
|
+
* @param suiClient - Sui client for blockchain interactions
|
|
817
|
+
*/
|
|
818
|
+
constructor(config: SevenKAggregatorConfig, suiClient: SuiClient);
|
|
819
|
+
/**
|
|
820
|
+
* Finds the optimal trade route for swapping tokens using 7K Protocol
|
|
821
|
+
* @param params - Trade route parameters
|
|
822
|
+
* @param params.coinInAmount - Amount of input token to swap
|
|
823
|
+
* @param params.coinInType - Type/address of input token
|
|
824
|
+
* @param params.coinOutType - Type/address of output token
|
|
825
|
+
* @returns Promise resolving to quote response with pricing and route information, or null if no route found
|
|
826
|
+
*/
|
|
827
|
+
getTradeRoute({ coinInAmount, coinInType, coinOutType, tradeFee, }: GetTradeRouteRequest): Promise<QuoteResponse | null>;
|
|
828
|
+
/**
|
|
829
|
+
* Builds a transaction for executing a trade route from 7K Protocol
|
|
830
|
+
* @param params - Transaction parameters
|
|
831
|
+
* @param params.walletAddress - Address of the wallet executing the trade
|
|
832
|
+
* @param params.completeRoute - Complete quote response from getTradeRoute()
|
|
833
|
+
* @param params.slippage - Maximum acceptable slippage (e.g., 0.01 for 1%)
|
|
834
|
+
* @returns Promise resolving to built transaction bytes ready for signing and execution
|
|
835
|
+
*/
|
|
836
|
+
getTransaction({ walletAddress, completeRoute, slippage, tradeFee, }: GetTransactionRequest): Promise<Uint8Array>;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
export declare namespace SevenKAggregator {
|
|
840
|
+
export function toCommonTradeRoutes(tradeRouteResponse: QuoteResponse): FinalTradeRoute | null;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* Configuration options for the 7K Protocol aggregator
|
|
845
|
+
*/
|
|
846
|
+
export declare type SevenKAggregatorConfig = {
|
|
847
|
+
/** Default trade fee settings applied to each trade */
|
|
848
|
+
defaultTradeFee: TradeFeeOptions;
|
|
849
|
+
/** Optional API key for 7K Protocol access */
|
|
850
|
+
sevenKApiKey?: string;
|
|
851
|
+
};
|
|
852
|
+
|
|
853
|
+
export declare function splitSuiCoinAfterFeeFromBuyTx(params: BuildSwapTxParams): Promise<BuildTxResult>;
|
|
854
|
+
|
|
855
|
+
export declare function splitSuiCoinAfterFeeFromSellTx(tx: Transaction, params: BuildSwapTxParams, suiCoin: TransactionObjectArgument): Promise<BuildTxResult>;
|
|
856
|
+
|
|
857
|
+
export declare const SUI_FULL_TYPE = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
858
|
+
|
|
859
|
+
export declare const SUI_METADATA_OBJECT_ID = "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3";
|
|
860
|
+
|
|
861
|
+
export declare const SUI_TYPE = "0x2::sui::SUI";
|
|
862
|
+
|
|
863
|
+
export declare enum SupportedAggregator {
|
|
864
|
+
ASTROS = "ASTROS",
|
|
865
|
+
AFTERMATH = "AFTERMATH",
|
|
866
|
+
SEVENK = "7K",
|
|
867
|
+
CETUS = "CETUS",
|
|
868
|
+
FLOWX = "FLOWX"
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
export declare enum SupportedBondingCurve {
|
|
872
|
+
BLAST_FUN = "BLAST_FUN",
|
|
873
|
+
MOONBAGS = "MOONBAGS"
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* Configuration options for trade fees applied to aggregator transactions
|
|
878
|
+
*/
|
|
879
|
+
export declare type TradeFeeOptions = {
|
|
880
|
+
/** Trade fee percentage as a decimal (e.g., 0.01 for 1%, 0.003 for 0.3%) */
|
|
881
|
+
tradeFeePercent: number;
|
|
882
|
+
/** Address that will receive the trade fees */
|
|
883
|
+
tradeFeeRecipientAddress: string;
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
export declare namespace TradeFeeOptions {
|
|
887
|
+
export function equals(a: TradeFeeOptions, b: TradeFeeOptions): boolean;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
export declare type TradePath = {
|
|
891
|
+
poolAddress: string;
|
|
892
|
+
coinIn: string;
|
|
893
|
+
coinOut: string;
|
|
894
|
+
amountIn: bigint;
|
|
895
|
+
amountOut: bigint;
|
|
896
|
+
};
|
|
897
|
+
|
|
898
|
+
export declare type TradeRoute = {
|
|
899
|
+
coinIn: string;
|
|
900
|
+
coinOut: string;
|
|
901
|
+
amountIn: bigint;
|
|
902
|
+
amountOut: bigint;
|
|
903
|
+
paths: TradePath[];
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
export declare const USDC_TOKEN_TYPE = "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN";
|
|
907
|
+
|
|
908
|
+
export { }
|