@gala-chain/launchpad-sdk 3.5.2 → 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/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 -10
- package/dist/utils/validation.d.ts.map +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Primitive Zod Schemas
|
|
3
|
+
*
|
|
4
|
+
* Reusable validation schemas for common data types across the SDK.
|
|
5
|
+
* These schemas replace manual CONSTRAINTS objects and type guards.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* Token name schema - alphanumeric, 3-20 characters
|
|
10
|
+
* Used for token creation and identification
|
|
11
|
+
*/
|
|
12
|
+
export declare const tokenNameSchema: z.ZodString;
|
|
13
|
+
/**
|
|
14
|
+
* Token symbol schema - uppercase letters, 1-8 characters
|
|
15
|
+
* Used for token ticker symbols
|
|
16
|
+
*/
|
|
17
|
+
export declare const tokenSymbolSchema: z.ZodString;
|
|
18
|
+
/**
|
|
19
|
+
* Token description schema - 1-500 characters
|
|
20
|
+
* Used for token metadata
|
|
21
|
+
*/
|
|
22
|
+
export declare const tokenDescriptionSchema: z.ZodString;
|
|
23
|
+
/**
|
|
24
|
+
* User token name schema - more permissive, 1-50 characters
|
|
25
|
+
* Used for user operations where token names may vary
|
|
26
|
+
*/
|
|
27
|
+
export declare const userTokenNameSchema: z.ZodString;
|
|
28
|
+
/**
|
|
29
|
+
* Search query schema - 1-100 characters
|
|
30
|
+
* Used for search and filter operations
|
|
31
|
+
*/
|
|
32
|
+
export declare const searchQuerySchema: z.ZodString;
|
|
33
|
+
/**
|
|
34
|
+
* Full name schema - alphabets and spaces only, 1-100 characters
|
|
35
|
+
* Used for user profiles
|
|
36
|
+
*/
|
|
37
|
+
export declare const fullNameSchema: z.ZodString;
|
|
38
|
+
/**
|
|
39
|
+
* Backend address format schema - eth|[40-hex-chars]
|
|
40
|
+
* Used for GalaChain address format
|
|
41
|
+
*/
|
|
42
|
+
export declare const addressFormatSchema: z.ZodString;
|
|
43
|
+
/**
|
|
44
|
+
* Ethereum address schema - 0x[40-hex-chars]
|
|
45
|
+
* Standard Ethereum address format
|
|
46
|
+
*/
|
|
47
|
+
export declare const ethereumAddressSchema: z.ZodString;
|
|
48
|
+
/**
|
|
49
|
+
* Flexible address schema - accepts both formats
|
|
50
|
+
* Automatically normalizes to backend format
|
|
51
|
+
*/
|
|
52
|
+
export declare const flexibleAddressSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
53
|
+
/**
|
|
54
|
+
* Vault address schema - supports both eth| and service| formats
|
|
55
|
+
* Used for token vault addresses
|
|
56
|
+
*/
|
|
57
|
+
export declare const vaultAddressSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
58
|
+
/**
|
|
59
|
+
* Positive decimal string schema
|
|
60
|
+
* Used for amounts, quantities, prices
|
|
61
|
+
*/
|
|
62
|
+
export declare const positiveDecimalStringSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
63
|
+
/**
|
|
64
|
+
* Non-negative decimal string schema
|
|
65
|
+
* Allows zero values
|
|
66
|
+
*/
|
|
67
|
+
export declare const nonNegativeDecimalStringSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
68
|
+
/**
|
|
69
|
+
* Faucet amount schema - positive, non-zero decimal
|
|
70
|
+
* Used for faucet requests
|
|
71
|
+
*/
|
|
72
|
+
export declare const faucetAmountSchema: z.ZodString;
|
|
73
|
+
/**
|
|
74
|
+
* HTTP/HTTPS URL schema
|
|
75
|
+
* Validates basic URL structure
|
|
76
|
+
*/
|
|
77
|
+
export declare const urlSchema: z.ZodString;
|
|
78
|
+
/**
|
|
79
|
+
* Optional URL schema
|
|
80
|
+
* Allows empty string or valid URL
|
|
81
|
+
*/
|
|
82
|
+
export declare const optionalUrlSchema: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
83
|
+
/**
|
|
84
|
+
* Page number schema - 1-1000
|
|
85
|
+
* Used for paginated queries
|
|
86
|
+
*/
|
|
87
|
+
export declare const pageNumberSchema: z.ZodDefault<z.ZodNumber>;
|
|
88
|
+
/**
|
|
89
|
+
* Limit schema factory - creates limit schemas with custom max values
|
|
90
|
+
* @param maxLimit - Maximum items per page
|
|
91
|
+
*/
|
|
92
|
+
export declare function createLimitSchema(maxLimit?: number): z.ZodDefault<z.ZodNumber>;
|
|
93
|
+
/**
|
|
94
|
+
* Standard pagination limit - 1-100 items
|
|
95
|
+
*/
|
|
96
|
+
export declare const standardLimitSchema: z.ZodDefault<z.ZodNumber>;
|
|
97
|
+
/**
|
|
98
|
+
* User operation limit - 1-20 items
|
|
99
|
+
*/
|
|
100
|
+
export declare const userLimitSchema: z.ZodDefault<z.ZodNumber>;
|
|
101
|
+
/**
|
|
102
|
+
* Trade operation limit - 1-20 items
|
|
103
|
+
*/
|
|
104
|
+
export declare const tradeLimitSchema: z.ZodDefault<z.ZodNumber>;
|
|
105
|
+
/**
|
|
106
|
+
* File size schema - 1 byte to 10MB
|
|
107
|
+
*/
|
|
108
|
+
export declare const fileSizeSchema: z.ZodNumber;
|
|
109
|
+
/**
|
|
110
|
+
* Filename schema - max 255 characters
|
|
111
|
+
*/
|
|
112
|
+
export declare const filenameSchema: z.ZodString;
|
|
113
|
+
/**
|
|
114
|
+
* Allowed image MIME types
|
|
115
|
+
*/
|
|
116
|
+
export declare const imageMimeTypeSchema: z.ZodEnum<["image/png", "image/jpg", "image/jpeg", "image/gif", "image/webp", "image/svg+xml"]>;
|
|
117
|
+
/**
|
|
118
|
+
* Comment message schema - 1-500 characters
|
|
119
|
+
*/
|
|
120
|
+
export declare const commentMessageSchema: z.ZodString;
|
|
121
|
+
/**
|
|
122
|
+
* ISO 8601 date string schema
|
|
123
|
+
*/
|
|
124
|
+
export declare const isoDateStringSchema: z.ZodString;
|
|
125
|
+
/**
|
|
126
|
+
* Unix timestamp schema (milliseconds)
|
|
127
|
+
*/
|
|
128
|
+
export declare const timestampSchema: z.ZodNumber;
|
|
129
|
+
/**
|
|
130
|
+
* Private key schema - 0x prefix followed by 64 hex characters
|
|
131
|
+
* Used for wallet authentication in SDK and MCP tools
|
|
132
|
+
*/
|
|
133
|
+
export declare const privateKeySchema: z.ZodString;
|
|
134
|
+
/**
|
|
135
|
+
* Transaction ID schema - UUID format
|
|
136
|
+
* Used for tracking bundler transactions in MCP tools
|
|
137
|
+
*/
|
|
138
|
+
export declare const transactionIdSchema: z.ZodString;
|
|
139
|
+
/**
|
|
140
|
+
* Unique key schema - idempotency key for transfers
|
|
141
|
+
* Format: galaconnect-operation-{unique-id}
|
|
142
|
+
*/
|
|
143
|
+
export declare const uniqueKeySchema: z.ZodString;
|
|
144
|
+
//# sourceMappingURL=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EG;AACH,eAAO,MAAM,gBAAgB,2BAAwB,CAAC;AAMtD;;GAEG;AACH,eAAO,MAAM,cAAc,aAI0B,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,cAAc,aAE2B,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,mBAAmB,iGAO9B,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,oBAAoB,aAGoB,CAAC;AAMtD;;GAEG;AACH,eAAO,MAAM,mBAAmB,aAEmB,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,eAAe,aAGe,CAAC;AAM5C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,aAEwD,CAAC;AAEtF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,aAK7B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,eAAe,aAKzB,CAAC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trade Operation Zod Schemas
|
|
3
|
+
*
|
|
4
|
+
* Validation schemas for trading operations including buy/sell,
|
|
5
|
+
* amount calculations, and trade history queries.
|
|
6
|
+
* Replaces manual TRADE_CONSTRAINTS with type-safe Zod schemas.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
/**
|
|
10
|
+
* Trade type schema - 'buy' or 'sell'
|
|
11
|
+
*/
|
|
12
|
+
export declare const tradeTypeSchema: z.ZodEnum<["buy", "sell"]>;
|
|
13
|
+
/**
|
|
14
|
+
* Trade type enum for backend - uppercase 'BUY' or 'SELL'
|
|
15
|
+
*/
|
|
16
|
+
export declare const tradeTypeBackendSchema: z.ZodEnum<["BUY", "SELL"]>;
|
|
17
|
+
/**
|
|
18
|
+
* Create trade data schema
|
|
19
|
+
* For legacy trade creation endpoints
|
|
20
|
+
*/
|
|
21
|
+
export declare const createTradeDataSchema: z.ZodObject<{
|
|
22
|
+
tradeType: z.ZodEnum<["buy", "sell"]>;
|
|
23
|
+
tokenAmount: z.ZodEffects<z.ZodString, string, string>;
|
|
24
|
+
vaultAddress: z.ZodEffects<z.ZodString, string, string>;
|
|
25
|
+
userAddress: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
26
|
+
slippageTolerance: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
27
|
+
deadline: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
userAddress: string;
|
|
30
|
+
tradeType: "buy" | "sell";
|
|
31
|
+
tokenAmount: string;
|
|
32
|
+
vaultAddress: string;
|
|
33
|
+
slippageTolerance?: string | undefined;
|
|
34
|
+
deadline?: number | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
userAddress: string;
|
|
37
|
+
tradeType: "buy" | "sell";
|
|
38
|
+
tokenAmount: string;
|
|
39
|
+
vaultAddress: string;
|
|
40
|
+
slippageTolerance?: string | undefined;
|
|
41
|
+
deadline?: number | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Buy tokens data schema
|
|
45
|
+
* For buying launchpad tokens with GALA
|
|
46
|
+
*/
|
|
47
|
+
export declare const buyTokensDataSchema: z.ZodObject<{
|
|
48
|
+
tokenSymbol: z.ZodString;
|
|
49
|
+
nativeTokenQuantity: z.ZodEffects<z.ZodString, string, string>;
|
|
50
|
+
expectedToken: z.ZodEffects<z.ZodString, string, string>;
|
|
51
|
+
maxAcceptableReverseBondingCurveFee: z.ZodOptional<z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
tokenSymbol: string;
|
|
54
|
+
nativeTokenQuantity: string;
|
|
55
|
+
expectedToken: string;
|
|
56
|
+
maxAcceptableReverseBondingCurveFee?: string | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
tokenSymbol: string;
|
|
59
|
+
nativeTokenQuantity: string;
|
|
60
|
+
expectedToken: string;
|
|
61
|
+
maxAcceptableReverseBondingCurveFee?: string | undefined;
|
|
62
|
+
}>;
|
|
63
|
+
/**
|
|
64
|
+
* Sell tokens data schema
|
|
65
|
+
* For selling launchpad tokens for GALA
|
|
66
|
+
*/
|
|
67
|
+
export declare const sellTokensDataSchema: z.ZodObject<{
|
|
68
|
+
tokenSymbol: z.ZodString;
|
|
69
|
+
tokenQuantity: z.ZodEffects<z.ZodString, string, string>;
|
|
70
|
+
expectedNativeToken: z.ZodEffects<z.ZodString, string, string>;
|
|
71
|
+
maxAcceptableReverseBondingCurveFee: z.ZodOptional<z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
tokenSymbol: string;
|
|
74
|
+
tokenQuantity: string;
|
|
75
|
+
expectedNativeToken: string;
|
|
76
|
+
maxAcceptableReverseBondingCurveFee?: string | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
tokenSymbol: string;
|
|
79
|
+
tokenQuantity: string;
|
|
80
|
+
expectedNativeToken: string;
|
|
81
|
+
maxAcceptableReverseBondingCurveFee?: string | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
/**
|
|
84
|
+
* Get trade options schema
|
|
85
|
+
* Basic trade query with optional token name filter
|
|
86
|
+
*/
|
|
87
|
+
export declare const getTradeOptionsSchema: z.ZodObject<{
|
|
88
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
89
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
90
|
+
} & {
|
|
91
|
+
tokenName: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
page: number;
|
|
94
|
+
limit: number;
|
|
95
|
+
tokenName?: string | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
page?: number | undefined;
|
|
98
|
+
limit?: number | undefined;
|
|
99
|
+
tokenName?: string | undefined;
|
|
100
|
+
}>;
|
|
101
|
+
/**
|
|
102
|
+
* Trade list params schema
|
|
103
|
+
* Simplified pagination-only params
|
|
104
|
+
*/
|
|
105
|
+
export declare const tradeListParamsSchema: z.ZodObject<{
|
|
106
|
+
page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
107
|
+
limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
page?: number | undefined;
|
|
110
|
+
limit?: number | undefined;
|
|
111
|
+
}, {
|
|
112
|
+
page?: number | undefined;
|
|
113
|
+
limit?: number | undefined;
|
|
114
|
+
}>;
|
|
115
|
+
/**
|
|
116
|
+
* Trade calculation type schema
|
|
117
|
+
* NATIVE = GALA input/output, MEME = launchpad token input/output
|
|
118
|
+
*/
|
|
119
|
+
export declare const tradeCalculationTypeSchema: z.ZodEnum<["NATIVE", "MEME"]>;
|
|
120
|
+
/**
|
|
121
|
+
* Trade calculation method schema
|
|
122
|
+
* IN = amount going into pool, OUT = amount coming out of pool
|
|
123
|
+
*/
|
|
124
|
+
export declare const tradeCalculationMethodSchema: z.ZodEnum<["IN", "OUT"]>;
|
|
125
|
+
/**
|
|
126
|
+
* Get amount options schema
|
|
127
|
+
* For calculating trade amounts with bonding curve
|
|
128
|
+
*/
|
|
129
|
+
export declare const getAmountOptionsSchema: z.ZodObject<{
|
|
130
|
+
type: z.ZodEnum<["NATIVE", "MEME"]>;
|
|
131
|
+
method: z.ZodEnum<["IN", "OUT"]>;
|
|
132
|
+
vaultAddress: z.ZodEffects<z.ZodString, string, string>;
|
|
133
|
+
amount: z.ZodEffects<z.ZodString, string, string>;
|
|
134
|
+
}, "strip", z.ZodTypeAny, {
|
|
135
|
+
method: "IN" | "OUT";
|
|
136
|
+
type: "NATIVE" | "MEME";
|
|
137
|
+
amount: string;
|
|
138
|
+
vaultAddress: string;
|
|
139
|
+
}, {
|
|
140
|
+
method: "IN" | "OUT";
|
|
141
|
+
type: "NATIVE" | "MEME";
|
|
142
|
+
amount: string;
|
|
143
|
+
vaultAddress: string;
|
|
144
|
+
}>;
|
|
145
|
+
/**
|
|
146
|
+
* Calculate pre-mint data schema
|
|
147
|
+
* For calculating initial token purchase amounts during creation
|
|
148
|
+
*/
|
|
149
|
+
export declare const calculatePreMintDataSchema: z.ZodObject<{
|
|
150
|
+
nativeTokenQuantity: z.ZodEffects<z.ZodString, string, string>;
|
|
151
|
+
}, "strip", z.ZodTypeAny, {
|
|
152
|
+
nativeTokenQuantity: string;
|
|
153
|
+
}, {
|
|
154
|
+
nativeTokenQuantity: string;
|
|
155
|
+
}>;
|
|
156
|
+
/**
|
|
157
|
+
* Fetch pool details data schema
|
|
158
|
+
*/
|
|
159
|
+
export declare const fetchPoolDetailsDataSchema: z.ZodObject<{
|
|
160
|
+
vaultAddress: z.ZodEffects<z.ZodString, string, string>;
|
|
161
|
+
}, "strip", z.ZodTypeAny, {
|
|
162
|
+
vaultAddress: string;
|
|
163
|
+
}, {
|
|
164
|
+
vaultAddress: string;
|
|
165
|
+
}>;
|
|
166
|
+
/**
|
|
167
|
+
* Reverse bonding curve configuration schema
|
|
168
|
+
*/
|
|
169
|
+
export declare const reverseBondingCurveConfigurationSchema: z.ZodObject<{
|
|
170
|
+
minFeePortion: z.ZodEffects<z.ZodString, string, string>;
|
|
171
|
+
maxFeePortion: z.ZodEffects<z.ZodString, string, string>;
|
|
172
|
+
}, "strip", z.ZodTypeAny, {
|
|
173
|
+
minFeePortion: string;
|
|
174
|
+
maxFeePortion: string;
|
|
175
|
+
}, {
|
|
176
|
+
minFeePortion: string;
|
|
177
|
+
maxFeePortion: string;
|
|
178
|
+
}>;
|
|
179
|
+
export type TradeType = z.infer<typeof tradeTypeSchema>;
|
|
180
|
+
export type TradeTypeBackend = z.infer<typeof tradeTypeBackendSchema>;
|
|
181
|
+
export type CreateTradeData = z.infer<typeof createTradeDataSchema>;
|
|
182
|
+
export type BuyTokensData = z.infer<typeof buyTokensDataSchema>;
|
|
183
|
+
export type SellTokensData = z.infer<typeof sellTokensDataSchema>;
|
|
184
|
+
export type GetTradeOptions = z.infer<typeof getTradeOptionsSchema>;
|
|
185
|
+
export type TradeListParams = z.infer<typeof tradeListParamsSchema>;
|
|
186
|
+
export type TradeCalculationType = z.infer<typeof tradeCalculationTypeSchema>;
|
|
187
|
+
export type TradeCalculationMethod = z.infer<typeof tradeCalculationMethodSchema>;
|
|
188
|
+
export type GetAmountOptions = z.infer<typeof getAmountOptionsSchema>;
|
|
189
|
+
export type CalculatePreMintData = z.infer<typeof calculatePreMintDataSchema>;
|
|
190
|
+
export type FetchPoolDetailsData = z.infer<typeof fetchPoolDetailsDataSchema>;
|
|
191
|
+
export type ReverseBondingCurveConfiguration = z.infer<typeof reverseBondingCurveConfigurationSchema>;
|
|
192
|
+
//# sourceMappingURL=trade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trade.d.ts","sourceRoot":"","sources":["../../src/schemas/trade.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB;;GAEG;AACH,eAAO,MAAM,eAAe,4BAA0B,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,sBAAsB,4BAA0B,CAAC;AAM9D;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;EAOhC,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;EAO9B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAO/B,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;EAEhC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,0BAA0B,+BAA6B,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,4BAA4B,0BAAwB,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;EAKjC,CAAC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AAC,CAAC"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Operation Zod Schemas
|
|
3
|
+
*
|
|
4
|
+
* Validation schemas for user-related operations including token lists,
|
|
5
|
+
* profiles, balances, and faucet transfers.
|
|
6
|
+
* Replaces manual USER_CONSTRAINTS with type-safe Zod schemas.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
/**
|
|
10
|
+
* User token type schema
|
|
11
|
+
*/
|
|
12
|
+
export declare const userTokenTypeSchema: z.ZodEnum<["all", "DEFI", "ASSET"]>;
|
|
13
|
+
/**
|
|
14
|
+
* Token list options schema
|
|
15
|
+
* Includes pagination, type filter, address filter, search, and token name
|
|
16
|
+
*/
|
|
17
|
+
export declare const tokenListOptionsSchema: z.ZodObject<{
|
|
18
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
19
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
20
|
+
} & {
|
|
21
|
+
type: z.ZodOptional<z.ZodEnum<["all", "DEFI", "ASSET"]>>;
|
|
22
|
+
address: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
23
|
+
search: z.ZodOptional<z.ZodString>;
|
|
24
|
+
tokenName: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
page: number;
|
|
27
|
+
limit: number;
|
|
28
|
+
address?: string | undefined;
|
|
29
|
+
type?: "all" | "DEFI" | "ASSET" | undefined;
|
|
30
|
+
tokenName?: string | undefined;
|
|
31
|
+
search?: string | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
address?: string | undefined;
|
|
34
|
+
page?: number | undefined;
|
|
35
|
+
limit?: number | undefined;
|
|
36
|
+
type?: "all" | "DEFI" | "ASSET" | undefined;
|
|
37
|
+
tokenName?: string | undefined;
|
|
38
|
+
search?: string | undefined;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Transfer faucets data schema
|
|
42
|
+
* For transferring test tokens to a wallet
|
|
43
|
+
*/
|
|
44
|
+
export declare const transferFaucetsDataSchema: z.ZodObject<{
|
|
45
|
+
walletAddress: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
46
|
+
amount: z.ZodString;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
walletAddress: string;
|
|
49
|
+
amount: string;
|
|
50
|
+
}, {
|
|
51
|
+
walletAddress: string;
|
|
52
|
+
amount: string;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Fetch GALA balance options schema
|
|
56
|
+
*/
|
|
57
|
+
export declare const fetchGalaBalanceOptionsSchema: z.ZodObject<{
|
|
58
|
+
address: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
59
|
+
refresh: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
address?: string | undefined;
|
|
62
|
+
refresh?: boolean | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
address?: string | undefined;
|
|
65
|
+
refresh?: boolean | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
/**
|
|
68
|
+
* Update profile data schema
|
|
69
|
+
*/
|
|
70
|
+
export declare const updateProfileDataSchema: z.ZodObject<{
|
|
71
|
+
profileImage: z.ZodString;
|
|
72
|
+
fullName: z.ZodString;
|
|
73
|
+
address: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
74
|
+
privateKey: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
address: string;
|
|
77
|
+
profileImage: string;
|
|
78
|
+
fullName: string;
|
|
79
|
+
privateKey?: string | undefined;
|
|
80
|
+
}, {
|
|
81
|
+
address: string;
|
|
82
|
+
profileImage: string;
|
|
83
|
+
fullName: string;
|
|
84
|
+
privateKey?: string | undefined;
|
|
85
|
+
}>;
|
|
86
|
+
/**
|
|
87
|
+
* Upload profile image options schema
|
|
88
|
+
*/
|
|
89
|
+
export declare const uploadProfileImageOptionsSchema: z.ZodObject<{
|
|
90
|
+
file: z.ZodUnion<[z.ZodType<File, z.ZodTypeDef, File>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>]>;
|
|
91
|
+
address: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
92
|
+
privateKey: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
file: File | Buffer<ArrayBufferLike>;
|
|
95
|
+
address?: string | undefined;
|
|
96
|
+
privateKey?: string | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
file: File | Buffer<ArrayBufferLike>;
|
|
99
|
+
address?: string | undefined;
|
|
100
|
+
privateKey?: string | undefined;
|
|
101
|
+
}>;
|
|
102
|
+
/**
|
|
103
|
+
* Fetch token balance options schema
|
|
104
|
+
* Supports flexible token identification via tokenId, tokenClassKey, or tokenName
|
|
105
|
+
*/
|
|
106
|
+
export declare const fetchTokenBalanceOptionsSchema: z.ZodEffects<z.ZodObject<{
|
|
107
|
+
address: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
108
|
+
tokenId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
109
|
+
collection: z.ZodString;
|
|
110
|
+
category: z.ZodString;
|
|
111
|
+
type: z.ZodString;
|
|
112
|
+
additionalKey: z.ZodString;
|
|
113
|
+
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
type: string;
|
|
115
|
+
collection: string;
|
|
116
|
+
category: string;
|
|
117
|
+
additionalKey: string;
|
|
118
|
+
}, {
|
|
119
|
+
type: string;
|
|
120
|
+
collection: string;
|
|
121
|
+
category: string;
|
|
122
|
+
additionalKey: string;
|
|
123
|
+
}>, z.ZodObject<{
|
|
124
|
+
collection: z.ZodString;
|
|
125
|
+
category: z.ZodString;
|
|
126
|
+
type: z.ZodString;
|
|
127
|
+
additionalKey: z.ZodString;
|
|
128
|
+
instance: z.ZodString;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
type: string;
|
|
131
|
+
collection: string;
|
|
132
|
+
category: string;
|
|
133
|
+
additionalKey: string;
|
|
134
|
+
instance: string;
|
|
135
|
+
}, {
|
|
136
|
+
type: string;
|
|
137
|
+
collection: string;
|
|
138
|
+
category: string;
|
|
139
|
+
additionalKey: string;
|
|
140
|
+
instance: string;
|
|
141
|
+
}>]>>;
|
|
142
|
+
tokenClassKey: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
collection: z.ZodString;
|
|
144
|
+
category: z.ZodString;
|
|
145
|
+
type: z.ZodString;
|
|
146
|
+
additionalKey: z.ZodString;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
type: string;
|
|
149
|
+
collection: string;
|
|
150
|
+
category: string;
|
|
151
|
+
additionalKey: string;
|
|
152
|
+
}, {
|
|
153
|
+
type: string;
|
|
154
|
+
collection: string;
|
|
155
|
+
category: string;
|
|
156
|
+
additionalKey: string;
|
|
157
|
+
}>>;
|
|
158
|
+
tokenName: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
|
160
|
+
address: string;
|
|
161
|
+
tokenName?: string | undefined;
|
|
162
|
+
tokenId?: string | {
|
|
163
|
+
type: string;
|
|
164
|
+
collection: string;
|
|
165
|
+
category: string;
|
|
166
|
+
additionalKey: string;
|
|
167
|
+
} | {
|
|
168
|
+
type: string;
|
|
169
|
+
collection: string;
|
|
170
|
+
category: string;
|
|
171
|
+
additionalKey: string;
|
|
172
|
+
instance: string;
|
|
173
|
+
} | undefined;
|
|
174
|
+
tokenClassKey?: {
|
|
175
|
+
type: string;
|
|
176
|
+
collection: string;
|
|
177
|
+
category: string;
|
|
178
|
+
additionalKey: string;
|
|
179
|
+
} | undefined;
|
|
180
|
+
}, {
|
|
181
|
+
address: string;
|
|
182
|
+
tokenName?: string | undefined;
|
|
183
|
+
tokenId?: string | {
|
|
184
|
+
type: string;
|
|
185
|
+
collection: string;
|
|
186
|
+
category: string;
|
|
187
|
+
additionalKey: string;
|
|
188
|
+
} | {
|
|
189
|
+
type: string;
|
|
190
|
+
collection: string;
|
|
191
|
+
category: string;
|
|
192
|
+
additionalKey: string;
|
|
193
|
+
instance: string;
|
|
194
|
+
} | undefined;
|
|
195
|
+
tokenClassKey?: {
|
|
196
|
+
type: string;
|
|
197
|
+
collection: string;
|
|
198
|
+
category: string;
|
|
199
|
+
additionalKey: string;
|
|
200
|
+
} | undefined;
|
|
201
|
+
}>, {
|
|
202
|
+
address: string;
|
|
203
|
+
tokenName?: string | undefined;
|
|
204
|
+
tokenId?: string | {
|
|
205
|
+
type: string;
|
|
206
|
+
collection: string;
|
|
207
|
+
category: string;
|
|
208
|
+
additionalKey: string;
|
|
209
|
+
} | {
|
|
210
|
+
type: string;
|
|
211
|
+
collection: string;
|
|
212
|
+
category: string;
|
|
213
|
+
additionalKey: string;
|
|
214
|
+
instance: string;
|
|
215
|
+
} | undefined;
|
|
216
|
+
tokenClassKey?: {
|
|
217
|
+
type: string;
|
|
218
|
+
collection: string;
|
|
219
|
+
category: string;
|
|
220
|
+
additionalKey: string;
|
|
221
|
+
} | undefined;
|
|
222
|
+
}, {
|
|
223
|
+
address: string;
|
|
224
|
+
tokenName?: string | undefined;
|
|
225
|
+
tokenId?: string | {
|
|
226
|
+
type: string;
|
|
227
|
+
collection: string;
|
|
228
|
+
category: string;
|
|
229
|
+
additionalKey: string;
|
|
230
|
+
} | {
|
|
231
|
+
type: string;
|
|
232
|
+
collection: string;
|
|
233
|
+
category: string;
|
|
234
|
+
additionalKey: string;
|
|
235
|
+
instance: string;
|
|
236
|
+
} | undefined;
|
|
237
|
+
tokenClassKey?: {
|
|
238
|
+
type: string;
|
|
239
|
+
collection: string;
|
|
240
|
+
category: string;
|
|
241
|
+
additionalKey: string;
|
|
242
|
+
} | undefined;
|
|
243
|
+
}>;
|
|
244
|
+
export type UserTokenType = z.infer<typeof userTokenTypeSchema>;
|
|
245
|
+
export type TokenListOptions = z.infer<typeof tokenListOptionsSchema>;
|
|
246
|
+
export type TransferFaucetsData = z.infer<typeof transferFaucetsDataSchema>;
|
|
247
|
+
export type FetchGalaBalanceOptions = z.infer<typeof fetchGalaBalanceOptionsSchema>;
|
|
248
|
+
export type UpdateProfileData = z.infer<typeof updateProfileDataSchema>;
|
|
249
|
+
export type UploadProfileImageOptions = z.infer<typeof uploadProfileImageOptionsSchema>;
|
|
250
|
+
export type FetchTokenBalanceOptions = z.infer<typeof fetchTokenBalanceOptionsSchema>;
|
|
251
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/schemas/user.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB;;GAEG;AACH,eAAO,MAAM,mBAAmB,qCAAmC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;EAKjC,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;EAGpC,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;EAGxC,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAKlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;EAO1C,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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