@xoxno/sdk-js 0.1.74-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.d.ts +7 -1
  18. package/{dist → out/cjs}/types/collection.js +34 -26
  19. package/out/cjs/types/collection.js.map +1 -0
  20. package/out/cjs/types/common.js +3 -0
  21. package/{dist → out/cjs}/types/common.js.map +1 -1
  22. package/out/cjs/types/index.js +24 -0
  23. package/out/cjs/types/index.js.map +1 -0
  24. package/{dist → out/cjs}/types/interactions.js +5 -2
  25. package/out/cjs/types/interactions.js.map +1 -0
  26. package/out/cjs/types/nft.js +3 -0
  27. package/out/cjs/types/nft.js.map +1 -0
  28. package/out/cjs/types/staking.js +15 -0
  29. package/out/cjs/types/staking.js.map +1 -0
  30. package/{dist → out/cjs}/types/trading.js +9 -6
  31. package/out/cjs/types/trading.js.map +1 -0
  32. package/out/cjs/types/user.js +13 -0
  33. package/out/cjs/types/user.js.map +1 -0
  34. package/out/cjs/users/index.js +335 -0
  35. package/out/cjs/users/index.js.map +1 -0
  36. package/out/cjs/utils/SmartContractAbis.js +103 -0
  37. package/out/cjs/utils/SmartContractAbis.js.map +1 -0
  38. package/out/cjs/utils/SmartContractService.js +13 -0
  39. package/out/cjs/utils/SmartContractService.js.map +1 -0
  40. package/out/cjs/utils/api.js +79 -0
  41. package/out/cjs/utils/api.js.map +1 -0
  42. package/out/cjs/utils/const.js +17 -0
  43. package/out/cjs/utils/const.js.map +1 -0
  44. package/out/cjs/utils/getActivity.js +65 -0
  45. package/out/cjs/utils/getActivity.js.map +1 -0
  46. package/out/cjs/utils/helpers.js +27 -0
  47. package/out/cjs/utils/helpers.js.map +1 -0
  48. package/out/cjs/utils/regex.js +12 -0
  49. package/out/cjs/utils/regex.js.map +1 -0
  50. package/out/cjs/utils/scCalls.js +39 -0
  51. package/out/cjs/utils/scCalls.js.map +1 -0
  52. package/out/src/collection/__tests__/collection.test.js +2 -0
  53. package/out/src/collection/__tests__/collection.test.js.map +1 -0
  54. package/out/src/collection/index.js +2 -0
  55. package/out/src/collection/index.js.map +1 -0
  56. package/out/src/common/index.js +2 -0
  57. package/out/src/common/index.js.map +1 -0
  58. package/out/src/index.js +2 -0
  59. package/out/src/index.js.map +1 -0
  60. package/out/src/index.large.js +2 -0
  61. package/out/src/index.large.js.map +1 -0
  62. package/out/src/interactions/__tests__/market.test.js +2 -0
  63. package/out/src/interactions/__tests__/market.test.js.map +1 -0
  64. package/out/src/interactions/index.js +2 -0
  65. package/out/src/interactions/index.js.map +1 -0
  66. package/out/src/launchpad/__tests__/market.test.js +2 -0
  67. package/out/src/launchpad/__tests__/market.test.js.map +1 -0
  68. package/out/src/launchpad/index.js +2 -0
  69. package/out/src/launchpad/index.js.map +1 -0
  70. package/out/src/nft/__tests__/nft.test.js +2 -0
  71. package/out/src/nft/__tests__/nft.test.js.map +1 -0
  72. package/out/src/nft/index.js +2 -0
  73. package/out/src/nft/index.js.map +1 -0
  74. package/out/src/staking/index.js +2 -0
  75. package/out/src/staking/index.js.map +1 -0
  76. package/out/src/types/collection.js +2 -0
  77. package/out/src/types/collection.js.map +1 -0
  78. package/out/src/types/common.js +2 -0
  79. package/out/src/types/common.js.map +1 -0
  80. package/out/src/types/index.js +2 -0
  81. package/out/src/types/index.js.map +1 -0
  82. package/out/src/types/interactions.js +2 -0
  83. package/out/src/types/interactions.js.map +1 -0
  84. package/out/src/types/nft.js +2 -0
  85. package/out/src/types/nft.js.map +1 -0
  86. package/out/src/types/staking.js +2 -0
  87. package/out/src/types/staking.js.map +1 -0
  88. package/out/src/types/trading.js +2 -0
  89. package/out/src/types/trading.js.map +1 -0
  90. package/out/src/types/user.js +2 -0
  91. package/out/src/types/user.js.map +1 -0
  92. package/out/src/users/__tests__/user.test.js +2 -0
  93. package/out/src/users/__tests__/user.test.js.map +1 -0
  94. package/out/src/users/index.js +2 -0
  95. package/out/src/users/index.js.map +1 -0
  96. package/out/src/utils/SmartContractAbis.js +2 -0
  97. package/out/src/utils/SmartContractAbis.js.map +1 -0
  98. package/out/src/utils/SmartContractService.js +2 -0
  99. package/out/src/utils/SmartContractService.js.map +1 -0
  100. package/out/src/utils/api.js +2 -0
  101. package/out/src/utils/api.js.map +1 -0
  102. package/out/src/utils/const.js +2 -0
  103. package/out/src/utils/const.js.map +1 -0
  104. package/out/src/utils/getActivity.js +2 -0
  105. package/out/src/utils/getActivity.js.map +1 -0
  106. package/out/src/utils/helpers.js +2 -0
  107. package/out/src/utils/helpers.js.map +1 -0
  108. package/out/src/utils/regex.js +2 -0
  109. package/out/src/utils/regex.js.map +1 -0
  110. package/out/src/utils/scCalls.js +2 -0
  111. package/out/src/utils/scCalls.js.map +1 -0
  112. package/package.json +27 -14
  113. package/.eslintrc.json +0 -19
  114. package/dist/collection/index.js +0 -660
  115. package/dist/collection/index.js.map +0 -1
  116. package/dist/common/index.js +0 -132
  117. package/dist/common/index.js.map +0 -1
  118. package/dist/index.js +0 -10
  119. package/dist/index.js.map +0 -1
  120. package/dist/index.large.js +0 -3
  121. package/dist/index.large.js.map +0 -1
  122. package/dist/interactions/index.js +0 -619
  123. package/dist/interactions/index.js.map +0 -1
  124. package/dist/launchpad/index.js +0 -140
  125. package/dist/launchpad/index.js.map +0 -1
  126. package/dist/nft/index.js +0 -109
  127. package/dist/nft/index.js.map +0 -1
  128. package/dist/staking/index.js +0 -17
  129. package/dist/staking/index.js.map +0 -1
  130. package/dist/types/collection.js.map +0 -1
  131. package/dist/types/common.js +0 -2
  132. package/dist/types/index.js +0 -8
  133. package/dist/types/index.js.map +0 -1
  134. package/dist/types/interactions.js.map +0 -1
  135. package/dist/types/nft.js +0 -2
  136. package/dist/types/nft.js.map +0 -1
  137. package/dist/types/staking.js +0 -12
  138. package/dist/types/staking.js.map +0 -1
  139. package/dist/types/trading.js.map +0 -1
  140. package/dist/types/user.js +0 -10
  141. package/dist/types/user.js.map +0 -1
  142. package/dist/users/index.js +0 -324
  143. package/dist/users/index.js.map +0 -1
  144. package/dist/utils/SmartContractAbis.js +0 -84
  145. package/dist/utils/SmartContractAbis.js.map +0 -1
  146. package/dist/utils/SmartContractService.js +0 -9
  147. package/dist/utils/SmartContractService.js.map +0 -1
  148. package/dist/utils/api.js +0 -82
  149. package/dist/utils/api.js.map +0 -1
  150. package/dist/utils/const.js +0 -14
  151. package/dist/utils/const.js.map +0 -1
  152. package/dist/utils/getActivity.js +0 -64
  153. package/dist/utils/getActivity.js.map +0 -1
  154. package/dist/utils/helpers.js +0 -21
  155. package/dist/utils/helpers.js.map +0 -1
  156. package/dist/utils/regex.js +0 -7
  157. package/dist/utils/regex.js.map +0 -1
  158. package/dist/utils/scCalls.js +0 -25
  159. package/dist/utils/scCalls.js.map +0 -1
  160. /package/{dist → out/cjs}/collection/index.d.ts +0 -0
  161. /package/{dist → out/cjs}/common/index.d.ts +0 -0
  162. /package/{dist → out/cjs}/index.d.ts +0 -0
  163. /package/{dist → out/cjs}/index.large.d.ts +0 -0
  164. /package/{dist → out/cjs}/interactions/index.d.ts +0 -0
  165. /package/{dist → out/cjs}/launchpad/index.d.ts +0 -0
  166. /package/{dist → out/cjs}/nft/index.d.ts +0 -0
  167. /package/{dist → out/cjs}/staking/index.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,324 +0,0 @@
