@gala-chain/launchpad-sdk 3.5.3 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/README.md +23 -1
- package/dist/constants/endpoints.d.ts +38 -0
- package/dist/constants/endpoints.d.ts.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/services/CommentService.d.ts +71 -0
- package/dist/services/CommentService.d.ts.map +1 -0
- package/dist/services/FaucetService.d.ts +55 -0
- package/dist/services/FaucetService.d.ts.map +1 -0
- package/dist/services/ImageService.d.ts +81 -0
- package/dist/services/ImageService.d.ts.map +1 -0
- package/dist/services/LaunchpadService.d.ts +57 -298
- package/dist/services/LaunchpadService.d.ts.map +1 -1
- package/dist/services/PoolService.d.ts +114 -0
- package/dist/services/PoolService.d.ts.map +1 -0
- package/dist/services/TradeService.d.ts +55 -0
- package/dist/services/TradeService.d.ts.map +1 -0
- package/dist/services/UserService.d.ts +121 -0
- package/dist/services/UserService.d.ts.map +1 -0
- package/dist/utils/query-params.d.ts +98 -0
- package/dist/utils/query-params.d.ts.map +1 -0
- package/dist/utils/response-normalizers.d.ts +133 -0
- package/dist/utils/response-normalizers.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
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 { CommentsResult } from '../types/comment.dto';
|
|
11
|
+
import { FetchCommentsOptions, PostCommentOptions } from '../types/options.dto';
|
|
12
|
+
import { PoolService } from './PoolService';
|
|
13
|
+
/**
|
|
14
|
+
* Comment Service Class
|
|
15
|
+
*
|
|
16
|
+
* Provides methods for:
|
|
17
|
+
* - Fetching comments for tokens
|
|
18
|
+
* - Posting comments on tokens
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const commentService = new CommentService(httpClient, poolService);
|
|
23
|
+
*
|
|
24
|
+
* // Fetch first page of comments for a token
|
|
25
|
+
* const comments = await commentService.fetchComments({ tokenName: "dragnrkti" });
|
|
26
|
+
*
|
|
27
|
+
* // Post a comment
|
|
28
|
+
* await commentService.postComment({
|
|
29
|
+
* tokenName: "dragnrkti",
|
|
30
|
+
* content: "Great project!"
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare class CommentService {
|
|
35
|
+
private readonly http;
|
|
36
|
+
private readonly poolService;
|
|
37
|
+
constructor(http: HttpClient, poolService: PoolService);
|
|
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
|
+
* Resolves a token name to its vault address by querying PoolService
|
|
64
|
+
*
|
|
65
|
+
* @private
|
|
66
|
+
* @param tokenName Token name to resolve
|
|
67
|
+
* @returns Promise<string | null> Vault address if found, null otherwise
|
|
68
|
+
*/
|
|
69
|
+
private resolveTokenNameToVault;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=CommentService.d.ts.map
|
|
@@ -0,0 +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;AAK3C,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;IA2E3E;;;;;;;;;;OAUG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmE7D;;;;;;OAMG;YACW,uBAAuB;CAsBtC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { TransferFaucetsData } from '../types/user.dto';
|
|
11
|
+
/**
|
|
12
|
+
* Faucet Service Class
|
|
13
|
+
*
|
|
14
|
+
* Provides methods for:
|
|
15
|
+
* - Transferring faucet tokens to users
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const faucetService = new FaucetService(httpClient);
|
|
20
|
+
*
|
|
21
|
+
* // Transfer 1 token from faucet
|
|
22
|
+
* await faucetService.transferFaucets({
|
|
23
|
+
* walletAddress: "eth|1234567890abcdef1234567890abcdef12345678",
|
|
24
|
+
* amount: "1"
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare class FaucetService {
|
|
29
|
+
private readonly http;
|
|
30
|
+
constructor(http: HttpClient);
|
|
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
|
|
@@ -0,0 +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;AAG3C,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;IAuB/D;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;CAiBpC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Image Service
|
|
3
|
+
*
|
|
4
|
+
* Handles all image upload operations for tokens and profiles.
|
|
5
|
+
*
|
|
6
|
+
* @category Services
|
|
7
|
+
* @since 3.6.0
|
|
8
|
+
*/
|
|
9
|
+
import { HttpClient } from '../utils/http';
|
|
10
|
+
import { UploadImageByTokenNameOptions } from '../types/options.dto';
|
|
11
|
+
/**
|
|
12
|
+
* Image Service Class
|
|
13
|
+
*
|
|
14
|
+
* Provides methods for:
|
|
15
|
+
* - Uploading token images
|
|
16
|
+
* - Image validation and processing
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const imageService = new ImageService(httpClient);
|
|
21
|
+
*
|
|
22
|
+
* // Upload token image
|
|
23
|
+
* const imageUrl = await imageService.uploadImageByTokenName({
|
|
24
|
+
* tokenName: 'mytoken',
|
|
25
|
+
* options: { file: imageFile, tokenName: 'mytoken' }
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare class ImageService {
|
|
30
|
+
private readonly http;
|
|
31
|
+
constructor(http: HttpClient);
|
|
32
|
+
/**
|
|
33
|
+
* Uploads an image for a token pool
|
|
34
|
+
*
|
|
35
|
+
* Uploads a token image that will be used for branding and display purposes.
|
|
36
|
+
* Supports both browser File objects and Node.js Buffer objects for maximum
|
|
37
|
+
* compatibility across environments.
|
|
38
|
+
*
|
|
39
|
+
* File Requirements:
|
|
40
|
+
* - Format: PNG, JPG, JPEG, WebP
|
|
41
|
+
* - Size: Maximum 5MB
|
|
42
|
+
* - Dimensions: Recommended 512x512px or higher
|
|
43
|
+
* - Aspect ratio: Square (1:1) recommended
|
|
44
|
+
*
|
|
45
|
+
* @param options Upload configuration object
|
|
46
|
+
* @param options.file Image file as File object (browser) or Buffer (Node.js)
|
|
47
|
+
* @param options.tokenName Token name for the image (must be valid token name format)
|
|
48
|
+
* @returns Promise that resolves to image URL string
|
|
49
|
+
* @throws {ValidationError} If token name format is invalid
|
|
50
|
+
* @throws {FileValidationError} If file doesn't meet requirements
|
|
51
|
+
* @throws {Error} If upload fails due to network or server issues
|
|
52
|
+
*
|
|
53
|
+
* @example Browser file upload
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const fileInput = document.querySelector('#image-upload') as HTMLInputElement;
|
|
56
|
+
* const file = fileInput.files?.[0];
|
|
57
|
+
*
|
|
58
|
+
* if (file) {
|
|
59
|
+
* const imageUrl = await service.uploadImageByTokenName({
|
|
60
|
+
* file,
|
|
61
|
+
* tokenName: 'mytoken'
|
|
62
|
+
* });
|
|
63
|
+
* console.log('Image uploaded:', imageUrl);
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @example Node.js buffer upload
|
|
68
|
+
* ```typescript
|
|
69
|
+
* import * as fs from 'fs';
|
|
70
|
+
*
|
|
71
|
+
* const imageBuffer = fs.readFileSync('./token-image.png');
|
|
72
|
+
* const imageUrl = await service.uploadImageByTokenName({
|
|
73
|
+
* file: imageBuffer,
|
|
74
|
+
* tokenName: 'mytoken'
|
|
75
|
+
* });
|
|
76
|
+
* console.log('Image URL:', imageUrl);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
uploadImageByTokenName(options: UploadImageByTokenNameOptions): Promise<string>;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=ImageService.d.ts.map
|
|
@@ -0,0 +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;AAK3C,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;CA6DnB"}
|