@xoxno/sdk-js 0.1.75-alpha → 0.1.76-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 (183) hide show
  1. package/out/cjs/collection/index.js +625 -0
  2. package/out/cjs/collection/index.js.map +1 -0
  3. package/out/cjs/common/index.js +141 -0
  4. package/out/cjs/common/index.js.map +1 -0
  5. package/out/cjs/index.js +26 -0
  6. package/out/cjs/index.js.map +1 -0
  7. package/out/cjs/index.large.js +19 -0
  8. package/out/cjs/index.large.js.map +1 -0
  9. package/out/cjs/interactions/index.js +678 -0
  10. package/out/cjs/interactions/index.js.map +1 -0
  11. package/out/cjs/launchpad/index.js +158 -0
  12. package/out/cjs/launchpad/index.js.map +1 -0
  13. package/out/cjs/nft/index.js +121 -0
  14. package/out/cjs/nft/index.js.map +1 -0
  15. package/out/cjs/staking/index.js +29 -0
  16. package/out/cjs/staking/index.js.map +1 -0
  17. package/{dist → out/cjs}/types/collection.js +31 -28
  18. package/out/cjs/types/collection.js.map +1 -0
  19. package/out/cjs/types/common.js +3 -0
  20. package/{dist → out/cjs}/types/common.js.map +1 -1
  21. package/out/cjs/types/index.js +24 -0
  22. package/out/cjs/types/index.js.map +1 -0
  23. package/{dist → out/cjs}/types/interactions.js +5 -2
  24. package/out/cjs/types/interactions.js.map +1 -0
  25. package/out/cjs/types/nft.js +3 -0
  26. package/out/cjs/types/nft.js.map +1 -0
  27. package/out/cjs/types/staking.js +15 -0
  28. package/out/cjs/types/staking.js.map +1 -0
  29. package/{dist → out/cjs}/types/trading.js +9 -6
  30. package/out/cjs/types/trading.js.map +1 -0
  31. package/out/cjs/types/user.js +13 -0
  32. package/out/cjs/types/user.js.map +1 -0
  33. package/out/cjs/users/index.js +335 -0
  34. package/out/cjs/users/index.js.map +1 -0
  35. package/out/cjs/utils/SmartContractAbis.js +103 -0
  36. package/out/cjs/utils/SmartContractAbis.js.map +1 -0
  37. package/out/cjs/utils/SmartContractService.js +13 -0
  38. package/out/cjs/utils/SmartContractService.js.map +1 -0
  39. package/out/cjs/utils/api.js +79 -0
  40. package/out/cjs/utils/api.js.map +1 -0
  41. package/out/cjs/utils/const.js +17 -0
  42. package/out/cjs/utils/const.js.map +1 -0
  43. package/out/cjs/utils/getActivity.js +65 -0
  44. package/out/cjs/utils/getActivity.js.map +1 -0
  45. package/out/cjs/utils/helpers.js +27 -0
  46. package/out/cjs/utils/helpers.js.map +1 -0
  47. package/out/cjs/utils/regex.js +12 -0
  48. package/out/cjs/utils/regex.js.map +1 -0
  49. package/out/cjs/utils/scCalls.js +39 -0
  50. package/out/cjs/utils/scCalls.js.map +1 -0
  51. package/out/src/collection/__tests__/collection.test.js +2 -0
  52. package/out/src/collection/__tests__/collection.test.js.map +1 -0
  53. package/out/src/collection/index.js +2 -0
  54. package/out/src/collection/index.js.map +1 -0
  55. package/out/src/common/index.js +2 -0
  56. package/out/src/common/index.js.map +1 -0
  57. package/out/src/index.js +2 -0
  58. package/out/src/index.js.map +1 -0
  59. package/out/src/index.large.js +2 -0
  60. package/out/src/index.large.js.map +1 -0
  61. package/out/src/interactions/__tests__/market.test.js +2 -0
  62. package/out/src/interactions/__tests__/market.test.js.map +1 -0
  63. package/out/src/interactions/index.js +2 -0
  64. package/out/src/interactions/index.js.map +1 -0
  65. package/out/src/launchpad/__tests__/market.test.js +2 -0
  66. package/out/src/launchpad/__tests__/market.test.js.map +1 -0
  67. package/out/src/launchpad/index.js +2 -0
  68. package/out/src/launchpad/index.js.map +1 -0
  69. package/out/src/nft/__tests__/nft.test.js +2 -0
  70. package/out/src/nft/__tests__/nft.test.js.map +1 -0
  71. package/out/src/nft/index.js +2 -0
  72. package/out/src/nft/index.js.map +1 -0
  73. package/out/src/staking/index.js +2 -0
  74. package/out/src/staking/index.js.map +1 -0
  75. package/out/src/types/collection.js +2 -0
  76. package/out/src/types/collection.js.map +1 -0
  77. package/out/src/types/common.js +2 -0
  78. package/out/src/types/common.js.map +1 -0
  79. package/out/src/types/index.js +2 -0
  80. package/out/src/types/index.js.map +1 -0
  81. package/out/src/types/interactions.js +2 -0
  82. package/out/src/types/interactions.js.map +1 -0
  83. package/out/src/types/nft.js +2 -0
  84. package/out/src/types/nft.js.map +1 -0
  85. package/out/src/types/staking.js +2 -0
  86. package/out/src/types/staking.js.map +1 -0
  87. package/out/src/types/trading.js +2 -0
  88. package/out/src/types/trading.js.map +1 -0
  89. package/out/src/types/user.js +2 -0
  90. package/out/src/types/user.js.map +1 -0
  91. package/out/src/users/__tests__/user.test.js +2 -0
  92. package/out/src/users/__tests__/user.test.js.map +1 -0
  93. package/out/src/users/index.js +2 -0
  94. package/out/src/users/index.js.map +1 -0
  95. package/out/src/utils/SmartContractAbis.js +2 -0
  96. package/out/src/utils/SmartContractAbis.js.map +1 -0
  97. package/out/src/utils/SmartContractService.js +2 -0
  98. package/out/src/utils/SmartContractService.js.map +1 -0
  99. package/out/src/utils/api.js +2 -0
  100. package/out/src/utils/api.js.map +1 -0
  101. package/out/src/utils/const.js +2 -0
  102. package/out/src/utils/const.js.map +1 -0
  103. package/out/src/utils/getActivity.js +2 -0
  104. package/out/src/utils/getActivity.js.map +1 -0
  105. package/out/src/utils/helpers.js +2 -0
  106. package/out/src/utils/helpers.js.map +1 -0
  107. package/out/src/utils/regex.js +2 -0
  108. package/out/src/utils/regex.js.map +1 -0
  109. package/out/src/utils/scCalls.js +2 -0
  110. package/out/src/utils/scCalls.js.map +1 -0
  111. package/package.json +21 -8
  112. package/.eslintrc.json +0 -19
  113. package/dist/collection/index.js +0 -660
  114. package/dist/collection/index.js.map +0 -1
  115. package/dist/common/index.js +0 -132
  116. package/dist/common/index.js.map +0 -1
  117. package/dist/index.js +0 -10
  118. package/dist/index.js.map +0 -1
  119. package/dist/index.large.js +0 -3
  120. package/dist/index.large.js.map +0 -1
  121. package/dist/interactions/index.js +0 -619
  122. package/dist/interactions/index.js.map +0 -1
  123. package/dist/launchpad/index.js +0 -140
  124. package/dist/launchpad/index.js.map +0 -1
  125. package/dist/nft/index.js +0 -109
  126. package/dist/nft/index.js.map +0 -1
  127. package/dist/staking/index.js +0 -17
  128. package/dist/staking/index.js.map +0 -1
  129. package/dist/types/collection.js.map +0 -1
  130. package/dist/types/common.js +0 -2
  131. package/dist/types/index.js +0 -8
  132. package/dist/types/index.js.map +0 -1
  133. package/dist/types/interactions.js.map +0 -1
  134. package/dist/types/nft.js +0 -2
  135. package/dist/types/nft.js.map +0 -1
  136. package/dist/types/staking.js +0 -12
  137. package/dist/types/staking.js.map +0 -1
  138. package/dist/types/trading.js.map +0 -1
  139. package/dist/types/user.js +0 -10
  140. package/dist/types/user.js.map +0 -1
  141. package/dist/users/index.js +0 -324
  142. package/dist/users/index.js.map +0 -1
  143. package/dist/utils/SmartContractAbis.js +0 -84
  144. package/dist/utils/SmartContractAbis.js.map +0 -1
  145. package/dist/utils/SmartContractService.js +0 -9
  146. package/dist/utils/SmartContractService.js.map +0 -1
  147. package/dist/utils/api.js +0 -82
  148. package/dist/utils/api.js.map +0 -1
  149. package/dist/utils/const.js +0 -14
  150. package/dist/utils/const.js.map +0 -1
  151. package/dist/utils/getActivity.js +0 -64
  152. package/dist/utils/getActivity.js.map +0 -1
  153. package/dist/utils/helpers.js +0 -21
  154. package/dist/utils/helpers.js.map +0 -1
  155. package/dist/utils/regex.js +0 -7
  156. package/dist/utils/regex.js.map +0 -1
  157. package/dist/utils/scCalls.js +0 -25
  158. package/dist/utils/scCalls.js.map +0 -1
  159. /package/{dist → out/cjs}/collection/index.d.ts +0 -0
  160. /package/{dist → out/cjs}/common/index.d.ts +0 -0
  161. /package/{dist → out/cjs}/index.d.ts +0 -0
  162. /package/{dist → out/cjs}/index.large.d.ts +0 -0
  163. /package/{dist → out/cjs}/interactions/index.d.ts +0 -0
  164. /package/{dist → out/cjs}/launchpad/index.d.ts +0 -0
  165. /package/{dist → out/cjs}/nft/index.d.ts +0 -0
  166. /package/{dist → out/cjs}/staking/index.d.ts +0 -0
  167. /package/{dist → out/cjs}/types/collection.d.ts +0 -0
  168. /package/{dist → out/cjs}/types/common.d.ts +0 -0
  169. /package/{dist → out/cjs}/types/index.d.ts +0 -0
  170. /package/{dist → out/cjs}/types/interactions.d.ts +0 -0
  171. /package/{dist → out/cjs}/types/nft.d.ts +0 -0
  172. /package/{dist → out/cjs}/types/staking.d.ts +0 -0
  173. /package/{dist → out/cjs}/types/trading.d.ts +0 -0
  174. /package/{dist → out/cjs}/types/user.d.ts +0 -0
  175. /package/{dist → out/cjs}/users/index.d.ts +0 -0
  176. /package/{dist → out/cjs}/utils/SmartContractAbis.d.ts +0 -0
  177. /package/{dist → out/cjs}/utils/SmartContractService.d.ts +0 -0
  178. /package/{dist → out/cjs}/utils/api.d.ts +0 -0
  179. /package/{dist → out/cjs}/utils/const.d.ts +0 -0
  180. /package/{dist → out/cjs}/utils/getActivity.d.ts +0 -0
  181. /package/{dist → out/cjs}/utils/helpers.d.ts +0 -0
  182. /package/{dist → out/cjs}/utils/regex.d.ts +0 -0
  183. /package/{dist → out/cjs}/utils/scCalls.d.ts +0 -0
