@gala-chain/launchpad-sdk 4.0.1-beta.3 → 4.0.1-beta.31
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.d.ts +5 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/src/LaunchpadSDK.d.ts +102 -46
- package/dist/src/LaunchpadSDK.d.ts.map +1 -1
- package/dist/src/api/LaunchpadAPI.d.ts +3 -3
- package/dist/src/api/LaunchpadAPI.d.ts.map +1 -1
- package/dist/src/constants/counts.d.ts +4 -7
- package/dist/src/constants/counts.d.ts.map +1 -1
- package/dist/src/constants/endpoints.d.ts +0 -3
- package/dist/src/constants/endpoints.d.ts.map +1 -1
- package/dist/src/constants/version.generated.d.ts +1 -1
- package/dist/src/constants/version.generated.d.ts.map +1 -1
- package/dist/src/index.d.ts +5 -6
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/schemas/pagination.d.ts +0 -16
- package/dist/src/schemas/pagination.d.ts.map +1 -1
- package/dist/src/schemas/primitives.d.ts +0 -9
- package/dist/src/schemas/primitives.d.ts.map +1 -1
- package/dist/src/schemas/user.d.ts +48 -16
- package/dist/src/schemas/user.d.ts.map +1 -1
- package/dist/src/schemas/validators.d.ts +1 -13
- package/dist/src/schemas/validators.d.ts.map +1 -1
- package/dist/src/services/DexQuoteService.d.ts.map +1 -1
- package/dist/src/services/DexService.d.ts.map +1 -1
- package/dist/src/services/GSwapService.d.ts +19 -6
- package/dist/src/services/GSwapService.d.ts.map +1 -1
- package/dist/src/services/GalaChainGatewayClient.d.ts.map +1 -1
- package/dist/src/services/GalaChainService.d.ts +9 -1
- package/dist/src/services/GalaChainService.d.ts.map +1 -1
- package/dist/src/services/ImageService.d.ts.map +1 -1
- package/dist/src/services/LaunchpadService.d.ts +2 -34
- package/dist/src/services/LaunchpadService.d.ts.map +1 -1
- package/dist/src/services/PoolService.d.ts.map +1 -1
- package/dist/src/services/UserService.d.ts.map +1 -1
- package/dist/src/types/galachain-api.types.d.ts +39 -16
- package/dist/src/types/galachain-api.types.d.ts.map +1 -1
- package/dist/src/types/gswap-responses.types.d.ts +8 -5
- package/dist/src/types/gswap-responses.types.d.ts.map +1 -1
- package/dist/src/types/gswap.dto.d.ts +13 -5
- package/dist/src/types/gswap.dto.d.ts.map +1 -1
- package/dist/src/types/launchpad.dto.d.ts +18 -0
- package/dist/src/types/launchpad.dto.d.ts.map +1 -1
- package/dist/src/types/options.dto.d.ts +0 -30
- package/dist/src/types/options.dto.d.ts.map +1 -1
- package/dist/src/types/result.types.d.ts +1 -18
- package/dist/src/types/result.types.d.ts.map +1 -1
- package/dist/src/types/user.dto.d.ts +65 -35
- package/dist/src/types/user.dto.d.ts.map +1 -1
- package/dist/src/types/websocket-data.types.d.ts +0 -8
- package/dist/src/types/websocket-data.types.d.ts.map +1 -1
- package/dist/src/utils/auto-pagination.d.ts +2 -5
- package/dist/src/utils/auto-pagination.d.ts.map +1 -1
- package/dist/src/utils/bondingCurveCalculations.d.ts.map +1 -1
- package/dist/src/utils/error-factories.d.ts +2 -2
- package/dist/src/utils/query-params.d.ts +0 -1
- package/dist/src/utils/query-params.d.ts.map +1 -1
- package/dist/src/utils/response-handlers.d.ts +10 -10
- package/dist/src/utils/validation-helpers.d.ts +3 -12
- package/dist/src/utils/validation-helpers.d.ts.map +1 -1
- package/dist/src/utils/validation.d.ts +2 -2
- package/dist/src/utils/websocket-validators.d.ts +1 -5
- package/dist/src/utils/websocket-validators.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/src/services/CommentService.d.ts +0 -63
- package/dist/src/services/CommentService.d.ts.map +0 -1
- package/dist/src/services/FaucetService.d.ts +0 -55
- package/dist/src/services/FaucetService.d.ts.map +0 -1
- package/dist/src/types/comment.dto.d.ts +0 -169
- package/dist/src/types/comment.dto.d.ts.map +0 -1
|
@@ -23,7 +23,6 @@ export interface QueryParamConfig<T> {
|
|
|
23
23
|
* Builds backend query parameters from typed options object
|
|
24
24
|
*
|
|
25
25
|
* This utility consolidates the logic from multiple query building methods:
|
|
26
|
-
* - buildGetCommentsQueryParams
|
|
27
26
|
* - buildTradeQueryParams
|
|
28
27
|
* - buildTokenListQueryParams
|
|
29
28
|
* - buildTokenHoldQueryParams
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-params.d.ts","sourceRoot":"","sources":["../../../src/utils/query-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,iDAAiD;IACjD,eAAe,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC9B,wDAAwD;IACxD,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC7B,qDAAqD;IACrD,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;CAClD;AAED
|
|
1
|
+
{"version":3,"file":"query-params.d.ts","sourceRoot":"","sources":["../../../src/utils/query-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,iDAAiD;IACjD,eAAe,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC9B,wDAAwD;IACxD,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC7B,qDAAqD;IACrD,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;CAClD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnE,OAAO,EAAE,CAAC,EACV,MAAM,GAAE,gBAAgB,CAAC,CAAC,CAAM,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAyCzB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKxB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKzB"}
|
|
@@ -40,17 +40,17 @@ interface BackendResponse<T = unknown> {
|
|
|
40
40
|
* throw new Error(response.message || 'Failed to fetch pools');
|
|
41
41
|
* }
|
|
42
42
|
*
|
|
43
|
-
* //
|
|
43
|
+
* // TradeService.ts
|
|
44
44
|
* if (response.error) {
|
|
45
|
-
* throw new Error(response.message || 'Failed to
|
|
45
|
+
* throw new Error(response.message || 'Failed to execute trade');
|
|
46
46
|
* }
|
|
47
47
|
*
|
|
48
|
-
* //
|
|
48
|
+
* // UserService.ts
|
|
49
49
|
* if (response.error || response.status !== 200) {
|
|
50
|
-
* throw new Error(response.message || '
|
|
50
|
+
* throw new Error(response.message || 'User operation failed');
|
|
51
51
|
* }
|
|
52
52
|
*
|
|
53
|
-
* // ...
|
|
53
|
+
* // ... more duplicate instances across different services
|
|
54
54
|
* ```
|
|
55
55
|
*
|
|
56
56
|
* ### After (Single Source of Truth):
|
|
@@ -58,11 +58,11 @@ interface BackendResponse<T = unknown> {
|
|
|
58
58
|
* // PoolService.ts
|
|
59
59
|
* assertResponseSuccess(response, 'Failed to fetch pools', true);
|
|
60
60
|
*
|
|
61
|
-
* //
|
|
62
|
-
* assertResponseSuccess(response, 'Failed to
|
|
61
|
+
* // TradeService.ts
|
|
62
|
+
* assertResponseSuccess(response, 'Failed to execute trade');
|
|
63
63
|
*
|
|
64
|
-
* //
|
|
65
|
-
* assertResponseSuccess(response, '
|
|
64
|
+
* // UserService.ts
|
|
65
|
+
* assertResponseSuccess(response, 'User operation failed');
|
|
66
66
|
*
|
|
67
67
|
* // All services use the same consistent error handling
|
|
68
68
|
* ```
|
|
@@ -88,7 +88,7 @@ interface BackendResponse<T = unknown> {
|
|
|
88
88
|
* // Custom error message context
|
|
89
89
|
* assertResponseSuccess(response, 'Token creation failed');
|
|
90
90
|
* assertResponseSuccess(response, 'Profile update failed');
|
|
91
|
-
* assertResponseSuccess(response, '
|
|
91
|
+
* assertResponseSuccess(response, 'Trade execution failed');
|
|
92
92
|
* ```
|
|
93
93
|
*/
|
|
94
94
|
export declare function assertResponseSuccess<T = unknown>(response: BackendResponse<T>, defaultErrorMessage: string, requireData?: boolean): void;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Pagination constraints structure
|
|
12
12
|
*
|
|
13
13
|
* This interface defines the expected structure for pagination constraint objects
|
|
14
|
-
* used across the SDK (e.g., USER_CONSTRAINTS, TRADE_CONSTRAINTS
|
|
14
|
+
* used across the SDK (e.g., USER_CONSTRAINTS, TRADE_CONSTRAINTS).
|
|
15
15
|
*/
|
|
16
16
|
export interface PaginationConstraints {
|
|
17
17
|
PAGINATION: {
|
|
@@ -25,11 +25,11 @@ export interface PaginationConstraints {
|
|
|
25
25
|
* Validates pagination parameters against constraint bounds
|
|
26
26
|
*
|
|
27
27
|
* This utility consolidates the duplicate pagination validation logic found across
|
|
28
|
-
* multiple services (UserService, TradeService
|
|
28
|
+
* multiple services (UserService, TradeService).
|
|
29
29
|
*
|
|
30
30
|
* ## Replaces Patterns
|
|
31
31
|
*
|
|
32
|
-
* This function replaces
|
|
32
|
+
* This function replaces duplicate pagination validation across services:
|
|
33
33
|
*
|
|
34
34
|
* ### Before (Duplicate Private Methods):
|
|
35
35
|
* ```typescript
|
|
@@ -51,11 +51,6 @@ export interface PaginationConstraints {
|
|
|
51
51
|
* private validateTradePagination(options: { page: number; limit: number }): void {
|
|
52
52
|
* // Same pattern, different constraints
|
|
53
53
|
* }
|
|
54
|
-
*
|
|
55
|
-
* // CommentService.ts (inline validation with helper function)
|
|
56
|
-
* if (!isValidCommentPagination(page, limit)) {
|
|
57
|
-
* throw new ValidationError(...);
|
|
58
|
-
* }
|
|
59
54
|
* ```
|
|
60
55
|
*
|
|
61
56
|
* ### After (Single Source of Truth):
|
|
@@ -67,10 +62,6 @@ export interface PaginationConstraints {
|
|
|
67
62
|
* // TradeService.ts
|
|
68
63
|
* import { assertValidPagination } from '../utils/validation-helpers';
|
|
69
64
|
* assertValidPagination(page, limit, TRADE_CONSTRAINTS);
|
|
70
|
-
*
|
|
71
|
-
* // CommentService.ts
|
|
72
|
-
* import { assertValidPagination } from '../utils/validation-helpers';
|
|
73
|
-
* assertValidPagination(page, limit, COMMENT_CONSTRAINTS);
|
|
74
65
|
* ```
|
|
75
66
|
*
|
|
76
67
|
* @param page - Page number to validate (1-based)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/validation-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH;;;;;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
|
|
1
|
+
{"version":3,"file":"validation-helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/validation-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH;;;;;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,CAA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A0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,kCAAkC;IAClC,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IACP,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACvB,GACL,uBAAuB,CA8BzB"}
|
|
@@ -134,13 +134,13 @@ export declare function isValidAddressFormat(address: string): address is Addres
|
|
|
134
134
|
*/
|
|
135
135
|
export declare function validateNumericString(value: string, fieldName: string, allowZero?: boolean): void;
|
|
136
136
|
/**
|
|
137
|
-
* Generates a vault address for
|
|
137
|
+
* Generates a vault address for token operations
|
|
138
138
|
*
|
|
139
139
|
* Format: service|Token$Unit$[SYMBOL]$eth:[CREATOR_ADDRESS]$launchpad
|
|
140
140
|
*
|
|
141
141
|
* @param tokenSymbol Token symbol (e.g., "BOBA", "CMPASY")
|
|
142
142
|
* @param creatorAddress Creator's wallet address (without 0x prefix)
|
|
143
|
-
* @returns Vault address string for
|
|
143
|
+
* @returns Vault address string for token operations
|
|
144
144
|
*
|
|
145
145
|
* @example
|
|
146
146
|
* ```typescript
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @category Validation
|
|
7
7
|
* @since 3.7.2
|
|
8
8
|
*/
|
|
9
|
-
import { WsTradeData, WsLaunchData, WsTransferData
|
|
9
|
+
import { WsTradeData, WsLaunchData, WsTransferData } from '../types/websocket-data.types';
|
|
10
10
|
/**
|
|
11
11
|
* Type guard for trade data from WebSocket responses
|
|
12
12
|
*/
|
|
@@ -19,10 +19,6 @@ export declare function isWsLaunchData(data: unknown): data is WsLaunchData;
|
|
|
19
19
|
* Type guard for token transfer data from WebSocket responses
|
|
20
20
|
*/
|
|
21
21
|
export declare function isWsTransferData(data: unknown): data is WsTransferData;
|
|
22
|
-
/**
|
|
23
|
-
* Type guard for comment data from WebSocket responses
|
|
24
|
-
*/
|
|
25
|
-
export declare function isWsCommentData(data: unknown): data is WsCommentData;
|
|
26
22
|
/**
|
|
27
23
|
* Validates WebSocket response structure
|
|
28
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket-validators.d.ts","sourceRoot":"","sources":["../../../src/utils/websocket-validators.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,cAAc,
|
|
1
|
+
{"version":3,"file":"websocket-validators.d.ts","sourceRoot":"","sources":["../../../src/utils/websocket-validators.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,cAAc,EACf,MAAM,+BAA+B,CAAC;AAGvC;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,WAAW,CAchE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,YAAY,CAalE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,cAAc,CActE;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAa1F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gala-chain/launchpad-sdk",
|
|
3
|
-
"version": "4.0.1-beta.
|
|
3
|
+
"version": "4.0.1-beta.31",
|
|
4
4
|
"description": "TypeScript SDK for Gala Launchpad Backend API - 72 methods supporting optional wallet (read-only and full-access modes). Production-ready DeFi token launchpad integration with AgentConfig setup, GalaChain trading, GSwap DEX integration, price history, token creation, DEX pool discovery, WebSocket event watchers, and comprehensive user operations. Multi-format output (ESM, CJS, UMD).",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Comment Service
|
|
3
|
-
*
|
|
4
|
-
* Handles all comment-related operations including fetching and posting comments.
|
|
5
|
-
*
|
|
6
|
-
* @category Services
|
|
7
|
-
* @since 3.6.0
|
|
8
|
-
*/
|
|
9
|
-
import { HttpClient } from '../utils/http';
|
|
10
|
-
import { BaseService } from './BaseService';
|
|
11
|
-
import { CommentsResult } from '../types/comment.dto';
|
|
12
|
-
import { FetchCommentsOptions, PostCommentOptions } from '../types/options.dto';
|
|
13
|
-
import { PoolService } from './PoolService';
|
|
14
|
-
/**
|
|
15
|
-
* Comment Service Class
|
|
16
|
-
*
|
|
17
|
-
* Provides methods for:
|
|
18
|
-
* - Fetching comments for tokens
|
|
19
|
-
* - Posting comments on tokens
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```typescript
|
|
23
|
-
* const commentService = new CommentService(httpClient, poolService);
|
|
24
|
-
*
|
|
25
|
-
* // Fetch first page of comments for a token
|
|
26
|
-
* const comments = await commentService.fetchComments({ tokenName: "dragnrkti" });
|
|
27
|
-
*
|
|
28
|
-
* // Post a comment
|
|
29
|
-
* await commentService.postComment({
|
|
30
|
-
* tokenName: "dragnrkti",
|
|
31
|
-
* content: "Great project!"
|
|
32
|
-
* });
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
export declare class CommentService extends BaseService {
|
|
36
|
-
private readonly poolService;
|
|
37
|
-
constructor(http: HttpClient, poolService: PoolService, debugMode?: boolean);
|
|
38
|
-
/**
|
|
39
|
-
* Fetches comments for a token by its tokenName
|
|
40
|
-
*
|
|
41
|
-
* This method provides a clean, intuitive API for fetching token comments
|
|
42
|
-
* using the token name. It automatically resolves the tokenName
|
|
43
|
-
* to the correct vault address internally.
|
|
44
|
-
*
|
|
45
|
-
* @param options Options for fetching comments
|
|
46
|
-
* @returns Promise<CommentsResult> Comments with pagination info
|
|
47
|
-
* @throws ValidationError if token name is invalid or not found
|
|
48
|
-
*/
|
|
49
|
-
fetchComments(options: FetchCommentsOptions): Promise<CommentsResult>;
|
|
50
|
-
/**
|
|
51
|
-
* Posts a comment on a token by its tokenName
|
|
52
|
-
*
|
|
53
|
-
* This method provides a clean, intuitive API for posting comments on tokens
|
|
54
|
-
* using the token name. It automatically resolves the tokenName
|
|
55
|
-
* to the correct vault address and uses the authenticated user's wallet address.
|
|
56
|
-
*
|
|
57
|
-
* @param options Options for posting a comment
|
|
58
|
-
* @returns Promise<void> No return data
|
|
59
|
-
* @throws ValidationError if token name is invalid, not found, or content is invalid
|
|
60
|
-
*/
|
|
61
|
-
postComment(options: PostCommentOptions): Promise<void>;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=CommentService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAS3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,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,cAAe,SAAQ,WAAW;IAG3C,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAD5B,IAAI,EAAE,UAAU,EACC,WAAW,EAAE,WAAW,EACzC,SAAS,GAAE,OAAe;IAK5B;;;;;;;;;;OAUG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAqF3E;;;;;;;;;;OAUG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAgE9D"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Faucet Service
|
|
3
|
-
*
|
|
4
|
-
* Handles faucet-related operations for transferring test tokens.
|
|
5
|
-
*
|
|
6
|
-
* @category Services
|
|
7
|
-
* @since 3.6.0
|
|
8
|
-
*/
|
|
9
|
-
import { HttpClient } from '../utils/http';
|
|
10
|
-
import { BaseService } from './BaseService';
|
|
11
|
-
import { TransferFaucetsData } from '../types/user.dto';
|
|
12
|
-
/**
|
|
13
|
-
* Faucet Service Class
|
|
14
|
-
*
|
|
15
|
-
* Provides methods for:
|
|
16
|
-
* - Transferring faucet tokens to users
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* const faucetService = new FaucetService(httpClient);
|
|
21
|
-
*
|
|
22
|
-
* // Transfer 1 token from faucet
|
|
23
|
-
* await faucetService.transferFaucets({
|
|
24
|
-
* walletAddress: "eth|1234567890abcdef1234567890abcdef12345678",
|
|
25
|
-
* amount: "1"
|
|
26
|
-
* });
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare class FaucetService extends BaseService {
|
|
30
|
-
constructor(http: HttpClient, debugMode?: boolean);
|
|
31
|
-
/**
|
|
32
|
-
* Transfers faucets to a user address
|
|
33
|
-
*
|
|
34
|
-
* @param data Transfer faucets data
|
|
35
|
-
* @returns Promise<void> No return data - throws on failure
|
|
36
|
-
* @throws ValidationError if input validation fails
|
|
37
|
-
* @throws Error if transfer fails
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```typescript
|
|
41
|
-
* await service.transferFaucets({
|
|
42
|
-
* walletAddress: "eth|1234567890abcdef1234567890abcdef12345678",
|
|
43
|
-
* amount: "1" // 1 token
|
|
44
|
-
* });
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
transferFaucets(data: TransferFaucetsData): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Validates transfer faucets data
|
|
50
|
-
*
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
|
-
private validateTransferFaucetsData;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=FaucetService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,mBAAmB,EAIpB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAc,SAAQ,WAAW;gBAChC,IAAI,EAAE,UAAU,EAAE,SAAS,GAAE,OAAe;IAIxD;;;;;;;;;;;;;;;OAeG;IACG,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB/D;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;CAiBpC"}
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Comment API Data Transfer Objects and Types
|
|
3
|
-
*
|
|
4
|
-
* This module defines all types and interfaces for token comment operations including
|
|
5
|
-
* fetching comments and creating new comments.
|
|
6
|
-
*/
|
|
7
|
-
import { AddressFormat } from './common';
|
|
8
|
-
/**
|
|
9
|
-
* Options for fetching token comments
|
|
10
|
-
*/
|
|
11
|
-
export interface GetCommentsOptions {
|
|
12
|
-
/** Service vault address for the token */
|
|
13
|
-
vaultAddress: string;
|
|
14
|
-
/** Page number (1-based), defaults to 1 */
|
|
15
|
-
page?: number;
|
|
16
|
-
/** Number of items per page, defaults to 10 */
|
|
17
|
-
limit?: number;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Backend format for get comments options (handles type conversion)
|
|
21
|
-
*/
|
|
22
|
-
export interface BackendGetCommentsOptions {
|
|
23
|
-
/** Service vault address for the token */
|
|
24
|
-
vaultAddress: string;
|
|
25
|
-
/** Page number as string (backend quirk) */
|
|
26
|
-
page: string;
|
|
27
|
-
/** Limit as string (backend quirk) */
|
|
28
|
-
limit: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* User information associated with a comment
|
|
32
|
-
*/
|
|
33
|
-
export interface CommentUser {
|
|
34
|
-
/** User's full name */
|
|
35
|
-
fullName: string;
|
|
36
|
-
/** Profile image URL or null */
|
|
37
|
-
profileImage: string | null;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Comment information returned by the API
|
|
41
|
-
*/
|
|
42
|
-
export interface CommentInfo {
|
|
43
|
-
/** Comment ID */
|
|
44
|
-
id: number;
|
|
45
|
-
/** Comment content/text */
|
|
46
|
-
content: string;
|
|
47
|
-
/** User address who posted the comment */
|
|
48
|
-
userAddress: AddressFormat;
|
|
49
|
-
/** Comment creation timestamp */
|
|
50
|
-
createdAt: Date;
|
|
51
|
-
/** User information */
|
|
52
|
-
user: CommentUser;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Internal response from get comments endpoint
|
|
56
|
-
*/
|
|
57
|
-
export interface InternalGetCommentsResponse {
|
|
58
|
-
/** HTTP status code */
|
|
59
|
-
status: number;
|
|
60
|
-
/** Response message */
|
|
61
|
-
message: string;
|
|
62
|
-
/** Error status */
|
|
63
|
-
error: boolean;
|
|
64
|
-
/** Comment data */
|
|
65
|
-
data: {
|
|
66
|
-
/** Array of comments */
|
|
67
|
-
comments: CommentInfo[];
|
|
68
|
-
/** Total count of comments */
|
|
69
|
-
count: number;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Clean result for fetching comments
|
|
74
|
-
*/
|
|
75
|
-
export interface CommentsResult {
|
|
76
|
-
/** Array of comments with Date objects */
|
|
77
|
-
comments: CommentInfo[];
|
|
78
|
-
/** Total count of comments */
|
|
79
|
-
total: number;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Data required for creating a new comment
|
|
83
|
-
*/
|
|
84
|
-
export interface CreateCommentData {
|
|
85
|
-
/** User address in backend format eth|[40-hex-chars] */
|
|
86
|
-
userAddress: AddressFormat;
|
|
87
|
-
/** Service vault address for the token */
|
|
88
|
-
vaultAddress: string;
|
|
89
|
-
/** Comment content/text */
|
|
90
|
-
content: string;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Internal response from create comment endpoint
|
|
94
|
-
*/
|
|
95
|
-
export interface InternalCreateCommentResponse {
|
|
96
|
-
/** HTTP status code */
|
|
97
|
-
status: number;
|
|
98
|
-
/** Response message */
|
|
99
|
-
message: string;
|
|
100
|
-
/** Error status */
|
|
101
|
-
error: boolean;
|
|
102
|
-
/** Created comment data */
|
|
103
|
-
data: {
|
|
104
|
-
/** Comment ID */
|
|
105
|
-
id: number;
|
|
106
|
-
/** User address who posted the comment */
|
|
107
|
-
userAddress: AddressFormat;
|
|
108
|
-
/** Comment content/text */
|
|
109
|
-
content: string;
|
|
110
|
-
/** Pool ID associated with the comment */
|
|
111
|
-
poolId: number;
|
|
112
|
-
/** Comment update timestamp */
|
|
113
|
-
updatedAt: string;
|
|
114
|
-
/** Comment creation timestamp */
|
|
115
|
-
createdAt: string;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Constraints for comment operations
|
|
120
|
-
*/
|
|
121
|
-
export declare const COMMENT_CONSTRAINTS: {
|
|
122
|
-
/** Pagination constraints */
|
|
123
|
-
readonly PAGINATION: {
|
|
124
|
-
readonly MIN_PAGE: 1;
|
|
125
|
-
readonly MAX_PAGE: 1000;
|
|
126
|
-
readonly MIN_LIMIT: 1;
|
|
127
|
-
readonly MAX_LIMIT: 50;
|
|
128
|
-
};
|
|
129
|
-
/** Comment content constraints */
|
|
130
|
-
readonly CONTENT: {
|
|
131
|
-
readonly MIN_LENGTH: 1;
|
|
132
|
-
readonly MAX_LENGTH: 500;
|
|
133
|
-
};
|
|
134
|
-
/** Vault address pattern for service tokens */
|
|
135
|
-
readonly VAULT_ADDRESS: {
|
|
136
|
-
/** Service vault pattern: service|[alphanumeric with special chars] */
|
|
137
|
-
readonly SERVICE_PATTERN: RegExp;
|
|
138
|
-
};
|
|
139
|
-
/** User address pattern */
|
|
140
|
-
readonly USER_ADDRESS: {
|
|
141
|
-
/** User address pattern: eth|[40-hex-chars] */
|
|
142
|
-
readonly PATTERN: RegExp;
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* Type guard to check if an object is valid GetCommentsOptions
|
|
147
|
-
*/
|
|
148
|
-
export declare function isGetCommentsOptions(obj: unknown): obj is GetCommentsOptions;
|
|
149
|
-
/**
|
|
150
|
-
* Type guard to check if an object is valid CreateCommentData
|
|
151
|
-
*/
|
|
152
|
-
export declare function isCreateCommentData(obj: unknown): obj is CreateCommentData;
|
|
153
|
-
/**
|
|
154
|
-
* Validates service vault address format
|
|
155
|
-
*/
|
|
156
|
-
export declare function isValidServiceVaultAddress(address: string): boolean;
|
|
157
|
-
/**
|
|
158
|
-
* Validates user address format
|
|
159
|
-
*/
|
|
160
|
-
export declare function isValidUserAddress(address: string): boolean;
|
|
161
|
-
/**
|
|
162
|
-
* Validates comment content format
|
|
163
|
-
*/
|
|
164
|
-
export declare function isValidCommentContent(content: string): boolean;
|
|
165
|
-
/**
|
|
166
|
-
* Validates pagination parameters
|
|
167
|
-
*/
|
|
168
|
-
export declare function isValidCommentPagination(page: number, limit: number): boolean;
|
|
169
|
-
//# sourceMappingURL=comment.dto.d.ts.map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