@xoxno/sdk-js 0.1.53-alpha → 0.1.55-alpha

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.
Files changed (62) hide show
  1. package/dist/236.bundle.js +1 -0
  2. package/dist/265.bundle.js +2 -0
  3. package/dist/265.bundle.js.LICENSE.txt +10 -0
  4. package/dist/collection/index.d.ts +27 -1
  5. package/dist/common/index.d.ts +1 -9
  6. package/dist/index.bundle.js +1 -0
  7. package/dist/index.d.ts +0 -2
  8. package/dist/interactions.bundle.js +1 -0
  9. package/dist/launchpad.bundle.js +1 -0
  10. package/dist/runtime.bundle.js +1 -0
  11. package/dist/types/collection.d.ts +3 -0
  12. package/dist/types/trading.d.ts +39 -19
  13. package/dist/utils/api.d.ts +1 -1
  14. package/package.json +11 -8
  15. package/dist/collection/index.js +0 -504
  16. package/dist/collection/index.js.map +0 -1
  17. package/dist/common/index.js +0 -78
  18. package/dist/common/index.js.map +0 -1
  19. package/dist/index.js +0 -26
  20. package/dist/index.js.map +0 -1
  21. package/dist/interactions/index.js +0 -678
  22. package/dist/interactions/index.js.map +0 -1
  23. package/dist/launchpad/index.js +0 -158
  24. package/dist/launchpad/index.js.map +0 -1
  25. package/dist/nft/index.js +0 -121
  26. package/dist/nft/index.js.map +0 -1
  27. package/dist/staking/index.js +0 -29
  28. package/dist/staking/index.js.map +0 -1
  29. package/dist/types/collection.js +0 -183
  30. package/dist/types/collection.js.map +0 -1
  31. package/dist/types/common.js +0 -3
  32. package/dist/types/common.js.map +0 -1
  33. package/dist/types/index.js +0 -21
  34. package/dist/types/index.js.map +0 -1
  35. package/dist/types/interactions.js +0 -11
  36. package/dist/types/interactions.js.map +0 -1
  37. package/dist/types/nft.js +0 -3
  38. package/dist/types/nft.js.map +0 -1
  39. package/dist/types/staking.js +0 -15
  40. package/dist/types/staking.js.map +0 -1
  41. package/dist/types/trading.js +0 -26
  42. package/dist/types/trading.js.map +0 -1
  43. package/dist/types/user.js +0 -13
  44. package/dist/types/user.js.map +0 -1
  45. package/dist/users/index.js +0 -220
  46. package/dist/users/index.js.map +0 -1
  47. package/dist/utils/SmartContractAbis.js +0 -103
  48. package/dist/utils/SmartContractAbis.js.map +0 -1
  49. package/dist/utils/SmartContractService.js +0 -13
  50. package/dist/utils/SmartContractService.js.map +0 -1
  51. package/dist/utils/api.js +0 -79
  52. package/dist/utils/api.js.map +0 -1
  53. package/dist/utils/const.js +0 -17
  54. package/dist/utils/const.js.map +0 -1
  55. package/dist/utils/getActivity.js +0 -53
  56. package/dist/utils/getActivity.js.map +0 -1
  57. package/dist/utils/helpers.js +0 -27
  58. package/dist/utils/helpers.js.map +0 -1
  59. package/dist/utils/regex.js +0 -12
  60. package/dist/utils/regex.js.map +0 -1
  61. package/dist/utils/scCalls.js +0 -39
  62. package/dist/utils/scCalls.js.map +0 -1
