@gala-chain/launchpad-sdk 3.6.0 → 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas/validators.d.ts +130 -32
- package/dist/schemas/validators.d.ts.map +1 -1
- package/dist/services/BundleService.d.ts.map +1 -1
- package/dist/services/CommentService.d.ts.map +1 -1
- package/dist/services/FaucetService.d.ts.map +1 -1
- package/dist/services/ImageService.d.ts.map +1 -1
- package/dist/services/PoolService.d.ts.map +1 -1
- package/dist/services/TradeService.d.ts +0 -6
- package/dist/services/TradeService.d.ts.map +1 -1
- package/dist/services/UserService.d.ts +0 -6
- package/dist/services/UserService.d.ts.map +1 -1
- package/dist/utils/error-factories.d.ts +95 -0
- package/dist/utils/error-factories.d.ts.map +1 -0
- package/dist/utils/response-handlers.d.ts +96 -0
- package/dist/utils/response-handlers.d.ts.map +1 -0
- package/dist/utils/validation-helpers.d.ts +116 -0
- package/dist/utils/validation-helpers.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
* Type-safe validation functions that replace manual type guards.
|
|
5
5
|
* These provide clean, backward-compatible wrappers around Zod schemas.
|
|
6
6
|
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
import { launchTokenDataSchema, tokenUrlsSchema, imageUploadOptionsSchema, checkPoolOptionsSchema } from './launchpad.js';
|
|
9
|
-
import { tokenListOptionsSchema, transferFaucetsDataSchema, fetchGalaBalanceOptionsSchema, updateProfileDataSchema, uploadProfileImageOptionsSchema, fetchTokenBalanceOptionsSchema } from './user.js';
|
|
10
|
-
import { createTradeDataSchema, buyTokensDataSchema, sellTokensDataSchema, getTradeOptionsSchema, tradeListParamsSchema, getAmountOptionsSchema, calculatePreMintDataSchema, fetchPoolDetailsDataSchema } from './trade.js';
|
|
11
7
|
/**
|
|
12
8
|
* Standard validation result
|
|
13
9
|
*
|
|
@@ -102,142 +98,244 @@ export interface ValidationResult<T> {
|
|
|
102
98
|
* Validates token name format
|
|
103
99
|
* Replaces: isValidTokenName()
|
|
104
100
|
*/
|
|
105
|
-
export declare
|
|
101
|
+
export declare const validateTokenName: (value: unknown) => ValidationResult<string>;
|
|
106
102
|
/**
|
|
107
103
|
* Validates token symbol format
|
|
108
104
|
* Replaces: isValidTokenSymbol()
|
|
109
105
|
*/
|
|
110
|
-
export declare
|
|
106
|
+
export declare const validateTokenSymbol: (value: unknown) => ValidationResult<string>;
|
|
111
107
|
/**
|
|
112
108
|
* Validates token description
|
|
113
109
|
* Replaces: isValidTokenDescription()
|
|
114
110
|
*/
|
|
115
|
-
export declare
|
|
111
|
+
export declare const validateTokenDescription: (value: unknown) => ValidationResult<string>;
|
|
116
112
|
/**
|
|
117
113
|
* Validates and normalizes address format
|
|
118
114
|
* Accepts both 0x... and eth|... formats, outputs eth|... format
|
|
119
115
|
* Replaces: isValidUserAddress(), normalizeAddressInput()
|
|
120
116
|
*/
|
|
121
|
-
export declare
|
|
117
|
+
export declare const validateAddress: (value: unknown) => ValidationResult<string>;
|
|
122
118
|
/**
|
|
123
119
|
* Validates vault address format
|
|
124
120
|
* Supports both eth| and service| formats
|
|
125
121
|
* Replaces: isValidVaultAddress()
|
|
126
122
|
*/
|
|
127
|
-
export declare
|
|
123
|
+
export declare const validateVaultAddress: (value: unknown) => ValidationResult<string>;
|
|
128
124
|
/**
|
|
129
125
|
* Validates positive decimal string
|
|
130
126
|
* Replaces: isValidAmountString()
|
|
131
127
|
*/
|
|
132
|
-
export declare
|
|
128
|
+
export declare const validateAmountString: (value: unknown) => ValidationResult<string>;
|
|
133
129
|
/**
|
|
134
130
|
* Validates faucet amount (positive, non-zero)
|
|
135
131
|
* Replaces: isValidFaucetAmount()
|
|
136
132
|
*/
|
|
137
|
-
export declare
|
|
133
|
+
export declare const validateFaucetAmount: (value: unknown) => ValidationResult<string>;
|
|
138
134
|
/**
|
|
139
135
|
* Validates full name format
|
|
140
136
|
* Replaces: isValidFullName()
|
|
141
137
|
*/
|
|
142
|
-
export declare
|
|
138
|
+
export declare const validateFullName: (value: unknown) => ValidationResult<string>;
|
|
143
139
|
/**
|
|
144
140
|
* Validates search query
|
|
145
141
|
* Replaces: isValidSearchQuery()
|
|
146
142
|
*/
|
|
147
|
-
export declare
|
|
143
|
+
export declare const validateSearchQuery: (value: unknown) => ValidationResult<string>;
|
|
148
144
|
/**
|
|
149
145
|
* Validates user token name (more permissive than creation token name)
|
|
150
146
|
* Replaces: isValidUserTokenName()
|
|
151
147
|
*/
|
|
152
|
-
export declare
|
|
148
|
+
export declare const validateUserTokenName: (value: unknown) => ValidationResult<string>;
|
|
153
149
|
/**
|
|
154
150
|
* Validates launch token data
|
|
155
151
|
* Replaces: isLaunchTokenData()
|
|
156
152
|
*/
|
|
157
|
-
export declare
|
|
153
|
+
export declare const validateLaunchTokenData: (value: unknown) => ValidationResult<{
|
|
154
|
+
tokenName: string;
|
|
155
|
+
tokenSymbol: string;
|
|
156
|
+
tokenDescription: string;
|
|
157
|
+
websiteUrl?: string | undefined;
|
|
158
|
+
telegramUrl?: string | undefined;
|
|
159
|
+
twitterUrl?: string | undefined;
|
|
160
|
+
tokenImage?: string | File | Buffer<ArrayBufferLike> | undefined;
|
|
161
|
+
preBuyQuantity?: string | undefined;
|
|
162
|
+
tokenCategory?: string | undefined;
|
|
163
|
+
tokenCollection?: string | undefined;
|
|
164
|
+
reverseBondingCurveConfiguration?: {
|
|
165
|
+
minFeePortion: string;
|
|
166
|
+
maxFeePortion: string;
|
|
167
|
+
} | undefined;
|
|
168
|
+
privateKey?: string | undefined;
|
|
169
|
+
}>;
|
|
158
170
|
/**
|
|
159
171
|
* Validates token social URLs
|
|
160
172
|
* Replaces manual URL validation
|
|
161
173
|
*/
|
|
162
|
-
export declare
|
|
174
|
+
export declare const validateTokenUrls: (value: unknown) => ValidationResult<{
|
|
175
|
+
websiteUrl?: string | undefined;
|
|
176
|
+
telegramUrl?: string | undefined;
|
|
177
|
+
twitterUrl?: string | undefined;
|
|
178
|
+
}>;
|
|
163
179
|
/**
|
|
164
180
|
* Validates image upload options
|
|
165
181
|
* Replaces: isImageUploadOptions()
|
|
166
182
|
*/
|
|
167
|
-
export declare
|
|
183
|
+
export declare const validateImageUploadOptions: (value: unknown) => ValidationResult<{
|
|
184
|
+
tokenName: string;
|
|
185
|
+
file: File | Buffer<ArrayBufferLike>;
|
|
186
|
+
}>;
|
|
168
187
|
/**
|
|
169
188
|
* Validates check pool options
|
|
170
189
|
* Replaces: isCheckPoolOptions()
|
|
171
190
|
*/
|
|
172
|
-
export declare
|
|
191
|
+
export declare const validateCheckPoolOptions: (value: unknown) => ValidationResult<{
|
|
192
|
+
symbol?: string | undefined;
|
|
193
|
+
tokenName?: string | undefined;
|
|
194
|
+
}>;
|
|
173
195
|
/**
|
|
174
196
|
* Validates token list options
|
|
175
197
|
* Replaces: isGetTokenListOptions()
|
|
176
198
|
*/
|
|
177
|
-
export declare
|
|
199
|
+
export declare const validateTokenListOptions: (value: unknown) => ValidationResult<{
|
|
200
|
+
address?: string | undefined;
|
|
201
|
+
page?: number | undefined;
|
|
202
|
+
limit?: number | undefined;
|
|
203
|
+
type?: "all" | "DEFI" | "ASSET" | undefined;
|
|
204
|
+
tokenName?: string | undefined;
|
|
205
|
+
search?: string | undefined;
|
|
206
|
+
}>;
|
|
178
207
|
/**
|
|
179
208
|
* Validates transfer faucets data
|
|
180
209
|
* Replaces: isTransferFaucetsData()
|
|
181
210
|
*/
|
|
182
|
-
export declare
|
|
211
|
+
export declare const validateTransferFaucetsData: (value: unknown) => ValidationResult<{
|
|
212
|
+
walletAddress: string;
|
|
213
|
+
amount: string;
|
|
214
|
+
}>;
|
|
183
215
|
/**
|
|
184
216
|
* Validates fetch GALA balance options
|
|
185
217
|
* Replaces: isFetchGalaBalanceOptions()
|
|
186
218
|
*/
|
|
187
|
-
export declare
|
|
219
|
+
export declare const validateFetchGalaBalanceOptions: (value: unknown) => ValidationResult<{
|
|
220
|
+
address?: string | undefined;
|
|
221
|
+
refresh?: boolean | undefined;
|
|
222
|
+
}>;
|
|
188
223
|
/**
|
|
189
224
|
* Validates update profile data
|
|
190
225
|
* Replaces: isUpdateProfileData()
|
|
191
226
|
*/
|
|
192
|
-
export declare
|
|
227
|
+
export declare const validateUpdateProfileData: (value: unknown) => ValidationResult<{
|
|
228
|
+
address: string;
|
|
229
|
+
profileImage: string;
|
|
230
|
+
fullName: string;
|
|
231
|
+
privateKey?: string | undefined;
|
|
232
|
+
}>;
|
|
193
233
|
/**
|
|
194
234
|
* Validates upload profile image options
|
|
195
235
|
* Replaces: isUploadProfileImageOptions()
|
|
196
236
|
*/
|
|
197
|
-
export declare
|
|
237
|
+
export declare const validateUploadProfileImageOptions: (value: unknown) => ValidationResult<{
|
|
238
|
+
file: File | Buffer<ArrayBufferLike>;
|
|
239
|
+
address?: string | undefined;
|
|
240
|
+
privateKey?: string | undefined;
|
|
241
|
+
}>;
|
|
198
242
|
/**
|
|
199
243
|
* Validates fetch token balance options
|
|
200
244
|
* Replaces: isFetchTokenBalanceOptions()
|
|
201
245
|
*/
|
|
202
|
-
export declare
|
|
246
|
+
export declare const validateFetchTokenBalanceOptions: (value: unknown) => ValidationResult<{
|
|
247
|
+
address: string;
|
|
248
|
+
tokenName?: string | undefined;
|
|
249
|
+
tokenId?: string | {
|
|
250
|
+
type: string;
|
|
251
|
+
collection: string;
|
|
252
|
+
category: string;
|
|
253
|
+
additionalKey: string;
|
|
254
|
+
} | {
|
|
255
|
+
type: string;
|
|
256
|
+
collection: string;
|
|
257
|
+
category: string;
|
|
258
|
+
additionalKey: string;
|
|
259
|
+
instance: string;
|
|
260
|
+
} | undefined;
|
|
261
|
+
tokenClassKey?: {
|
|
262
|
+
type: string;
|
|
263
|
+
collection: string;
|
|
264
|
+
category: string;
|
|
265
|
+
additionalKey: string;
|
|
266
|
+
} | undefined;
|
|
267
|
+
}>;
|
|
203
268
|
/**
|
|
204
269
|
* Validates create trade data
|
|
205
270
|
* Replaces: isCreateTradeData()
|
|
206
271
|
*/
|
|
207
|
-
export declare
|
|
272
|
+
export declare const validateCreateTradeData: (value: unknown) => ValidationResult<{
|
|
273
|
+
userAddress: string;
|
|
274
|
+
tradeType: "buy" | "sell";
|
|
275
|
+
tokenAmount: string;
|
|
276
|
+
vaultAddress: string;
|
|
277
|
+
slippageTolerance?: string | undefined;
|
|
278
|
+
deadline?: number | undefined;
|
|
279
|
+
}>;
|
|
208
280
|
/**
|
|
209
281
|
* Validates buy tokens data
|
|
210
282
|
* Replaces: isBuyTokensData()
|
|
211
283
|
*/
|
|
212
|
-
export declare
|
|
284
|
+
export declare const validateBuyTokensData: (value: unknown) => ValidationResult<{
|
|
285
|
+
tokenSymbol: string;
|
|
286
|
+
nativeTokenQuantity: string;
|
|
287
|
+
expectedToken: string;
|
|
288
|
+
maxAcceptableReverseBondingCurveFee?: string | undefined;
|
|
289
|
+
}>;
|
|
213
290
|
/**
|
|
214
291
|
* Validates sell tokens data
|
|
215
292
|
* Replaces: isSellTokensData()
|
|
216
293
|
*/
|
|
217
|
-
export declare
|
|
294
|
+
export declare const validateSellTokensData: (value: unknown) => ValidationResult<{
|
|
295
|
+
tokenSymbol: string;
|
|
296
|
+
tokenQuantity: string;
|
|
297
|
+
expectedNativeToken: string;
|
|
298
|
+
maxAcceptableReverseBondingCurveFee?: string | undefined;
|
|
299
|
+
}>;
|
|
218
300
|
/**
|
|
219
301
|
* Validates get trade options
|
|
220
302
|
* Replaces: isGetTradeOptions()
|
|
221
303
|
*/
|
|
222
|
-
export declare
|
|
304
|
+
export declare const validateGetTradeOptions: (value: unknown) => ValidationResult<{
|
|
305
|
+
page?: number | undefined;
|
|
306
|
+
limit?: number | undefined;
|
|
307
|
+
tokenName?: string | undefined;
|
|
308
|
+
}>;
|
|
223
309
|
/**
|
|
224
310
|
* Validates trade list params
|
|
225
311
|
* Replaces: isTradeListParams()
|
|
226
312
|
*/
|
|
227
|
-
export declare
|
|
313
|
+
export declare const validateTradeListParams: (value: unknown) => ValidationResult<{
|
|
314
|
+
page?: number | undefined;
|
|
315
|
+
limit?: number | undefined;
|
|
316
|
+
}>;
|
|
228
317
|
/**
|
|
229
318
|
* Validates get amount options
|
|
230
319
|
* Replaces: isGetAmountOptions()
|
|
231
320
|
*/
|
|
232
|
-
export declare
|
|
321
|
+
export declare const validateGetAmountOptions: (value: unknown) => ValidationResult<{
|
|
322
|
+
method: "IN" | "OUT";
|
|
323
|
+
type: "NATIVE" | "MEME";
|
|
324
|
+
amount: string;
|
|
325
|
+
vaultAddress: string;
|
|
326
|
+
}>;
|
|
233
327
|
/**
|
|
234
328
|
* Validates calculate pre-mint data
|
|
235
329
|
* Replaces: isCalculatePreMintData()
|
|
236
330
|
*/
|
|
237
|
-
export declare
|
|
331
|
+
export declare const validateCalculatePreMintData: (value: unknown) => ValidationResult<{
|
|
332
|
+
nativeTokenQuantity: string;
|
|
333
|
+
}>;
|
|
238
334
|
/**
|
|
239
335
|
* Validates fetch pool details data
|
|
240
336
|
* Replaces: isFetchPoolDetailsData()
|
|
241
337
|
*/
|
|
242
|
-
export declare
|
|
338
|
+
export declare const validateFetchPoolDetailsData: (value: unknown) => ValidationResult<{
|
|
339
|
+
vaultAddress: string;
|
|
340
|
+
}>;
|
|
243
341
|
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/schemas/validators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/schemas/validators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiDH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,gC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B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAmD1B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAQ3B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAwB5B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAoB1B;;;;;;;;;;;;;;OAcG;IACG,2BAA2B,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IA8B9E;;;;;OAKG;IACG,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IA8BpE;;;;OAIG;IACG,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC;IA6B7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IA4H9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC;IAgIhE;;OAEG;IACH,OAAO,CAAC,8BAA8B;IAYtC;;OAEG;YACW,wBAAwB;IA2DtC;;;;;OAKG;YAEW,uBAAuB;CAKtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentService.d.ts","sourceRoot":"","sources":["../../src/services/CommentService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"CommentService.d.ts","sourceRoot":"","sources":["../../src/services/CommentService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,OAAO,EAEL,cAAc,EAKf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAGnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBADX,IAAI,EAAE,UAAU,EAChB,WAAW,EAAE,WAAW;IAG3C;;;;;;;;;;OAUG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IA8D3E;;;;;;;;;;OAUG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IA6D7D;;;;;;OAMG;YACW,uBAAuB;CAsBtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FaucetService.d.ts","sourceRoot":"","sources":["../../src/services/FaucetService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"FaucetService.d.ts","sourceRoot":"","sources":["../../src/services/FaucetService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,EACL,mBAAmB,EAIpB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;;;;;;;;;;;OAeG;IACG,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB/D;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;CAiBpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageService.d.ts","sourceRoot":"","sources":["../../src/services/ImageService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ImageService.d.ts","sourceRoot":"","sources":["../../src/services/ImageService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,sBAAsB,CAC1B,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,MAAM,CAAC;CAyDnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PoolService.d.ts","sourceRoot":"","sources":["../../src/services/PoolService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"PoolService.d.ts","sourceRoot":"","sources":["../../src/services/PoolService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,OAAO,EAGL,WAAW,EACX,gBAAgB,EAIhB,eAAe,EAEf,uBAAuB,EAEvB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EAErB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;OAKG;IACG,UAAU,CACd,OAAO,GAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;KACX,GACL,OAAO,CAAC,WAAW,CAAC;IAiFvB;;;;;OAKG;IACG,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAqC5D;;;;;OAKG;IACG,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAW/D;;;;;OAKG;IACG,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAW9D;;;;;OAKG;IACG,eAAe,CACnB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,eAAe,CAAC;IAiD3B;;;;;;;;OAQG;IACG,sBAAsB,CAC1B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,uBAAuB,CAAC;IAgCnC;;;;;;;;OAQG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAwBrE;;;;;OAKG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAkBpE;;;;;;OAMG;YACW,uBAAuB;CAsBtC"}
|
|
@@ -45,11 +45,5 @@ export declare class TradeService {
|
|
|
45
45
|
* @throws ValidationError if token name is invalid or not found
|
|
46
46
|
*/
|
|
47
47
|
fetchTrades(options: FetchTradesOptions): Promise<TradesResult>;
|
|
48
|
-
/**
|
|
49
|
-
* Validates pagination parameters
|
|
50
|
-
*
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
|
-
private validateTradePagination;
|
|
54
48
|
}
|
|
55
49
|
//# sourceMappingURL=TradeService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TradeService.d.ts","sourceRoot":"","sources":["../../src/services/TradeService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"TradeService.d.ts","sourceRoot":"","sources":["../../src/services/TradeService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,OAAO,EAEL,YAAY,EAEb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAwB,MAAM,sBAAsB,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;;;;;OASG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;CA2DtE"}
|
|
@@ -99,12 +99,6 @@ export declare class UserService {
|
|
|
99
99
|
* @private
|
|
100
100
|
*/
|
|
101
101
|
private validateGetTokenListOptions;
|
|
102
|
-
/**
|
|
103
|
-
* Validates user pagination parameters
|
|
104
|
-
*
|
|
105
|
-
* @private
|
|
106
|
-
*/
|
|
107
|
-
private validateUserPagination;
|
|
108
102
|
/**
|
|
109
103
|
* Validates update profile data
|
|
110
104
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../src/services/UserService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../src/services/UserService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EAEjB,yBAAyB,EAO1B,MAAM,mBAAmB,CAAC;AAO3B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;;OAMG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAmBlD;;;;;;;;;;;OAWG;IACG,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiD3D;;;;;;;OAOG;IACG,kBAAkB,CACtB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,MAAM,CAAC;IAgElB;;;;;;OAMG;IACG,cAAc,CAClB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,mBAAmB,CAAC;IA0C/B;;;;;;OAMG;IACG,eAAe,CACnB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,mBAAmB,CAAC;IAyC/B;;;;;OAKG;IACG,kBAAkB,CACtB,OAAO,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GACnF,OAAO,CAAC,mBAAmB,CAAC;IAsB/B;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IAuCnC;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;IAkBjC;;;;OAIG;IACH,OAAO,CAAC,iCAAiC;CAW1C"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Factories
|
|
3
|
+
*
|
|
4
|
+
* Standardized error message generators for common validation failures.
|
|
5
|
+
* Eliminates duplicate error messages across services.
|
|
6
|
+
*
|
|
7
|
+
* @category Utilities
|
|
8
|
+
* @since 3.6.1
|
|
9
|
+
*/
|
|
10
|
+
import { ValidationError } from './validation';
|
|
11
|
+
/**
|
|
12
|
+
* Creates a standardized "token not found" validation error
|
|
13
|
+
*
|
|
14
|
+
* This factory eliminates duplicate token error messages found across
|
|
15
|
+
* multiple service files. It provides a single source of truth for
|
|
16
|
+
* token resolution failures.
|
|
17
|
+
*
|
|
18
|
+
* ## Replaces Patterns
|
|
19
|
+
*
|
|
20
|
+
* This function replaces 8+ instances of duplicate error creation:
|
|
21
|
+
*
|
|
22
|
+
* ### Before (Duplicate Pattern Across Services):
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // CommentService.ts (×2)
|
|
25
|
+
* throw new ValidationError(
|
|
26
|
+
* `Token "${tokenName}" not found. Please verify the token name is correct.`,
|
|
27
|
+
* 'tokenName',
|
|
28
|
+
* 'TOKEN_NOT_FOUND'
|
|
29
|
+
* );
|
|
30
|
+
*
|
|
31
|
+
* // BundleService.ts (×2)
|
|
32
|
+
* throw new ValidationError(
|
|
33
|
+
* `Token "${tokenName}" not found. Please verify the token name is correct.`,
|
|
34
|
+
* 'tokenName',
|
|
35
|
+
* 'TOKEN_NOT_FOUND'
|
|
36
|
+
* );
|
|
37
|
+
*
|
|
38
|
+
* // GalaChainService.ts
|
|
39
|
+
* throw new ValidationError(
|
|
40
|
+
* `Token '${tokenName}' not found or not available for transfer`,
|
|
41
|
+
* 'tokenName',
|
|
42
|
+
* 'TOKEN_NOT_FOUND'
|
|
43
|
+
* );
|
|
44
|
+
*
|
|
45
|
+
* // TokenResolverService.ts
|
|
46
|
+
* throw new ValidationError(
|
|
47
|
+
* `Token "${tokenName}" not found. Please verify the token name is correct.`,
|
|
48
|
+
* 'tokenName',
|
|
49
|
+
* 'TOKEN_NOT_FOUND'
|
|
50
|
+
* );
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* ### After (Single Source of Truth):
|
|
54
|
+
* ```typescript
|
|
55
|
+
* // CommentService.ts
|
|
56
|
+
* throw createTokenNotFoundError(tokenName);
|
|
57
|
+
*
|
|
58
|
+
* // BundleService.ts
|
|
59
|
+
* throw createTokenNotFoundError(tokenName);
|
|
60
|
+
*
|
|
61
|
+
* // GalaChainService.ts
|
|
62
|
+
* throw createTokenNotFoundError(tokenName, 'transfer');
|
|
63
|
+
*
|
|
64
|
+
* // TokenResolverService.ts
|
|
65
|
+
* throw createTokenNotFoundError(tokenName);
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @param tokenName The token name that was not found
|
|
69
|
+
* @param context Optional context for error message customization
|
|
70
|
+
* @returns ValidationError with standardized message
|
|
71
|
+
*
|
|
72
|
+
* @example Basic usage
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const tokenName = 'mytoken';
|
|
75
|
+
* const vaultAddress = await resolveTokenName(tokenName);
|
|
76
|
+
* if (!vaultAddress) {
|
|
77
|
+
* throw createTokenNotFoundError(tokenName);
|
|
78
|
+
* }
|
|
79
|
+
* // Throws: ValidationError with message:
|
|
80
|
+
* // "Token "mytoken" not found. Please verify the token name is correct."
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* @example With transfer context
|
|
84
|
+
* ```typescript
|
|
85
|
+
* const tokenName = 'mytoken';
|
|
86
|
+
* const tokenInfo = await getTokenForTransfer(tokenName);
|
|
87
|
+
* if (!tokenInfo) {
|
|
88
|
+
* throw createTokenNotFoundError(tokenName, 'transfer');
|
|
89
|
+
* }
|
|
90
|
+
* // Throws: ValidationError with message:
|
|
91
|
+
* // "Token 'mytoken' not found or not available for transfer"
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
export declare function createTokenNotFoundError(tokenName: string, context?: 'transfer'): ValidationError;
|
|
95
|
+
//# sourceMappingURL=error-factories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-factories.d.ts","sourceRoot":"","sources":["../../src/utils/error-factories.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,UAAU,GACnB,eAAe,CAOjB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response Handlers
|
|
3
|
+
*
|
|
4
|
+
* Standardized response validation and error handling for API calls.
|
|
5
|
+
* Eliminates duplicate error checking patterns across services.
|
|
6
|
+
*
|
|
7
|
+
* @category Utilities
|
|
8
|
+
* @since 3.6.1
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Standard backend response structure
|
|
12
|
+
*/
|
|
13
|
+
interface BackendResponse<T = unknown> {
|
|
14
|
+
status: number;
|
|
15
|
+
error: boolean;
|
|
16
|
+
message?: string;
|
|
17
|
+
data?: T;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Asserts that a backend response is successful, throwing an error if not.
|
|
21
|
+
*
|
|
22
|
+
* This utility eliminates the duplicate error checking pattern found across
|
|
23
|
+
* all service files. It provides a single source of truth for response validation.
|
|
24
|
+
*
|
|
25
|
+
* ## Error Checking Logic
|
|
26
|
+
*
|
|
27
|
+
* A response is considered **failed** if any of these conditions are true:
|
|
28
|
+
* 1. `response.error === true` - Explicit error flag from backend
|
|
29
|
+
* 2. `response.status !== 200` - Non-success HTTP status code
|
|
30
|
+
* 3. `requireData === true && !response.data` - Data is required but missing
|
|
31
|
+
*
|
|
32
|
+
* ## Replaces Patterns
|
|
33
|
+
*
|
|
34
|
+
* This function replaces 18+ instances of duplicate error checking:
|
|
35
|
+
*
|
|
36
|
+
* ### Before (Duplicate Pattern in Every Service):
|
|
37
|
+
* ```typescript
|
|
38
|
+
* // PoolService.ts
|
|
39
|
+
* if (response.error === true || response.status !== 200 || !response.data) {
|
|
40
|
+
* throw new Error(response.message || 'Failed to fetch pools');
|
|
41
|
+
* }
|
|
42
|
+
*
|
|
43
|
+
* // CommentService.ts
|
|
44
|
+
* if (response.error) {
|
|
45
|
+
* throw new Error(response.message || 'Failed to post comment');
|
|
46
|
+
* }
|
|
47
|
+
*
|
|
48
|
+
* // FaucetService.ts
|
|
49
|
+
* if (response.error || response.status !== 200) {
|
|
50
|
+
* throw new Error(response.message || 'Faucet transfer failed');
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* // ... 15 more duplicate instances across different services
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* ### After (Single Source of Truth):
|
|
57
|
+
* ```typescript
|
|
58
|
+
* // PoolService.ts
|
|
59
|
+
* assertResponseSuccess(response, 'Failed to fetch pools', true);
|
|
60
|
+
*
|
|
61
|
+
* // CommentService.ts
|
|
62
|
+
* assertResponseSuccess(response, 'Failed to post comment');
|
|
63
|
+
*
|
|
64
|
+
* // FaucetService.ts
|
|
65
|
+
* assertResponseSuccess(response, 'Faucet transfer failed');
|
|
66
|
+
*
|
|
67
|
+
* // All services use the same consistent error handling
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @template T The expected type of response.data
|
|
71
|
+
* @param response Backend response object to validate
|
|
72
|
+
* @param defaultErrorMessage Default error message if response.message is unavailable
|
|
73
|
+
* @param requireData Whether to require response.data to be present (default: false)
|
|
74
|
+
* @throws Error if the response indicates failure
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* // Basic usage - check status and error flag only
|
|
79
|
+
* const response = await http.post('/api/endpoint', data);
|
|
80
|
+
* assertResponseSuccess(response, 'Operation failed');
|
|
81
|
+
* // No return value - throws if response is invalid
|
|
82
|
+
*
|
|
83
|
+
* // Require data to be present
|
|
84
|
+
* const response = await http.get('/api/pools');
|
|
85
|
+
* assertResponseSuccess(response, 'Failed to fetch pools', true);
|
|
86
|
+
* // Throws if response.error, status !== 200, OR !response.data
|
|
87
|
+
*
|
|
88
|
+
* // Custom error message context
|
|
89
|
+
* assertResponseSuccess(response, 'Token creation failed');
|
|
90
|
+
* assertResponseSuccess(response, 'Profile update failed');
|
|
91
|
+
* assertResponseSuccess(response, 'Comment submission failed');
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
export declare function assertResponseSuccess<T = unknown>(response: BackendResponse<T>, defaultErrorMessage: string, requireData?: boolean): void;
|
|
95
|
+
export {};
|
|
96
|
+
//# sourceMappingURL=response-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-handlers.d.ts","sourceRoot":"","sources":["../../src/utils/response-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,UAAU,eAAe,CAAC,CAAC,GAAG,OAAO;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;CACV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,GAAG,OAAO,EAC/C,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,EAC5B,mBAAmB,EAAE,MAAM,EAC3B,WAAW,GAAE,OAAe,GAC3B,IAAI,CAQN"}
|