@gala-chain/launchpad-sdk 0.4.0
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/CHANGELOG.md +46 -0
- package/README.md +628 -0
- package/dist/LaunchpadSDK.d.ts +573 -0
- package/dist/LaunchpadSDK.d.ts.map +1 -0
- package/dist/api/CommentAPI.d.ts +119 -0
- package/dist/api/CommentAPI.d.ts.map +1 -0
- package/dist/api/LaunchpadAPI.d.ts +440 -0
- package/dist/api/LaunchpadAPI.d.ts.map +1 -0
- package/dist/api/TradeAPI.d.ts +164 -0
- package/dist/api/TradeAPI.d.ts.map +1 -0
- package/dist/api/Trading.d.ts +176 -0
- package/dist/api/Trading.d.ts.map +1 -0
- package/dist/api/UserAPI.d.ts +426 -0
- package/dist/api/UserAPI.d.ts.map +1 -0
- package/dist/api/WebSocketAPI.d.ts +156 -0
- package/dist/api/WebSocketAPI.d.ts.map +1 -0
- package/dist/api/dto/BondingCurveDTOs.d.ts +142 -0
- package/dist/api/dto/BondingCurveDTOs.d.ts.map +1 -0
- package/dist/api/services/BundleService.d.ts +105 -0
- package/dist/api/services/BundleService.d.ts.map +1 -0
- package/dist/api/services/SignatureService.d.ts +71 -0
- package/dist/api/services/SignatureService.d.ts.map +1 -0
- package/dist/api/services/TokenClassKeyService.d.ts +116 -0
- package/dist/api/services/TokenClassKeyService.d.ts.map +1 -0
- package/dist/api/services/WebSocketManager.d.ts +99 -0
- package/dist/api/services/WebSocketManager.d.ts.map +1 -0
- package/dist/api/services/WebSocketService.d.ts +66 -0
- package/dist/api/services/WebSocketService.d.ts.map +1 -0
- package/dist/auth/SignatureAuth.d.ts +92 -0
- package/dist/auth/SignatureAuth.d.ts.map +1 -0
- package/dist/auth/types.d.ts +41 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/helpers/sdk.d.ts +75 -0
- package/dist/helpers/sdk.d.ts.map +1 -0
- package/dist/helpers/wallet.d.ts +60 -0
- package/dist/helpers/wallet.d.ts.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/comment.dto.d.ts +160 -0
- package/dist/types/comment.dto.d.ts.map +1 -0
- package/dist/types/common.d.ts +108 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/dto.d.ts +145 -0
- package/dist/types/dto.d.ts.map +1 -0
- package/dist/types/launchpad.dto.d.ts +517 -0
- package/dist/types/launchpad.dto.d.ts.map +1 -0
- package/dist/types/launchpad.validation.d.ts +40 -0
- package/dist/types/launchpad.validation.d.ts.map +1 -0
- package/dist/types/trade.dto.d.ts +446 -0
- package/dist/types/trade.dto.d.ts.map +1 -0
- package/dist/types/user.dto.d.ts +330 -0
- package/dist/types/user.dto.d.ts.map +1 -0
- package/dist/utils/VaultCache.d.ts +73 -0
- package/dist/utils/VaultCache.d.ts.map +1 -0
- package/dist/utils/adapters.d.ts +111 -0
- package/dist/utils/adapters.d.ts.map +1 -0
- package/dist/utils/agent-config.d.ts +206 -0
- package/dist/utils/agent-config.d.ts.map +1 -0
- package/dist/utils/http.d.ts +85 -0
- package/dist/utils/http.d.ts.map +1 -0
- package/dist/utils/multipart.d.ts +60 -0
- package/dist/utils/multipart.d.ts.map +1 -0
- package/dist/utils/precision-math.d.ts +37 -0
- package/dist/utils/precision-math.d.ts.map +1 -0
- package/dist/utils/validation.d.ts +131 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/wallet.d.ts +174 -0
- package/dist/utils/wallet.d.ts.map +1 -0
- package/package.json +151 -0
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trade API Data Transfer Objects and Types
|
|
3
|
+
*
|
|
4
|
+
* This module defines all types and interfaces for trade operations including
|
|
5
|
+
* trade creation and trade listing endpoints.
|
|
6
|
+
*/
|
|
7
|
+
import { AddressFormat } from './common';
|
|
8
|
+
/**
|
|
9
|
+
* Pre-mint vault address constant
|
|
10
|
+
*/
|
|
11
|
+
export declare const PRE_MINT_VAULT_ADDRESS = "service|testToken";
|
|
12
|
+
/**
|
|
13
|
+
* Trade type enumeration
|
|
14
|
+
*/
|
|
15
|
+
export type TradeType = 'buy' | 'sell';
|
|
16
|
+
/**
|
|
17
|
+
* Data required for creating a trade
|
|
18
|
+
*/
|
|
19
|
+
export interface CreateTradeData {
|
|
20
|
+
/** Trade type */
|
|
21
|
+
tradeType: TradeType;
|
|
22
|
+
/** Token amount as string (validated as number on backend) */
|
|
23
|
+
tokenAmount: string;
|
|
24
|
+
/** Vault address - either eth|0x[40] or service|[alphanumeric] */
|
|
25
|
+
vaultAddress: string;
|
|
26
|
+
/** User address in backend format eth|[40-hex-chars] */
|
|
27
|
+
userAddress: AddressFormat;
|
|
28
|
+
/** Optional slippage tolerance */
|
|
29
|
+
slippageTolerance?: string;
|
|
30
|
+
/** Optional deadline timestamp */
|
|
31
|
+
deadline?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Response from trade creation endpoint
|
|
35
|
+
*/
|
|
36
|
+
export interface CreateTradeResponse {
|
|
37
|
+
/** Success status */
|
|
38
|
+
success: boolean;
|
|
39
|
+
/** Created trade information */
|
|
40
|
+
data?: any;
|
|
41
|
+
/** Error message if creation failed */
|
|
42
|
+
message?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Data required for buying tokens with native currency (GALA)
|
|
46
|
+
*/
|
|
47
|
+
export interface BuyTokensData {
|
|
48
|
+
/** Token symbol (e.g., 'WBB') */
|
|
49
|
+
tokenSymbol: string;
|
|
50
|
+
/** Amount of native currency (GALA) to spend */
|
|
51
|
+
nativeTokenQuantity: string;
|
|
52
|
+
/** Expected amount of tokens to receive */
|
|
53
|
+
expectedToken: string;
|
|
54
|
+
/** Maximum acceptable reverse bonding curve fee for slippage protection (optional, defaults to '0') */
|
|
55
|
+
maxAcceptableReverseBondingCurveFee?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Data required for selling tokens for native currency (GALA)
|
|
59
|
+
*/
|
|
60
|
+
export interface SellTokensData {
|
|
61
|
+
/** Token symbol (e.g., 'WBB') */
|
|
62
|
+
tokenSymbol: string;
|
|
63
|
+
/** Amount of tokens to sell */
|
|
64
|
+
tokenQuantity: string;
|
|
65
|
+
/** Expected amount of native currency (GALA) to receive */
|
|
66
|
+
expectedNativeToken: string;
|
|
67
|
+
/** Maximum acceptable reverse bonding curve fee for slippage protection (optional, defaults to '0') */
|
|
68
|
+
maxAcceptableReverseBondingCurveFee?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Signed DTO for buy token operations
|
|
72
|
+
*/
|
|
73
|
+
export interface BuyTokensSignedDto {
|
|
74
|
+
/** Service vault address for the token */
|
|
75
|
+
vaultAddress: string;
|
|
76
|
+
/** Amount of native currency (GALA) to spend */
|
|
77
|
+
nativeTokenQuantity: string;
|
|
78
|
+
/** Expected amount of tokens to receive */
|
|
79
|
+
expectedToken: string;
|
|
80
|
+
/** Extra fees for slippage protection */
|
|
81
|
+
extraFees: {
|
|
82
|
+
maxAcceptableReverseBondingCurveFee: string;
|
|
83
|
+
};
|
|
84
|
+
/** Unique operation key */
|
|
85
|
+
uniqueKey: string;
|
|
86
|
+
/** Ethereum message prefix */
|
|
87
|
+
prefix?: string;
|
|
88
|
+
/** Signature */
|
|
89
|
+
signature: string;
|
|
90
|
+
/** EIP-712 types structure */
|
|
91
|
+
types?: any;
|
|
92
|
+
/** EIP-712 domain */
|
|
93
|
+
domain?: any;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Signed DTO for sell token operations
|
|
97
|
+
*/
|
|
98
|
+
export interface SellTokensSignedDto {
|
|
99
|
+
/** Service vault address for the token */
|
|
100
|
+
vaultAddress: string;
|
|
101
|
+
/** Amount of tokens to sell */
|
|
102
|
+
tokenQuantity: string;
|
|
103
|
+
/** Expected amount of native currency (GALA) to receive */
|
|
104
|
+
expectedNativeToken: string;
|
|
105
|
+
/** Extra fees for slippage protection */
|
|
106
|
+
extraFees: {
|
|
107
|
+
maxAcceptableReverseBondingCurveFee: string;
|
|
108
|
+
};
|
|
109
|
+
/** Unique operation key */
|
|
110
|
+
uniqueKey: string;
|
|
111
|
+
/** Ethereum message prefix */
|
|
112
|
+
prefix?: string;
|
|
113
|
+
/** Signature */
|
|
114
|
+
signature: string;
|
|
115
|
+
/** EIP-712 types structure */
|
|
116
|
+
types?: any;
|
|
117
|
+
/** EIP-712 domain */
|
|
118
|
+
domain?: any;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Response from token trading operations
|
|
122
|
+
*/
|
|
123
|
+
export interface TokenTradeResponse {
|
|
124
|
+
/** HTTP status code */
|
|
125
|
+
status: number;
|
|
126
|
+
/** Success status */
|
|
127
|
+
success?: boolean;
|
|
128
|
+
/** Trade result data */
|
|
129
|
+
data: any;
|
|
130
|
+
/** Response message */
|
|
131
|
+
message: string;
|
|
132
|
+
/** Error message if trade failed */
|
|
133
|
+
error: string | null;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Options for fetching trades with filtering
|
|
137
|
+
*/
|
|
138
|
+
export interface GetTradeOptions {
|
|
139
|
+
/** Optional token name filter */
|
|
140
|
+
tokenName?: string;
|
|
141
|
+
/** Page number (1-based), defaults to 1 */
|
|
142
|
+
page?: number;
|
|
143
|
+
/** Number of items per page, defaults to 10 */
|
|
144
|
+
limit?: number;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Pagination parameters for tokenName-based trade methods
|
|
148
|
+
*/
|
|
149
|
+
export interface TradeListParams {
|
|
150
|
+
/** Page number (1-based), defaults to 1 */
|
|
151
|
+
page?: number;
|
|
152
|
+
/** Number of items per page, defaults to 10 */
|
|
153
|
+
limit?: number;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Backend format for get trade options (handles type conversion)
|
|
157
|
+
*/
|
|
158
|
+
export interface BackendGetTradeOptions {
|
|
159
|
+
/** Optional token name filter */
|
|
160
|
+
tokenName?: string;
|
|
161
|
+
/** Page number as string (backend quirk) */
|
|
162
|
+
page: string;
|
|
163
|
+
/** Limit as string (backend quirk) */
|
|
164
|
+
limit: string;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Trade information returned by the API
|
|
168
|
+
*/
|
|
169
|
+
export interface TradeInfo {
|
|
170
|
+
/** Trade ID */
|
|
171
|
+
id: string;
|
|
172
|
+
/** User address involved in the trade */
|
|
173
|
+
userAddress: AddressFormat;
|
|
174
|
+
/** Trade type */
|
|
175
|
+
tradeType: TradeType;
|
|
176
|
+
/** Token amount */
|
|
177
|
+
tokenAmount: string;
|
|
178
|
+
/** Vault address */
|
|
179
|
+
vaultAddress: string;
|
|
180
|
+
/** Trade timestamp */
|
|
181
|
+
createdAt: string;
|
|
182
|
+
/** Last update timestamp */
|
|
183
|
+
updatedAt: string;
|
|
184
|
+
/** Optional slippage tolerance */
|
|
185
|
+
slippageTolerance?: string;
|
|
186
|
+
/** Optional deadline */
|
|
187
|
+
deadline?: number;
|
|
188
|
+
/** Additional trade metadata */
|
|
189
|
+
[key: string]: any;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Response from get trades endpoint
|
|
193
|
+
*/
|
|
194
|
+
export interface GetTradesResponse {
|
|
195
|
+
/** Array of trades */
|
|
196
|
+
data: TradeInfo[];
|
|
197
|
+
/** Pagination metadata */
|
|
198
|
+
page: number;
|
|
199
|
+
limit: number;
|
|
200
|
+
total: number;
|
|
201
|
+
totalPages: number;
|
|
202
|
+
hasNextPage: boolean;
|
|
203
|
+
hasPrevPage: boolean;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Constraints for trade operations
|
|
207
|
+
*/
|
|
208
|
+
export declare const TRADE_CONSTRAINTS: {
|
|
209
|
+
/** Pagination constraints */
|
|
210
|
+
readonly PAGINATION: {
|
|
211
|
+
readonly MIN_PAGE: 1;
|
|
212
|
+
readonly MAX_PAGE: 1000;
|
|
213
|
+
readonly MIN_LIMIT: 1;
|
|
214
|
+
readonly MAX_LIMIT: 20;
|
|
215
|
+
};
|
|
216
|
+
/** Vault address patterns */
|
|
217
|
+
readonly VAULT_ADDRESS: {
|
|
218
|
+
/** Ethereum vault pattern: eth|0x[40-hex-chars] */
|
|
219
|
+
readonly ETH_PATTERN: RegExp;
|
|
220
|
+
/** Service vault pattern: service|[alphanumeric with special chars] */
|
|
221
|
+
readonly SERVICE_PATTERN: RegExp;
|
|
222
|
+
};
|
|
223
|
+
/** User address pattern */
|
|
224
|
+
readonly USER_ADDRESS: {
|
|
225
|
+
/** User address pattern: eth|[40-hex-chars] */
|
|
226
|
+
readonly PATTERN: RegExp;
|
|
227
|
+
};
|
|
228
|
+
/** Amount validation */
|
|
229
|
+
readonly AMOUNT: {
|
|
230
|
+
/** Pattern for positive decimal numbers */
|
|
231
|
+
readonly POSITIVE_DECIMAL: RegExp;
|
|
232
|
+
};
|
|
233
|
+
/** Token name constraints */
|
|
234
|
+
readonly TOKEN_NAME: {
|
|
235
|
+
readonly MIN_LENGTH: 1;
|
|
236
|
+
readonly MAX_LENGTH: 50;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* Type guard to check if an object is valid CreateTradeData
|
|
241
|
+
*/
|
|
242
|
+
export declare function isCreateTradeData(obj: any): obj is CreateTradeData;
|
|
243
|
+
/**
|
|
244
|
+
* Type guard to check if an object is valid GetTradeOptions
|
|
245
|
+
*/
|
|
246
|
+
export declare function isGetTradeOptions(obj: any): obj is GetTradeOptions;
|
|
247
|
+
/**
|
|
248
|
+
* Type guard to check if an object is valid TradeListParams
|
|
249
|
+
*/
|
|
250
|
+
export declare function isTradeListParams(obj: any): obj is TradeListParams;
|
|
251
|
+
/**
|
|
252
|
+
* Type guard to check if a string is a valid TradeType
|
|
253
|
+
*/
|
|
254
|
+
export declare function isTradeType(value: string): value is TradeType;
|
|
255
|
+
/**
|
|
256
|
+
* Validates vault address format (supports both eth and service formats)
|
|
257
|
+
*/
|
|
258
|
+
export declare function isValidVaultAddress(address: string): boolean;
|
|
259
|
+
/**
|
|
260
|
+
* Validates user address format
|
|
261
|
+
* Now uses GSwap SDK validator for consistency
|
|
262
|
+
*/
|
|
263
|
+
export declare function isValidUserAddress(address: string): boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Validates amount string format (positive decimal)
|
|
266
|
+
* Now uses GSwap SDK validator for consistency
|
|
267
|
+
*/
|
|
268
|
+
export declare function isValidAmountString(amount: string): boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Type guard to check if an object is valid BuyTokensData
|
|
271
|
+
*/
|
|
272
|
+
export declare function isBuyTokensData(obj: any): obj is BuyTokensData;
|
|
273
|
+
/**
|
|
274
|
+
* Type guard to check if an object is valid SellTokensData
|
|
275
|
+
*/
|
|
276
|
+
export declare function isSellTokensData(obj: any): obj is SellTokensData;
|
|
277
|
+
/**
|
|
278
|
+
* Validates token symbol format
|
|
279
|
+
* Now uses GSwap SDK validator for consistency
|
|
280
|
+
*/
|
|
281
|
+
export declare function isValidTokenSymbol(symbol: string): boolean;
|
|
282
|
+
/**
|
|
283
|
+
* Request data for fetching sale details
|
|
284
|
+
*/
|
|
285
|
+
export interface FetchSaleDetailsData {
|
|
286
|
+
/** Vault address in service format */
|
|
287
|
+
vaultAddress: string;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Token information structure
|
|
291
|
+
*/
|
|
292
|
+
export interface TokenInfo {
|
|
293
|
+
/** Additional key identifier */
|
|
294
|
+
additionalKey: string;
|
|
295
|
+
/** Token category */
|
|
296
|
+
category: string;
|
|
297
|
+
/** Token collection */
|
|
298
|
+
collection: string;
|
|
299
|
+
/** Token instance */
|
|
300
|
+
instance: string;
|
|
301
|
+
/** Token type */
|
|
302
|
+
type: string;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Reverse bonding curve configuration
|
|
306
|
+
*/
|
|
307
|
+
export interface ReverseBondingCurveConfiguration {
|
|
308
|
+
/** Maximum fee portion */
|
|
309
|
+
maxFeePortion: string;
|
|
310
|
+
/** Minimum fee portion */
|
|
311
|
+
minFeePortion: string;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Sale details data from GalaChain
|
|
315
|
+
*/
|
|
316
|
+
export interface SaleDetailsData {
|
|
317
|
+
/** Base price for the token */
|
|
318
|
+
basePrice: string;
|
|
319
|
+
/** Euler constant */
|
|
320
|
+
euler: string;
|
|
321
|
+
/** Exponent factor for bonding curve */
|
|
322
|
+
exponentFactor: string;
|
|
323
|
+
/** Maximum token supply */
|
|
324
|
+
maxSupply: string;
|
|
325
|
+
/** Native token information (GALA) */
|
|
326
|
+
nativeToken: TokenInfo;
|
|
327
|
+
/** Current native token quantity in the vault */
|
|
328
|
+
nativeTokenQuantity: string;
|
|
329
|
+
/** Reverse bonding curve configuration */
|
|
330
|
+
reverseBondingCurveConfiguration: ReverseBondingCurveConfiguration;
|
|
331
|
+
/** Sale owner address */
|
|
332
|
+
saleOwner: string;
|
|
333
|
+
/** Current sale status */
|
|
334
|
+
saleStatus: string;
|
|
335
|
+
/** Selling token information */
|
|
336
|
+
sellingToken: TokenInfo;
|
|
337
|
+
/** Current selling token quantity */
|
|
338
|
+
sellingTokenQuantity: string;
|
|
339
|
+
/** Vault address */
|
|
340
|
+
vaultAddress: string;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Response from fetch sale details endpoint
|
|
344
|
+
*/
|
|
345
|
+
export interface FetchSaleDetailsResponse {
|
|
346
|
+
/** Status code (1 = success) */
|
|
347
|
+
Status: number;
|
|
348
|
+
/** Sale details data */
|
|
349
|
+
Data: SaleDetailsData;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Type guard to check if an object is valid FetchSaleDetailsData
|
|
353
|
+
*/
|
|
354
|
+
export declare function isFetchSaleDetailsData(obj: any): obj is FetchSaleDetailsData;
|
|
355
|
+
/**
|
|
356
|
+
* Data required for calculating pre-mint token amounts
|
|
357
|
+
*/
|
|
358
|
+
export interface CalculatePreMintData {
|
|
359
|
+
/** Amount of native currency (GALA) to spend */
|
|
360
|
+
nativeTokenQuantity: string;
|
|
361
|
+
/** Optional vault address (defaults to "service|testToken" for pre-mint) */
|
|
362
|
+
vaultAddress?: string;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Response from CallMemeTokenOut endpoint
|
|
366
|
+
*/
|
|
367
|
+
export interface CalculatePreMintResponse {
|
|
368
|
+
/** Status code (1 = success) */
|
|
369
|
+
Status: number;
|
|
370
|
+
/** Calculation result data */
|
|
371
|
+
Data: {
|
|
372
|
+
/** Calculated quantity of tokens user will receive */
|
|
373
|
+
calculatedQuantity: string;
|
|
374
|
+
/** Extra fees breakdown */
|
|
375
|
+
extraFees: {
|
|
376
|
+
/** Reverse bonding curve fee */
|
|
377
|
+
reverseBondingCurve: string;
|
|
378
|
+
/** Transaction fees */
|
|
379
|
+
transactionFees: string;
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Trade calculation type enumeration
|
|
385
|
+
*/
|
|
386
|
+
export type TradeCalculationType = 'NATIVE' | 'MEME';
|
|
387
|
+
/**
|
|
388
|
+
* Trade calculation method enumeration
|
|
389
|
+
*/
|
|
390
|
+
export type TradeCalculationMethod = 'IN' | 'OUT';
|
|
391
|
+
/**
|
|
392
|
+
* Options for calculating trade amounts
|
|
393
|
+
*/
|
|
394
|
+
export interface GetAmountOptions {
|
|
395
|
+
/** Type of calculation - determines input currency */
|
|
396
|
+
type: TradeCalculationType;
|
|
397
|
+
/** Method - IN or OUT from pool perspective */
|
|
398
|
+
method: TradeCalculationMethod;
|
|
399
|
+
/** Vault address for the token */
|
|
400
|
+
vaultAddress: string;
|
|
401
|
+
/** Amount to calculate with */
|
|
402
|
+
amount: string;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Response from get amount calculation endpoint
|
|
406
|
+
*/
|
|
407
|
+
export interface GetAmountResponse {
|
|
408
|
+
/** Success status */
|
|
409
|
+
success: boolean;
|
|
410
|
+
/** Calculation result data */
|
|
411
|
+
data?: {
|
|
412
|
+
/** Calculated amount */
|
|
413
|
+
amount: string;
|
|
414
|
+
/** Extra fees breakdown */
|
|
415
|
+
extraFees?: {
|
|
416
|
+
/** Reverse bonding curve fee */
|
|
417
|
+
reverseBondingCurve?: string;
|
|
418
|
+
/** Transaction fees */
|
|
419
|
+
transactionFees?: string;
|
|
420
|
+
/** Total fees */
|
|
421
|
+
totalFees?: string;
|
|
422
|
+
};
|
|
423
|
+
/** Price impact percentage */
|
|
424
|
+
priceImpact?: string;
|
|
425
|
+
/** Minimum amount received with slippage protection */
|
|
426
|
+
minimumReceived?: string;
|
|
427
|
+
};
|
|
428
|
+
/** Error message if calculation failed */
|
|
429
|
+
message?: string;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Enhanced extra fees interface (IExtraFeesDTO from frontend)
|
|
433
|
+
*/
|
|
434
|
+
export interface IExtraFeesDTO {
|
|
435
|
+
/** Maximum acceptable reverse bonding curve fee for slippage protection */
|
|
436
|
+
maxAcceptableReverseBondingCurveFee: string;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Type guard to check if an object is valid CalculatePreMintData
|
|
440
|
+
*/
|
|
441
|
+
export declare function isCalculatePreMintData(obj: any): obj is CalculatePreMintData;
|
|
442
|
+
/**
|
|
443
|
+
* Type guard to check if an object is valid GetAmountOptions
|
|
444
|
+
*/
|
|
445
|
+
export declare function isGetAmountOptions(obj: any): obj is GetAmountOptions;
|
|
446
|
+
//# sourceMappingURL=trade.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trade.dto.d.ts","sourceRoot":"","sources":["../../src/types/trade.dto.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OA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