@@ -1,504 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CollectionModule = void 0;
13
- const collection_1 = require("../types/collection");
14
- const index_1 = require("../index");
15
- const getActivity_1 = require("../utils/getActivity");
16
- const regex_1 = require("../utils/regex");
17
- /**
18
- * CollectionModule provides a set of methods to interact with NFT collections.
19
- * It includes methods for getting collection profile information, floor price,
20
- * collection attributes, and searching NFTs within a collection.
21
- *
22
- * @example
23
- * const collectionModule = new CollectionModule();
24
- */
25
- class CollectionModule {
26
- constructor() {
27
- /**
28
- * @public
29
- * @async
30
- * @function getCollectionProfile
31
- * @param {string} collection - The ticker of the collection to fetch the profile for.
32
- * @returns {Promise<ICollectionProfile>} A promise that resolves to the fetched collection profile.
33
- *
34
- * This function fetches the profile of a given collection. It takes the following parameter:
35
- * - collection (string): The ticker of the collection to fetch the profile for.
36
- *
37
- * The function first validates the input ticker and checks if it is a valid collection ticker.
38
- * If it is valid, the function fetches the collection profile using the API.
39
- * Finally, it returns a promise that resolves to the fetched collection profile.
40
- */
41
- this.getCollectionProfile = (collection) => __awaiter(this, void 0, void 0, function* () {
42
- if (!(0, regex_1.isValidCollectionTicker)(collection)) {
43
- throw new Error('Invalid collection ticker: ' + collection);
44
- }
45
- const response = yield this.api.fetchWithTimeout(`/collection/${collection}/profile`, {
46
- next: {
47
- tags: ['getCollectionProfile'],
48
- revalidate: 30,
49
- },
50
- });
51
- return response;
52
- });
53
- /**
54
- * @public
55
- * @async
56
- * @function getDailyTrending
57
- * @returns {Promise<NftData[]>} A promise that resolves to the array of trending NFTs.
58
- * This function fetches the top NFTs that are trending today based on their floor and volumes
59
- */
60
- this.getDailyTrending = () => __awaiter(this, void 0, void 0, function* () {
61
- const response = yield this.api.fetchWithTimeout('/nfts/getDailyTrending', {
62
- next: {
63
- tags: ['getDailyTrending'],
64
- revalidate: 180,
65
- },
66
- });
67
- return response;
68
- });
69
- /**
70
- * Fetches the floor price of a collection.
71
- * @param collection - The ticker of the collection.
72
- * @param token - The token for the floor price calculation (default: 'EGLD').
73
- * @returns A Promise that resolves to the collection's floor price as a number.
74
- * @throws An error if the provided collection ticker is invalid.
75
- */
76
- this.getCollectionFloorPrice = (collection, token = 'EGLD') => __awaiter(this, void 0, void 0, function* () {
77
- if (!(0, regex_1.isValidCollectionTicker)(collection)) {
78
- throw new Error('Invalid collection ticker: ' + collection);
79
- }
80
- const response = yield this.api.fetchWithTimeout(`/collection/${collection}/floor-price`, {
81
- next: {
82
- tags: ['getCollectionFloorPrice'],
83
- },
84
- params: {
85
- token,
86
- },
87
- });
88
- return (response === null || response === void 0 ? void 0 : response.price) ? response.price : 0;
89
- });
90
- /**
91
- * @public
92
- * @async
93
- * @function getCollectionAttributes
94
- * @param {string} collection - The ticker of the collection to fetch the attributes for.
95
- * @returns {Promise<ICollectionAttributes>} A promise that resolves to the fetched collection attributes.
96
- *
97
- * This function fetches the attributes of a given collection. It takes the following parameter:
98
- * - collection (string): The ticker of the collection to fetch the attributes for.
99
- *
100
- * The function first validates the input ticker and checks if it is a valid collection ticker.
101
- * If it is valid, the function fetches the collection attributes using the API.
102
- * Finally, it returns a promise that resolves to the fetched collection attributes.
103
- */
104
- this.getCollectionAttributes = (collection) => __awaiter(this, void 0, void 0, function* () {
105
- if (!(0, regex_1.isValidCollectionTicker)(collection)) {
106
- throw new Error('Invalid collection ticker: ' + collection);
107
- }
108
- const response = yield this.api.fetchWithTimeout(`/collection/${collection}/attributes`, {
109
- next: {
110
- tags: ['getCollectionAttributes'],
111
- revalidate: 180,
112
- },
113
- });
114
- return response;
115
- });
116
- /**
117
- * Searches for NFTs based on the provided arguments.
118
- * @param {SearchNFTsArgs} args - The SearchNFTsArgs object containing the search parameters.
119
- * @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
120
- * @throws An error if the provided collection ticker is invalid or if the 'top' value is greater than 35.
121
- */
122
- this.getNFTs = (args) => __awaiter(this, void 0, void 0, function* () {
123
- var _a, _b, _c, _d, _e;
124
- (_a = args === null || args === void 0 ? void 0 : args.collections) === null || _a === void 0 ? void 0 : _a.forEach((element) => {
125
- if (!(0, regex_1.isValidCollectionTicker)(element)) {
126
- throw new Error('Invalid collection ticker: ' + element);
127
- }
128
- });
129
- if (args.top && args.top > 35) {
130
- throw new Error('Top cannot be greater than 35');
131
- }
132
- const ranges = [];
133
- if (args.priceRange) {
134
- ranges.push(Object.assign(Object.assign({}, args.priceRange), { field: args.onlyAuctions
135
- ? 'saleInfo.currentBidShort'
136
- : 'saleInfo.minBidShort' }));
137
- }
138
- if (args.rankRange) {
139
- ranges.push(Object.assign(Object.assign({}, args.rankRange), { field: 'metadata.rarity.rank' }));
140
- }
141
- const payloadBody = {
142
- filters: {
143
- dataType: (_b = args.dataType) !== null && _b !== void 0 ? _b : ['nft'],
144
- activeAuction: args.onlyAuctions || args.activeAuctions,
145
- collection: (_c = args.collections) !== null && _c !== void 0 ? _c : [],
146
- onSale: args.onlyOnSale,
147
- saleInfo: {
148
- seller: args.listedBy || [],
149
- marketplace: args.listedOnlyOn || undefined,
150
- paymentToken: args.listedInToken || [],
151
- auctionType: args.onlyOnSale
152
- ? args.onlyAuctions
153
- ? ['NftBid', 'SftAll']
154
- : ['Nft', 'SftOnePerPayment']
155
- : undefined,
156
- },
157
- owner: args.ownedBy || [],
158
- verifiedOnly: args.onlyVerified || false,
159
- metadata: {
160
- attributes: args.attributes || undefined,
161
- },
162
- range: ranges,
163
- cp_staked: args.isStaked || undefined,
164
- },
165
- applyNftExtraDetails: args.applyNftExtraDetails || true,
166
- orderBy: args.orderBy || [],
167
- select: args.onlySelectFields || [],
168
- includeCount: args.includeCount || false,
169
- top: args.top || 35,
170
- skip: args.skip || 0,
171
- };
172
- const buffer = Buffer.from(JSON.stringify(payloadBody)).toString('base64');
173
- const response = yield this.api.fetchWithTimeout(`/nft/${buffer}/query`, {
174
- next: {
175
- tags: ['getCollectionNFTs'],
176
- },
177
- cache: 'no-store',
178
- });
179
- return Object.assign(Object.assign({}, response), { getNextPagePayload: Object.assign(Object.assign({}, args), { skip: ((_d = args.skip) !== null && _d !== void 0 ? _d : 0) + ((_e = args.top) !== null && _e !== void 0 ? _e : 35) }) });
180
- });
181
- /**
182
- * @public
183
- * @async
184
- * @function suggestResults
185
- * @param {SuggestNFTsArgs} args - An object containing the necessary parameters to fetch suggested NFT results.
186
- * @returns {Promise<SuggestResults>} A promise that resolves to the fetched NFT results.
187
- *
188
- * This function fetches suggested NFT results based on the provided arguments. It takes an object with the following properties:
189
- * - name (string): The name to search for (required).
190
- * - orderBy (SuggestOrderBy[], optional): An array of ordering preferences for the results.
191
- * - top (number, optional): The maximum number of results to return (default is 35, cannot be greater than 35).
192
- * - skip (number, optional): The number of results to skip (default is 0).
193
- *
194
- * The function first validates the input arguments and constructs a payload body with the provided parameters.
195
- * Then, it converts the payload body into a base64 string and fetches the suggested results using the API.
196
- * Finally, it returns a promise that resolves to the fetched NFT results.
197
- */
198
- this.suggestResults = (args) => __awaiter(this, void 0, void 0, function* () {
199
- if (args.top && args.top > 35) {
200
- throw new Error('Top cannot be greater than 35');
201
- }
202
- if (!args.name) {
203
- throw new Error('Name is required');
204
- }
205
- const payloadBody = {
206
- name: args.name,
207
- orderBy: args.orderBy || [
208
- collection_1.SuggestOrderBy.TotalVolumeHighToLow,
209
- collection_1.SuggestOrderBy.FollowersHighToLow,
210
- collection_1.SuggestOrderBy.IsVerifiedTrueToFalse,
211
- collection_1.SuggestOrderBy.HasImageTrueToFalse,
212
- ],
213
- top: args.top || 35,
214
- skip: args.skip || 0,
215
- };
216
- const buffer = Buffer.from(JSON.stringify(payloadBody)).toString('base64');
217
- return yield this.api.fetchWithTimeout(`https://proxy-api.xoxno.com/search/${buffer}`, {
218
- next: {
219
- tags: ['suggestResults'],
220
- revalidate: 180,
221
- },
222
- });
223
- });
224
- /**
225
- * @public
226
- * @async
227
- * @function suggestResults
228
- * @param {string} ticker - The unique collection identifier called ticker
229
- * @returns {Promise<ListingDistribution[]>} A promise that resolves to the distribution of listings
230
- */
231
- this.collectionListings = (ticker) => __awaiter(this, void 0, void 0, function* () {
232
- return yield this.api.fetchWithTimeout(`https://proxy-api.xoxno.com/listingDistribution/${ticker}`, {
233
- next: {
234
- tags: ['collectionListings'],
235
- revalidate: 180,
236
- },
237
- });
238
- });
239
- /**
240
- * Retrieves trading history based on the provided arguments.
241
- *
242
- * @param {TradincActivityArgs} args - The arguments for filtering the trading activity.
243
- * @returns {Promise<TradingActivityResponse>} A promise resolving to a TradingActivityResponse object containing the activity.
244
- * @throws {Error} Throws an error if the 'top' argument is greater than 35.
245
- */
246
- this.getTradingActivity = (args) => __awaiter(this, void 0, void 0, function* () {
247
- return yield (0, getActivity_1.getActivity)(args, this.api);
248
- });
249
- /**
250
- * Fetch collections profiles based on the provided arguments.
251
- * @param {GetCollectionsArgs} args - The GetCollectionsArgs object containing the search parameters.
252
- * @returns {Promise<CollectionsNFTsResponse>} A Promise that resolves to the CollectionsNFTsResponse object.
253
- * @throws An error if the 'top' value is greater than 35.
254
- */
255
- this.getCollections = (args) => __awaiter(this, void 0, void 0, function* () {
256
- if ((args === null || args === void 0 ? void 0 : args.top) && args.top > 25) {
257
- throw new Error('Top cannot be greater than 25');
258
- }
259
- const payloadBody = {
260
- skip: (args === null || args === void 0 ? void 0 : args.skip) || 0,
261
- top: (args === null || args === void 0 ? void 0 : args.top) || 25,
262
- select: (args === null || args === void 0 ? void 0 : args.onlySelectFields) || [],
263
- filters: Object.assign({ dataType: 'collectionProfile', isMintable: (args === null || args === void 0 ? void 0 : args.onlyMintable) || undefined }, ((args === null || args === void 0 ? void 0 : args.collections) &&
264
- args.collections.length > 0 && {
265
- collection: args.collections,
266
- })),
267
- orderBy: [(args === null || args === void 0 ? void 0 : args.orderBy) || 'statistics.tradeData.weekEgldVolume desc'],
268
- };
269
- const buffer = Buffer.from(JSON.stringify(payloadBody)).toString('base64');
270
- const response = yield this.api.fetchWithTimeout(`/collection/${buffer}/query`, {
271
- next: {
272
- tags: ['getCollections'],
273
- revalidate: 180,
274
- },
275
- });
276
- return {
277
- results: response,
278
- resultsCount: response.length,
279
- empty: response.length === 0,
280
- getNextPagePayload: Object.assign(Object.assign({}, args), { skip: ((args === null || args === void 0 ? void 0 : args.skip) || 0) + ((args === null || args === void 0 ? void 0 : args.top) || 25) }),
281
- hasMoreResults: response.length >= ((args === null || args === void 0 ? void 0 : args.top) || 25),
282
- };
283
- });
284
- /**
285
- * Fetch global offers based on the provided arguments.
286
- * @param {GetGlobalOffersArgs} args - The GetCollectionsArgs object containing the search parameters.
287
- * @returns {Promise<GlobalOffersResult>} A Promise that resolves to the GlobalOffersResult object.
288
- * @throws An error if the 'top' value is greater than 35.
289
- */
290
- this.getGlobalOffers = (args) => __awaiter(this, void 0, void 0, function* () {
291
- var _f, _g;
292
- if ((args === null || args === void 0 ? void 0 : args.top) && args.top > 25) {
293
- throw new Error('Top cannot be greater than 25');
294
- }
295
- const payloadBody = {
296
- skip: (args === null || args === void 0 ? void 0 : args.skip) || 0,
297
- top: (args === null || args === void 0 ? void 0 : args.top) || 25,
298
- select: (args === null || args === void 0 ? void 0 : args.onlySelectFields) || [],
299
- filters: {
300
- collection: (args === null || args === void 0 ? void 0 : args.collections) || [],
301
- withAttributes: (_f = args === null || args === void 0 ? void 0 : args.withAttributes) !== null && _f !== void 0 ? _f : false,
302
- isActive: (_g = args === null || args === void 0 ? void 0 : args.onlyActive) !== null && _g !== void 0 ? _g : true,
303
- offerId: args === null || args === void 0 ? void 0 : args.offerIds,
304
- owner: args === null || args === void 0 ? void 0 : args.ownedBy,
305
- marketplace: args === null || args === void 0 ? void 0 : args.listedOnlyOn,
306
- range: (args === null || args === void 0 ? void 0 : args.priceRange)
307
- ? Object.assign(Object.assign({}, args.priceRange), { type: 'priceShort' }) : undefined,
308
- attributes: args === null || args === void 0 ? void 0 : args.attributes,
309
- },
310
- orderBy: [(args === null || args === void 0 ? void 0 : args.orderBy) || collection_1.GlobalOfferOrderBy.PriceHighToLow],
311
- };
312
- const buffer = Buffer.from(JSON.stringify(payloadBody)).toString('base64');
313
- const response = yield this.api.fetchWithTimeout(`/collection/${buffer}/global-offer/query`, {
314
- next: {
315
- tags: ['getGlobalOffers'],
316
- revalidate: 12,
317
- },
318
- });
319
- return Object.assign(Object.assign({}, response), { getNextPagePayload: Object.assign(Object.assign({}, args), { skip: ((args === null || args === void 0 ? void 0 : args.top) || 25) + response.lastSkip }) });
320
- });
321
- /**
322
- * @public
323
- * @async
324
- * @function getCollectionVolume
325
- * @param {string} collection - The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
326
- * @param {string} after - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
327
- * @param {string} before - The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
328
- * @param {string} bin - The binning period for the volume data (e.g., '1d' for 1 day).
329
- * @returns {Promise<CollectionVolume[]>} A promise that resolves to an array of collection volume data.
330
- *
331
- * This function fetches volume data for a given collection within a specified date range and binning period. It takes the following parameters:
332
- * - collection (string): The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
333
- * - after (string): The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
334
- * - before (string): The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
335
- * - bin (string): The binning period for the volume data (e.g., '1d' for 1 day).
336
- *
337
- * The function first validates the input collection ticker and checks if it is a valid collection ticker.
338
- * If it is valid, the function fetches the collection volume data using the API with the specified query parameters.
339
- * Finally, it returns a promise that resolves to an array of collection volume data.
340
- */
341
- this.getCollectionVolume = (collection, after, before, bin) => __awaiter(this, void 0, void 0, function* () {
342
- if (!(0, regex_1.isValidCollectionTicker)(collection)) {
343
- throw new Error('Invalid collection ticker: ' + collection);
344
- }
345
- const response = yield this.api.fetchWithTimeout(`https://proxy-api.xoxno.com/getCollectionVolume/${collection}?after=${after}&before=${before}&bin=${bin}`, {
346
- next: {
347
- tags: ['getCollectionVolume'],
348
- revalidate: 180,
349
- },
350
- });
351
- return response;
352
- });
353
- /**
354
- * @public
355
- * @async
356
- * @function getMarketplaceVolume
357
- * @param {string} after - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
358
- * @param {string} before - The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
359
- * @param {string} bin - The binning period for the volume data (e.g., '1d' for 1 day).
360
- * @returns {Promise<CollectionVolume[]>} A promise that resolves to an array of collection volume data.
361
- *
362
- * This function fetches volume data for a given collection within a specified date range and binning period. It takes the following parameters:
363
- * - collection (string): The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
364
- * - after (string): The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
365
- * - before (string): The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
366
- * - bin (string): The binning period for the volume data (e.g., '1d' for 1 day).
367
- *
368
- * The function first validates the input collection ticker and checks if it is a valid collection ticker.
369
- * If it is valid, the function fetches the collection volume data using the API with the specified query parameters.
370
- * Finally, it returns a promise that resolves to an array of collection volume data.
371
- */
372
- this.getMarketplaceVolume = (after, before, bin) => __awaiter(this, void 0, void 0, function* () {
373
- const response = yield this.api.fetchWithTimeout(`https://proxy-api.xoxno.com/getMarketplaceVolume?after=${after}&before=${before}&bin=${bin}`, {
374
- next: {
375
- tags: ['getMarketplaceVolume'],
376
- revalidate: 180,
377
- },
378
- });
379
- return response;
380
- });
381
- /**
382
- * @public
383
- * @async
384
- * @function getCollectionFloor
385
- * @param {string} collection - The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
386
- * @param {string} after - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
387
- * @param {string} before - The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
388
- * @param {string} bin - The binning period for the volume data (e.g., '1d' for 1 day).
389
- * @returns {Promise<FloorPriceHistory[]>} A promise that resolves to an array of floor price history data.
390
- *
391
- * This function fetches floor data for a given collection within a specified date range and binning period. It takes the following parameters:
392
- * - collection (string): The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
393
- * - after (string): The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
394
- * - before (string): The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
395
- * - bin (string): The binning period for the volume data (e.g., '1d' for 1 day).
396
- *
397
- * The function first validates the input collection ticker and checks if it is a valid collection ticker.
398
- * If it is valid, the function fetches the collection volume data using the API with the specified query parameters.
399
- * Finally, it returns a promise that resolves to an array of floor price history data.
400
- */
401
- this.getCollectionFloor = (collection, after, before, bin) => __awaiter(this, void 0, void 0, function* () {
402
- if (!(0, regex_1.isValidCollectionTicker)(collection)) {
403
- throw new Error('Invalid collection ticker: ' + collection);
404
- }
405
- const response = yield this.api.fetchWithTimeout(`https://proxy-api.xoxno.com/getCollectionFloor/${collection}?after=${after}&before=${before}&bin=${bin}`, {
406
- next: {
407
- tags: ['getCollectionFloor'],
408
- revalidate: 180,
409
- },
410
- });
411
- return response;
412
- });
413
- /**
414
- * @public
415
- * @async
416
- * @function getCollectionOwners
417
- * @param {string} collection - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
418
- * @returns {Promise<IOwners>} A promise that resolves a struct of collection information about holders
419
- *
420
- * This function fetches owner information for a given collection. It takes the following parameter:
421
- * - collection (string): The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
422
- *
423
- * The function first validates the input collection ticker and checks if it is a valid collection ticker.
424
- * If it is valid, the function fetches the collection owner information using the API.
425
- * Finally, it returns a promise that resolves a struct of collection information about holders
426
- */
427
- this.getCollectionOwners = (collection) => __awaiter(this, void 0, void 0, function* () {
428
- if (!(0, regex_1.isValidCollectionTicker)(collection)) {
429
- throw new Error('Invalid collection ticker: ' + collection);
430
- }
431
- const response = yield this.api.fetchWithTimeout(`/collection/${collection}/holders`, {
432
- next: {
433
- tags: ['getCollectionOwners'],
434
- revalidate: 500,
435
- },
436
- });
437
- return response;
438
- });
439
- /**
440
- * @public
441
- * @async
442
- * @function getExportOwners
443
- * @param {string} collection - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
444
- * @returns {Promise<ISingleHolder[]>} A promise that resolves an array of holders part of the collection.
445
- *
446
- * This function fetches owners information for a given collection. It takes the following parameter:
447
- * - collection (string): The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
448
- *
449
- * The function first validates the input collection ticker and checks if it is a valid collection ticker.
450
- * If it is valid, the function fetches the collection owner information using the API.
451
- * Finally, it returns a promise that resolves to an array of collection owner information.
452
- */
453
- this.getExportOwners = (collection) => __awaiter(this, void 0, void 0, function* () {
454
- if (!(0, regex_1.isValidCollectionTicker)(collection)) {
455
- throw new Error('Invalid collection ticker: ' + collection);
456
- }
457
- const response = yield this.api.fetchWithTimeout(`/collection/${collection}/holders?exportHolders=true`, {
458
- next: {
459
- tags: ['getExportOwners'],
460
- },
461
- });
462
- return response;
463
- });
464
- /**
465
- * @public
466
- * @async
467
- * @function getCollectionsStatistics
468
- * @param {GetCollectionStatsArgs} args - The filter payload for the collection statsitics
469
- * @returns {Promise<CollectionStatsResults>} A promise that resolves to a struct with information
470
- * Finally, it returns a promise that resolves a struct with information
471
- */
472
- this.getCollectionsStatistics = (args) => __awaiter(this, void 0, void 0, function* () {
473
- if ((args === null || args === void 0 ? void 0 : args.top) && args.top > 25) {
474
- throw new Error('Top cannot be greater than 25');
475
- }
476
- const buffer = Buffer.from(JSON.stringify(args)).toString('base64');
477
- const response = yield this.api.fetchWithTimeout(`/collection/${buffer}/stats/query`, {
478
- next: {
479
- tags: ['collectionStatistics'],
480
- revalidate: 12,
481
- },
482
- });
483
- return Object.assign(Object.assign({}, response), { getNextPagePayload: Object.assign(Object.assign({}, args), { skip: args.skip + args.top }) });
484
- });
485
- /**
486
- * @public
487
- * @async
488
- * @function getCollectionMintInfo
489
- * @param {string} ticker - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
490
- * @returns {Promise<GetCollectionMintInfo>} A promise that resolves to a struct with information
491
- * Finally, it returns a promise that resolves a struct with information
492
- */
493
- this.getCollectionMintInfo = ({ ticker, extra, }) => __awaiter(this, void 0, void 0, function* () {
494
- const response = yield this.api.fetchWithTimeout(`/collection/${ticker}/drop-info`, Object.assign({ next: {
495
- tags: ['getCollectionMintInfo'],
496
- revalidate: 12,
497
- } }, extra));
498
- return response;
499
- });
500
- this.api = index_1.XOXNOClient.init();
501
- }
502
- }
503
- exports.CollectionModule = CollectionModule;
504
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collection/index.ts"],"names":[],"mappings":";;;;;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ACpE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,eAAe,MAAM,cAAc,EACnC;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,CAAC,sBAAsB,CAAC;oBAC9B,UAAU,EAAE,EAAE;iBACf;aACF,CACF,CAAC;YACF,uCACK,QAAQ,KACX,kBAAkB,kCACb,IAAI,KACP,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,OAE5B;QACJ,CAAC,CAAA,CAAC;QAEF;;;;;;;WAOG;QACI,0BAAqB,GAAG,CAAO,EACpC,MAAM,EACN,KAAK,GAIN,EAAkC,EAAE;YACnC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,eAAe,MAAM,YAAY,kBAE/B,IAAI,EAAE;oBACJ,IAAI,EAAE,CAAC,uBAAuB,CAAC;oBAC/B,UAAU,EAAE,EAAE;iBACf,IACE,KAAK,EAEX,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QA/mBA,IAAI,CAAC,GAAG,GAAG,mBAAW,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;CA+mBF;AAnnBD,4CAmnBC"}
@@ -1,78 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CommonModule = void 0;
13
- const collection_1 = require("../types/collection");
14
- const api_1 = require("../utils/api");
15
- class CommonModule {
16
- constructor() {
17
- /** Gets all tokens usd price
18
- * @returns {TokenUSDPrices} User's creator info
19
- * */
20
- this.getTokensUsdPrice = () => __awaiter(this, void 0, void 0, function* () {
21
- const response = yield this.api.fetchWithTimeout(`/tokens/usd-price`);
22
- return response;
23
- });
24
- /** Gets all tokens usd price
25
- * @returns {TokenUSDPrices} User's creator info
26
- * */
27
- this.getAshSwapAmount = ({ originalToken, originalTokenValue, paymentToken, }) => __awaiter(this, void 0, void 0, function* () {
28
- const response = yield this.api.fetchWithTimeout(`/ash/min-token-quantity`, {
29
- params: {
30
- originalToken: originalToken,
31
- originalTokenValue: originalTokenValue,
32
- paymentToken: paymentToken,
33
- },
34
- });
35
- return response;
36
- });
37
- /**
38
- * @public
39
- * @async
40
- * @function getFungibleTokens
41
- * @param category - The ticker of the collection.
42
- * @returns {Promise<FungibleAssetsMap>} A promise that resolves a map of ESDT tokens and their info
43
- * This function fetches all branded fungible assets and their info
44
- */
45
- this.getFungibleTokens = (categories = [collection_1.AssetCategory.ALL], identifiers) => __awaiter(this, void 0, void 0, function* () {
46
- const response = yield this.api.fetchWithTimeout(`/tokens`, {
47
- params: {
48
- identifiers: identifiers ? identifiers.join(',') : undefined,
49
- category: categories ? categories.join(',') : undefined,
50
- },
51
- next: {
52
- tags: ['getFungibleTokens'],
53
- revalidate: 500,
54
- },
55
- });
56
- return response;
57
- });
58
- /**
59
- * @public
60
- * @async
61
- * @function getFungibleToken
62
- * @returns {Promise<FungibleAssets>} A promise that resolves the ESDT token info
63
- * This function fetches the branded fungible asset info
64
- */
65
- this.getFungibleToken = (identifier) => __awaiter(this, void 0, void 0, function* () {
66
- const response = yield this.api.fetchWithTimeout(`https://proxy-api.xoxno.com/getFungibleTokens/${identifier}`, {
67
- next: {
68
- tags: ['getFungibleToken'],
69
- revalidate: 500,
70
- },
71
- });
72
- return response;
73
- });
74
- this.api = api_1.XOXNOClient.init();
75
- }
76
- }
77
- exports.CommonModule = CommonModule;
78
- //#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,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;;WAMG;QACI,qBAAgB,GAAG,CACxB,UAAkB,EACO,EAAE;YAC3B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,iDAAiD,UAAU,EAAE,EAC7D;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,CAAC,kBAAkB,CAAC;oBAC1B,UAAU,EAAE,GAAG;iBAChB;aACF,CACF,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QApFA,IAAI,CAAC,GAAG,GAAG,iBAAW,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;CAoFF;AAxFD,oCAwFC"}
package/dist/index.js DELETED
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./types"), exports);
18
- __exportStar(require("./collection"), exports);
19
- __exportStar(require("./launchpad"), exports);
20
- __exportStar(require("./interactions"), exports);
21
- __exportStar(require("./nft"), exports);
22
- __exportStar(require("./users"), exports);
23
- __exportStar(require("./staking"), exports);
24
- __exportStar(require("./utils/api"), exports);
25
- __exportStar(require("./common"), exports);
26
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,+CAA6B;AAC7B,8CAA4B;AAC5B,iDAA+B;AAC/B,wCAAsB;AACtB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB"}