@gala-chain/launchpad-sdk 3.6.1 → 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.
@@ -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;AAO3C,OAAO,EAEL,cAAc,EAMf,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;IAqE3E;;;;;;;;;;OAUG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IA6D7D;;;;;;OAMG;YACW,uBAAuB;CAsBtC"}
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"}
@@ -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;AAK3C,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;IA2DrE;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;CAyBhC"}
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;AAM3C,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;IA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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,116 @@
1
+ /**
2
+ * Validation Helper Utilities
3
+ *
4
+ * Reusable validation functions for common patterns across services.
5
+ * Eliminates duplicate validation logic and provides consistent error messages.
6
+ *
7
+ * @category Utilities
8
+ * @since 3.6.2
9
+ */
10
+ /**
11
+ * Pagination constraints structure
12
+ *
13
+ * This interface defines the expected structure for pagination constraint objects
14
+ * used across the SDK (e.g., USER_CONSTRAINTS, TRADE_CONSTRAINTS, COMMENT_CONSTRAINTS).
15
+ */
16
+ export interface PaginationConstraints {
17
+ PAGINATION: {
18
+ MIN_PAGE: number;
19
+ MAX_PAGE: number;
20
+ MIN_LIMIT: number;
21
+ MAX_LIMIT: number;
22
+ };
23
+ }
24
+ /**
25
+ * Validates pagination parameters against constraint bounds
26
+ *
27
+ * This utility consolidates the duplicate pagination validation logic found across
28
+ * multiple services (UserService, TradeService, CommentService).
29
+ *
30
+ * ## Replaces Patterns
31
+ *
32
+ * This function replaces 3 instances of duplicate pagination validation:
33
+ *
34
+ * ### Before (Duplicate Private Methods):
35
+ * ```typescript
36
+ * // UserService.ts (lines 403-427)
37
+ * private validateUserPagination(options: { page: number; limit: number }): void {
38
+ * if (typeof options.page !== 'number' ||
39
+ * options.page < USER_CONSTRAINTS.PAGINATION.MIN_PAGE ||
40
+ * options.page > USER_CONSTRAINTS.PAGINATION.MAX_PAGE) {
41
+ * throw new ValidationError(...);
42
+ * }
43
+ * if (typeof options.limit !== 'number' ||
44
+ * options.limit < USER_CONSTRAINTS.PAGINATION.MIN_LIMIT ||
45
+ * options.limit > USER_CONSTRAINTS.PAGINATION.MAX_LIMIT) {
46
+ * throw new ValidationError(...);
47
+ * }
48
+ * }
49
+ *
50
+ * // TradeService.ts (lines 121-145) - IDENTICAL STRUCTURE
51
+ * private validateTradePagination(options: { page: number; limit: number }): void {
52
+ * // Same pattern, different constraints
53
+ * }
54
+ *
55
+ * // CommentService.ts (inline validation with helper function)
56
+ * if (!isValidCommentPagination(page, limit)) {
57
+ * throw new ValidationError(...);
58
+ * }
59
+ * ```
60
+ *
61
+ * ### After (Single Source of Truth):
62
+ * ```typescript
63
+ * // UserService.ts
64
+ * import { assertValidPagination } from '../utils/validation-helpers';
65
+ * assertValidPagination(page, limit, USER_CONSTRAINTS);
66
+ *
67
+ * // TradeService.ts
68
+ * import { assertValidPagination } from '../utils/validation-helpers';
69
+ * assertValidPagination(page, limit, TRADE_CONSTRAINTS);
70
+ *
71
+ * // CommentService.ts
72
+ * import { assertValidPagination } from '../utils/validation-helpers';
73
+ * assertValidPagination(page, limit, COMMENT_CONSTRAINTS);
74
+ * ```
75
+ *
76
+ * @param page - Page number to validate (1-based)
77
+ * @param limit - Results per page limit to validate
78
+ * @param constraints - Constraint object with PAGINATION bounds
79
+ * @throws ValidationError if page or limit is invalid
80
+ *
81
+ * @example Basic usage with USER_CONSTRAINTS
82
+ * ```typescript
83
+ * import { assertValidPagination } from '../utils/validation-helpers';
84
+ * import { USER_CONSTRAINTS } from '../types/user.dto';
85
+ *
86
+ * function fetchUsers(page: number, limit: number) {
87
+ * assertValidPagination(page, limit, USER_CONSTRAINTS);
88
+ * // Validation passed - proceed with fetch
89
+ * }
90
+ * ```
91
+ *
92
+ * @example With TRADE_CONSTRAINTS
93
+ * ```typescript
94
+ * import { assertValidPagination } from '../utils/validation-helpers';
95
+ * import { TRADE_CONSTRAINTS } from '../types/trade.dto';
96
+ *
97
+ * function fetchTrades(page: number, limit: number) {
98
+ * assertValidPagination(page, limit, TRADE_CONSTRAINTS);
99
+ * // Validation passed - proceed with fetch
100
+ * }
101
+ * ```
102
+ *
103
+ * @example Error handling
104
+ * ```typescript
105
+ * try {
106
+ * assertValidPagination(0, 100, USER_CONSTRAINTS);
107
+ * } catch (error) {
108
+ * if (error instanceof ValidationError) {
109
+ * console.log(error.code); // 'INVALID_PAGE'
110
+ * console.log(error.message); // 'Page must be a number between 1 and 1000'
111
+ * }
112
+ * }
113
+ * ```
114
+ */
115
+ export declare function assertValidPagination(page: number, limit: number, constraints: PaginationConstraints): void;
116
+ //# sourceMappingURL=validation-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/validation-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,qBAAqB,GACjC,IAAI,CAoBN"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gala-chain/launchpad-sdk",
3
- "version": "3.6.1",
3
+ "version": "3.6.2",
4
4
  "description": "TypeScript SDK for Gala Launchpad Backend API - Production-ready DeFi token launchpad integration with wallet-based authentication, GalaChain trading, and comprehensive user operations. 100% tested (22/22 endpoints working).",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",