@gala-chain/launchpad-sdk 0.4.3 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +351 -77
  2. package/dist/examples/complete-sdk-demo.d.ts +22 -0
  3. package/dist/examples/complete-sdk-demo.d.ts.map +1 -0
  4. package/dist/index.cjs.js +1 -1
  5. package/dist/index.esm.js +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/src/LaunchpadSDK.d.ts +755 -0
  8. package/dist/src/LaunchpadSDK.d.ts.map +1 -0
  9. package/dist/{api → src/api}/LaunchpadAPI.d.ts +105 -67
  10. package/dist/src/api/LaunchpadAPI.d.ts.map +1 -0
  11. package/dist/{api → src/api}/dto/BondingCurveDTOs.d.ts +8 -5
  12. package/dist/src/api/dto/BondingCurveDTOs.d.ts.map +1 -0
  13. package/dist/src/api/dto/TransferTokenDto.d.ts +76 -0
  14. package/dist/src/api/dto/TransferTokenDto.d.ts.map +1 -0
  15. package/dist/src/auth/SignatureAuth.d.ts.map +1 -0
  16. package/dist/src/auth/types.d.ts.map +1 -0
  17. package/dist/src/config/environments.d.ts +45 -0
  18. package/dist/src/config/environments.d.ts.map +1 -0
  19. package/dist/{helpers → src/helpers}/sdk.d.ts +23 -13
  20. package/dist/src/helpers/sdk.d.ts.map +1 -0
  21. package/dist/src/helpers/wallet.d.ts.map +1 -0
  22. package/dist/src/index.d.ts +25 -0
  23. package/dist/src/index.d.ts.map +1 -0
  24. package/dist/src/services/BundleService.d.ts +197 -0
  25. package/dist/src/services/BundleService.d.ts.map +1 -0
  26. package/dist/src/services/DexService.d.ts +84 -0
  27. package/dist/src/services/DexService.d.ts.map +1 -0
  28. package/dist/src/services/GalaChainService.d.ts +254 -0
  29. package/dist/src/services/GalaChainService.d.ts.map +1 -0
  30. package/dist/src/services/LaunchpadService.d.ts +479 -0
  31. package/dist/src/services/LaunchpadService.d.ts.map +1 -0
  32. package/dist/src/services/SignatureService.d.ts.map +1 -0
  33. package/dist/src/services/TokenClassKeyService.d.ts.map +1 -0
  34. package/dist/src/services/TokenResolverService.d.ts +154 -0
  35. package/dist/src/services/TokenResolverService.d.ts.map +1 -0
  36. package/dist/src/services/WebSocketManager.d.ts.map +1 -0
  37. package/dist/{api → src}/services/WebSocketService.d.ts +4 -1
  38. package/dist/src/services/WebSocketService.d.ts.map +1 -0
  39. package/dist/{types → src/types}/comment.dto.d.ts +14 -5
  40. package/dist/src/types/comment.dto.d.ts.map +1 -0
  41. package/dist/{types → src/types}/common.d.ts +36 -1
  42. package/dist/src/types/common.d.ts.map +1 -0
  43. package/dist/{types → src/types}/dto.d.ts +19 -0
  44. package/dist/src/types/dto.d.ts.map +1 -0
  45. package/dist/{types → src/types}/launchpad.dto.d.ts +216 -30
  46. package/dist/src/types/launchpad.dto.d.ts.map +1 -0
  47. package/dist/{types → src/types}/launchpad.validation.d.ts +8 -8
  48. package/dist/src/types/launchpad.validation.d.ts.map +1 -0
  49. package/dist/src/types/options.dto.d.ts +281 -0
  50. package/dist/src/types/options.dto.d.ts.map +1 -0
  51. package/dist/src/types/result.types.d.ts +120 -0
  52. package/dist/src/types/result.types.d.ts.map +1 -0
  53. package/dist/{types → src/types}/trade.dto.d.ts +46 -19
  54. package/dist/src/types/trade.dto.d.ts.map +1 -0
  55. package/dist/src/types/transfer.dto.d.ts +161 -0
  56. package/dist/src/types/transfer.dto.d.ts.map +1 -0
  57. package/dist/{types → src/types}/user.dto.d.ts +98 -38
  58. package/dist/src/types/user.dto.d.ts.map +1 -0
  59. package/dist/src/types/websocket.types.d.ts +82 -0
  60. package/dist/src/types/websocket.types.d.ts.map +1 -0
  61. package/dist/src/utils/Logger.d.ts +136 -0
  62. package/dist/src/utils/Logger.d.ts.map +1 -0
  63. package/dist/src/utils/SignatureHelper.d.ts +77 -0
  64. package/dist/src/utils/SignatureHelper.d.ts.map +1 -0
  65. package/dist/src/utils/adapters.d.ts.map +1 -0
  66. package/dist/src/utils/agent-config.d.ts.map +1 -0
  67. package/dist/src/utils/date-utils.d.ts +39 -0
  68. package/dist/src/utils/date-utils.d.ts.map +1 -0
  69. package/dist/src/utils/http.d.ts.map +1 -0
  70. package/dist/src/utils/multipart.d.ts.map +1 -0
  71. package/dist/src/utils/number-utils.d.ts +57 -0
  72. package/dist/src/utils/number-utils.d.ts.map +1 -0
  73. package/dist/src/utils/precision-math.d.ts.map +1 -0
  74. package/dist/src/utils/slippage-utils.d.ts +70 -0
  75. package/dist/src/utils/slippage-utils.d.ts.map +1 -0
  76. package/dist/src/utils/tokenNormalizer.d.ts +111 -0
  77. package/dist/src/utils/tokenNormalizer.d.ts.map +1 -0
  78. package/dist/{utils → src/utils}/validation.d.ts +4 -4
  79. package/dist/src/utils/validation.d.ts.map +1 -0
  80. package/dist/{utils → src/utils}/wallet.d.ts +2 -2
  81. package/dist/src/utils/wallet.d.ts.map +1 -0
  82. package/package.json +10 -13
  83. package/dist/LaunchpadSDK.d.ts +0 -573
  84. package/dist/LaunchpadSDK.d.ts.map +0 -1
  85. package/dist/api/CommentAPI.d.ts +0 -119
  86. package/dist/api/CommentAPI.d.ts.map +0 -1
  87. package/dist/api/LaunchpadAPI.d.ts.map +0 -1
  88. package/dist/api/TradeAPI.d.ts +0 -164
  89. package/dist/api/TradeAPI.d.ts.map +0 -1
  90. package/dist/api/Trading.d.ts +0 -176
  91. package/dist/api/Trading.d.ts.map +0 -1
  92. package/dist/api/UserAPI.d.ts +0 -426
  93. package/dist/api/UserAPI.d.ts.map +0 -1
  94. package/dist/api/WebSocketAPI.d.ts +0 -156
  95. package/dist/api/WebSocketAPI.d.ts.map +0 -1
  96. package/dist/api/dto/BondingCurveDTOs.d.ts.map +0 -1
  97. package/dist/api/services/BundleService.d.ts +0 -105
  98. package/dist/api/services/BundleService.d.ts.map +0 -1
  99. package/dist/api/services/SignatureService.d.ts.map +0 -1
  100. package/dist/api/services/TokenClassKeyService.d.ts.map +0 -1
  101. package/dist/api/services/WebSocketManager.d.ts.map +0 -1
  102. package/dist/api/services/WebSocketService.d.ts.map +0 -1
  103. package/dist/auth/SignatureAuth.d.ts.map +0 -1
  104. package/dist/auth/types.d.ts.map +0 -1
  105. package/dist/helpers/sdk.d.ts.map +0 -1
  106. package/dist/helpers/wallet.d.ts.map +0 -1
  107. package/dist/index.d.ts +0 -49
  108. package/dist/index.d.ts.map +0 -1
  109. package/dist/types/comment.dto.d.ts.map +0 -1
  110. package/dist/types/common.d.ts.map +0 -1
  111. package/dist/types/dto.d.ts.map +0 -1
  112. package/dist/types/launchpad.dto.d.ts.map +0 -1
  113. package/dist/types/launchpad.validation.d.ts.map +0 -1
  114. package/dist/types/trade.dto.d.ts.map +0 -1
  115. package/dist/types/user.dto.d.ts.map +0 -1
  116. package/dist/utils/VaultCache.d.ts +0 -73
  117. package/dist/utils/VaultCache.d.ts.map +0 -1
  118. package/dist/utils/adapters.d.ts.map +0 -1
  119. package/dist/utils/agent-config.d.ts.map +0 -1
  120. package/dist/utils/http.d.ts.map +0 -1
  121. package/dist/utils/multipart.d.ts.map +0 -1
  122. package/dist/utils/precision-math.d.ts.map +0 -1
  123. package/dist/utils/validation.d.ts.map +0 -1
  124. package/dist/utils/wallet.d.ts.map +0 -1
  125. /package/dist/{auth → src/auth}/SignatureAuth.d.ts +0 -0
  126. /package/dist/{auth → src/auth}/types.d.ts +0 -0
  127. /package/dist/{helpers → src/helpers}/wallet.d.ts +0 -0
  128. /package/dist/{api → src}/services/SignatureService.d.ts +0 -0
  129. /package/dist/{api → src}/services/TokenClassKeyService.d.ts +0 -0
  130. /package/dist/{api → src}/services/WebSocketManager.d.ts +0 -0
  131. /package/dist/{utils → src/utils}/adapters.d.ts +0 -0
  132. /package/dist/{utils → src/utils}/agent-config.d.ts +0 -0
  133. /package/dist/{utils → src/utils}/http.d.ts +0 -0
  134. /package/dist/{utils → src/utils}/multipart.d.ts +0 -0
  135. /package/dist/{utils → src/utils}/precision-math.d.ts +0 -0
