@xoxno/sdk-js 0.1.3-alpha → 0.1.5-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.
- package/dist/collection/index.d.ts +75 -3
- package/dist/collection/index.js +119 -3
- package/dist/collection/index.js.map +1 -1
- package/dist/nft/index.d.ts +16 -0
- package/dist/nft/index.js +21 -0
- package/dist/nft/index.js.map +1 -1
- package/dist/staking/index.js.map +1 -1
- package/dist/types/collection.d.ts +131 -49
- package/dist/types/collection.js +33 -1
- package/dist/types/collection.js.map +1 -1
- package/dist/types/user.d.ts +48 -0
- package/dist/types/user.js.map +1 -1
- package/dist/users/index.d.ts +8 -1
- package/dist/users/index.js +12 -0
- package/dist/users/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NftData } from '../types';
|
|
2
|
+
import { CollectionsNFTsResponse, GetCollectionsArgs, ICollectionAttributes, ICollectionProfile, GetNFTsArgs, SearchNFTsResponse, SuggestNFTsArgs, SuggestResults, CollectionVolume, FloorPriceHistory, FungibleAssets, FungibleAssetsMap, AssetCategory, IOwners, ISingleHolder, CollectionsSummary, CollectionsSummaryFilter } from '../types/collection';
|
|
2
3
|
import { TradincActivityArgs, TradingActivityResponse } from '../types/trading';
|
|
3
4
|
/**
|
|
4
5
|
* CollectionModule provides a set of methods to interact with NFT collections.
|
|
@@ -26,6 +27,31 @@ export default class CollectionModule {
|
|
|
26
27
|
* Finally, it returns a promise that resolves to the fetched collection profile.
|
|
27
28
|
*/
|
|
28
29
|
getCollectionProfile: (collection: string) => Promise<ICollectionProfile>;
|
|
30
|
+
/**
|
|
31
|
+
* @public
|
|
32
|
+
* @async
|
|
33
|
+
* @function getFungibleTokens
|
|
34
|
+
* @param category - The ticker of the collection.
|
|
35
|
+
* @returns {Promise<FungibleAssetsMap>} A promise that resolves a map of ESDT tokens and their info
|
|
36
|
+
* This function fetches all branded fungible assets and their info
|
|
37
|
+
*/
|
|
38
|
+
getFungibleTokens: (categories?: AssetCategory[]) => Promise<FungibleAssetsMap>;
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
* @async
|
|
42
|
+
* @function getFungibleToken
|
|
43
|
+
* @returns {Promise<FungibleAssets>} A promise that resolves the ESDT token info
|
|
44
|
+
* This function fetches the branded fungible asset info
|
|
45
|
+
*/
|
|
46
|
+
getFungibleToken: (identifier: string) => Promise<FungibleAssets>;
|
|
47
|
+
/**
|
|
48
|
+
* @public
|
|
49
|
+
* @async
|
|
50
|
+
* @function getDailyTrending
|
|
51
|
+
* @returns {Promise<NftData[]>} A promise that resolves to the array of trending NFTs.
|
|
52
|
+
* This function fetches the top NFTs that are trending today based on their floor and volumes
|
|
53
|
+
*/
|
|
54
|
+
getDailyTrending: () => Promise<NftData[]>;
|
|
29
55
|
/**
|
|
30
56
|
* Fetches the floor price of a collection.
|
|
31
57
|
* @param collection - The ticker of the collection.
|
|
@@ -110,6 +136,26 @@ export default class CollectionModule {
|
|
|
110
136
|
* Finally, it returns a promise that resolves to an array of collection volume data.
|
|
111
137
|
*/
|
|
112
138
|
getCollectionVolume: (collection: string, after: string, before: string, bin: string) => Promise<CollectionVolume[]>;
|
|
139
|
+
/**
|
|
140
|
+
* @public
|
|
141
|
+
* @async
|
|
142
|
+
* @function getMarketplaceVolume
|
|
143
|
+
* @param {string} after - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
144
|
+
* @param {string} before - The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
|
|
145
|
+
* @param {string} bin - The binning period for the volume data (e.g., '1d' for 1 day).
|
|
146
|
+
* @returns {Promise<CollectionVolume[]>} A promise that resolves to an array of collection volume data.
|
|
147
|
+
*
|
|
148
|
+
* This function fetches volume data for a given collection within a specified date range and binning period. It takes the following parameters:
|
|
149
|
+
* - collection (string): The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
|
|
150
|
+
* - after (string): The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
151
|
+
* - before (string): The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
|
|
152
|
+
* - bin (string): The binning period for the volume data (e.g., '1d' for 1 day).
|
|
153
|
+
*
|
|
154
|
+
* The function first validates the input collection ticker and checks if it is a valid collection ticker.
|
|
155
|
+
* If it is valid, the function fetches the collection volume data using the API with the specified query parameters.
|
|
156
|
+
* Finally, it returns a promise that resolves to an array of collection volume data.
|
|
157
|
+
*/
|
|
158
|
+
getMarketplaceVolume: (after: string, before: string, bin: string) => Promise<CollectionVolume[]>;
|
|
113
159
|
/**
|
|
114
160
|
* @public
|
|
115
161
|
* @async
|
|
@@ -136,14 +182,40 @@ export default class CollectionModule {
|
|
|
136
182
|
* @async
|
|
137
183
|
* @function getCollectionOwners
|
|
138
184
|
* @param {string} collection - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
|
|
139
|
-
* @returns {Promise<
|
|
185
|
+
* @returns {Promise<IOwners>} A promise that resolves a struct of collection information about holders
|
|
140
186
|
*
|
|
141
187
|
* This function fetches owner information for a given collection. It takes the following parameter:
|
|
142
188
|
* - collection (string): The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
|
|
143
189
|
*
|
|
144
190
|
* The function first validates the input collection ticker and checks if it is a valid collection ticker.
|
|
145
191
|
* If it is valid, the function fetches the collection owner information using the API.
|
|
192
|
+
* Finally, it returns a promise that resolves a struct of collection information about holders
|
|
193
|
+
*/
|
|
194
|
+
getCollectionOwners: (collection: string) => Promise<IOwners>;
|
|
195
|
+
/**
|
|
196
|
+
* @public
|
|
197
|
+
* @async
|
|
198
|
+
* @function getExportOwners
|
|
199
|
+
* @param {string} collection - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
|
|
200
|
+
* @returns {Promise<ISingleHolder[]>} A promise that resolves an array of holders part of the collection.
|
|
201
|
+
*
|
|
202
|
+
* This function fetches owners information for a given collection. It takes the following parameter:
|
|
203
|
+
* - collection (string): The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
|
|
204
|
+
*
|
|
205
|
+
* The function first validates the input collection ticker and checks if it is a valid collection ticker.
|
|
206
|
+
* If it is valid, the function fetches the collection owner information using the API.
|
|
146
207
|
* Finally, it returns a promise that resolves to an array of collection owner information.
|
|
147
208
|
*/
|
|
148
|
-
|
|
209
|
+
getExportOwners: (collection: string) => Promise<ISingleHolder[]>;
|
|
210
|
+
/**
|
|
211
|
+
* @public
|
|
212
|
+
* @async
|
|
213
|
+
* @function getCollectionsSummary
|
|
214
|
+
* @param {string} type - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
215
|
+
* @param {string} skip - The offset from where to start reading
|
|
216
|
+
* @param {string} take - How many results per call
|
|
217
|
+
* @returns {Promise<CollectionsSummary>} A promise that resolves to a struct with information
|
|
218
|
+
* Finally, it returns a promise that resolves a struct with information
|
|
219
|
+
*/
|
|
220
|
+
getCollectionsSummary: (type: CollectionsSummaryFilter, skip: number, take: number) => Promise<CollectionsSummary>;
|
|
149
221
|
}
|
package/dist/collection/index.js
CHANGED
|
@@ -51,6 +51,53 @@ class CollectionModule {
|
|
|
51
51
|
});
|
|
52
52
|
return response;
|
|
53
53
|
});
|
|
54
|
+
/**
|
|
55
|
+
* @public
|
|
56
|
+
* @async
|
|
57
|
+
* @function getFungibleTokens
|
|
58
|
+
* @param category - The ticker of the collection.
|
|
59
|
+
* @returns {Promise<FungibleAssetsMap>} A promise that resolves a map of ESDT tokens and their info
|
|
60
|
+
* This function fetches all branded fungible assets and their info
|
|
61
|
+
*/
|
|
62
|
+
this.getFungibleTokens = (categories = [collection_1.AssetCategory.ALL]) => __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const category = categories.join(',');
|
|
64
|
+
const response = yield this.api.fetchWithTimeout(`/getFungibleTokens?category=${category}`, {
|
|
65
|
+
next: {
|
|
66
|
+
tags: ['getFungibleTokens'],
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
return response;
|
|
70
|
+
});
|
|
71
|
+
/**
|
|
72
|
+
* @public
|
|
73
|
+
* @async
|
|
74
|
+
* @function getFungibleToken
|
|
75
|
+
* @returns {Promise<FungibleAssets>} A promise that resolves the ESDT token info
|
|
76
|
+
* This function fetches the branded fungible asset info
|
|
77
|
+
*/
|
|
78
|
+
this.getFungibleToken = (identifier) => __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const response = yield this.api.fetchWithTimeout(`/getFungibleTokens/${identifier}`, {
|
|
80
|
+
next: {
|
|
81
|
+
tags: ['getFungibleToken'],
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
return response;
|
|
85
|
+
});
|
|
86
|
+
/**
|
|
87
|
+
* @public
|
|
88
|
+
* @async
|
|
89
|
+
* @function getDailyTrending
|
|
90
|
+
* @returns {Promise<NftData[]>} A promise that resolves to the array of trending NFTs.
|
|
91
|
+
* This function fetches the top NFTs that are trending today based on their floor and volumes
|
|
92
|
+
*/
|
|
93
|
+
this.getDailyTrending = () => __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
const response = yield this.api.fetchWithTimeout('/nfts/getDailyTrending', {
|
|
95
|
+
next: {
|
|
96
|
+
tags: ['getDailyTrending'],
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
return response;
|
|
100
|
+
});
|
|
54
101
|
/**
|
|
55
102
|
* Fetches the floor price of a collection.
|
|
56
103
|
* @param collection - The ticker of the collection.
|
|
@@ -141,7 +188,6 @@ class CollectionModule {
|
|
|
141
188
|
skip: args.skip || 0,
|
|
142
189
|
};
|
|
143
190
|
const buffer = Buffer.from(JSON.stringify(payloadBody)).toString('base64');
|
|
144
|
-
console.log(buffer);
|
|
145
191
|
const response = yield this.api.fetchWithTimeout(`/getNfts/${buffer}`, {
|
|
146
192
|
next: {
|
|
147
193
|
tags: ['getCollectionNFTs'],
|
|
@@ -266,6 +312,33 @@ class CollectionModule {
|
|
|
266
312
|
});
|
|
267
313
|
return response;
|
|
268
314
|
});
|
|
315
|
+
/**
|
|
316
|
+
* @public
|
|
317
|
+
* @async
|
|
318
|
+
* @function getMarketplaceVolume
|
|
319
|
+
* @param {string} after - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
320
|
+
* @param {string} before - The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
|
|
321
|
+
* @param {string} bin - The binning period for the volume data (e.g., '1d' for 1 day).
|
|
322
|
+
* @returns {Promise<CollectionVolume[]>} A promise that resolves to an array of collection volume data.
|
|
323
|
+
*
|
|
324
|
+
* This function fetches volume data for a given collection within a specified date range and binning period. It takes the following parameters:
|
|
325
|
+
* - collection (string): The ticker of the collection to fetch the volume for (e.g., 'EAPES-8f3c1f').
|
|
326
|
+
* - after (string): The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
327
|
+
* - before (string): The end date (inclusive) of the date range for the volume data (e.g., '2023-04-25').
|
|
328
|
+
* - bin (string): The binning period for the volume data (e.g., '1d' for 1 day).
|
|
329
|
+
*
|
|
330
|
+
* The function first validates the input collection ticker and checks if it is a valid collection ticker.
|
|
331
|
+
* If it is valid, the function fetches the collection volume data using the API with the specified query parameters.
|
|
332
|
+
* Finally, it returns a promise that resolves to an array of collection volume data.
|
|
333
|
+
*/
|
|
334
|
+
this.getMarketplaceVolume = (after, before, bin) => __awaiter(this, void 0, void 0, function* () {
|
|
335
|
+
const response = yield this.api.fetchWithTimeout(`/getMarketplaceVolume?after=${after}&before=${before}&bin=${bin}`, {
|
|
336
|
+
next: {
|
|
337
|
+
tags: ['getMarketplaceVolume'],
|
|
338
|
+
},
|
|
339
|
+
});
|
|
340
|
+
return response;
|
|
341
|
+
});
|
|
269
342
|
/**
|
|
270
343
|
* @public
|
|
271
344
|
* @async
|
|
@@ -302,14 +375,14 @@ class CollectionModule {
|
|
|
302
375
|
* @async
|
|
303
376
|
* @function getCollectionOwners
|
|
304
377
|
* @param {string} collection - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
|
|
305
|
-
* @returns {Promise<
|
|
378
|
+
* @returns {Promise<IOwners>} A promise that resolves a struct of collection information about holders
|
|
306
379
|
*
|
|
307
380
|
* This function fetches owner information for a given collection. It takes the following parameter:
|
|
308
381
|
* - collection (string): The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
|
|
309
382
|
*
|
|
310
383
|
* The function first validates the input collection ticker and checks if it is a valid collection ticker.
|
|
311
384
|
* If it is valid, the function fetches the collection owner information using the API.
|
|
312
|
-
* Finally, it returns a promise that resolves
|
|
385
|
+
* Finally, it returns a promise that resolves a struct of collection information about holders
|
|
313
386
|
*/
|
|
314
387
|
this.getCollectionOwners = (collection) => __awaiter(this, void 0, void 0, function* () {
|
|
315
388
|
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
@@ -322,6 +395,49 @@ class CollectionModule {
|
|
|
322
395
|
});
|
|
323
396
|
return response;
|
|
324
397
|
});
|
|
398
|
+
/**
|
|
399
|
+
* @public
|
|
400
|
+
* @async
|
|
401
|
+
* @function getExportOwners
|
|
402
|
+
* @param {string} collection - The ticker of the collection to fetch the owner information for (e.g., 'EAPES-8f3c1f').
|
|
403
|
+
* @returns {Promise<ISingleHolder[]>} A promise that resolves an array of holders part of the collection.
|
|
404
|
+
*
|
|
405
|
+
* This function fetches owners 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 to an array of collection owner information.
|
|
411
|
+
*/
|
|
412
|
+
this.getExportOwners = (collection) => __awaiter(this, void 0, void 0, function* () {
|
|
413
|
+
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
414
|
+
throw new Error('Invalid collection ticker: ' + collection);
|
|
415
|
+
}
|
|
416
|
+
const response = yield this.api.fetchWithTimeout(`/getCollectionOwners/${collection}?exportHolders=true`, {
|
|
417
|
+
next: {
|
|
418
|
+
tags: ['getExportOwners'],
|
|
419
|
+
},
|
|
420
|
+
});
|
|
421
|
+
return response;
|
|
422
|
+
});
|
|
423
|
+
/**
|
|
424
|
+
* @public
|
|
425
|
+
* @async
|
|
426
|
+
* @function getCollectionsSummary
|
|
427
|
+
* @param {string} type - The start date (inclusive) of the date range for the volume data (e.g., '2023-04-17').
|
|
428
|
+
* @param {string} skip - The offset from where to start reading
|
|
429
|
+
* @param {string} take - How many results per call
|
|
430
|
+
* @returns {Promise<CollectionsSummary>} A promise that resolves to a struct with information
|
|
431
|
+
* Finally, it returns a promise that resolves a struct with information
|
|
432
|
+
*/
|
|
433
|
+
this.getCollectionsSummary = (type, skip, take) => __awaiter(this, void 0, void 0, function* () {
|
|
434
|
+
const response = yield this.api.fetchWithTimeout(`/getCollectionsSummary/${type}/${skip}/${take}`, {
|
|
435
|
+
next: {
|
|
436
|
+
tags: ['getCollectionsSummary'],
|
|
437
|
+
},
|
|
438
|
+
});
|
|
439
|
+
return response;
|
|
440
|
+
});
|
|
325
441
|
this.api = api_1.default.init();
|
|
326
442
|
}
|
|
327
443
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collection/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collection/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,oDAoB6B;AAE7B,uDAAuC;AACvC,sDAAmD;AACnD,0CAAyD;AAEzD;;;;;;;GAOG;AACH,MAAqB,gBAAgB;IAEnC;QAIA;;;;;;;;;;;;;WAaG;QACI,yBAAoB,GAAG,CAC5B,UAAkB,EACW,EAAE;YAC/B,IAAI,CAAC,IAAA,+BAAuB,EAAC,UAAU,CAAC,EAAE;gBACxC,MAAM,IAAI,KA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BF;AA5hBD,mCA4hBC"}
|
package/dist/nft/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NftData } from '../types/nft';
|
|
2
2
|
import { TradingActivityResponse, TradincActivityArgs } from '../types/trading';
|
|
3
|
+
import { UserOffers } from '../types/user';
|
|
3
4
|
/**
|
|
4
5
|
* NFTModule provides a set of methods to interact with single NFTs.
|
|
5
6
|
* It includes methods for getting single NFT information, and searching NFTs by collection and nonce.
|
|
@@ -25,6 +26,21 @@ export default class NFTModule {
|
|
|
25
26
|
* Finally, it returns a promise that resolves to the fetched NFT data.
|
|
26
27
|
*/
|
|
27
28
|
getNFTByIdentifier: (identifier: string) => Promise<NftData>;
|
|
29
|
+
/**
|
|
30
|
+
* @public
|
|
31
|
+
* @async
|
|
32
|
+
* @function getNFTByIdentifier
|
|
33
|
+
* @param {string} identifier - The identifier of the NFT to fetch data for.
|
|
34
|
+
* @returns {Promise<NftData>} A promise that resolves to the fetched NFT data.
|
|
35
|
+
*
|
|
36
|
+
* This function fetches data for a given NFT by its identifier. It takes the following parameter:
|
|
37
|
+
* - identifier (string): The identifier of the NFT to fetch data for.
|
|
38
|
+
*
|
|
39
|
+
* The function first validates the input identifier and checks if it is a valid NFT identifier.
|
|
40
|
+
* If it is valid, the function fetches the NFT data using the API.
|
|
41
|
+
* Finally, it returns a promise that resolves to the fetched NFT data.
|
|
42
|
+
*/
|
|
43
|
+
getNFTsOffers: (identifier: string, skip?: number, top?: number) => Promise<UserOffers>;
|
|
28
44
|
/**
|
|
29
45
|
* Gets an NFT by collection and nonce.
|
|
30
46
|
* @param collection The collection ticker.
|
package/dist/nft/index.js
CHANGED
|
@@ -46,6 +46,27 @@ class NFTModule {
|
|
|
46
46
|
const response = yield this.api.fetchWithTimeout(`/getSingleNft/${identifier}`);
|
|
47
47
|
return response;
|
|
48
48
|
});
|
|
49
|
+
/**
|
|
50
|
+
* @public
|
|
51
|
+
* @async
|
|
52
|
+
* @function getNFTByIdentifier
|
|
53
|
+
* @param {string} identifier - The identifier of the NFT to fetch data for.
|
|
54
|
+
* @returns {Promise<NftData>} A promise that resolves to the fetched NFT data.
|
|
55
|
+
*
|
|
56
|
+
* This function fetches data for a given NFT by its identifier. It takes the following parameter:
|
|
57
|
+
* - identifier (string): The identifier of the NFT to fetch data for.
|
|
58
|
+
*
|
|
59
|
+
* The function first validates the input identifier and checks if it is a valid NFT identifier.
|
|
60
|
+
* If it is valid, the function fetches the NFT data using the API.
|
|
61
|
+
* Finally, it returns a promise that resolves to the fetched NFT data.
|
|
62
|
+
*/
|
|
63
|
+
this.getNFTsOffers = (identifier, skip = 0, top = 25) => __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
if (!(0, regex_1.isValidNftIdentifier)(identifier)) {
|
|
65
|
+
throw new Error('Invalid identifier: ' + identifier);
|
|
66
|
+
}
|
|
67
|
+
const response = yield this.api.fetchWithTimeout(`/getSingleNft/${identifier}/offers?skip=${skip}&top=${top}`);
|
|
68
|
+
return response;
|
|
69
|
+
});
|
|
49
70
|
/**
|
|
50
71
|
* Gets an NFT by collection and nonce.
|
|
51
72
|
* @param collection The collection ticker.
|
package/dist/nft/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nft/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nft/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA,uDAAuC;AACvC,sDAAmD;AACnD,8CAAgE;AAChE,0CAA+E;AAE/E;;;;;;GAMG;AAEH,MAAqB,SAAS;IAE5B;QAIA;;;;;;;;;;;;;WAaG;QACI,uBAAkB,GAAG,CAAO,UAAkB,EAAoB,EAAE;YACzE,IAAI,CAAC,IAAA,4BAAoB,EAAC,UAAU,CAAC,EAAE;gBACrC,MAAM,IAAI,KAAK,CAAC,sBAAsB,GAAG,UAAU,CAAC,CAAC;aAC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AAK,CAAC,EAAE;gBAC7B,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC;aAC3B;YACD,qBAAqB;YACrB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,iBAAiB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CACpD,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;;WAMG;QACI,uBAAkB,GAAG,CAC1B,IAAyB,EACS,EAAE;YACpC,OAAO,MAAM,IAAA,yBAAW,EAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3C,CAAC,CAAA,CAAC;QAlHA,IAAI,CAAC,GAAG,GAAG,aAAW,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;CAkHF;AAtHD,4BAsHC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/staking/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,uDAAuC;AACvC,8CAAkD;AAClD,0CAAyD;AAEzD,MAAqB,aAAa;IAEhC;QAIA;;;;WAIG;QACI,uBAAkB,GAAG,GAAiC,EAAE;YAC7D,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/staking/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,uDAAuC;AACvC,8CAAkD;AAClD,0CAAyD;AAEzD,MAAqB,aAAa;IAEhC;QAIA;;;;WAIG;QACI,uBAAkB,GAAG,GAAiC,EAAE;YAC7D,MAAM,QAAQ,GACZ,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAgB,kBAAkB,CAAC,CAAC;YACrE,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;WAIG;QACI,qBAAgB,GAAG,CACxB,UAAkB,EACM,EAAE;YAC1B,IAAI,C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,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACnE,IAAI,CAAC,IAAA,wBAAc,EAAC,OAAO,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACjE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAO,iBAAiB,EAAE;gBACxE,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,MAAM;oBACN,OAAO;oBACP,OAAO;iBACR,CAAC;aACH,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAtGA,IAAI,CAAC,GAAG,GAAG,aAAW,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;CAsGF;AA1GD,gCA0GC"}
|
|
@@ -122,12 +122,18 @@ export declare enum FieldsToSelect {
|
|
|
122
122
|
export declare enum SearchOrderBy {
|
|
123
123
|
PriceHighToLow = "saleInfo.minBidShort desc",
|
|
124
124
|
PriceLowToHigh = "saleInfo.minBidShort asc",
|
|
125
|
+
MaxPriceHighToLow = "saleInfo.maxBidShort desc",
|
|
126
|
+
MaxPriceLowToHigh = "saleInfo.maxBidShort asc",
|
|
127
|
+
BidPriceHighToLow = "saleInfo.currentBidShort desc",
|
|
128
|
+
BidPriceLowToHigh = "saleInfo.currentBidShort asc",
|
|
125
129
|
RarityHighToLow = "metadata.rarity.rank desc",
|
|
126
130
|
RarityLowToHigh = "metadata.rarity.rank asc",
|
|
127
131
|
NonceHighToLow = "nonce desc",
|
|
128
132
|
NonceLowToHigh = "nonce asc",
|
|
129
133
|
RecentListed = "saleInfo.timestamp desc",
|
|
130
|
-
OldestListed = "saleInfo.timestamp asc"
|
|
134
|
+
OldestListed = "saleInfo.timestamp asc",
|
|
135
|
+
EndingLate = "saleInfo.deadline desc",
|
|
136
|
+
EndingSoon = "saleInfo.deadline asc"
|
|
131
137
|
}
|
|
132
138
|
export declare enum SuggestOrderBy {
|
|
133
139
|
TotalVolumeHighToLow = "statistics/tradeData/totalEgldVolume desc",
|
|
@@ -366,70 +372,146 @@ export interface MintStatistics {
|
|
|
366
372
|
}
|
|
367
373
|
export interface CollectionVolume {
|
|
368
374
|
Day: string;
|
|
375
|
+
DR_Trades: number;
|
|
376
|
+
DR_Volume: number;
|
|
377
|
+
DR_VolumeUSD: number;
|
|
378
|
+
DR_Buyers: number;
|
|
379
|
+
DR_Sellers: number;
|
|
380
|
+
DR_FeesPaid: number;
|
|
381
|
+
DR_FeesPaidUSD: number;
|
|
382
|
+
DR_RoyaltiesPaid: number;
|
|
383
|
+
DR_RoyaltiesPaidUSD: number;
|
|
369
384
|
FM_Trades: number;
|
|
370
385
|
FM_Volume: number;
|
|
386
|
+
FM_VolumeUSD: number;
|
|
387
|
+
FM_Buyers: number;
|
|
388
|
+
FM_Sellers: number;
|
|
389
|
+
FM_FeesPaid: number;
|
|
390
|
+
FM_FeesPaidUSD: number;
|
|
391
|
+
FM_RoyaltiesPaid: number;
|
|
392
|
+
FM_RoyaltiesPaidUSD: number;
|
|
371
393
|
KG_Trades: number;
|
|
372
394
|
KG_Volume: number;
|
|
395
|
+
KG_VolumeUSD: number;
|
|
396
|
+
KG_Buyers: number;
|
|
397
|
+
KG_Sellers: number;
|
|
398
|
+
KG_FeesPaid: number;
|
|
399
|
+
KG_FeesPaidUSD: number;
|
|
400
|
+
KG_RoyaltiesPaid: number;
|
|
401
|
+
KG_RoyaltiesPaidUSD: number;
|
|
373
402
|
Total_Trades: number;
|
|
374
403
|
Total_Volume: number;
|
|
404
|
+
Total_VolumeUSD: number;
|
|
405
|
+
Total_Buyers: number;
|
|
406
|
+
Total_Sellers: number;
|
|
407
|
+
Total_FeesPaid: number;
|
|
408
|
+
Total_FeesPaidUSD: number;
|
|
409
|
+
Total_RoyaltiesPaid: number;
|
|
410
|
+
Total_RoyaltiesPaidUSD: number;
|
|
375
411
|
XO_Trades: number;
|
|
376
412
|
XO_Volume: number;
|
|
413
|
+
XO_VolumeUSD: number;
|
|
414
|
+
XO_Buyers: number;
|
|
415
|
+
XO_Sellers: number;
|
|
416
|
+
XO_FeesPaid: number;
|
|
417
|
+
XO_FeesPaidUSD: number;
|
|
418
|
+
XO_RoyaltiesPaid: number;
|
|
419
|
+
XO_RoyaltiesPaidUSD: number;
|
|
377
420
|
}
|
|
378
421
|
export interface FloorPriceHistory {
|
|
379
422
|
Day: string;
|
|
380
423
|
FloorPrice: number;
|
|
381
424
|
AveragePrice: number;
|
|
382
425
|
}
|
|
383
|
-
export
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
426
|
+
export type FungibleAssets = {
|
|
427
|
+
id?: string;
|
|
428
|
+
identifier?: string;
|
|
429
|
+
collection?: string;
|
|
430
|
+
dataType?: string;
|
|
431
|
+
decimals?: number;
|
|
432
|
+
name: string;
|
|
433
|
+
type?: string;
|
|
434
|
+
category?: string[];
|
|
435
|
+
svgUrl: string;
|
|
436
|
+
pngUrl: string;
|
|
437
|
+
ticker: string;
|
|
438
|
+
_ts?: number;
|
|
439
|
+
};
|
|
440
|
+
export type FungibleAssetsMap = {
|
|
441
|
+
[key: string]: FungibleAssets;
|
|
442
|
+
};
|
|
443
|
+
export declare enum AssetCategory {
|
|
444
|
+
ALL = "all",
|
|
445
|
+
Trade = "trade",
|
|
446
|
+
P2P = "p2p",
|
|
447
|
+
Staking = "staking",
|
|
448
|
+
Minting = "minting"
|
|
449
|
+
}
|
|
450
|
+
export type ISingleHolder = {
|
|
400
451
|
address: string;
|
|
401
452
|
count: number;
|
|
402
453
|
weight: number;
|
|
454
|
+
};
|
|
455
|
+
export type IOwners = {
|
|
456
|
+
totalSupply: number;
|
|
457
|
+
onMarket: HoldedDetails;
|
|
458
|
+
staked: HoldedDetails;
|
|
459
|
+
otherSCs: HoldedDetails;
|
|
460
|
+
burnWallet: HoldedDetails;
|
|
461
|
+
uniqueHolders: HoldedDetails;
|
|
462
|
+
holded: AvgHolder;
|
|
463
|
+
walletDetails: ISingleHolder[];
|
|
464
|
+
};
|
|
465
|
+
export type HoldedDetails = {
|
|
466
|
+
count: number;
|
|
467
|
+
weight: number;
|
|
468
|
+
};
|
|
469
|
+
export interface AvgHolder extends HoldedDetails {
|
|
470
|
+
avgPerHodler: number;
|
|
403
471
|
}
|
|
404
|
-
export
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}
|
|
433
|
-
export
|
|
434
|
-
|
|
472
|
+
export type CollectionsSummary = {
|
|
473
|
+
data: CollectionsSummaryItem[];
|
|
474
|
+
count: number;
|
|
475
|
+
};
|
|
476
|
+
export type CollectionsSummaryItem = {
|
|
477
|
+
Collection: string;
|
|
478
|
+
TotalVolume: number;
|
|
479
|
+
TotalTrades: number;
|
|
480
|
+
DailyVolume: number | null;
|
|
481
|
+
Last2DaysVolume: number | null;
|
|
482
|
+
DailyTrades: number | null;
|
|
483
|
+
Last2DaysTrades: number | null;
|
|
484
|
+
WeekTrades: number;
|
|
485
|
+
LastWeekTrades: number | null;
|
|
486
|
+
WeekVolume: number;
|
|
487
|
+
LastWeekVolume: number | null;
|
|
488
|
+
WeeklyTradesMargin: number | null;
|
|
489
|
+
DailyTradesMargin: number | null;
|
|
490
|
+
WeeklyVolumeMargin: number | null;
|
|
491
|
+
DailyVolumeEgldMargin: number | null;
|
|
492
|
+
CollectionAthTrade: number;
|
|
493
|
+
CollectionAthTxHash: string;
|
|
494
|
+
Name: string;
|
|
495
|
+
AthHash: string;
|
|
496
|
+
Profile: string;
|
|
497
|
+
Banner: string;
|
|
498
|
+
isVerified: boolean;
|
|
499
|
+
FloorPrice: number;
|
|
500
|
+
};
|
|
501
|
+
export declare enum CollectionsSummaryFilter {
|
|
502
|
+
TotalVolume = "TotalVolume",
|
|
503
|
+
TotalTrades = "TotalTrades",
|
|
504
|
+
DailyVolume = "DailyVolume",
|
|
505
|
+
Last2DaysVolume = "Last2DaysVolume",
|
|
506
|
+
DailyTrades = "DailyTrades",
|
|
507
|
+
Last2DaysTrades = "Last2DaysTrades",
|
|
508
|
+
WeekTrades = "WeekTrades",
|
|
509
|
+
LastWeekTrades = "LastWeekTrades",
|
|
510
|
+
WeekVolume = "WeekVolume",
|
|
511
|
+
LastWeekVolume = "LastWeekVolume",
|
|
512
|
+
WeeklyTradesMargin = "WeeklyTradesMargin",
|
|
513
|
+
DailyTradesMargin = "DailyTradesMargin",
|
|
514
|
+
WeeklyVolumeMargin = "WeeklyVolumeMargin",
|
|
515
|
+
DailyVolumeEgldMargin = "DailyVolumeEgldMargin",
|
|
516
|
+
CollectionAthTrade = "CollectionAthTrade"
|
|
435
517
|
}
|
package/dist/types/collection.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CollectionsFieldsToSelect = exports.CollectionsOrderBy = exports.SuggestOrderBy = exports.SearchOrderBy = exports.FieldsToSelect = exports.Marketplace = void 0;
|
|
3
|
+
exports.CollectionsSummaryFilter = exports.AssetCategory = exports.CollectionsFieldsToSelect = exports.CollectionsOrderBy = exports.SuggestOrderBy = exports.SearchOrderBy = exports.FieldsToSelect = exports.Marketplace = void 0;
|
|
4
4
|
var Marketplace;
|
|
5
5
|
(function (Marketplace) {
|
|
6
6
|
Marketplace["XO"] = "xoxno";
|
|
@@ -31,12 +31,18 @@ var SearchOrderBy;
|
|
|
31
31
|
(function (SearchOrderBy) {
|
|
32
32
|
SearchOrderBy["PriceHighToLow"] = "saleInfo.minBidShort desc";
|
|
33
33
|
SearchOrderBy["PriceLowToHigh"] = "saleInfo.minBidShort asc";
|
|
34
|
+
SearchOrderBy["MaxPriceHighToLow"] = "saleInfo.maxBidShort desc";
|
|
35
|
+
SearchOrderBy["MaxPriceLowToHigh"] = "saleInfo.maxBidShort asc";
|
|
36
|
+
SearchOrderBy["BidPriceHighToLow"] = "saleInfo.currentBidShort desc";
|
|
37
|
+
SearchOrderBy["BidPriceLowToHigh"] = "saleInfo.currentBidShort asc";
|
|
34
38
|
SearchOrderBy["RarityHighToLow"] = "metadata.rarity.rank desc";
|
|
35
39
|
SearchOrderBy["RarityLowToHigh"] = "metadata.rarity.rank asc";
|
|
36
40
|
SearchOrderBy["NonceHighToLow"] = "nonce desc";
|
|
37
41
|
SearchOrderBy["NonceLowToHigh"] = "nonce asc";
|
|
38
42
|
SearchOrderBy["RecentListed"] = "saleInfo.timestamp desc";
|
|
39
43
|
SearchOrderBy["OldestListed"] = "saleInfo.timestamp asc";
|
|
44
|
+
SearchOrderBy["EndingLate"] = "saleInfo.deadline desc";
|
|
45
|
+
SearchOrderBy["EndingSoon"] = "saleInfo.deadline asc";
|
|
40
46
|
})(SearchOrderBy || (exports.SearchOrderBy = SearchOrderBy = {}));
|
|
41
47
|
var SuggestOrderBy;
|
|
42
48
|
(function (SuggestOrderBy) {
|
|
@@ -83,4 +89,30 @@ var CollectionsFieldsToSelect;
|
|
|
83
89
|
CollectionsFieldsToSelect["Statistics"] = "statistics";
|
|
84
90
|
CollectionsFieldsToSelect["Collection"] = "collection";
|
|
85
91
|
})(CollectionsFieldsToSelect || (exports.CollectionsFieldsToSelect = CollectionsFieldsToSelect = {}));
|
|
92
|
+
var AssetCategory;
|
|
93
|
+
(function (AssetCategory) {
|
|
94
|
+
AssetCategory["ALL"] = "all";
|
|
95
|
+
AssetCategory["Trade"] = "trade";
|
|
96
|
+
AssetCategory["P2P"] = "p2p";
|
|
97
|
+
AssetCategory["Staking"] = "staking";
|
|
98
|
+
AssetCategory["Minting"] = "minting";
|
|
99
|
+
})(AssetCategory || (exports.AssetCategory = AssetCategory = {}));
|
|
100
|
+
var CollectionsSummaryFilter;
|
|
101
|
+
(function (CollectionsSummaryFilter) {
|
|
102
|
+
CollectionsSummaryFilter["TotalVolume"] = "TotalVolume";
|
|
103
|
+
CollectionsSummaryFilter["TotalTrades"] = "TotalTrades";
|
|
104
|
+
CollectionsSummaryFilter["DailyVolume"] = "DailyVolume";
|
|
105
|
+
CollectionsSummaryFilter["Last2DaysVolume"] = "Last2DaysVolume";
|
|
106
|
+
CollectionsSummaryFilter["DailyTrades"] = "DailyTrades";
|
|
107
|
+
CollectionsSummaryFilter["Last2DaysTrades"] = "Last2DaysTrades";
|
|
108
|
+
CollectionsSummaryFilter["WeekTrades"] = "WeekTrades";
|
|
109
|
+
CollectionsSummaryFilter["LastWeekTrades"] = "LastWeekTrades";
|
|
110
|
+
CollectionsSummaryFilter["WeekVolume"] = "WeekVolume";
|
|
111
|
+
CollectionsSummaryFilter["LastWeekVolume"] = "LastWeekVolume";
|
|
112
|
+
CollectionsSummaryFilter["WeeklyTradesMargin"] = "WeeklyTradesMargin";
|
|
113
|
+
CollectionsSummaryFilter["DailyTradesMargin"] = "DailyTradesMargin";
|
|
114
|
+
CollectionsSummaryFilter["WeeklyVolumeMargin"] = "WeeklyVolumeMargin";
|
|
115
|
+
CollectionsSummaryFilter["DailyVolumeEgldMargin"] = "DailyVolumeEgldMargin";
|
|
116
|
+
CollectionsSummaryFilter["CollectionAthTrade"] = "CollectionAthTrade";
|
|
117
|
+
})(CollectionsSummaryFilter || (exports.CollectionsSummaryFilter = CollectionsSummaryFilter = {}));
|
|
86
118
|
//# sourceMappingURL=collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../src/types/collection.ts"],"names":[],"mappings":";;;AAyFA,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,2BAAY,CAAA;IACZ,6BAAc,CAAA;IACd,8BAAe,CAAA;IACf,4BAAa,CAAA;AACf,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAmBD,IAAY,cAiBX;AAjBD,WAAY,cAAc;IACxB,+CAA6B,CAAA;IAC7B,oDAAkC,CAAA;IAClC,sDAAoC,CAAA;IACpC,+BAAa,CAAA;IACb,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,yCAAuB,CAAA;IACvB,2CAAyB,CAAA;IACzB,2CAAyB,CAAA;IACzB,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,2DAAyC,CAAA;IACzC,+CAA6B,CAAA;IAC7B,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;AACf,CAAC,EAjBW,cAAc,8BAAd,cAAc,QAiBzB;AAED,IAAY,
|
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../src/types/collection.ts"],"names":[],"mappings":";;;AAyFA,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,2BAAY,CAAA;IACZ,6BAAc,CAAA;IACd,8BAAe,CAAA;IACf,4BAAa,CAAA;AACf,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAmBD,IAAY,cAiBX;AAjBD,WAAY,cAAc;IACxB,+CAA6B,CAAA;IAC7B,oDAAkC,CAAA;IAClC,sDAAoC,CAAA;IACpC,+BAAa,CAAA;IACb,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,yCAAuB,CAAA;IACvB,2CAAyB,CAAA;IACzB,2CAAyB,CAAA;IACzB,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,2DAAyC,CAAA;IACzC,+CAA6B,CAAA;IAC7B,qCAAmB,CAAA;IACnB,qCAAm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A;IACzB,kDAAqB,CAAA;IACrB,sDAAyB,CAAA;IACzB,0CAAa,CAAA;IACb,8CAAiB,CAAA;IACjB,sDAAyB,CAAA;IACzB,sDAAyB,CAAA;IACzB,sDAAyB,CAAA;IACzB,sDAAyB,CAAA;AAC3B,CAAC,EAhBW,yBAAyB,yCAAzB,yBAAyB,QAgBpC;AA2RD,IAAY,aAMX;AAND,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,gCAAe,CAAA;IACf,4BAAW,CAAA;IACX,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;AACrB,CAAC,EANW,aAAa,6BAAb,aAAa,QAMxB;AA2DD,IAAY,wBAgBX;AAhBD,WAAY,wBAAwB;IAClC,uDAA2B,CAAA;IAC3B,uDAA2B,CAAA;IAC3B,uDAA2B,CAAA;IAC3B,+DAAmC,CAAA;IACnC,uDAA2B,CAAA;IAC3B,+DAAmC,CAAA;IACnC,qDAAyB,CAAA;IACzB,6DAAiC,CAAA;IACjC,qDAAyB,CAAA;IACzB,6DAAiC,CAAA;IACjC,qEAAyC,CAAA;IACzC,mEAAuC,CAAA;IACvC,qEAAyC,CAAA;IACzC,2EAA+C,CAAA;IAC/C,qEAAyC,CAAA;AAC3C,CAAC,EAhBW,wBAAwB,wCAAxB,wBAAwB,QAgBnC"}
|
package/dist/types/user.d.ts
CHANGED
|
@@ -149,3 +149,51 @@ export type UnClaimedReward = {
|
|
|
149
149
|
reward_token_nonce: string;
|
|
150
150
|
amount: number;
|
|
151
151
|
};
|
|
152
|
+
export type UserAccountInfo = {
|
|
153
|
+
address: string;
|
|
154
|
+
nonce: number;
|
|
155
|
+
totalEsdtUsd: number;
|
|
156
|
+
totalStables: number;
|
|
157
|
+
totalEgldStables: number;
|
|
158
|
+
totalEgldEsdt: number;
|
|
159
|
+
totalUsdBalance: number;
|
|
160
|
+
totalEGLDBalance: number;
|
|
161
|
+
balance: string;
|
|
162
|
+
balanceShort: number;
|
|
163
|
+
balanceUsd: number;
|
|
164
|
+
balanceWalletWeight: number;
|
|
165
|
+
stablesWalletWeight: number;
|
|
166
|
+
esdtWalletWeight: number;
|
|
167
|
+
username?: string;
|
|
168
|
+
ownerAddress?: string;
|
|
169
|
+
esdtTokens: EsdtToken[];
|
|
170
|
+
shard: number;
|
|
171
|
+
guarded: boolean;
|
|
172
|
+
activeGuardian: ActiveGuardian;
|
|
173
|
+
isUpgradeable: boolean;
|
|
174
|
+
isReadable: boolean;
|
|
175
|
+
isPayable: boolean;
|
|
176
|
+
isPayableBySmartContract: boolean;
|
|
177
|
+
};
|
|
178
|
+
export type ActiveGuardian = {
|
|
179
|
+
activationEpoch: number;
|
|
180
|
+
address: string;
|
|
181
|
+
serviceUID: string;
|
|
182
|
+
};
|
|
183
|
+
export type EsdtToken = {
|
|
184
|
+
nonce: number;
|
|
185
|
+
identifier: string;
|
|
186
|
+
decimals: number;
|
|
187
|
+
balance: string;
|
|
188
|
+
ticker: string;
|
|
189
|
+
name: string;
|
|
190
|
+
shortBalance: number;
|
|
191
|
+
assets: Assets;
|
|
192
|
+
isAshSupported?: boolean;
|
|
193
|
+
usdValue: number;
|
|
194
|
+
walletWeight: number;
|
|
195
|
+
};
|
|
196
|
+
export type Assets = {
|
|
197
|
+
pngUrl: string;
|
|
198
|
+
svgUrl: string;
|
|
199
|
+
};
|
package/dist/types/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":";;;AAyGA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":";;;AAyGA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AA2CD,IAAY,IAEX;AAFD,WAAY,IAAI;IACd,2CAAmC,CAAA;AACrC,CAAC,EAFW,IAAI,oBAAJ,IAAI,QAEf"}
|
package/dist/users/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GetNFTsArgs, SearchNFTsResponse, TradincActivityArgs, TradingActivityResponse } from '../types';
|
|
2
|
-
import { ArgsUserOffers, IUserProfile, UserInventory, UserOffers, UserStakingInfo } from '../types/user';
|
|
2
|
+
import { ArgsUserOffers, IUserProfile, UserAccountInfo, UserInventory, UserOffers, UserStakingInfo } from '../types/user';
|
|
3
3
|
export default class UserModule {
|
|
4
4
|
private api;
|
|
5
5
|
private collection;
|
|
@@ -11,6 +11,13 @@ export default class UserModule {
|
|
|
11
11
|
* @returns {IUserProfile}
|
|
12
12
|
*/
|
|
13
13
|
getUserProfile: (address: string) => Promise<IUserProfile>;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the user account info that inclues nonce, guardian data, esdtTokens
|
|
16
|
+
*
|
|
17
|
+
* @param {String} address - Address of the user
|
|
18
|
+
* @returns {UserAccountInfo}
|
|
19
|
+
*/
|
|
20
|
+
getUserAccount: (address: string) => Promise<UserAccountInfo>;
|
|
14
21
|
/**
|
|
15
22
|
* Gets user's inventory
|
|
16
23
|
*
|
package/dist/users/index.js
CHANGED
|
@@ -30,6 +30,18 @@ class UserModule {
|
|
|
30
30
|
const response = yield this.api.fetchWithTimeout(`/getUserProfile/${address}`);
|
|
31
31
|
return response;
|
|
32
32
|
});
|
|
33
|
+
/**
|
|
34
|
+
* Returns the user account info that inclues nonce, guardian data, esdtTokens
|
|
35
|
+
*
|
|
36
|
+
* @param {String} address - Address of the user
|
|
37
|
+
* @returns {UserAccountInfo}
|
|
38
|
+
*/
|
|
39
|
+
this.getUserAccount = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (!(0, helpers_1.isAddressValid)(address))
|
|
41
|
+
throw new Error('Invalid address');
|
|
42
|
+
const response = yield this.api.fetchWithTimeout(`/accounts/${address}`);
|
|
43
|
+
return response;
|
|
44
|
+
});
|
|
33
45
|
/**
|
|
34
46
|
* Gets user's inventory
|
|
35
47
|
*
|
package/dist/users/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/users/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA6C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/users/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA6C;AAe7C,uDAAuC;AACvC,sDAAmD;AACnD,8CAAkD;AAElD,MAAqB,UAAU;IAG7B;QAKA;;;;;WAKG;QACI,mBAAc,GAAG,CAAO,OAAe,EAAyB,EAAE;YACvE,IAAI,CAAC,IAAA,wBAAc,EAAC,OAAO,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACjE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,mBAAmB,OAAO,EAAE,CAC7B,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;WAKG;QACI,mBAAc,GAAG,CAAO,OAAe,EAA4B,EAAE;YAC1E,IAAI,CAAC,IAAA,wBAAc,EAAC,OAAO,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACjE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,aAAa,OAAO,EAAE,CACvB,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;WAKG;QAEI,4BAAuB,GAAG,CAC/B,OAAe,EACW,EAAE;YAC5B,IAAI,CAAC,IAAA,wBAAc,EAAC,OAAO,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CA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