1
- import { CollectionModule, XOXNOClient } from '../index';
2
- import { getActivity } from '../utils/getActivity';
3
- import { isAddressValid } from '../utils/helpers';
4
- import { isValidCollectionTicker } from '../utils/regex';
5
- export class UserModule {
6
- api;
7
- collection;
8
- constructor() {
9
- this.api = XOXNOClient.init();
10
- this.collection = new CollectionModule();
11
- }
12
- /**
13
- * Returns the user profile
14
- *
15
- * @param {String} address - Address of the user
16
- * @returns {IUserProfile}
17
- */
18
- getUserProfile = async (address) => {
19
- if (!isAddressValid(address))
20
- throw new Error('Invalid address');
21
- const response = await this.api.fetchWithTimeout(`/user/${address}/profile`);
22
- return response;
23
- };
24
- /**
25
- * Returns the wallet accounts
26
- *
27
- * @param {String[]} addresses - Addresses of the user
28
- * @returns {BulkAccount[]}
29
- */
30
- getBulkAccounts = async (addresses) => {
31
- const response = await this.api.fetchWithTimeout(`/user/network-account`, {
32
- method: 'POST',
33
- body: JSON.stringify(addresses),
34
- });
35
- return response;
36
- };
37
- /**
38
- * Returns the user account info that inclues nonce, guardian data, esdtTokens
39
- *
40
- * @param {String} address - Address of the user
41
- * @returns {UserAccountInfo}
42
- */
43
- getUserAccount = async (address) => {
44
- if (!isAddressValid(address))
45
- throw new Error('Invalid address');
46
- const response = await this.api.fetchWithTimeout(`/user/${address}/network-account`);
47
- return response;
48
- };
49
- /**
50
- * Returns the user account info that inclues nonce, guardian data, esdtTokens
51
- *
52
- * @param {String} address - Address of the user
53
- * @returns {UserAccountInfo}
54
- */
55
- getUserTokenInventory = async (address) => {
56
- if (!isAddressValid(address))
57
- throw new Error('Invalid address');
58
- const response = await this.api.fetchWithTimeout(`/user/${address}/token-inventory`);
59
- return response;
60
- };
61
- /**
62
- * Gets user's inventory
63
- *
64
- * @param {String} address - User's address
65
- * @returns {UserInventory} User's inventory
66
- */
67
- getUserSummaryInventory = async (address) => {
68
- if (!isAddressValid(address))
69
- throw new Error('Invalid address');
70
- const response = await this.api.fetchWithTimeout(`/user/${address}/inventory-summary`);
71
- return response;
72
- };
73
- /**
74
- * Fetches the user's NFTs listed on the marketplaces
75
- * @param address - The user's address
76
- * @returns {UserInventory} - A list of token ids and the price
77
- */
78
- getUserNFTs = async (args) => {
79
- return await this.collection.getNFTs(args);
80
- };
81
- /**
82
- * @name getUserOffers
83
- * @description Fetches all offers sent or received associated with a user address
84
- * @param {String} address - The user's wallet address
85
- * @returns {UserOffers} - The user's listings
86
- */
87
- getUserOffers = async (args) => {
88
- if (!isAddressValid(args.address))
89
- throw new Error('Invalid address');
90
- const response = await this.api.fetchWithTimeout(`/user/${args.address}/offers`, {
91
- params: {
92
- type: args.type,
93
- skip: args.skip,
94
- top: args.top,
95
- },
96
- });
97
- return response;
98
- };
99
- /**
100
- * @public
101
- * @async
102
- * @function suggestUsers
103
- * @param {SuggestNFTsArgs} args - An object containing the necessary parameters to fetch suggested users results.
104
- * @returns {Promise<SuggestResults>} A promise that resolves to the fetched users results.
105
- *
106
- * This function fetches suggested users results based on the provided arguments. It takes an object with the following properties:
107
- * - name (string): The name to search for (required).
108
- * - top (number, optional): The maximum number of results to return (default is 35, cannot be greater than 35).
109
- * - skip (number, optional): The number of results to skip (default is 0).
110
- *
111
- * Finally, it returns a promise that resolves to the fetched users results.
112
- */
113
- suggestUsers = async (args) => {
114
- if (args.top && args.top > 35) {
115
- throw new Error('Top cannot be greater than 35');
116
- }
117
- if (!args.name) {
118
- throw new Error('Name is required');
119
- }
120
- const payloadBody = {
121
- name: args.name,
122
- top: args.top || 35,
123
- skip: args.skip || 0,
124
- };
125
- return await this.api.fetchWithTimeout(`/user/search`, {
126
- params: {
127
- filter: JSON.stringify(payloadBody),
128
- },
129
- next: {
130
- tags: ['/search/global'],
131
- revalidate: 180,
132
- },
133
- });
134
- };
135
- /**
136
- * Retrieves trading history based on the provided arguments.
137
- *
138
- * @param {TradincActivityArgs} args - The arguments for filtering the trading activity.
139
- * @returns {Promise<TradingActivityResponse>} A promise resolving to a TradingActivityResponse object containing the activity.
140
- * @throws {Error} Throws an error if the 'top' argument is greater than 35.
141
- */
142
- getTradingActivity = async (args) => {
143
- return await getActivity(args, this.api);
144
- };
145
- /** Gets user's creator profile
146
- * @param {String} address - User's address
147
- * @returns {CreatorProfile} User's creator profile struct
148
- * @throws {Error} Throws an error if the address is invalid
149
- * */
150
- getUserCreatorProfile = async (address) => {
151
- if (!isAddressValid(address))
152
- throw new Error('Invalid address');
153
- const response = await this.api.fetchWithTimeout(`/user/${address}/creator/profile`);
154
- return response;
155
- };
156
- /** Gets user's creator profile
157
- * @param {String} address - User's address
158
- * @returns {IMintInfo[]} User's creator profile struct
159
- * @throws {Error} Throws an error if the address is invalid
160
- * */
161
- getCreatorListings = async (address) => {
162
- if (!isAddressValid(address))
163
- throw new Error('Invalid address');
164
- const response = await this.api.fetchWithTimeout(`/user/${address}/creator/listing`);
165
- return response;
166
- };
167
- /** Gets user's staking info
168
- * @param {String} address - User's address
169
- * @returns {UserStakingSummary[]} User's staking info
170
- * @throws {Error} Throws an error if the address is invalid
171
- * */
172
- getUserStakingSummary = async (address) => {
173
- if (!isAddressValid(address))
174
- throw new Error('Invalid address');
175
- const response = await this.api.fetchWithTimeout(`/user/${address}/staking/summary`);
176
- return response;
177
- };
178
- /** Gets user's staking info
179
- * @param {String} address - User's address
180
- * @returns {UserStakingAvaiblePools[]} User's staking info
181
- * @throws {Error} Throws an error if the address is invalid
182
- * */
183
- getUserStakingAailable = async (address) => {
184
- if (!isAddressValid(address))
185
- throw new Error('Invalid address');
186
- const response = await this.api.fetchWithTimeout(`/user/${address}/staking/available-pools`);
187
- return response;
188
- };
189
- /** Gets user's creator info
190
- * @param {String} address - User's address
191
- * @returns {CreatorInfo} User's creator info
192
- * @throws {Error} Throws an error if the address is invalid
193
- * */
194
- getUserCreatorInfo = async (address) => {
195
- if (!isAddressValid(address))
196
- throw new Error('Invalid address');
197
- const response = await this.api.fetchWithTimeout(`/user/${address}/creator/details`);
198
- return response;
199
- };
200
- /** Gets pool details
201
- * @param {String} address - User's address
202
- * @param {String} collection - Collection ticker
203
- * @returns {UserCollectionStaking} User's creator info
204
- * @throws {Error} Throws an error if the address is invalid
205
- * */
206
- getUserCollectionStaking = async (address, collection) => {
207
- if (!isAddressValid(address))
208
- throw new Error('Invalid address');
209
- if (!isValidCollectionTicker(collection)) {
210
- throw new Error('Invalid collection ticker: ' + collection);
211
- }
212
- const response = await this.api.fetchWithTimeout(`/user/${address}/staking/collection/${collection}`);
213
- return response;
214
- };
215
- /** Gets pool details
216
- * @param {number} poolId - User's address
217
- * @returns {CreatoPoolDetailsrInfo} User's creator info
218
- * @throws {Error} Throws an error if the address is invalid
219
- * */
220
- getUserPoolStaking = async (address, poolId) => {
221
- if (!isAddressValid(address))
222
- throw new Error('Invalid address');
223
- const response = await this.api.fetchWithTimeout(`/user/${address}/staking/pool/${poolId}`);
224
- return response;
225
- };
226
- /** Gets pool details
227
- * @param {number} poolId - User's address
228
- * @returns {CreatoPoolDetailsrInfo} User's creator info
229
- * @throws {Error} Throws an error if the address is invalid
230
- * */
231
- getAvailableNFTsForStakingPool = async (address, poolId) => {
232
- if (!isAddressValid(address))
233
- throw new Error('Invalid address');
234
- const response = await this.api.fetchWithTimeout(`/user/${address}/staking/pool/${poolId}/nfts`);
235
- return response;
236
- };
237
- /** Gets owned pools by address
238
- * @param {string} address - User's address
239
- * @returns {PoolDetails[]} User pools
240
- * @throws {Error} Throws an error if the address is invalid
241
- * */
242
- getOwnedPoolsByAddress = async (address) => {
243
- if (!isAddressValid(address))
244
- throw new Error('Invalid address');
245
- const response = await this.api.fetchWithTimeout(`/user/${address}/staking/owned-pools`);
246
- return response;
247
- };
248
- /**
249
- * Gets user's analytics summary
250
- *
251
- * @param {String} address - User's address
252
- * @returns {UserAnalyticSummary} User's analytics summary
253
- */
254
- getUserAnalyticsSummary = async (address) => {
255
- if (!isAddressValid(address))
256
- throw new Error('Invalid address');
257
- const response = await this.api.fetchWithTimeout(`/user/${address}/analytics/volume`);
258
- return response;
259
- };
260
- /** Gets user's favorite NFTs
261
- * @param {String} address - User's address
262
- * @param {number} top - Top
263
- * @param {number} skip - Skip
264
- * @returns {NftData[]} Array of NFTs
265
- * @throws {Error} Throws an error if the address is invalid
266
- * */
267
- getUserFavoriteNFTs = async (address, top, skip) => {
268
- if (!isAddressValid(address))
269
- throw new Error('Invalid address');
270
- const response = await this.api.fetchWithTimeout(`/user/${address}/favorite/nfts`, {
271
- params: {
272
- top,
273
- skip,
274
- },
275
- });
276
- return response;
277
- };
278
- /** Gets user's favorite collection tickers
279
- * @param {String} address - User's address
280
- * @returns {String[]} Array of tickers
281
- * @throws {Error} Throws an error if the address is invalid
282
- * */
283
- getUserFavoriteCollectionTickers = async (address) => {
284
- if (!isAddressValid(address))
285
- throw new Error('Invalid address');
286
- const response = await this.api.fetchWithTimeout(`/user/${address}/favorite/collections`);
287
- return response;
288
- };
289
- /** Get if the creator tag is registered already
290
- * @param {String} creatorTag - The creator tag that needs to be checked
291
- * @returns {StatusResponse} True or false
292
- * */
293
- getIsCreatorRegistered = async (creatorTag) => {
294
- const response = await this.api.fetchWithTimeout(`/user/${creatorTag}/creator/is-registered`);
295
- return response;
296
- };
297
- /**
298
- * @public
299
- * @async
300
- * @function getUsersStats
301
- * @param {SuggestNFTsArgs} args - An object containing the necessary parameters to fetch suggested users results.
302
- * @returns {Promise<SuggestResults>} A promise that resolves to the fetched users results.
303
- */
304
- getUsersStats = async (args) => {
305
- if (args.top && args.top > 35) {
306
- throw new Error('Top cannot be greater than 35');
307
- }
308
- if (!args.name) {
309
- throw new Error('Name is required');
310
- }
311
- return await this.api.fetchWithTimeout(`/user/stats`, {
312
- params: {
313
- top: args.top,
314
- skip: args.skip,
315
- orderBy: args.orderBy,
316
- },
317
- next: {
318
- tags: ['/search/global'],
319
- revalidate: 180,
320
- },
321
- });
322
- };
323
- }
324
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/users/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AA4BzD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,MAAM,OAAO,UAAU;IACb,GAAG,CAAc;IACjB,UAAU,CAAmB;IACrC;QACE,IAAI,CAAC,GAAG,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,IAAI,gBAAgB,EAAE,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACI,cAAc,GAAG,KAAK,EAAE,OAAe,EAAyB,EAAE;QACvE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC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C,gBAAgB,CAAiB,aAAa,EAAE;YACpE,MAAM,EAAE;gBACN,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,CAAC,gBAAgB,CAAC;gBACxB,UAAU,EAAE,GAAG;aAChB;SACF,CAAC,CAAC;IACL,CAAC,CAAC;CACH"}
@@ -1,84 +0,0 @@
1
- import { AbiRegistry } from '@multiversx/sdk-core/out/smartcontracts/typesystem/abiRegistry';
2
- import { XOXNOClient } from './api';
3
- export class SmartContractAbis {
4
- static manager;
5
- static exchange;
6
- static minter;
7
- static market;
8
- static staking;
9
- static p2p;
10
- static async getMarket() {
11
- if (!SmartContractAbis.market) {
12
- const data = await XOXNOClient.init().fetchWithTimeout('https://media.xoxno.com/smartcontractabi/esdt-nft-marketplace.abi.json', {
13
- next: {
14
- tags: ['getMarket'],
15
- },
16
- });
17
- const abiRegistry = AbiRegistry.create(data);
18
- SmartContractAbis.market = abiRegistry;
19
- }
20
- return SmartContractAbis.market;
21
- }
22
- static async getManager() {
23
- if (!SmartContractAbis.manager) {
24
- const data = await XOXNOClient.init().fetchWithTimeout('https://media.xoxno.com/smartcontractabi/manage.json', {
25
- next: {
26
- tags: ['getManager'],
27
- },
28
- });
29
- const abiRegistry = AbiRegistry.create(data);
30
- SmartContractAbis.manager = abiRegistry;
31
- }
32
- return SmartContractAbis.manager;
33
- }
34
- static async getMinter() {
35
- if (!SmartContractAbis.minter) {
36
- const data = await XOXNOClient.init().fetchWithTimeout('https://media.xoxno.com/smartcontractabi/minter.json', {
37
- next: {
38
- tags: ['getMinter'],
39
- },
40
- });
41
- const abiRegistry = AbiRegistry.create(data);
42
- SmartContractAbis.minter = abiRegistry;
43
- }
44
- return SmartContractAbis.minter;
45
- }
46
- static async getStaking() {
47
- if (!SmartContractAbis.staking) {
48
- const data = await XOXNOClient.init().fetchWithTimeout('https://media.xoxno.com/smartcontractabi/staking-nfts.abi.json', {
49
- next: {
50
- tags: ['getStaking'],
51
- },
52
- });
53
- const abiRegistry = AbiRegistry.create(data);
54
- SmartContractAbis.staking = abiRegistry;
55
- }
56
- return SmartContractAbis.staking;
57
- }
58
- static async getExchange() {
59
- if (!SmartContractAbis.exchange) {
60
- const data = await XOXNOClient.init().fetchWithTimeout('https://media.xoxno.com/smartcontractabi/rs-exchange.abi.json', {
61
- next: {
62
- tags: ['getExchange'],
63
- },
64
- });
65
- const abiRegistry = AbiRegistry.create(data);
66
- SmartContractAbis.exchange = abiRegistry;
67
- }
68
- return SmartContractAbis.exchange;
69
- }
70
- static async getP2P() {
71
- if (!SmartContractAbis.p2p) {
72
- const data = await XOXNOClient.init().fetchWithTimeout('https://media.xoxno.com/smartcontractabi/p2p.abi.json', {
73
- next: {
74
- tags: ['getP2P'],
75
- revalidate: 500,
76
- },
77
- });
78
- const abiRegistry = AbiRegistry.create(data);
79
- SmartContractAbis.p2p = abiRegistry;
80
- }
81
- return SmartContractAbis.p2p;
82
- }
83
- }
84
- //# sourceMappingURL=SmartContractAbis.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SmartContractAbis.js","sourceRoot":"","sources":["../../src/utils/SmartContractAbis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gEAAgE,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAAC,OAAO,CAAc;IAC5B,MAAM,CAAC,QAAQ,CAAc;IAC7B,MAAM,CAAC,MAAM,CAAc;IAC3B,MAAM,CAAC,MAAM,CAAc;IAC3B,MAAM,CAAC,OAAO,CAAc;IAC5B,MAAM,CAAC,GAAG,CAAc;IAEzB,MAAM,CAAC,KAAK,CAAC,SAAS;QAC3B,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;YAC9B,MAAM,IAAI,GAAG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C,GAAG,CAAC;IAC/B,CAAC;CACF"}
@@ -1,9 +0,0 @@
1
- import { Address } from '@multiversx/sdk-core/out/address';
2
- import { SmartContract } from '@multiversx/sdk-core/out/smartcontracts/smartContract';
3
- export const getSmartContract = (abiRegistry, address) => {
4
- return new SmartContract({
5
- address: new Address(address),
6
- abi: abiRegistry,
7
- });
8
- };
9
- //# sourceMappingURL=SmartContractService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SmartContractService.js","sourceRoot":"","sources":["../../src/utils/SmartContractService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AAGtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,WAAwB,EAAE,OAAe,EAAE,EAAE;IAC5E,OAAO,IAAI,aAAa,CAAC;QACvB,OAAO,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC;QAC7B,GAAG,EAAE,WAAW;KACjB,CAAC,CAAC;AACL,CAAC,CAAC"}
package/dist/utils/api.js DELETED
@@ -1,82 +0,0 @@
1
- import { API_URL, API_URL_DEV, DR_SC, FM_SC, KG_SC, Manager_SC, Manager_SC_DEV, P2P_SC, P2P_SC_DEV, Staking_SC, Staking_SC_DEV, XOXNO_SC, XOXNO_SC_DEV, } from './const';
2
- export var Chain;
3
- (function (Chain) {
4
- Chain["MAINNET"] = "1";
5
- Chain["DEVNET"] = "D";
6
- })(Chain || (Chain = {}));
7
- export class XOXNOClient {
8
- static instance;
9
- apiUrl;
10
- apiKey;
11
- chain;
12
- config;
13
- constructor(apiUrl = API_URL, apiKey = '', chain = Chain.MAINNET) {
14
- this.apiUrl = apiUrl;
15
- this.apiKey = apiKey;
16
- this.chain = chain;
17
- this.config =
18
- chain === Chain.MAINNET
19
- ? {
20
- XO_SC: XOXNO_SC,
21
- FM_SC: FM_SC,
22
- DR_SC,
23
- KG_SC,
24
- Staking_SC,
25
- Manager_SC,
26
- P2P_SC,
27
- }
28
- : {
29
- XO_SC: XOXNO_SC_DEV,
30
- FM_SC,
31
- DR_SC,
32
- KG_SC,
33
- Staking_SC: Staking_SC_DEV,
34
- Manager_SC: Manager_SC_DEV,
35
- P2P_SC: P2P_SC_DEV,
36
- };
37
- }
38
- static init({ apiUrl = API_URL, apiKey = '', chain = Chain.MAINNET, } = {}) {
39
- if (!XOXNOClient.instance) {
40
- if (chain == Chain.DEVNET) {
41
- XOXNOClient.instance = new XOXNOClient(API_URL_DEV, apiKey, chain);
42
- }
43
- XOXNOClient.instance = new XOXNOClient(apiUrl, apiKey, chain);
44
- }
45
- return XOXNOClient.instance;
46
- }
47
- fetchWithTimeout = async (path, options = {}, timeout = 40000) => {
48
- const headers = {
49
- 'Accept-Encoding': 'gzip,deflate,br',
50
- Referer: 'https://xoxno.sdk',
51
- 'User-Agent': 'XOXNO/1.0/SDK',
52
- ...(options.method === 'POST'
53
- ? { 'Content-Type': 'application/json' }
54
- : {}),
55
- ...(options.headers ?? {}),
56
- };
57
- const shouldInsertOrigin = typeof path === 'string' && path.startsWith('/');
58
- const url = `${shouldInsertOrigin ? `${this.apiUrl}${path}` : path}${options.params
59
- ? '?' +
60
- Object.keys(options.params)
61
- .map((key) => {
62
- return `${key}=${encodeURIComponent(options.params[key])}`;
63
- })
64
- .join('&')
65
- : ''}`;
66
- const controller = new AbortController();
67
- setTimeout(() => controller.abort(), timeout);
68
- const res = await fetch(url, {
69
- ...options,
70
- ...(options?.next && options.next.revalidate
71
- ? {}
72
- : { cache: 'no-store' }),
73
- signal: controller.signal,
74
- ...(Object.keys(headers).length ? { headers } : {}),
75
- method: options.method ?? 'GET',
76
- });
77
- if (!res.ok)
78
- throw new Error((await res.json()).message.toString());
79
- return res.json();
80
- };
81
- }
82
- //# sourceMappingURL=api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL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EAAE,CAAC;QACzC,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;QAC9C,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAC3B,GAAG,OAAO;YACV,GAAG,CAAC,OAAO,EAAE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,UAAU;gBAC1C,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;YAC1B,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACnD,MAAM,EAAG,OAAO,CAAC,MAAc,IAAI,KAAK;SACzC,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QACpE,OAAO,GAAG,CAAC,IAAI,EAAO,CAAC;IACzB,CAAC,CAAC;CACH"}
@@ -1,14 +0,0 @@
1
- export const API_URL = 'https://api.xoxno.com';
2
- export const API_URL_DEV = 'https://api-dev.xoxno.com';
3
- export const XOXNO_SC = 'erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8';
4
- export const FM_SC = 'erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s';
5
- export const DR_SC = 'erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0';
6
- export const KG_SC = 'erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e';
7
- export const Staking_SC = 'erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z';
8
- export const Manager_SC = 'erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7';
9
- export const P2P_SC = 'erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6';
10
- export const XOXNO_SC_DEV = 'erd1qqqqqqqqqqqqqpgqn4fnwl43hhchz9emdy66eh5azzhl599zd8ssxjdyh3';
11
- export const Staking_SC_DEV = 'erd1qqqqqqqqqqqqqpgqmkt2fvumf0zgum5qd0awl2l46x2pxdgmr5rswjr6r8';
12
- export const Manager_SC_DEV = 'erd1qqqqqqqqqqqqqpgq6sysl7mga393a850xemfpawaqanf4da5d8ssp3xamn';
13
- export const P2P_SC_DEV = 'erd1qqqqqqqqqqqqqpgqhuvnvkwwmucdzy3g7pvgvjumjfcgfwf69w2svch5c2';
14
- //# sourceMappingURL=const.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"const.js","sourceRoot":"","sources":["../../src/utils/const.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,uBAAuB,CAAC;AAC/C,MAAM,CAAC,MAAM,WAAW,GAAG,2BAA2B,CAAC;AAEvD,MAAM,CAAC,MAAM,QAAQ,GACnB,gEAAgE,CAAC;AACnE,MAAM,CAAC,MAAM,KAAK,GAChB,gEAAgE,CAAC;AACnE,MAAM,CAAC,MAAM,KAAK,GAChB,gEAAgE,CAAC;AACnE,MAAM,CAAC,MAAM,KAAK,GAChB,gEAAgE,CAAC;AACnE,MAAM,CAAC,MAAM,UAAU,GACrB,gEAAgE,CAAC;AACnE,MAAM,CAAC,MAAM,UAAU,GACrB,gEAAgE,CAAC;AACnE,MAAM,CAAC,MAAM,MAAM,GACjB,gEAAgE,CAAC;AAEnE,MAAM,CAAC,MAAM,YAAY,GACvB,gEAAgE,CAAC;AACnE,MAAM,CAAC,MAAM,cAAc,GACzB,gEAAgE,CAAC;AACnE,MAAM,CAAC,MAAM,cAAc,GACzB,gEAAgE,CAAC;AACnE,MAAM,CAAC,MAAM,UAAU,GACrB,gEAAgE,CAAC"}
@@ -1,64 +0,0 @@
1
- /**
2
- * Fetches the trading activity of the given collections
3
- * @param args - The trading activity arguments
4
- * @param api - The API client
5
- * @returns - The trading activity response
6
- * @throws - If the top is greater than 35
7
- */
8
- export const getActivity = async (args, api) => {
9
- if (args.top && args.top > 35) {
10
- throw new Error('Top cannot be greater than 35');
11
- }
12
- const ranges = [];
13
- if (args.priceRange) {
14
- ranges.push({
15
- ...args.priceRange,
16
- field: 'activityData.egldValue',
17
- });
18
- }
19
- if (args.timestampRange) {
20
- ranges.push({
21
- ...args.timestampRange,
22
- field: 'timestamp',
23
- });
24
- }
25
- const payloadBody = {
26
- filters: {
27
- activityData: args.from == null && args.to == null
28
- ? {
29
- collection: args.collections,
30
- identifier: args.identifiers || undefined,
31
- }
32
- : undefined,
33
- from: args.from,
34
- to: args.to,
35
- activityAddress: args.wallets || undefined,
36
- source: args.source || undefined,
37
- activityType: args.activityType || undefined,
38
- range: ranges,
39
- },
40
- strictSelect: args.strictSelect,
41
- orderBy: args.orderBy,
42
- select: args.select,
43
- top: args.top || 35,
44
- skip: args.skip || 0,
45
- };
46
- const response = await api.fetchWithTimeout(`/activity/query`, {
47
- params: {
48
- filter: JSON.stringify(payloadBody),
49
- },
50
- next: {
51
- tags: ['getActivity'],
52
- revalidate: 180,
53
- },
54
- });
55
- return {
56
- ...response,
57
- getNextPagePayload: {
58
- ...args,
59
- skip: (args.skip ?? 0) + (args.top ?? 35),
60
- },
61
- empty: response.resources.length === 0,
62
- };
63
- };
64
- //# sourceMappingURL=getActivity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getActivity.js","sourceRoot":"","sources":["../../src/utils/getActivity.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAC9B,IAAy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CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,gBAAgB,CACzC,iBAAiB,EACjB;QACE,MAAM,EAAE;YACN,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;SACpC;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,CAAC,aAAa,CAAC;YACrB,UAAU,EAAE,GAAG;SAChB;KACF,CACF,CAAC;IAEF,OAAO;QACL,GAAG,QAAQ;QACX,kBAAkB,EAAE;YAClB,GAAG,IAAI;YACP,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;SAC1C;QACD,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC;KACvC,CAAC;AACJ,CAAC,CAAC"}
@@ -1,21 +0,0 @@
1
- import { Address } from '@multiversx/sdk-core/out/address';
2
- export const nonceToHex = (nonce) => {
3
- let nonceHex = nonce.toString(16);
4
- if (nonceHex.length % 2 !== 0) {
5
- nonceHex = '0' + nonceHex;
6
- }
7
- return nonceHex;
8
- };
9
- export const getIdentifierFromColAndNonce = (collection, nonce) => {
10
- return [collection, nonceToHex(nonce)].join('-');
11
- };
12
- export const isAddressValid = (address) => {
13
- try {
14
- new Address(address);
15
- return true && address.includes('erd1');
16
- }
17
- catch (error) {
18
- return false;
19
- }
20
- };
21
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAa,EAAU,EAAE;IAClD,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC;IAC5B,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,UAAkB,EAClB,KAAa,EACL,EAAE;IACV,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAwB,EAAW,EAAE;IAClE,IAAI,CAAC;QACH,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- export const isValidCollectionTicker = (ticker) => {
2
- return /^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(ticker);
3
- };
4
- export const isValidNftIdentifier = (identifier) => {
5
- return /^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,5}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(identifier);
6
- };
7
- //# sourceMappingURL=regex.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"regex.js","sourceRoot":"","sources":["../../src/utils/regex.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAc,EAAW,EAAE;IACjE,OAAO,8BAA8B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACrD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,UAAkB,EAAW,EAAE;IAClE,OAAO,gFAAgF,CAAC,IAAI,CAC1F,UAAU,CACX,CAAC;AACJ,CAAC,CAAC"}