@@ -1,660 +0,0 @@
1
- import { GlobalOfferOrderBy, AuctionTypes, } from '../types/collection';
2
- import { XOXNOClient } from '../index';
3
- import { getActivity } from '../utils/getActivity';
4
- import { isValidCollectionTicker } from '../utils/regex';
5
- /**
6
- * CollectionModule provides a set of methods to interact with NFT collections.
7
- * It includes methods for getting collection profile information, floor price,
8
- * collection attributes, and searching NFTs within a collection.
9
- *
10
- * @example
11
- * const collectionModule = new CollectionModule();
12
- */
13
- export class CollectionModule {
14
- api;
15
- constructor() {
16
- this.api = XOXNOClient.init();
17
- }
18
- /**
19
- * @public
20
- * @async
21
- * @function getCollectionProfile
22
- * @param {string} collection - The ticker of the collection to fetch the profile for.
23
- * @returns {Promise<ICollectionProfile>} A promise that resolves to the fetched collection profile.
24
- *
25
- * This function fetches the profile of a given collection. It takes the following parameter:
26
- * - collection (string): The ticker of the collection to fetch the profile for.
27
- *
28
- * The function first validates the input ticker and checks if it is a valid collection ticker.
29
- * If it is valid, the function fetches the collection profile using the API.
30
- * Finally, it returns a promise that resolves to the fetched collection profile.
31
- */
32
- getCollectionProfile = async (collection) => {
33
- if (!isValidCollectionTicker(collection)) {
34
- throw new Error('Invalid collection ticker: ' + collection);
35
- }
36
- const response = await this.api.fetchWithTimeout(`/collection/${collection}/profile`, {
37
- next: {
38
- tags: ['getCollectionProfile'],
39
- revalidate: 30,
40
- },
41
- });
42
- return response;
43
- };
44
- /**
45
- * @public
46
- * @async
47
- * @function getDailyTrending
48
- * @returns {Promise<NftData[]>} A promise that resolves to the array of trending NFTs.
49
- * This function fetches the top NFTs that are trending today based on their floor and volumes
50
- */
51
- getDailyTrending = async () => {
52
- const response = await this.api.fetchWithTimeout('/nfts/getDailyTrending', {
53
- next: {
54
- tags: ['getDailyTrending'],
55
- revalidate: 180,
56
- },
57
- });
58
- return response;
59
- };
60
- /**
61
- * Fetches the floor price of a collection.
62
- * @param collection - The ticker of the collection.
63
- * @param token - The token for the floor price calculation (default: 'EGLD').
64
- * @returns A Promise that resolves to the collection's floor price as a number.
65
- * @throws An error if the provided collection ticker is invalid.
66
- */
67
- getCollectionFloorPrice = async (collection, token = 'EGLD') => {
68
- if (!isValidCollectionTicker(collection)) {
69
- throw new Error('Invalid collection ticker: ' + collection);
70
- }
71
- const response = await this.api.fetchWithTimeout(`/collection/${collection}/floor-price`, {
72
- next: {
73
- tags: ['getCollectionFloorPrice'],
74
- },
75
- params: {
76
- token,
77
- },
78
- });
79
- return response?.price ? response.price : 0;
80
- };
81
- /**
82
- * @public
83
- * @async
84
- * @function getCollectionAttributes
85
- * @param {string} collection - The ticker of the collection to fetch the attributes for.
86
- * @returns {Promise<ICollectionAttributes>} A promise that resolves to the fetched collection attributes.
87
- *
88
- * This function fetches the attributes of a given collection. It takes the following parameter:
89
- * - collection (string): The ticker of the collection to fetch the attributes for.
90
- *
91
- * The function first validates the input ticker and checks if it is a valid collection ticker.
92
- * If it is valid, the function fetches the collection attributes using the API.
93
- * Finally, it returns a promise that resolves to the fetched collection attributes.
94
- */
95
- getCollectionAttributes = async (collection) => {
96
- if (!isValidCollectionTicker(collection)) {
97
- throw new Error('Invalid collection ticker: ' + collection);
98
- }
99
- const response = await this.api.fetchWithTimeout(`/collection/${collection}/attributes`, {
100
- next: {
101
- tags: ['getCollectionAttributes'],
102
- revalidate: 180,
103
- },
104
- });
105
- return response;
106
- };
107
- /**
108
- * Searches for NFTs based on the provided arguments.
109
- * @param {SearchNFTsArgs} args - The SearchNFTsArgs object containing the search parameters.
110
- * @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
111
- * @throws An error if the provided collection ticker is invalid or if the 'top' value is greater than 35.
112
- */
113
- getNFTs = async (args) => {
114
- args?.collections?.forEach((element) => {
115
- if (!isValidCollectionTicker(element)) {
116
- throw new Error('Invalid collection ticker: ' + element);
117
- }
118
- });
119
- if (args.top && args.top > 35) {
120
- throw new Error('Top cannot be greater than 35');
121
- }
122
- const ranges = [];
123
- if (args.priceRange) {
124
- ranges.push({
125
- ...args.priceRange,
126
- field: args.auctionType == AuctionTypes.Auctions
127
- ? 'saleInfo.currentBidShort'
128
- : 'saleInfo.minBidShort',
129
- });
130
- }
131
- if (args.rankRange) {
132
- ranges.push({
133
- ...args.rankRange,
134
- field: 'metadata.rarity.rank',
135
- });
136
- }
137
- const payloadBody = {
138
- filters: {
139
- dataType: args.dataType ?? ['nft'],
140
- // @borispoehland Has to be false only if we want to show the expired auctions, undefined to show all, and true only actives
141
- activeAuction: args.activeAuctions,
142
- collection: args.collections ?? [],
143
- onSale: args.onlyOnSale,
144
- saleInfo: {
145
- seller: args.listedBy || [],
146
- marketplace: args.listedOnlyOn || undefined,
147
- paymentToken: args.listedInToken || [],
148
- auctionType: args.auctionType == AuctionTypes.Auctions
149
- ? ['NftBid', 'SftAll']
150
- : args.auctionType == AuctionTypes.FixedPrice
151
- ? ['Nft', 'SftOnePerPayment']
152
- : args.auctionType == AuctionTypes.AllListed
153
- ? ['NftBid', 'SftAll', 'Nft', 'SftOnePerPayment']
154
- : undefined,
155
- },
156
- owner: args.ownedBy || [],
157
- verifiedOnly: args.onlyVerified || false,
158
- metadata: {
159
- attributes: args.attributes || undefined,
160
- },
161
- range: ranges,
162
- cp_staked: args.isStaked || undefined,
163
- },
164
- applyNftExtraDetails: args.applyNftExtraDetails,
165
- orderBy: args.orderBy || [],
166
- select: args.onlySelectFields || [],
167
- includeCount: args.includeCount || false,
168
- top: args.top || 35,
169
- skip: args.skip || 0,
170
- };
171
- const response = await this.api.fetchWithTimeout(`/nft/query`, {
172
- params: {
173
- filter: JSON.stringify(payloadBody),
174
- },
175
- next: {
176
- tags: ['getCollectionNFTs'],
177
- },
178
- cache: 'no-store',
179
- });
180
- return {
181
- ...response,
182
- getNextPagePayload: {
183
- ...args,
184
- skip: (args.skip ?? 0) + (args.top ?? 35),
185
- },
186
- };
187
- };
188
- /**
189
- * @public
190
- * @async
191
- * @function suggestCollections
192
- * @param {SuggestNFTsArgs} args - An object containing the necessary parameters to fetch suggested collections results.
193
- * @returns {Promise<SuggestResults>} A promise that resolves to the fetched collections results.
194
- *
195
- * This function fetches suggested collections results based on the provided arguments. It takes an object with the following properties:
196
- * - name (string): The name to search for (required).
197
- * - top (number, optional): The maximum number of results to return (default is 35, cannot be greater than 35).
198
- * - skip (number, optional): The number of results to skip (default is 0).
199
- *
200
- * Finally, it returns a promise that resolves to the fetched collections results.
201
- */
202
- suggestCollections = async (args) => {
203
- if (args.top && args.top > 35) {
204
- throw new Error('Top cannot be greater than 35');
205
- }
206
- if (!args.name) {
207
- throw new Error('Name is required');
208
- }
209
- const payloadBody = {
210
- name: args.name,
211
- top: args.top || 35,
212
- skip: args.skip || 0,
213
- };
214
- return await this.api.fetchWithTimeout(`/collection/search`, {
215
- params: {
216
- filter: JSON.stringify(payloadBody),
217
- },
218
- next: {
219
- tags: ['/collection/search'],
220
- revalidate: 180,
221
- },
222
- });
223
- };
224
- /**
225
- * @public
226
- * @async
227
- * @function collectionListings
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
- collectionListingsAnalytics = async (ticker) => {
232
- return await this.api.fetchWithTimeout(`collection/${ticker}/listing`, {
233
- next: {
234
- tags: ['collection/${ticker}/listing'],
235
- revalidate: 500,
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
- getTradingActivity = async (args) => {
247
- return await 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
- getCollections = async (args) => {
256
- if (args?.top && args.top > 25) {
257
- throw new Error('Top cannot be greater than 25');
258
- }
259
- const payloadBody = {
260
- skip: args?.skip || 0,
261
- top: args?.top || 25,
262
- select: args?.onlySelectFields || [],
263
- filters: {
264
- dataType: 'collectionProfile',
265
- isMintable: args?.onlyMintable || undefined,
266
- ...(args?.collections &&
267
- args.collections.length > 0 && {
268
- collection: args.collections,
269
- }),
270
- },
271
- orderBy: [args?.orderBy || 'statistics.tradeData.weekEgldVolume desc'],
272
- };
273
- const response = await this.api.fetchWithTimeout(`/collection/query`, {
274
- params: {
275
- filter: JSON.stringify(payloadBody),
276
- },
277
- next: {
278
- tags: ['getCollections'],
279
- revalidate: 180,
280
- },
281
- });
282
- return {
283
- results: response,
284
- resultsCount: response.length,
285
- empty: response.length === 0,
286
- getNextPagePayload: {
287
- ...args,
288
- skip: (args?.skip || 0) + (args?.top || 25),
289
- },
290
- hasMoreResults: response.length >= (args?.top || 25),
291
- };
292
- };
293
- /**
294
- * Fetch global offers based on the provided arguments.
295
- * @param {GetGlobalOffersArgs} args - The GetCollectionsArgs object containing the search parameters.
296
- * @returns {Promise<GlobalOffersResult>} A Promise that resolves to the GlobalOffersResult object.
297
- * @throws An error if the 'top' value is greater than 35.
298
- */
299
- getGlobalOffers = async (args) => {
300
- if (args?.top && args.top > 25) {
301
- throw new Error('Top cannot be greater than 25');
302
- }
303
- const payloadBody = {
304
- skip: args?.skip || 0,
305
- top: args?.top || 25,
306
- select: args?.onlySelectFields || [],
307
- filters: {
308
- collection: args?.collections || [],
309
- withAttributes: args?.withAttributes ?? false,
310
- isActive: args?.onlyActive ?? true,
311
- offerId: args?.offerIds,
312
- owner: args?.ownedBy,
313
- marketplace: args?.listedOnlyOn,
314
- range: args?.priceRange
315
- ? { ...args.priceRange, type: 'priceShort' }
316
- : undefined,
317
- attributes: args?.attributes,
318
- },
319
- orderBy: [args?.orderBy || GlobalOfferOrderBy.PriceHighToLow],
320
- };
321
- const response = await this.api.fetchWithTimeout(`/collection/global-offer/query`, {
322
- params: {
323
- filter: JSON.stringify(payloadBody),
324
- },
325
- next: {
326
- tags: ['getGlobalOffers'],
327
- revalidate: 12,
328
- },
329
- });
330
- return {
331
- ...response,
332
- getNextPagePayload: {
333
- ...args,
334
- skip: (args?.top || 25) + response.lastSkip,
335
- },
336
- };
337
- };
338
- /**
339
- * @public
340
- * @async
341
- * @function getCollectionVolume
342
- * @param {string} collection - The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
343
- * @param {string} after - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
344
- * @param {string} before - The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
345
- * @param {string} bin - The binning period for the volume data (e.g., '1d' for 1 day).
346
- * @returns {Promise<CollectionVolume[]>} A promise that resolves to an array of collection volume data.
347
- *
348
- * This function fetches volume data for a given collection within a specified date range and binning period. It takes the following parameters:
349
- * - collection (string): The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
350
- * - after (string): The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
351
- * - before (string): The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
352
- * - bin (string): The binning period for the volume data (e.g., '1d' for 1 day).
353
- *
354
- * The function first validates the input collection ticker and checks if it is a valid collection ticker.
355
- * If it is valid, the function fetches the collection volume data using the API with the specified query parameters.
356
- * Finally, it returns a promise that resolves to an array of collection volume data.
357
- */
358
- getCollectionVolume = async (collection, after, before, bin) => {
359
- if (!isValidCollectionTicker(collection)) {
360
- throw new Error('Invalid collection ticker: ' + collection);
361
- }
362
- const response = await this.api.fetchWithTimeout(`/collection/${collection}/analytics/volume?startTime=${after}&endTime=${before}&bin=${bin}`, {
363
- next: {
364
- tags: ['getCollectionVolume'],
365
- revalidate: 180,
366
- },
367
- });
368
- return response;
369
- };
370
- /**
371
- * @public
372
- * @async
373
- * @function getMarketplaceVolume
374
- * @param {string} after - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
375
- * @param {string} before - The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
376
- * @param {string} bin - The binning period for the volume data (e.g., '1d' for 1 day).
377
- * @returns {Promise<CollectionVolume[]>} A promise that resolves to an array of collection volume data.
378
- *
379
- * This function fetches volume data for a given collection within a specified date range and binning period. It takes the following parameters:
380
- * - collection (string): The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
381
- * - after (string): The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
382
- * - before (string): The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
383
- * - bin (string): The binning period for the volume data (e.g., '1d' for 1 day).
384
- *
385
- * The function first validates the input collection ticker and checks if it is a valid collection ticker.
386
- * If it is valid, the function fetches the collection volume data using the API with the specified query parameters.
387
- * Finally, it returns a promise that resolves to an array of collection volume data.
388
- */
389
- getMarketplaceVolume = async (after, before, bin) => {
390
- const response = await this.api.fetchWithTimeout(`/analytics/volume?startTime=${after}&endTime=${before}&bin=${bin}`, {
391
- next: {
392
- tags: ['getMarketplaceVolume'],
393
- revalidate: 180,
394
- },
395
- });
396
- return response;
397
- };
398
- /**
399
- * @public
400
- * @async
401
- * @function getCollectionOwners
402
- * @param {string} collection - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
403
- * @returns {Promise<IOwners>} A promise that resolves a struct of collection information about holders
404
- *
405
- * This function fetches owner information for a given collection. It takes the following parameter:
406
- * - collection (string): The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
407
- *
408
- * The function first validates the input collection ticker and checks if it is a valid collection ticker.
409
- * If it is valid, the function fetches the collection owner information using the API.
410
- * Finally, it returns a promise that resolves a struct of collection information about holders
411
- */
412
- getCollectionOwners = async (collection) => {
413
- if (!isValidCollectionTicker(collection)) {
414
- throw new Error('Invalid collection ticker: ' + collection);
415
- }
416
- const response = await this.api.fetchWithTimeout(`/collection/${collection}/holders`, {
417
- next: {
418
- tags: ['getCollectionOwners'],
419
- revalidate: 500,
420
- },
421
- });
422
- return response;
423
- };
424
- /**
425
- * @public
426
- * @async
427
- * @function getExportOwners
428
- * @param {string} collection - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
429
- * @returns {Promise<ISingleHolder[]>} A promise that resolves an array of holders part of the collection.
430
- *
431
- * This function fetches owners information for a given collection. It takes the following parameter:
432
- * - collection (string): The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
433
- *
434
- * The function first validates the input collection ticker and checks if it is a valid collection ticker.
435
- * If it is valid, the function fetches the collection owner information using the API.
436
- * Finally, it returns a promise that resolves to an array of collection owner information.
437
- */
438
- getExportOwners = async (collection) => {
439
- if (!isValidCollectionTicker(collection)) {
440
- throw new Error('Invalid collection ticker: ' + collection);
441
- }
442
- const response = await this.api.fetchWithTimeout(`/collection/${collection}/holders?exportHolders=true`, {
443
- next: {
444
- tags: ['getExportOwners'],
445
- },
446
- });
447
- return response;
448
- };
449
- /**
450
- * @public
451
- * @async
452
- * @function getCollectionsStatistics
453
- * @param {GetCollectionStatsArgs} args - The filter payload for the collection statsitics
454
- * @returns {Promise<CollectionStatsResults>} A promise that resolves to a struct with information
455
- * Finally, it returns a promise that resolves a struct with information
456
- */
457
- getCollectionsStatistics = async (args) => {
458
- if (args?.top && args.top > 25) {
459
- throw new Error('Top cannot be greater than 25');
460
- }
461
- const response = await this.api.fetchWithTimeout(`/collection/stats/query`, {
462
- params: {
463
- filter: JSON.stringify(args),
464
- },
465
- next: {
466
- tags: ['collectionStatistics'],
467
- revalidate: 12,
468
- },
469
- });
470
- return {
471
- ...response,
472
- getNextPagePayload: {
473
- ...args,
474
- skip: args.skip + args.top,
475
- },
476
- };
477
- };
478
- /**
479
- * @public
480
- * @async
481
- * @function getCollectionStats
482
- * @param {GetCollectionStatsArgs} args - The filter payload for the collection statsitics
483
- * @returns {Promise<CollectionStatsDoc>} A promise that resolves to a struct with information
484
- * Finally, it returns a promise that resolves a struct with information
485
- */
486
- getCollectionStats = async (ticker) => {
487
- if (!isValidCollectionTicker(ticker)) {
488
- throw new Error('Invalid collection ticker: ' + ticker);
489
- }
490
- return await this.api.fetchWithTimeout(`/collection/${ticker}/stats`, {
491
- next: {
492
- tags: ['collectionStatistics'],
493
- revalidate: 12,
494
- },
495
- });
496
- };
497
- getAwaitEmpty = async (delay) => {
498
- return new Promise((resolve) => {
499
- setTimeout(() => {
500
- resolve(true);
501
- }, delay);
502
- });
503
- };
504
- /**
505
- * @public
506
- * @async
507
- * @function getCollectionMintInfo
508
- * @param {string} ticker - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
509
- * @returns {Promise<GetCollectionMintInfo>} A promise that resolves to a struct with information
510
- * Finally, it returns a promise that resolves a struct with information
511
- */
512
- getCollectionMintInfo = async ({ ticker, extra, }) => {
513
- if (!isValidCollectionTicker(ticker)) {
514
- throw new Error('Invalid collection ticker: ' + ticker);
515
- }
516
- const response = await this.api.fetchWithTimeout(`/collection/${ticker}/drop-info`, {
517
- next: {
518
- tags: [`/collection/${ticker}/drop-info`],
519
- revalidate: 12,
520
- },
521
- ...extra,
522
- });
523
- return response;
524
- };
525
- /**
526
- * @public
527
- * @async
528
- * @function getCollectionRanks
529
- * @param {string} ticker - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
530
- * @returns {Promise<CollectionRanksExport[]>} A promise that resolves to a struct with information
531
- * Finally, it returns a promise that resolves a struct with information
532
- */
533
- getCollectionRanks = async ({ ticker, extra, }) => {
534
- if (!isValidCollectionTicker(ticker)) {
535
- throw new Error('Invalid collection ticker: ' + ticker);
536
- }
537
- const response = await this.api.fetchWithTimeout(`/collection/${ticker}/ranks`, {
538
- next: {
539
- tags: [`/collection/${ticker}/ranks`],
540
- revalidate: 60,
541
- },
542
- ...extra,
543
- });
544
- return response;
545
- };
546
- /**
547
- * @public
548
- * @async
549
- * @function getDropInfo
550
- * @param {string} collectionTag - The unique ID of the collection part of the launchpad smart contract
551
- * @param {string} creatorTag - The unique ID of the creator part of the launchpad smart contract
552
- * @returns {Promise<GetCollectionMintInfo>} A promise that resolves to a struct with information
553
- * Finally, it returns a promise that resolves a struct with information
554
- */
555
- getDropInfo = async ({ collectionTag, creatorTag, extra, }) => {
556
- const response = await this.api.fetchWithTimeout(`/collection/${creatorTag}/${collectionTag}/drop-info`, {
557
- next: {
558
- tags: [`/collection/${creatorTag}/${collectionTag}/drop-info`],
559
- revalidate: 12,
560
- },
561
- ...extra,
562
- });
563
- return response;
564
- };
565
- /**
566
- * @public
567
- * @async
568
- * @function getCollectionGraphData
569
- * @param category - The ticker of the collection.
570
- * @returns {Promise<AnalyticsGraphs>} A promise the required analytics data
571
- * This function gets the global graph data
572
- */
573
- getCollectionGraphData = async (collection, startTime, endTime, bin) => {
574
- if (!isValidCollectionTicker(collection)) {
575
- throw new Error('Invalid collection ticker: ' + collection);
576
- }
577
- const response = await this.api.fetchWithTimeout(`/collection/${collection}/analytics/volume`, {
578
- params: {
579
- startTime: startTime,
580
- endTime: endTime,
581
- bin: bin,
582
- },
583
- next: {
584
- tags: [`/collection/${collection}/analytics/volume`],
585
- revalidate: 60,
586
- },
587
- });
588
- return response;
589
- };
590
- /**
591
- * @public
592
- * @async
593
- * @function getPinnedCollections
594
- * @param category - The ticker of the collection.
595
- * @returns {Promise<AnalyticsGraphs>} A promise the required analytics data
596
- * This function gets the global graph data
597
- */
598
- getPinnedCollections = async () => {
599
- const response = await this.api.fetchWithTimeout(`/collection/pinned`, {
600
- next: {
601
- tags: [`/collection/pinned`],
602
- revalidate: 60,
603
- },
604
- });
605
- return response;
606
- };
607
- /**
608
- * Get drops based on the provided arguments.
609
- * @param {SearchNFTsArgs} args - The SearchNFTsArgs object containing the search parameters.
610
- * @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
611
- * @throws An error if the provided collection ticker is invalid or if the 'top' value is greater than 35.
612
- */
613
- getDrops = async (args) => {
614
- args?.collections?.forEach((element) => {
615
- if (!isValidCollectionTicker(element)) {
616
- throw new Error('Invalid collection ticker: ' + element);
617
- }
618
- });
619
- if (args.top && args.top > 35) {
620
- throw new Error('Top cannot be greater than 35');
621
- }
622
- const ranges = [];
623
- if (args.timeRange) {
624
- ranges.push({
625
- ...args.timeRange,
626
- field: 'startTime',
627
- });
628
- }
629
- const payloadBody = {
630
- filters: {
631
- collection: args.collections ?? [],
632
- verifiedOnly: args.onlyVerified || false,
633
- mintToken: args.listedInToken || undefined,
634
- range: ranges,
635
- },
636
- orderBy: args.orderBy || [],
637
- select: args.onlySelectFields || [],
638
- includeCount: args.includeCount || false,
639
- top: args.top || 35,
640
- skip: args.skip || 0,
641
- };
642
- const response = await this.api.fetchWithTimeout(`/collection/drops/query`, {
643
- params: {
644
- filter: JSON.stringify(payloadBody),
645
- },
646
- next: {
647
- tags: ['/collection/drops/query'],
648
- },
649
- cache: 'no-store',
650
- });
651
- return {
652
- ...response,
653
- getNextPagePayload: {
654
- ...args,
655
- skip: (args.skip ?? 0) + (args.top ?? 35),
656
- },
657
- };
658
- };
659
- }
660
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collection/index.ts"],"names":[],"mappings":"AACA,OAAO,EAeL,kBAAkB,EAOlB,YAAY,GAGb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,OAAO,gBAAgB;IACnB,GAAG,CAAc;IACzB;QACE,IAAI,CAAC,GAAG,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,oBAAoB,GAAG,KAAK,EACjC,UAAkB,EACW,EAAE;QAC/B,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,UAAU,CAAC,CAAC;QAC9D,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,eAAe,UAAU,UAAU,EACnC;YACE,IAAI,EAAE;gBACJ,IAAI,EAAE,CAAC,sBAAsB,CAAC;gBAC9B,UAAU,EAAE,EAAE;aACf;SACF,CACF,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;IAEF;;;;;;OAMG;IACI,gBAAgB,GAAG,KAAK,IAAwB,EAAE;QACvD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,wBAAwB,EACxB;YACE,IAAI,EAAE;gBACJ,IAAI,EAAE,CAAC,kBAAkB,CAAC;gBAC1B,UAAU,EAAE,GAAG;aAChB;SACF,CACF,CAAC;QACF,OAAO,QA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