@gala-chain/launchpad-sdk 3.5.3 → 3.6.1
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/schemas/validators.d.ts +130 -32
- package/dist/schemas/validators.d.ts.map +1 -1
- package/dist/services/BundleService.d.ts.map +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/error-factories.d.ts +95 -0
- package/dist/utils/error-factories.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-handlers.d.ts +96 -0
- package/dist/utils/response-handlers.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
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
* Type-safe validation functions that replace manual type guards.
|
|
5
5
|
* These provide clean, backward-compatible wrappers around Zod schemas.
|
|
6
6
|
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
import { launchTokenDataSchema, tokenUrlsSchema, imageUploadOptionsSchema, checkPoolOptionsSchema } from './launchpad.js';
|
|
9
|
-
import { tokenListOptionsSchema, transferFaucetsDataSchema, fetchGalaBalanceOptionsSchema, updateProfileDataSchema, uploadProfileImageOptionsSchema, fetchTokenBalanceOptionsSchema } from './user.js';
|
|
10
|
-
import { createTradeDataSchema, buyTokensDataSchema, sellTokensDataSchema, getTradeOptionsSchema, tradeListParamsSchema, getAmountOptionsSchema, calculatePreMintDataSchema, fetchPoolDetailsDataSchema } from './trade.js';
|
|
11
7
|
/**
|
|
12
8
|
* Standard validation result
|
|
13
9
|
*
|
|
@@ -102,142 +98,244 @@ export interface ValidationResult<T> {
|
|
|
102
98
|
* Validates token name format
|
|
103
99
|
* Replaces: isValidTokenName()
|
|
104
100
|
*/
|
|
105
|
-
export declare
|
|
101
|
+
export declare const validateTokenName: (value: unknown) => ValidationResult<string>;
|
|
106
102
|
/**
|
|
107
103
|
* Validates token symbol format
|
|
108
104
|
* Replaces: isValidTokenSymbol()
|
|
109
105
|
*/
|
|
110
|
-
export declare
|
|
106
|
+
export declare const validateTokenSymbol: (value: unknown) => ValidationResult<string>;
|
|
111
107
|
/**
|
|
112
108
|
* Validates token description
|
|
113
109
|
* Replaces: isValidTokenDescription()
|
|
114
110
|
*/
|
|
115
|
-
export declare
|
|
111
|
+
export declare const validateTokenDescription: (value: unknown) => ValidationResult<string>;
|
|
116
112
|
/**
|
|
117
113
|
* Validates and normalizes address format
|
|
118
114
|
* Accepts both 0x... and eth|... formats, outputs eth|... format
|
|
119
115
|
* Replaces: isValidUserAddress(), normalizeAddressInput()
|
|
120
116
|
*/
|
|
121
|
-
export declare
|
|
117
|
+
export declare const validateAddress: (value: unknown) => ValidationResult<string>;
|
|
122
118
|
/**
|
|
123
119
|
* Validates vault address format
|
|
124
120
|
* Supports both eth| and service| formats
|
|
125
121
|
* Replaces: isValidVaultAddress()
|
|
126
122
|
*/
|
|
127
|
-
export declare
|
|
123
|
+
export declare const validateVaultAddress: (value: unknown) => ValidationResult<string>;
|
|
128
124
|
/**
|
|
129
125
|
* Validates positive decimal string
|
|
130
126
|
* Replaces: isValidAmountString()
|
|
131
127
|
*/
|
|
132
|
-
export declare
|
|
128
|
+
export declare const validateAmountString: (value: unknown) => ValidationResult<string>;
|
|
133
129
|
/**
|
|
134
130
|
* Validates faucet amount (positive, non-zero)
|
|
135
131
|
* Replaces: isValidFaucetAmount()
|
|
136
132
|
*/
|
|
137
|
-
export declare
|
|
133
|
+
export declare const validateFaucetAmount: (value: unknown) => ValidationResult<string>;
|
|
138
134
|
/**
|
|
139
135
|
* Validates full name format
|
|
140
136
|
* Replaces: isValidFullName()
|
|
141
137
|
*/
|
|
142
|
-
export declare
|
|
138
|
+
export declare const validateFullName: (value: unknown) => ValidationResult<string>;
|
|
143
139
|
/**
|
|
144
140
|
* Validates search query
|
|
145
141
|
* Replaces: isValidSearchQuery()
|
|
146
142
|
*/
|
|
147
|
-
export declare
|
|
143
|
+
export declare const validateSearchQuery: (value: unknown) => ValidationResult<string>;
|
|
148
144
|
/**
|
|
149
145
|
* Validates user token name (more permissive than creation token name)
|
|
150
146
|
* Replaces: isValidUserTokenName()
|
|
151
147
|
*/
|
|
152
|
-
export declare
|
|
148
|
+
export declare const validateUserTokenName: (value: unknown) => ValidationResult<string>;
|
|
153
149
|
/**
|
|
154
150
|
* Validates launch token data
|
|
155
151
|
* Replaces: isLaunchTokenData()
|
|
156
152
|
*/
|
|
157
|
-
export declare
|
|
153
|
+
export declare const validateLaunchTokenData: (value: unknown) => ValidationResult<{
|
|
154
|
+
tokenName: string;
|
|
155
|
+
tokenSymbol: string;
|
|
156
|
+
tokenDescription: string;
|
|
157
|
+
websiteUrl?: string | undefined;
|
|
158
|
+
telegramUrl?: string | undefined;
|
|
159
|
+
twitterUrl?: string | undefined;
|
|
160
|
+
tokenImage?: string | File | Buffer<ArrayBufferLike> | undefined;
|
|
161
|
+
preBuyQuantity?: string | undefined;
|
|
162
|
+
tokenCategory?: string | undefined;
|
|
163
|
+
tokenCollection?: string | undefined;
|
|
164
|
+
reverseBondingCurveConfiguration?: {
|
|
165
|
+
minFeePortion: string;
|
|
166
|
+
maxFeePortion: string;
|
|
167
|
+
} | undefined;
|
|
168
|
+
privateKey?: string | undefined;
|
|
169
|
+
}>;
|
|
158
170
|
/**
|
|
159
171
|
* Validates token social URLs
|
|
160
172
|
* Replaces manual URL validation
|
|
161
173
|
*/
|
|
162
|
-
export declare
|
|
174
|
+
export declare const validateTokenUrls: (value: unknown) => ValidationResult<{
|
|
175
|
+
websiteUrl?: string | undefined;
|
|
176
|
+
telegramUrl?: string | undefined;
|
|
177
|
+
twitterUrl?: string | undefined;
|
|
178
|
+
}>;
|
|
163
179
|
/**
|
|
164
180
|
* Validates image upload options
|
|
165
181
|
* Replaces: isImageUploadOptions()
|
|
166
182
|
*/
|
|
167
|
-
export declare
|
|
183
|
+
export declare const validateImageUploadOptions: (value: unknown) => ValidationResult<{
|
|
184
|
+
tokenName: string;
|
|
185
|
+
file: File | Buffer<ArrayBufferLike>;
|
|
186
|
+
}>;
|
|
168
187
|
/**
|
|
169
188
|
* Validates check pool options
|
|
170
189
|
* Replaces: isCheckPoolOptions()
|
|
171
190
|
*/
|
|
172
|
-
export declare
|
|
191
|
+
export declare const validateCheckPoolOptions: (value: unknown) => ValidationResult<{
|
|
192
|
+
symbol?: string | undefined;
|
|
193
|
+
tokenName?: string | undefined;
|
|
194
|
+
}>;
|
|
173
195
|
/**
|
|
174
196
|
* Validates token list options
|
|
175
197
|
* Replaces: isGetTokenListOptions()
|
|
176
198
|
*/
|
|
177
|
-
export declare
|
|
199
|
+
export declare const validateTokenListOptions: (value: unknown) => ValidationResult<{
|
|
200
|
+
address?: string | undefined;
|
|
201
|
+
page?: number | undefined;
|
|
202
|
+
limit?: number | undefined;
|
|
203
|
+
type?: "all" | "DEFI" | "ASSET" | undefined;
|
|
204
|
+
tokenName?: string | undefined;
|
|
205
|
+
search?: string | undefined;
|
|
206
|
+
}>;
|
|
178
207
|
/**
|
|
179
208
|
* Validates transfer faucets data
|
|
180
209
|
* Replaces: isTransferFaucetsData()
|
|
181
210
|
*/
|
|
182
|
-
export declare
|
|
211
|
+
export declare const validateTransferFaucetsData: (value: unknown) => ValidationResult<{
|
|
212
|
+
walletAddress: string;
|
|
213
|
+
amount: string;
|
|
214
|
+
}>;
|
|
183
215
|
/**
|
|
184
216
|
* Validates fetch GALA balance options
|
|
185
217
|
* Replaces: isFetchGalaBalanceOptions()
|
|
186
218
|
*/
|
|
187
|
-
export declare
|
|
219
|
+
export declare const validateFetchGalaBalanceOptions: (value: unknown) => ValidationResult<{
|
|
220
|
+
address?: string | undefined;
|
|
221
|
+
refresh?: boolean | undefined;
|
|
222
|
+
}>;
|
|
188
223
|
/**
|
|
189
224
|
* Validates update profile data
|
|
190
225
|
* Replaces: isUpdateProfileData()
|
|
191
226
|
*/
|
|
192
|
-
export declare
|
|
227
|
+
export declare const validateUpdateProfileData: (value: unknown) => ValidationResult<{
|
|
228
|
+
address: string;
|
|
229
|
+
profileImage: string;
|
|
230
|
+
fullName: string;
|
|
231
|
+
privateKey?: string | undefined;
|
|
232
|
+
}>;
|
|
193
233
|
/**
|
|
194
234
|
* Validates upload profile image options
|
|
195
235
|
* Replaces: isUploadProfileImageOptions()
|
|
196
236
|
*/
|
|
197
|
-
export declare
|
|
237
|
+
export declare const validateUploadProfileImageOptions: (value: unknown) => ValidationResult<{
|
|
238
|
+
file: File | Buffer<ArrayBufferLike>;
|
|
239
|
+
address?: string | undefined;
|
|
240
|
+
privateKey?: string | undefined;
|
|
241
|
+
}>;
|
|
198
242
|
/**
|
|
199
243
|
* Validates fetch token balance options
|
|
200
244
|
* Replaces: isFetchTokenBalanceOptions()
|
|
201
245
|
*/
|
|
202
|
-
export declare
|
|
246
|
+
export declare const validateFetchTokenBalanceOptions: (value: unknown) => ValidationResult<{
|
|
247
|
+
address: string;
|
|
248
|
+
tokenName?: string | undefined;
|
|
249
|
+
tokenId?: string | {
|
|
250
|
+
type: string;
|
|
251
|
+
collection: string;
|
|
252
|
+
category: string;
|
|
253
|
+
additionalKey: string;
|
|
254
|
+
} | {
|
|
255
|
+
type: string;
|
|
256
|
+
collection: string;
|
|
257
|
+
category: string;
|
|
258
|
+
additionalKey: string;
|
|
259
|
+
instance: string;
|
|
260
|
+
} | undefined;
|
|
261
|
+
tokenClassKey?: {
|
|
262
|
+
type: string;
|
|
263
|
+
collection: string;
|
|
264
|
+
category: string;
|
|
265
|
+
additionalKey: string;
|
|
266
|
+
} | undefined;
|
|
267
|
+
}>;
|
|
203
268
|
/**
|
|
204
269
|
* Validates create trade data
|
|
205
270
|
* Replaces: isCreateTradeData()
|
|
206
271
|
*/
|
|
207
|
-
export declare
|
|
272
|
+
export declare const validateCreateTradeData: (value: unknown) => ValidationResult<{
|
|
273
|
+
userAddress: string;
|
|
274
|
+
tradeType: "buy" | "sell";
|
|
275
|
+
tokenAmount: string;
|
|
276
|
+
vaultAddress: string;
|
|
277
|
+
slippageTolerance?: string | undefined;
|
|
278
|
+
deadline?: number | undefined;
|
|
279
|
+
}>;
|
|
208
280
|
/**
|
|
209
281
|
* Validates buy tokens data
|
|
210
282
|
* Replaces: isBuyTokensData()
|
|
211
283
|
*/
|
|
212
|
-
export declare
|
|
284
|
+
export declare const validateBuyTokensData: (value: unknown) => ValidationResult<{
|
|
285
|
+
tokenSymbol: string;
|
|
286
|
+
nativeTokenQuantity: string;
|
|
287
|
+
expectedToken: string;
|
|
288
|
+
maxAcceptableReverseBondingCurveFee?: string | undefined;
|
|
289
|
+
}>;
|
|
213
290
|
/**
|
|
214
291
|
* Validates sell tokens data
|
|
215
292
|
* Replaces: isSellTokensData()
|
|
216
293
|
*/
|
|
217
|
-
export declare
|
|
294
|
+
export declare const validateSellTokensData: (value: unknown) => ValidationResult<{
|
|
295
|
+
tokenSymbol: string;
|
|
296
|
+
tokenQuantity: string;
|
|
297
|
+
expectedNativeToken: string;
|
|
298
|
+
maxAcceptableReverseBondingCurveFee?: string | undefined;
|
|
299
|
+
}>;
|
|
218
300
|
/**
|
|
219
301
|
* Validates get trade options
|
|
220
302
|
* Replaces: isGetTradeOptions()
|
|
221
303
|
*/
|
|
222
|
-
export declare
|
|
304
|
+
export declare const validateGetTradeOptions: (value: unknown) => ValidationResult<{
|
|
305
|
+
page?: number | undefined;
|
|
306
|
+
limit?: number | undefined;
|
|
307
|
+
tokenName?: string | undefined;
|
|
308
|
+
}>;
|
|
223
309
|
/**
|
|
224
310
|
* Validates trade list params
|
|
225
311
|
* Replaces: isTradeListParams()
|
|
226
312
|
*/
|
|
227
|
-
export declare
|
|
313
|
+
export declare const validateTradeListParams: (value: unknown) => ValidationResult<{
|
|
314
|
+
page?: number | undefined;
|
|
315
|
+
limit?: number | undefined;
|
|
316
|
+
}>;
|
|
228
317
|
/**
|
|
229
318
|
* Validates get amount options
|
|
230
319
|
* Replaces: isGetAmountOptions()
|
|
231
320
|
*/
|
|
232
|
-
export declare
|
|
321
|
+
export declare const validateGetAmountOptions: (value: unknown) => ValidationResult<{
|
|
322
|
+
method: "IN" | "OUT";
|
|
323
|
+
type: "NATIVE" | "MEME";
|
|
324
|
+
amount: string;
|
|
325
|
+
vaultAddress: string;
|
|
326
|
+
}>;
|
|
233
327
|
/**
|
|
234
328
|
* Validates calculate pre-mint data
|
|
235
329
|
* Replaces: isCalculatePreMintData()
|
|
236
330
|
*/
|
|
237
|
-
export declare
|
|
331
|
+
export declare const validateCalculatePreMintData: (value: unknown) => ValidationResult<{
|
|
332
|
+
nativeTokenQuantity: string;
|
|
333
|
+
}>;
|
|
238
334
|
/**
|
|
239
335
|
* Validates fetch pool details data
|
|
240
336
|
* Replaces: isFetchPoolDetailsData()
|
|
241
337
|
*/
|
|
242
|
-
export declare
|
|
338
|
+
export declare const validateFetchPoolDetailsData: (value: unknown) => ValidationResult<{
|
|
339
|
+
vaultAddress: string;
|
|
340
|
+
}>;
|
|
243
341
|
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/schemas/validators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/schemas/validators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiDH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,qDAAqD;IACrD,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC;IACpB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CAC9B;AA6CD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,UAlBb,OAAO,6BAkByC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UAxBf,OAAO,6BAwB6C,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,UA9BpB,OAAO,6BA8BuD,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,eAAe,UArCX,OAAO,6BAqC6C,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,UA5ChB,OAAO,6BA4C+C,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,UAlDhB,OAAO,6BAkDwD,CAAC;AAEjF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,UAxDhB,OAAO,6BAwD+C,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UA9DZ,OAAO,6BA8DuC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UApEf,OAAO,6BAoE6C,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,UA1EjB,OAAO,6BA0EiD,CAAC;AAM1E;;;GAGG;AACH,eAAO,MAAM,uBAAuB,UApFnB,OAAO;;;;;;;;;;;;;;;;EAoFqD,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,iBAAiB,UA1Fb,OAAO;;;;EA0FyC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,0BAA0B,UAhGtB,OAAO;;;EAgG2D,CAAC;AAEpF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,UAtGpB,OAAO;;;EAsGuD,CAAC;AAMhF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,UAhHpB,OAAO;;;;;;;EAgHuD,CAAC;AAEhF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,UAtHvB,OAAO;;;EAsH6D,CAAC;AAEtF;;;GAGG;AACH,eAAO,MAAM,+BAA+B,UA5H3B,OAAO;;;EA4HqE,CAAC;AAE9F;;;GAGG;AACH,eAAO,MAAM,yBAAyB,UAlIrB,OAAO;;;;;EAkIyD,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,UAxI7B,OAAO;;;;EAwIyE,CAAC;AAElG;;;GAGG;AACH,eAAO,MAAM,gCAAgC,UA9I5B,OAAO;;;;;;;;;;;;;;;;;;;;;EA8IuE,CAAC;AAMhG;;;GAGG;AACH,eAAO,MAAM,uBAAuB,UAxJnB,OAAO;;;;;;;EAwJqD,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,qBAAqB,UA9JjB,OAAO;;;;;EA8JiD,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,sBAAsB,UApKlB,OAAO;;;;;EAoKmD,CAAC;AAE5E;;;GAGG;AACH,eAAO,MAAM,uBAAuB,UA1KnB,OAAO;;;;EA0KqD,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,uBAAuB,UAhLnB,OAAO;;;EAgLqD,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,wBAAwB,UAtLpB,OAAO;;;;;EAsLuD,CAAC;AAEhF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,UA5LxB,OAAO;;EA4L+D,CAAC;AAExF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,UAlMxB,OAAO;;EAkM+D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleService.d.ts","sourceRoot":"","sources":["../../src/services/BundleService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAInD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"BundleService.d.ts","sourceRoot":"","sources":["../../src/services/BundleService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAInD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAMzE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,GAAG,CAAC;IACf,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;CAChB;AAYD;;GAEG;AACH,qBAAa,aAAa;IAOtB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,aAAa;IAErB,OAAO,CAAC,cAAc,CAAC;IACvB,OAAO,CAAC,WAAW,CAAC;IACpB,OAAO,CAAC,8BAA8B;IACtC,OAAO,CAAC,wDAAwD;IAZlE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAa;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,eAAe,CAAC,CAAuB;gBAGrC,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,oBAAoB,EAC3C,SAAS,GAAE,OAAe,EAClB,cAAc,CAAC,EAAE,GAAG,YAAA,EACpB,WAAW,CAAC,EAAE,MAAM,YAAA,EACpB,8BAA8B,GAAE,MAAa,EAC7C,wDAAwD,GAAE,MAAa;IAYjF;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,iBAAiB,CACrB,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC,WAAW,CAAC;IA4CvB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAmD1B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAQ3B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAwB5B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAoB1B;;;;;;;;;;;;;;OAcG;IACG,2BAA2B,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IA8B9E;;;;;OAKG;IACG,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IA8BpE;;;;OAIG;IACG,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC;IA6B7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IA4H9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC;IAgIhE;;OAEG;IACH,OAAO,CAAC,8BAA8B;IAYtC;;OAEG;YACW,wBAAwB;IA2DtC;;;;;OAKG;YAEW,uBAAuB;CAKtC"}
|
|
@@ -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;AAO3C,OAAO,EAEL,cAAc,EAMf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAGnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBADX,IAAI,EAAE,UAAU,EAChB,WAAW,EAAE,WAAW;IAG3C;;;;;;;;;;OAUG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAqE3E;;;;;;;;;;OAUG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IA6D7D;;;;;;OAMG;YACW,uBAAuB;CAsBtC"}
|
|
@@ -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;AAI3C,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;IAqB/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;AAM3C,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;CAyDnB"}
|