@@ -1,426 +0,0 @@
1
- /**
2
- * User API Controller
3
- *
4
- * This controller provides access to user-related operations including:
5
- * - Token list retrieval with filtering
6
- * - Faucet transfers
7
- * - GALA balance fetching
8
- *
9
- * All methods include input validation and handle backend type inconsistencies.
10
- */
11
- import { HttpClient } from '../utils/http';
12
- import { GetTokenListOptions, GetTokenListResponse, TransferFaucetsData, TransferFaucetsResponse, FetchGalaBalanceOptions, FetchGalaBalanceResponse, UpdateProfileData, UpdateProfileResponse, UploadProfileImageOptions, UploadProfileImageResponse, GetTokenBalanceResponse, UserTokenType } from '../types/user.dto';
13
- /**
14
- * User API controller for user operations
15
- *
16
- * Provides methods for:
17
- * - Fetching user token lists with optional filtering
18
- * - Transferring faucets to users
19
- * - Retrieving GALA balance for users
20
- * - Updating user profiles
21
- * - Uploading profile images
22
- *
23
- * @example
24
- * ```typescript
25
- * // Get user's token list with filtering
26
- * const tokens = await sdk.user.getTokenList({
27
- * type: "DEFI",
28
- * search: "gala",
29
- * page: 1,
30
- * limit: 10
31
- * });
32
- *
33
- * // Transfer faucets to user
34
- * const transferResult = await sdk.user.transferFaucets({
35
- * userAddress: "eth|1234567890abcdef1234567890abcdef12345678",
36
- * amount: "1000000000000000000" // 1 token with 18 decimals
37
- * });
38
- *
39
- * // Get user's GALA balance
40
- * const balance = await sdk.user.getGalaBalance({
41
- * userAddress: "eth|1234567890abcdef1234567890abcdef12345678"
42
- * });
43
- *
44
- * // Update user profile
45
- * const updateResult = await sdk.user.updateProfile({
46
- * profileImage: "https://example.com/avatar.jpg",
47
- * fullName: "John Doe",
48
- * userAddress: "eth|1234567890abcdef1234567890abcdef12345678"
49
- * });
50
- * ```
51
- */
52
- export declare class UserAPI {
53
- private readonly http;
54
- constructor(http: HttpClient);
55
- /**
56
- * Fetches user token list with optional filtering and pagination
57
- *
58
- * ✅ VERIFIED: Real API payload confirmed - endpoint /user/token-created
59
- *
60
- * @param options Filtering and pagination options
61
- * @returns Promise<GetTokenListResponse> Token list with pagination
62
- * @throws ValidationError if input validation fails
63
- *
64
- * @example
65
- * ```typescript
66
- * // Get all user tokens with pagination
67
- * const tokens = await userAPI.getTokenList({
68
- * page: 1,
69
- * limit: 10
70
- * });
71
- *
72
- * // Get filtered tokens by type
73
- * const defiTokens = await userAPI.getTokenList({
74
- * type: "DEFI",
75
- * page: 1,
76
- * limit: 5
77
- * });
78
- *
79
- * // Search for specific tokens
80
- * const searchResults = await userAPI.getTokenList({
81
- * search: "gala",
82
- * page: 1,
83
- * limit: 20
84
- * });
85
- * ```
86
- */
87
- getTokenList(options: GetTokenListOptions): Promise<GetTokenListResponse>;
88
- /**
89
- * Fetches tokens held by user (balances)
90
- *
91
- * ✅ VERIFIED: Real API payload confirmed - endpoint /user/token-hold
92
- *
93
- * @param options Token held filtering options
94
- * @returns Promise<GetTokenListResponse> Tokens held with pagination
95
- * @throws ValidationError if input validation fails
96
- *
97
- * @example
98
- * ```typescript
99
- * // Get tokens held by user
100
- * const heldTokens = await userAPI.getTokensHeld({
101
- * address: "eth|1234567890abcdef1234567890abcdef12345678",
102
- * page: 1,
103
- * limit: 10
104
- * });
105
- * ```
106
- */
107
- getTokensHeld(options: GetTokenListOptions): Promise<GetTokenListResponse>;
108
- /**
109
- * Gets token balance for a specific wallet address
110
- *
111
- * ✅ VERIFIED: Real API payload confirmed - endpoint /user/token-list with tokenName parameter
112
- *
113
- * @param tokenName Token name to check balance for
114
- * @param walletAddress Wallet address to check (in backend format eth|[40-hex-chars])
115
- * @param type Token type to filter by (default: 'DEFI')
116
- * @returns Promise<GetTokenBalanceResponse> Token balance information or empty if not held
117
- * @throws ValidationError if input validation fails
118
- *
119
- * @example
120
- * ```typescript
121
- * // Check if wallet holds specific token
122
- * const balance = await userAPI.getTokenBalance(
123
- * "WB",
124
- * "eth|5AD173F004990940b20e7A5C64C72E8b6B91a783",
125
- * "DEFI"
126
- * );
127
- *
128
- * // Response contains balance details or empty data if not held
129
- * if (balance.data?.count > 0) {
130
- * console.log(`Wallet holds ${balance.data.token[0].quantity} ${balance.data.token[0].symbol}`);
131
- * } else {
132
- * console.log('Wallet does not hold this token');
133
- * }
134
- * ```
135
- */
136
- getTokenBalanceByTokenName(tokenName: string, walletAddress: string, type?: UserTokenType): Promise<GetTokenBalanceResponse>;
137
- /**
138
- * Transfers faucets to a user address
139
- *
140
- * @param data Transfer faucets data
141
- * @returns Promise<TransferFaucetsResponse> Transfer result
142
- * @throws ValidationError if input validation fails
143
- *
144
- * @example
145
- * ```typescript
146
- * const transferData = {
147
- * userAddress: "eth|1234567890abcdef1234567890abcdef12345678",
148
- * amount: "1000000000000000000" // 1 token with 18 decimals
149
- * };
150
- * const result = await userAPI.transferFaucets(transferData);
151
- * if (result.status === 200 && !result.error) {
152
- * console.log('Transfer successful:', result.message);
153
- * }
154
- * ```
155
- */
156
- transferFaucets(data: TransferFaucetsData): Promise<TransferFaucetsResponse>;
157
- /**
158
- * Fetches user profile information
159
- *
160
- * ✅ VERIFIED: Real API payload confirmed - endpoint /user/profile (GET)
161
- *
162
- * @param walletAddress Optional wallet address (defaults to SDK wallet address)
163
- * @returns Promise<any> User profile information
164
- * @throws ValidationError if input validation fails
165
- *
166
- * @example
167
- * ```typescript
168
- * // Get current user's profile
169
- * const profile = await userAPI.getProfile();
170
- *
171
- * // Get specific user's profile
172
- * const otherProfile = await userAPI.getProfile("eth|1234567890abcdef1234567890abcdef12345678");
173
- * ```
174
- */
175
- getProfile(walletAddress?: string): Promise<any>;
176
- /**
177
- * Fetches GALA balance for a user address
178
- *
179
- * ✅ VERIFIED: Real API payload confirmed - endpoint /user/fetch-gala-balance
180
- *
181
- * @param options GALA balance fetch options
182
- * @returns Promise<FetchGalaBalanceResponse> Balance information
183
- * @throws ValidationError if input validation fails
184
- *
185
- * @example
186
- * ```typescript
187
- * const balanceOptions = {
188
- * userAddress: "eth|1234567890abcdef1234567890abcdef12345678"
189
- * };
190
- * const balance = await userAPI.getGalaBalance(balanceOptions);
191
- * ```
192
- */
193
- getGalaBalance(options: FetchGalaBalanceOptions): Promise<FetchGalaBalanceResponse>;
194
- /**
195
- * Updates user profile information
196
- *
197
- * ✅ VERIFIED: Real API payload confirmed - endpoint /user/profile (PUT)
198
- *
199
- * **Smart Image Preservation**: If profileImage is empty or not provided,
200
- * the method automatically fetches and preserves the existing profile image
201
- * to prevent accidental image loss.
202
- *
203
- * @param data Profile update data
204
- * @returns Promise<UpdateProfileResponse> Update result
205
- * @throws ValidationError if input validation fails
206
- *
207
- * @example
208
- * ```typescript
209
- * // Update with new image
210
- * const profileData = {
211
- * profileImage: "https://example.com/avatar.jpg",
212
- * fullName: "John Doe",
213
- * userAddress: "eth|1234567890abcdef1234567890abcdef12345678"
214
- * };
215
- * const result = await userAPI.updateProfile(profileData);
216
- *
217
- * // Update name only - existing image will be preserved automatically
218
- * const nameOnlyUpdate = {
219
- * profileImage: "", // or omit entirely
220
- * fullName: "Jane Doe",
221
- * userAddress: "eth|1234567890abcdef1234567890abcdef12345678"
222
- * };
223
- * const result2 = await userAPI.updateProfile(nameOnlyUpdate);
224
- * ```
225
- */
226
- updateProfile(data: UpdateProfileData): Promise<UpdateProfileResponse>;
227
- /**
228
- * Uploads a profile image and returns the image URL
229
- *
230
- * ✅ VERIFIED: Real API payload confirmed - endpoint /launchpad/upload-image (for profile)
231
- *
232
- * @param options Profile image upload options
233
- * @returns Promise<UploadProfileImageResponse> Upload result with image URL
234
- * @throws ValidationError if input validation fails
235
- *
236
- * @example
237
- * ```typescript
238
- * // Upload profile image file
239
- * const fileInput = document.getElementById('avatar') as HTMLInputElement;
240
- * const file = fileInput.files[0];
241
- * const uploadResult = await userAPI.uploadProfileImage({
242
- * file: file,
243
- * walletAddress: "eth|1234567890abcdef1234567890abcdef12345678"
244
- * });
245
- *
246
- * // Use the uploaded image URL in profile update
247
- * await userAPI.updateProfile({
248
- * profileImage: uploadResult.data?.imageUrl,
249
- * fullName: "John Doe",
250
- * walletAddress: "eth|1234567890abcdef1234567890abcdef12345678"
251
- * });
252
- * ```
253
- */
254
- uploadProfileImage(options: UploadProfileImageOptions): Promise<UploadProfileImageResponse>;
255
- /**
256
- * Validates get token list options
257
- */
258
- private validateGetTokenListOptions;
259
- /**
260
- * Validates transfer faucets data
261
- */
262
- private validateTransferFaucetsData;
263
- /**
264
- * Validates fetch GALA balance options
265
- */
266
- private validateFetchGalaBalanceOptions;
267
- /**
268
- * Validates update profile data
269
- */
270
- private validateUpdateProfileData;
271
- /**
272
- * Validates upload profile image options
273
- */
274
- private validateUploadProfileImageOptions;
275
- /**
276
- * Validates pagination parameters
277
- */
278
- private validatePagination;
279
- /**
280
- * Builds query parameters for token list fetching
281
- * Note: GET /user/token-list expects page/limit as STRINGS (backend quirk)
282
- */
283
- private buildTokenListQueryParams;
284
- /**
285
- * Builds query parameters for token hold endpoint (excludes type parameter)
286
- *
287
- * @param options GetTokenListOptions
288
- * @returns Record<string, any> Query parameters for backend
289
- */
290
- private buildTokenHoldQueryParams;
291
- /**
292
- * Gets all tokens for current user (convenience method)
293
- *
294
- * @param page Page number (default: 1)
295
- * @param limit Items per page (default: 10)
296
- * @returns Promise<GetTokenListResponse> All tokens for the user
297
- */
298
- getAllTokens(page?: number, limit?: number): Promise<GetTokenListResponse>;
299
- /**
300
- * Gets tokens created by current user (convenience method)
301
- *
302
- * @param page Page number (default: 1)
303
- * @param limit Items per page (default: 10)
304
- * @returns Promise<GetTokenListResponse> Tokens created by the user
305
- */
306
- getCreatedTokens(page?: number, limit?: number): Promise<GetTokenListResponse>;
307
- /**
308
- * Gets tokens owned by current user (convenience method)
309
- *
310
- * @param page Page number (default: 1)
311
- * @param limit Items per page (default: 10)
312
- * @returns Promise<GetTokenListResponse> Tokens owned by the user
313
- */
314
- getOwnedTokens(page?: number, limit?: number): Promise<GetTokenListResponse>;
315
- /**
316
- * Searches for tokens by name or symbol (convenience method)
317
- *
318
- * @param searchQuery Search query
319
- * @param page Page number (default: 1)
320
- * @param limit Items per page (default: 10)
321
- * @returns Promise<GetTokenListResponse> Search results
322
- */
323
- searchTokens(searchQuery: string, page?: number, limit?: number): Promise<GetTokenListResponse>;
324
- /**
325
- * Gets tokens for a specific address (convenience method)
326
- *
327
- * @param userAddress User address to get tokens for
328
- * @param page Page number (default: 1)
329
- * @param limit Items per page (default: 10)
330
- * @returns Promise<GetTokenListResponse> Tokens for the address
331
- */
332
- getTokensForAddress(userAddress: string, page?: number, limit?: number): Promise<GetTokenListResponse>;
333
- /**
334
- * Checks if a wallet holds a specific token (convenience method)
335
- *
336
- * @param tokenName Token name to check
337
- * @param walletAddress Wallet address to check
338
- * @param type Token type (default: 'DEFI')
339
- * @returns Promise<boolean> True if wallet holds the token
340
- *
341
- * @example
342
- * ```typescript
343
- * const hasWBToken = await userAPI.hasToken(
344
- * "WB",
345
- * "eth|5AD173F004990940b20e7A5C64C72E8b6B91a783"
346
- * );
347
- * ```
348
- */
349
- hasTokenByTokenName(tokenName: string, walletAddress: string, type?: UserTokenType): Promise<boolean>;
350
- /**
351
- * Gets token balance for the current SDK wallet (convenience method)
352
- *
353
- * @param tokenName Token name to check balance for
354
- * @param type Token type (default: 'DEFI')
355
- * @returns Promise<GetTokenBalanceResponse> Token balance for current wallet
356
- *
357
- * @example
358
- * ```typescript
359
- * const balance = await userAPI.getOwnTokenBalance("WB");
360
- * if (balance.data?.count > 0) {
361
- * console.log(`I hold ${balance.data.token[0].quantity} WB tokens`);
362
- * }
363
- * ```
364
- */
365
- getOwnTokenBalance(tokenName: string, type?: UserTokenType): Promise<GetTokenBalanceResponse>;
366
- /**
367
- * Gets just the token quantity for a wallet (convenience method)
368
- *
369
- * @param tokenName Token name to check
370
- * @param walletAddress Wallet address to check
371
- * @param type Token type (default: 'DEFI')
372
- * @returns Promise<string> Token quantity as decimal string, '0' if not held
373
- *
374
- * @example
375
- * ```typescript
376
- * const quantity = await userAPI.getTokenQuantity(
377
- * "WB",
378
- * "eth|5AD173F004990940b20e7A5C64C72E8b6B91a783"
379
- * );
380
- * console.log(`Wallet holds ${quantity} WB tokens`);
381
- * ```
382
- */
383
- getTokenQuantity(tokenName: string, walletAddress: string, type?: UserTokenType): Promise<string>;
384
- /**
385
- * Gets the authenticated user's address in backend format
386
- *
387
- * @returns Address in eth|{40-hex-chars} format
388
- */
389
- getAddress(): string;
390
- /**
391
- * Validates a user address format (exposed for external validation)
392
- *
393
- * @param userAddress User address to validate
394
- * @returns True if valid user address format
395
- */
396
- validateUserAddress(userAddress: string): boolean;
397
- /**
398
- * Validates a token type (exposed for external validation)
399
- *
400
- * @param tokenType Token type to validate
401
- * @returns True if valid token type
402
- */
403
- validateTokenType(tokenType: string): boolean;
404
- /**
405
- * Validates a search query (exposed for external validation)
406
- *
407
- * @param searchQuery Search query to validate
408
- * @returns True if valid search query
409
- */
410
- validateSearchQuery(searchQuery: string): boolean;
411
- /**
412
- * Validates a token name for user operations (exposed for external validation)
413
- *
414
- * @param tokenName Token name to validate
415
- * @returns True if valid token name
416
- */
417
- validateTokenName(tokenName: string): boolean;
418
- /**
419
- * Validates a full name (exposed for external validation)
420
- *
421
- * @param fullName Full name to validate
422
- * @returns True if valid full name
423
- */
424
- validateFullName(fullName: string): boolean;
425
- }
426
- //# sourceMappingURL=UserAPI.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserAPI.d.ts","sourceRoot":"","sources":["../../src/api/UserAPI.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EAEpB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EAad,MAAM,mBAAmB,CAAC;AAO3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;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OAAO;IAI7C;;;;;OAKG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAIjD;;;;;OAKG;IACH,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAI7C;;;;;OAKG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;CAG5C"}
@@ -1,156 +0,0 @@
1
- /**
2
- * WebSocket API Controller
3
- *
4
- * This controller provides WebSocket-based real-time transaction monitoring
5
- * for bundle transactions submitted to the bundle backend.
6
- *
7
- * @category API Controllers
8
- * @since 2.0.0
9
- */
10
- import { TransactionStatus, WebSocketConfig } from './services/WebSocketService';
11
- /**
12
- * WebSocket API Controller for Real-time Transaction Monitoring
13
- */
14
- export declare class WebSocketAPI {
15
- private wsService;
16
- private config;
17
- private debug;
18
- constructor(wsConfig: WebSocketConfig, debug?: boolean);
19
- /**
20
- * Initialize WebSocket connection using singleton manager
21
- *
22
- * @example
23
- * ```typescript
24
- * await sdk.websocket.connect();
25
- * ```
26
- */
27
- connect(): Promise<void>;
28
- /**
29
- * Monitor a transaction for completion
30
- *
31
- * @param transactionId Bundle transaction ID
32
- * @param callback Status update callback
33
- *
34
- * @example
35
- * ```typescript
36
- * await sdk.websocket.monitorTransaction(txId, (status) => {
37
- * console.log(`Transaction ${status.transactionId}: ${status.status}`);
38
- * if (status.status === 'completed') {
39
- * console.log('Transaction completed!');
40
- * }
41
- * });
42
- * ```
43
- */
44
- monitorTransaction(transactionId: string, callback: (status: TransactionStatus) => void): Promise<void>;
45
- /**
46
- * Wait for transaction completion (Promise-based)
47
- *
48
- * @param transactionId Bundle transaction ID
49
- * @returns Promise that resolves when transaction completes
50
- *
51
- * @example
52
- * ```typescript
53
- * try {
54
- * const result = await sdk.websocket.waitForTransaction(txId);
55
- * console.log('Transaction completed:', result);
56
- * } catch (error) {
57
- * console.error('Transaction failed:', error);
58
- * }
59
- * ```
60
- */
61
- waitForTransaction(transactionId: string): Promise<TransactionStatus>;
62
- /**
63
- * Monitor multiple transactions
64
- *
65
- * @param transactionIds Array of transaction IDs
66
- * @param callback Status update callback
67
- *
68
- * @example
69
- * ```typescript
70
- * await sdk.websocket.monitorTransactions([buyTxId, sellTxId], (status) => {
71
- * console.log(`${status.transactionId}: ${status.status}`);
72
- * });
73
- * ```
74
- */
75
- monitorTransactions(transactionIds: string[], callback: (status: TransactionStatus) => void): Promise<void>;
76
- /**
77
- * Wait for all transactions to complete
78
- *
79
- * @param transactionIds Array of transaction IDs
80
- * @returns Promise that resolves when all transactions complete
81
- *
82
- * @example
83
- * ```typescript
84
- * const results = await sdk.websocket.waitForTransactions([buyTxId, sellTxId]);
85
- * console.log('All transactions completed:', results);
86
- * ```
87
- */
88
- waitForTransactions(transactionIds: string[]): Promise<TransactionStatus[]>;
89
- /**
90
- * Release reference to WebSocket connection
91
- *
92
- * Uses reference counting - connection is only closed when all
93
- * SDK instances have released their references.
94
- *
95
- * @example
96
- * ```typescript
97
- * sdk.websocket.disconnect();
98
- * ```
99
- */
100
- disconnect(): void;
101
- /**
102
- * Check connection status
103
- *
104
- * @returns True if WebSocket is connected
105
- *
106
- * @example
107
- * ```typescript
108
- * if (sdk.websocket.isConnected()) {
109
- * console.log('WebSocket is ready');
110
- * }
111
- * ```
112
- */
113
- isConnected(): boolean;
114
- /**
115
- * Get connection information for debugging
116
- *
117
- * @returns Array of connection info objects
118
- *
119
- * @example
120
- * ```typescript
121
- * const connections = sdk.websocket.getConnectionInfo();
122
- * console.log('Active connections:', connections);
123
- * ```
124
- */
125
- getConnectionInfo(): Array<{
126
- url: string;
127
- referenceCount: number;
128
- isConnected: boolean;
129
- }>;
130
- /**
131
- * Check if this instance has an active reference to a WebSocket connection
132
- *
133
- * @returns True if this instance has a WebSocket service reference
134
- */
135
- hasActiveReference(): boolean;
136
- /**
137
- * Cleanup all WebSocket connections (static method)
138
- *
139
- * Forces disconnection of all managed connections across all SDK instances.
140
- * Useful for application shutdown or testing cleanup.
141
- *
142
- * @param debug Enable debug logging
143
- *
144
- * @example
145
- * ```typescript
146
- * WebSocketAPI.cleanupAll();
147
- * ```
148
- */
149
- static cleanupAll(debug?: boolean): void;
150
- /**
151
- * Ensure WebSocket is connected
152
- */
153
- private ensureConnected;
154
- }
155
- export type { TransactionStatus } from './services/WebSocketService';
156
- //# sourceMappingURL=WebSocketAPI.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WebSocketAPI.d.ts","sourceRoot":"","sources":["../../src/api/WebSocketAPI.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAoB,iBAAiB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnG;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,SAAS,CAAiC;IAClD,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,KAAK,CAAU;gBAEX,QAAQ,EAAE,eAAe,EAAE,KAAK,GAAE,OAAe;IAK7D;;;;;;;OAOG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAW9B;;;;;;;;;;;;;;;OAeG;IACG,kBAAkB,CACtB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,GAC5C,OAAO,CAAC,IAAI,CAAC;IAKhB;;;;;;;;;;;;;;;OAeG;IACG,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAK3E;;;;;;;;;;;;OAYG;IACG,mBAAmB,CACvB,cAAc,EAAE,MAAM,EAAE,EACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,GAC5C,OAAO,CAAC,IAAI,CAAC;IAkBhB;;;;;;;;;;;OAWG;IACG,mBAAmB,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAkCjF;;;;;;;;;;OAUG;IACH,UAAU,IAAI,IAAI;IAQlB;;;;;;;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