@gala-chain/launchpad-sdk 3.5.1 → 3.5.3
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 +16 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas/files.d.ts +63 -0
- package/dist/schemas/files.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +82 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/launchpad.d.ts +188 -0
- package/dist/schemas/launchpad.d.ts.map +1 -0
- package/dist/schemas/pagination.d.ts +208 -0
- package/dist/schemas/pagination.d.ts.map +1 -0
- package/dist/schemas/primitives.d.ts +144 -0
- package/dist/schemas/primitives.d.ts.map +1 -0
- package/dist/schemas/trade.d.ts +192 -0
- package/dist/schemas/trade.d.ts.map +1 -0
- package/dist/schemas/user.d.ts +251 -0
- package/dist/schemas/user.d.ts.map +1 -0
- package/dist/schemas/validators.d.ts +243 -0
- package/dist/schemas/validators.d.ts.map +1 -0
- package/dist/services/LaunchpadService.d.ts.map +1 -1
- package/dist/types/launchpad.validation.d.ts +9 -6
- package/dist/types/launchpad.validation.d.ts.map +1 -1
- package/dist/utils/multipart.d.ts +4 -1
- package/dist/utils/multipart.d.ts.map +1 -1
- package/dist/utils/validation.d.ts +13 -12
- package/dist/utils/validation.d.ts.map +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Upload Zod Schemas
|
|
3
|
+
*
|
|
4
|
+
* Validation schemas for file uploads (images, documents).
|
|
5
|
+
* Replaces manual FILE_UPLOAD_CONSTRAINTS with type-safe Zod schemas.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* Allowed image file extensions
|
|
10
|
+
*/
|
|
11
|
+
export declare const IMAGE_EXTENSIONS: readonly [".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"];
|
|
12
|
+
/**
|
|
13
|
+
* File upload validation schema
|
|
14
|
+
* Validates file size, type, and filename
|
|
15
|
+
*/
|
|
16
|
+
export declare const fileUploadSchema: z.ZodObject<{
|
|
17
|
+
/** File object (browser File or Node.js Buffer) */
|
|
18
|
+
file: z.ZodUnion<[z.ZodType<File, z.ZodTypeDef, File>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>]>;
|
|
19
|
+
/** Filename with extension */
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
/** File size in bytes */
|
|
22
|
+
size: z.ZodNumber;
|
|
23
|
+
/** MIME type for image files */
|
|
24
|
+
type: z.ZodEnum<["image/png", "image/jpg", "image/jpeg", "image/gif", "image/webp", "image/svg+xml"]>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
name: string;
|
|
27
|
+
type: "image/png" | "image/jpg" | "image/jpeg" | "image/gif" | "image/webp" | "image/svg+xml";
|
|
28
|
+
file: File | Buffer<ArrayBufferLike>;
|
|
29
|
+
size: number;
|
|
30
|
+
}, {
|
|
31
|
+
name: string;
|
|
32
|
+
type: "image/png" | "image/jpg" | "image/jpeg" | "image/gif" | "image/webp" | "image/svg+xml";
|
|
33
|
+
file: File | Buffer<ArrayBufferLike>;
|
|
34
|
+
size: number;
|
|
35
|
+
}>;
|
|
36
|
+
/**
|
|
37
|
+
* Browser File object validation
|
|
38
|
+
* For client-side file uploads
|
|
39
|
+
*/
|
|
40
|
+
export declare const browserFileSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodType<File, z.ZodTypeDef, File>, File, File>, File, File>, File, File>;
|
|
41
|
+
/**
|
|
42
|
+
* Node.js Buffer validation
|
|
43
|
+
* For server-side file uploads
|
|
44
|
+
*/
|
|
45
|
+
export declare const bufferFileSchema: z.ZodEffects<z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>;
|
|
46
|
+
/**
|
|
47
|
+
* Flexible file schema - accepts both File and Buffer
|
|
48
|
+
*/
|
|
49
|
+
export declare const flexibleFileSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodType<File, z.ZodTypeDef, File>, File, File>, File, File>, File, File>, z.ZodEffects<z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
|
|
50
|
+
/**
|
|
51
|
+
* Image extension schema
|
|
52
|
+
*/
|
|
53
|
+
export declare const imageExtensionSchema: z.ZodEnum<[".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"]>;
|
|
54
|
+
/**
|
|
55
|
+
* Validate filename has allowed image extension
|
|
56
|
+
*/
|
|
57
|
+
export declare const imageFilenameSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
58
|
+
export type FileUpload = z.infer<typeof fileUploadSchema>;
|
|
59
|
+
export type BrowserFile = z.infer<typeof browserFileSchema>;
|
|
60
|
+
export type BufferFile = z.infer<typeof bufferFileSchema>;
|
|
61
|
+
export type FlexibleFile = z.infer<typeof flexibleFileSchema>;
|
|
62
|
+
export type ImageExtension = z.infer<typeof imageExtensionSchema>;
|
|
63
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/schemas/files.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AACH,eAAO,MAAM,gBAAgB,6DAA8D,CAAC;AAE5F;;;GAGG;AACH,eAAO,MAAM,gBAAgB;IAC3B,mDAAmD;;IAKnD,8BAA8B;;IAE9B,yBAAyB;;IAEzB,gCAAgC;;;;;;;;;;;;EAEhC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,mHAmB7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,2IAG5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,4QAG7B,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,oBAAoB,+DAA6D,CAAC;AAE/F;;GAEG;AACH,eAAO,MAAM,mBAAmB,2CAM/B,CAAC;AAMF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod Schemas Index
|
|
3
|
+
*
|
|
4
|
+
* Central export point for all Zod validation schemas.
|
|
5
|
+
* This replaces manual CONSTRAINTS objects across the SDK with type-safe,
|
|
6
|
+
* composable Zod schemas that provide runtime validation and type inference.
|
|
7
|
+
*/
|
|
8
|
+
export * from './primitives.js';
|
|
9
|
+
export * from './launchpad.js';
|
|
10
|
+
export * from './files.js';
|
|
11
|
+
export * from './pagination.js';
|
|
12
|
+
export * from './user.js';
|
|
13
|
+
export * from './trade.js';
|
|
14
|
+
export * from './validators.js';
|
|
15
|
+
/**
|
|
16
|
+
* Example: Basic validation
|
|
17
|
+
*
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { tokenNameSchema } from './schemas';
|
|
20
|
+
*
|
|
21
|
+
* const result = tokenNameSchema.safeParse('mytoken123');
|
|
22
|
+
* if (result.success) {
|
|
23
|
+
* console.log('Valid:', result.data);
|
|
24
|
+
* } else {
|
|
25
|
+
* console.error('Errors:', result.error.errors);
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Example: Type inference
|
|
31
|
+
*
|
|
32
|
+
* ```typescript
|
|
33
|
+
* import { launchTokenDataSchema, type LaunchTokenData } from './schemas';
|
|
34
|
+
*
|
|
35
|
+
* // Infer input type (before transform)
|
|
36
|
+
* type Input = z.input<typeof launchTokenDataSchema>;
|
|
37
|
+
*
|
|
38
|
+
* // Infer output type (after transform)
|
|
39
|
+
* type Output = z.infer<typeof launchTokenDataSchema>;
|
|
40
|
+
* // or use exported type
|
|
41
|
+
* const data: LaunchTokenData = { ... };
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* Example: Schema composition
|
|
46
|
+
*
|
|
47
|
+
* ```typescript
|
|
48
|
+
* import { userPaginationSchema, searchQuerySchema } from './schemas';
|
|
49
|
+
*
|
|
50
|
+
* const customSchema = userPaginationSchema.extend({
|
|
51
|
+
* customFilter: searchQuerySchema.optional(),
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* Example: Address normalization
|
|
57
|
+
*
|
|
58
|
+
* ```typescript
|
|
59
|
+
* import { flexibleAddressSchema } from './schemas';
|
|
60
|
+
*
|
|
61
|
+
* // Accepts both formats, transforms to eth| format
|
|
62
|
+
* const result = flexibleAddressSchema.parse('0x1234567890123456789012345678901234567890');
|
|
63
|
+
* // result: 'eth|1234567890123456789012345678901234567890'
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
/**
|
|
67
|
+
* Example: Custom error messages
|
|
68
|
+
*
|
|
69
|
+
* ```typescript
|
|
70
|
+
* import { tokenNameSchema } from './schemas';
|
|
71
|
+
*
|
|
72
|
+
* try {
|
|
73
|
+
* tokenNameSchema.parse('ab'); // Too short
|
|
74
|
+
* } catch (error) {
|
|
75
|
+
* if (error instanceof z.ZodError) {
|
|
76
|
+
* console.log(error.errors[0].message);
|
|
77
|
+
* // "Token name must be at least 3 characters"
|
|
78
|
+
* }
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,cAAc,iBAAiB,CAAC;AAMhC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAM3B,cAAc,iBAAiB,CAAC;AAMhC;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Launchpad Zod Schemas
|
|
3
|
+
*
|
|
4
|
+
* Composed schemas for launchpad token creation, validation, and pool operations.
|
|
5
|
+
* These schemas replace manual LAUNCHPAD_CONSTRAINTS and provide type inference.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* Token social URLs schema
|
|
10
|
+
* At least one URL is required for token creation
|
|
11
|
+
*/
|
|
12
|
+
export declare const tokenUrlsSchema: z.ZodEffects<z.ZodObject<{
|
|
13
|
+
websiteUrl: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
14
|
+
telegramUrl: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
15
|
+
twitterUrl: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
websiteUrl?: string | undefined;
|
|
18
|
+
telegramUrl?: string | undefined;
|
|
19
|
+
twitterUrl?: string | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
websiteUrl?: string | undefined;
|
|
22
|
+
telegramUrl?: string | undefined;
|
|
23
|
+
twitterUrl?: string | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
websiteUrl?: string | undefined;
|
|
26
|
+
telegramUrl?: string | undefined;
|
|
27
|
+
twitterUrl?: string | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
websiteUrl?: string | undefined;
|
|
30
|
+
telegramUrl?: string | undefined;
|
|
31
|
+
twitterUrl?: string | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Token category schema - defaults to 'Unit'
|
|
35
|
+
*/
|
|
36
|
+
export declare const tokenCategorySchema: z.ZodDefault<z.ZodString>;
|
|
37
|
+
/**
|
|
38
|
+
* Token collection schema - defaults to 'Token'
|
|
39
|
+
*/
|
|
40
|
+
export declare const tokenCollectionSchema: z.ZodDefault<z.ZodString>;
|
|
41
|
+
/**
|
|
42
|
+
* Reverse bonding curve configuration schema
|
|
43
|
+
*/
|
|
44
|
+
export declare const reverseBondingCurveConfigSchema: z.ZodObject<{
|
|
45
|
+
minFeePortion: z.ZodEffects<z.ZodString, string, string>;
|
|
46
|
+
maxFeePortion: z.ZodEffects<z.ZodString, string, string>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
minFeePortion: string;
|
|
49
|
+
maxFeePortion: string;
|
|
50
|
+
}, {
|
|
51
|
+
minFeePortion: string;
|
|
52
|
+
maxFeePortion: string;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Token launch data schema
|
|
56
|
+
* Complete validation for creating a new launchpad token
|
|
57
|
+
*/
|
|
58
|
+
export declare const launchTokenDataSchema: z.ZodObject<{
|
|
59
|
+
tokenName: z.ZodString;
|
|
60
|
+
tokenSymbol: z.ZodString;
|
|
61
|
+
tokenDescription: z.ZodString;
|
|
62
|
+
tokenImage: z.ZodOptional<z.ZodUnion<[z.ZodType<File, z.ZodTypeDef, File>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodString]>>;
|
|
63
|
+
preBuyQuantity: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
|
|
64
|
+
websiteUrl: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
65
|
+
telegramUrl: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
66
|
+
twitterUrl: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
67
|
+
tokenCategory: z.ZodDefault<z.ZodString>;
|
|
68
|
+
tokenCollection: z.ZodDefault<z.ZodString>;
|
|
69
|
+
reverseBondingCurveConfiguration: z.ZodOptional<z.ZodObject<{
|
|
70
|
+
minFeePortion: z.ZodEffects<z.ZodString, string, string>;
|
|
71
|
+
maxFeePortion: z.ZodEffects<z.ZodString, string, string>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
minFeePortion: string;
|
|
74
|
+
maxFeePortion: string;
|
|
75
|
+
}, {
|
|
76
|
+
minFeePortion: string;
|
|
77
|
+
maxFeePortion: string;
|
|
78
|
+
}>>;
|
|
79
|
+
privateKey: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
tokenName: string;
|
|
82
|
+
tokenSymbol: string;
|
|
83
|
+
tokenDescription: string;
|
|
84
|
+
preBuyQuantity: string;
|
|
85
|
+
tokenCategory: string;
|
|
86
|
+
tokenCollection: string;
|
|
87
|
+
websiteUrl?: string | undefined;
|
|
88
|
+
telegramUrl?: string | undefined;
|
|
89
|
+
twitterUrl?: string | undefined;
|
|
90
|
+
tokenImage?: string | File | Buffer<ArrayBufferLike> | undefined;
|
|
91
|
+
reverseBondingCurveConfiguration?: {
|
|
92
|
+
minFeePortion: string;
|
|
93
|
+
maxFeePortion: string;
|
|
94
|
+
} | undefined;
|
|
95
|
+
privateKey?: string | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
tokenName: string;
|
|
98
|
+
tokenSymbol: string;
|
|
99
|
+
tokenDescription: string;
|
|
100
|
+
websiteUrl?: string | undefined;
|
|
101
|
+
telegramUrl?: string | undefined;
|
|
102
|
+
twitterUrl?: string | undefined;
|
|
103
|
+
tokenImage?: string | File | Buffer<ArrayBufferLike> | undefined;
|
|
104
|
+
preBuyQuantity?: string | undefined;
|
|
105
|
+
tokenCategory?: string | undefined;
|
|
106
|
+
tokenCollection?: string | undefined;
|
|
107
|
+
reverseBondingCurveConfiguration?: {
|
|
108
|
+
minFeePortion: string;
|
|
109
|
+
maxFeePortion: string;
|
|
110
|
+
} | undefined;
|
|
111
|
+
privateKey?: string | undefined;
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Image upload options schema
|
|
115
|
+
*/
|
|
116
|
+
export declare const imageUploadOptionsSchema: z.ZodObject<{
|
|
117
|
+
file: z.ZodUnion<[z.ZodType<File, z.ZodTypeDef, File>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>]>;
|
|
118
|
+
tokenName: z.ZodString;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
tokenName: string;
|
|
121
|
+
file: File | Buffer<ArrayBufferLike>;
|
|
122
|
+
}, {
|
|
123
|
+
tokenName: string;
|
|
124
|
+
file: File | Buffer<ArrayBufferLike>;
|
|
125
|
+
}>;
|
|
126
|
+
/**
|
|
127
|
+
* Pool fetch type schema - 'recent' or 'popular'
|
|
128
|
+
*/
|
|
129
|
+
export declare const poolFetchTypeSchema: z.ZodEnum<["recent", "popular"]>;
|
|
130
|
+
/**
|
|
131
|
+
* Pool check options schema
|
|
132
|
+
* At least one of tokenName or symbol is required
|
|
133
|
+
*/
|
|
134
|
+
export declare const checkPoolOptionsSchema: z.ZodEffects<z.ZodObject<{
|
|
135
|
+
tokenName: z.ZodOptional<z.ZodString>;
|
|
136
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
symbol?: string | undefined;
|
|
139
|
+
tokenName?: string | undefined;
|
|
140
|
+
}, {
|
|
141
|
+
symbol?: string | undefined;
|
|
142
|
+
tokenName?: string | undefined;
|
|
143
|
+
}>, {
|
|
144
|
+
symbol?: string | undefined;
|
|
145
|
+
tokenName?: string | undefined;
|
|
146
|
+
}, {
|
|
147
|
+
symbol?: string | undefined;
|
|
148
|
+
tokenName?: string | undefined;
|
|
149
|
+
}>;
|
|
150
|
+
/**
|
|
151
|
+
* Amount calculation type - 'NATIVE' (GALA) or 'MEME' (Launchpad token)
|
|
152
|
+
*/
|
|
153
|
+
export declare const amountTypeSchema: z.ZodEnum<["NATIVE", "MEME"]>;
|
|
154
|
+
/**
|
|
155
|
+
* Amount calculation method - 'IN' (input) or 'OUT' (output)
|
|
156
|
+
*/
|
|
157
|
+
export declare const amountMethodSchema: z.ZodEnum<["IN", "OUT"]>;
|
|
158
|
+
/**
|
|
159
|
+
* Graph data options schema
|
|
160
|
+
* For fetching volume/price data with timestamp validation
|
|
161
|
+
*/
|
|
162
|
+
export declare const graphDataOptionsSchema: z.ZodObject<{
|
|
163
|
+
from: z.ZodNumber;
|
|
164
|
+
to: z.ZodNumber;
|
|
165
|
+
resolution: z.ZodNumber;
|
|
166
|
+
tokenName: z.ZodString;
|
|
167
|
+
}, "strip", z.ZodTypeAny, {
|
|
168
|
+
tokenName: string;
|
|
169
|
+
from: number;
|
|
170
|
+
to: number;
|
|
171
|
+
resolution: number;
|
|
172
|
+
}, {
|
|
173
|
+
tokenName: string;
|
|
174
|
+
from: number;
|
|
175
|
+
to: number;
|
|
176
|
+
resolution: number;
|
|
177
|
+
}>;
|
|
178
|
+
export type TokenUrlsInput = z.input<typeof tokenUrlsSchema>;
|
|
179
|
+
export type TokenUrls = z.infer<typeof tokenUrlsSchema>;
|
|
180
|
+
export type LaunchTokenDataInput = z.input<typeof launchTokenDataSchema>;
|
|
181
|
+
export type LaunchTokenData = z.infer<typeof launchTokenDataSchema>;
|
|
182
|
+
export type ImageUploadOptions = z.infer<typeof imageUploadOptionsSchema>;
|
|
183
|
+
export type PoolFetchType = z.infer<typeof poolFetchTypeSchema>;
|
|
184
|
+
export type CheckPoolOptions = z.infer<typeof checkPoolOptionsSchema>;
|
|
185
|
+
export type AmountType = z.infer<typeof amountTypeSchema>;
|
|
186
|
+
export type AmountMethod = z.infer<typeof amountMethodSchema>;
|
|
187
|
+
export type GraphDataOptions = z.infer<typeof graphDataOptionsSchema>;
|
|
188
|
+
//# sourceMappingURL=launchpad.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launchpad.d.ts","sourceRoot":"","sources":["../../src/schemas/launchpad.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;EASzB,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,mBAAmB,2BAGd,CAAC;AAEnB;;GAEG;AACH,eAAO,MAAM,qBAAqB,2BAGf,CAAC;AAEpB;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;EAG1C,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBhC,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;EAMnC,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,mBAAmB,kCAAgC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;EAQhC,CAAC;AAMJ;;GAEG;AACH,eAAO,MAAM,gBAAgB,+BAA6B,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,kBAAkB,0BAAwB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;EAcjC,CAAC;AAMH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACzE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pagination Zod Schemas
|
|
3
|
+
*
|
|
4
|
+
* Validation schemas for pagination across all API operations.
|
|
5
|
+
* Replaces manual PAGINATION_CONSTRAINTS with operation-specific schemas.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* Standard pagination params schema
|
|
10
|
+
* Used for pool queries and general operations
|
|
11
|
+
* Page: 1-1000, Limit: 1-100 (default 10)
|
|
12
|
+
*/
|
|
13
|
+
export declare const standardPaginationSchema: z.ZodObject<{
|
|
14
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
page: number;
|
|
18
|
+
limit: number;
|
|
19
|
+
}, {
|
|
20
|
+
page?: number | undefined;
|
|
21
|
+
limit?: number | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* User operation pagination schema
|
|
25
|
+
* Used for fetchTokensHeld, fetchTokensCreated
|
|
26
|
+
* Page: 1-1000, Limit: 1-20 (default 10)
|
|
27
|
+
*/
|
|
28
|
+
export declare const userPaginationSchema: z.ZodObject<{
|
|
29
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
30
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
page: number;
|
|
33
|
+
limit: number;
|
|
34
|
+
}, {
|
|
35
|
+
page?: number | undefined;
|
|
36
|
+
limit?: number | undefined;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Trade operation pagination schema
|
|
40
|
+
* Used for fetchTrades
|
|
41
|
+
* Page: 1-1000, Limit: 1-20 (default 10)
|
|
42
|
+
*/
|
|
43
|
+
export declare const tradePaginationSchema: z.ZodObject<{
|
|
44
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
45
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
page: number;
|
|
48
|
+
limit: number;
|
|
49
|
+
}, {
|
|
50
|
+
page?: number | undefined;
|
|
51
|
+
limit?: number | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Comment pagination schema
|
|
55
|
+
* Used for fetchComments
|
|
56
|
+
* Page: 1-1000, Limit: 1-50 (default 10)
|
|
57
|
+
*/
|
|
58
|
+
export declare const commentPaginationSchema: z.ZodObject<{
|
|
59
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
60
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
page: number;
|
|
63
|
+
limit: number;
|
|
64
|
+
}, {
|
|
65
|
+
page?: number | undefined;
|
|
66
|
+
limit?: number | undefined;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Pool pagination with filters
|
|
70
|
+
* Includes type, tokenName, and search filters
|
|
71
|
+
*/
|
|
72
|
+
export declare const poolPaginationSchema: z.ZodObject<{
|
|
73
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
74
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
75
|
+
} & {
|
|
76
|
+
type: z.ZodOptional<z.ZodEnum<["recent", "popular"]>>;
|
|
77
|
+
tokenName: z.ZodOptional<z.ZodString>;
|
|
78
|
+
search: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
page: number;
|
|
81
|
+
limit: number;
|
|
82
|
+
type?: "recent" | "popular" | undefined;
|
|
83
|
+
tokenName?: string | undefined;
|
|
84
|
+
search?: string | undefined;
|
|
85
|
+
}, {
|
|
86
|
+
page?: number | undefined;
|
|
87
|
+
limit?: number | undefined;
|
|
88
|
+
type?: "recent" | "popular" | undefined;
|
|
89
|
+
tokenName?: string | undefined;
|
|
90
|
+
search?: string | undefined;
|
|
91
|
+
}>;
|
|
92
|
+
/**
|
|
93
|
+
* User tokens pagination with filters
|
|
94
|
+
* Includes tokenName and search filters
|
|
95
|
+
*/
|
|
96
|
+
export declare const userTokensPaginationSchema: z.ZodObject<{
|
|
97
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
98
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
99
|
+
} & {
|
|
100
|
+
tokenName: z.ZodOptional<z.ZodString>;
|
|
101
|
+
search: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
page: number;
|
|
104
|
+
limit: number;
|
|
105
|
+
tokenName?: string | undefined;
|
|
106
|
+
search?: string | undefined;
|
|
107
|
+
}, {
|
|
108
|
+
page?: number | undefined;
|
|
109
|
+
limit?: number | undefined;
|
|
110
|
+
tokenName?: string | undefined;
|
|
111
|
+
search?: string | undefined;
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Trade pagination with filters
|
|
115
|
+
* Includes tradeType, tokenName, userAddress, date range filters
|
|
116
|
+
*/
|
|
117
|
+
export declare const tradePaginationWithFiltersSchema: z.ZodObject<{
|
|
118
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
119
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
120
|
+
} & {
|
|
121
|
+
tradeType: z.ZodOptional<z.ZodEnum<["BUY", "SELL"]>>;
|
|
122
|
+
tokenName: z.ZodOptional<z.ZodString>;
|
|
123
|
+
userAddress: z.ZodOptional<z.ZodString>;
|
|
124
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
125
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
126
|
+
sortOrder: z.ZodDefault<z.ZodEnum<["ASC", "DESC"]>>;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
page: number;
|
|
129
|
+
limit: number;
|
|
130
|
+
sortOrder: "ASC" | "DESC";
|
|
131
|
+
userAddress?: string | undefined;
|
|
132
|
+
tokenName?: string | undefined;
|
|
133
|
+
tradeType?: "BUY" | "SELL" | undefined;
|
|
134
|
+
startDate?: string | undefined;
|
|
135
|
+
endDate?: string | undefined;
|
|
136
|
+
}, {
|
|
137
|
+
page?: number | undefined;
|
|
138
|
+
limit?: number | undefined;
|
|
139
|
+
userAddress?: string | undefined;
|
|
140
|
+
tokenName?: string | undefined;
|
|
141
|
+
tradeType?: "BUY" | "SELL" | undefined;
|
|
142
|
+
startDate?: string | undefined;
|
|
143
|
+
endDate?: string | undefined;
|
|
144
|
+
sortOrder?: "ASC" | "DESC" | undefined;
|
|
145
|
+
}>;
|
|
146
|
+
/**
|
|
147
|
+
* Base pagination result metadata
|
|
148
|
+
*/
|
|
149
|
+
export declare const paginationResultMetaSchema: z.ZodObject<{
|
|
150
|
+
page: z.ZodNumber;
|
|
151
|
+
limit: z.ZodNumber;
|
|
152
|
+
total: z.ZodNumber;
|
|
153
|
+
totalPages: z.ZodNumber;
|
|
154
|
+
hasNext: z.ZodBoolean;
|
|
155
|
+
hasPrevious: z.ZodBoolean;
|
|
156
|
+
}, "strip", z.ZodTypeAny, {
|
|
157
|
+
page: number;
|
|
158
|
+
limit: number;
|
|
159
|
+
total: number;
|
|
160
|
+
totalPages: number;
|
|
161
|
+
hasNext: boolean;
|
|
162
|
+
hasPrevious: boolean;
|
|
163
|
+
}, {
|
|
164
|
+
page: number;
|
|
165
|
+
limit: number;
|
|
166
|
+
total: number;
|
|
167
|
+
totalPages: number;
|
|
168
|
+
hasNext: boolean;
|
|
169
|
+
hasPrevious: boolean;
|
|
170
|
+
}>;
|
|
171
|
+
/**
|
|
172
|
+
* Generic paginated result schema factory
|
|
173
|
+
* Creates a schema for paginated results with data type
|
|
174
|
+
*/
|
|
175
|
+
export declare function createPaginatedResultSchema<T extends z.ZodTypeAny>(dataSchema: T): z.ZodObject<{
|
|
176
|
+
data: z.ZodArray<T, "many">;
|
|
177
|
+
page: z.ZodNumber;
|
|
178
|
+
limit: z.ZodNumber;
|
|
179
|
+
total: z.ZodNumber;
|
|
180
|
+
totalPages: z.ZodNumber;
|
|
181
|
+
hasNext: z.ZodBoolean;
|
|
182
|
+
hasPrevious: z.ZodBoolean;
|
|
183
|
+
}, "strip", z.ZodTypeAny, {
|
|
184
|
+
data: T["_output"][];
|
|
185
|
+
page: number;
|
|
186
|
+
limit: number;
|
|
187
|
+
total: number;
|
|
188
|
+
totalPages: number;
|
|
189
|
+
hasNext: boolean;
|
|
190
|
+
hasPrevious: boolean;
|
|
191
|
+
}, {
|
|
192
|
+
data: T["_input"][];
|
|
193
|
+
page: number;
|
|
194
|
+
limit: number;
|
|
195
|
+
total: number;
|
|
196
|
+
totalPages: number;
|
|
197
|
+
hasNext: boolean;
|
|
198
|
+
hasPrevious: boolean;
|
|
199
|
+
}>;
|
|
200
|
+
export type StandardPagination = z.infer<typeof standardPaginationSchema>;
|
|
201
|
+
export type UserPagination = z.infer<typeof userPaginationSchema>;
|
|
202
|
+
export type TradePagination = z.infer<typeof tradePaginationSchema>;
|
|
203
|
+
export type CommentPagination = z.infer<typeof commentPaginationSchema>;
|
|
204
|
+
export type PoolPagination = z.infer<typeof poolPaginationSchema>;
|
|
205
|
+
export type UserTokensPagination = z.infer<typeof userTokensPaginationSchema>;
|
|
206
|
+
export type TradePaginationWithFilters = z.infer<typeof tradePaginationWithFiltersSchema>;
|
|
207
|
+
export type PaginationResultMeta = z.infer<typeof paginationResultMetaSchema>;
|
|
208
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/schemas/pagination.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;EAGnC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;EAGlC,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;EAI/B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;EAGrC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO3C,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;EAOrC,CAAC;AAEH;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;GAUhF;AAMD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|