@xoxno/sdk-js 0.0.22-alpha → 0.1.0-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 +3 -10
- package/dist/collection/index.js +69 -66
- package/dist/collection/index.js.map +1 -1
- package/dist/nft/index.js +3 -3
- package/dist/nft/index.js.map +1 -1
- package/dist/staking/index.d.ts +6 -0
- package/dist/staking/index.js +13 -0
- package/dist/staking/index.js.map +1 -1
- package/dist/types/collection.d.ts +55 -41
- package/dist/types/collection.js +21 -21
- package/dist/types/collection.js.map +1 -1
- package/dist/types/interactions.js +1 -1
- package/dist/types/interactions.js.map +1 -1
- package/dist/types/nft.d.ts +49 -41
- package/dist/types/staking.js +2 -2
- package/dist/types/staking.js.map +1 -1
- package/dist/types/trading.js +2 -2
- package/dist/types/trading.js.map +1 -1
- package/dist/types/user.d.ts +34 -37
- package/dist/types/user.js +4 -4
- package/dist/types/user.js.map +1 -1
- package/dist/users/index.d.ts +6 -13
- package/dist/users/index.js +9 -27
- package/dist/users/index.js.map +1 -1
- package/dist/utils/api.js +5 -5
- package/dist/utils/api.js.map +1 -1
- package/dist/utils/getActivity.js +5 -1
- package/dist/utils/getActivity.js.map +1 -1
- package/package.json +19 -19
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CollectionsNFTsResponse, GetCollectionsArgs, ICollectionAttributes, ICollectionProfile,
|
|
1
|
+
import { CollectionsNFTsResponse, GetCollectionsArgs, ICollectionAttributes, ICollectionProfile, GetNFTsArgs, SearchNFTsResponse, SuggestNFTsArgs, SuggestResults, CollectionVolume, FloorPriceHistory, CollectionHoldersInfo } from '../types/collection';
|
|
2
2
|
import { TradincActivityArgs, TradingActivityResponse } from '../types/trading';
|
|
3
3
|
/**
|
|
4
4
|
* CollectionModule provides a set of methods to interact with NFT collections.
|
|
@@ -50,19 +50,12 @@ export default class CollectionModule {
|
|
|
50
50
|
*/
|
|
51
51
|
getCollectionAttributes: (collection: string) => Promise<ICollectionAttributes>;
|
|
52
52
|
/**
|
|
53
|
-
* Searches for NFTs
|
|
53
|
+
* Searches for NFTs based on the provided arguments.
|
|
54
54
|
* @param {SearchNFTsArgs} args - The SearchNFTsArgs object containing the search parameters.
|
|
55
55
|
* @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
|
|
56
56
|
* @throws An error if the provided collection ticker is invalid or if the 'top' value is greater than 35.
|
|
57
57
|
*/
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Searches for Global NFTs or in specific collections based on the provided arguments.
|
|
61
|
-
* @param {ExploreNFTsArgs} args - The SearchNFTsArgs object containing the search parameters.
|
|
62
|
-
* @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
|
|
63
|
-
* @throws An error if the 'top' value is greater than 35.
|
|
64
|
-
*/
|
|
65
|
-
getGlobalNFTs: (args: GetCollectionNFTsArgs) => Promise<SearchNFTsResponse>;
|
|
58
|
+
getNFTs: (args: GetNFTsArgs) => Promise<SearchNFTsResponse>;
|
|
66
59
|
/**
|
|
67
60
|
* @public
|
|
68
61
|
* @async
|
package/dist/collection/index.js
CHANGED
|
@@ -44,7 +44,11 @@ class CollectionModule {
|
|
|
44
44
|
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
45
45
|
throw new Error('Invalid collection ticker: ' + collection);
|
|
46
46
|
}
|
|
47
|
-
const response = yield this.api.fetchWithTimeout(`/getCollectionProfile/${collection}
|
|
47
|
+
const response = yield this.api.fetchWithTimeout(`/getCollectionProfile/${collection}`, {
|
|
48
|
+
next: {
|
|
49
|
+
tags: ['getCollectionProfile'],
|
|
50
|
+
},
|
|
51
|
+
});
|
|
48
52
|
return response;
|
|
49
53
|
});
|
|
50
54
|
/**
|
|
@@ -58,7 +62,11 @@ class CollectionModule {
|
|
|
58
62
|
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
59
63
|
throw new Error('Invalid collection ticker: ' + collection);
|
|
60
64
|
}
|
|
61
|
-
const response = yield this.api.fetchWithTimeout(`/getFloorPrice/${collection}/${token}
|
|
65
|
+
const response = yield this.api.fetchWithTimeout(`/getFloorPrice/${collection}/${token}`, {
|
|
66
|
+
next: {
|
|
67
|
+
tags: ['getCollectionFloorPrice'],
|
|
68
|
+
},
|
|
69
|
+
});
|
|
62
70
|
return response;
|
|
63
71
|
});
|
|
64
72
|
/**
|
|
@@ -79,92 +87,67 @@ class CollectionModule {
|
|
|
79
87
|
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
80
88
|
throw new Error('Invalid collection ticker: ' + collection);
|
|
81
89
|
}
|
|
82
|
-
const response = yield this.api.fetchWithTimeout(`/getCollectionAttributes/${collection}
|
|
90
|
+
const response = yield this.api.fetchWithTimeout(`/getCollectionAttributes/${collection}`, {
|
|
91
|
+
next: {
|
|
92
|
+
tags: ['getCollectionAttributes'],
|
|
93
|
+
},
|
|
94
|
+
});
|
|
83
95
|
return response;
|
|
84
96
|
});
|
|
85
97
|
/**
|
|
86
|
-
* Searches for NFTs
|
|
98
|
+
* Searches for NFTs based on the provided arguments.
|
|
87
99
|
* @param {SearchNFTsArgs} args - The SearchNFTsArgs object containing the search parameters.
|
|
88
100
|
* @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
|
|
89
101
|
* @throws An error if the provided collection ticker is invalid or if the 'top' value is greater than 35.
|
|
90
102
|
*/
|
|
91
|
-
this.
|
|
92
|
-
var _a, _b, _c, _d;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
103
|
+
this.getNFTs = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
var _a, _b, _c, _d, _e;
|
|
105
|
+
(_a = args === null || args === void 0 ? void 0 : args.collections) === null || _a === void 0 ? void 0 : _a.forEach((element) => {
|
|
106
|
+
if (!(0, regex_1.isValidCollectionTicker)(element)) {
|
|
107
|
+
throw new Error('Invalid collection ticker: ' + element);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
96
110
|
if (args.top && args.top > 35) {
|
|
97
111
|
throw new Error('Top cannot be greater than 35');
|
|
98
112
|
}
|
|
99
113
|
const payloadBody = {
|
|
100
114
|
filters: {
|
|
115
|
+
dataType: (_b = args.dataType) !== null && _b !== void 0 ? _b : ['nft'],
|
|
116
|
+
activeAuction: args.onlyAuctions || false,
|
|
117
|
+
collection: (_c = args.collections) !== null && _c !== void 0 ? _c : [],
|
|
101
118
|
onSale: args.onlyOnSale || false,
|
|
119
|
+
seller: args.listedBy || [],
|
|
120
|
+
owner: args.ownedBy || [],
|
|
102
121
|
marketplace: args.listedOnlyOn || undefined,
|
|
103
|
-
|
|
122
|
+
auctionType: args.onlyOnSale
|
|
104
123
|
? args.onlyAuctions
|
|
105
124
|
? ['NftBid', 'SftAll']
|
|
106
125
|
: ['Nft', 'SftOnePerPayment']
|
|
107
126
|
: undefined,
|
|
108
|
-
|
|
127
|
+
verifiedOnly: args.onlyVerified || false,
|
|
128
|
+
paymentToken: args.listedInToken || [],
|
|
109
129
|
attributes: args.attributes || undefined,
|
|
110
|
-
|
|
130
|
+
priceRange: args.priceRange
|
|
111
131
|
? Object.assign(Object.assign({}, args.priceRange), { type: args.onlyAuctions
|
|
112
|
-
? '
|
|
113
|
-
: '
|
|
132
|
+
? 'saleInfo.currentBidShort'
|
|
133
|
+
: 'saleInfo.minBidShort' }) : undefined,
|
|
114
134
|
rankRange: args.rankRange || undefined,
|
|
115
|
-
|
|
135
|
+
gameLevelRange: args.cantinaLevelRange || undefined,
|
|
116
136
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
select: args.onlySelectFields || undefined,
|
|
137
|
+
orderBy: args.orderBy || [],
|
|
138
|
+
select: args.onlySelectFields || [],
|
|
139
|
+
includeCount: args.includeCount || false,
|
|
121
140
|
top: args.top || 35,
|
|
122
141
|
skip: args.skip || 0,
|
|
123
142
|
};
|
|
124
143
|
const buffer = Buffer.from(JSON.stringify(payloadBody)).toString('base64');
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
* Searches for Global NFTs or in specific collections based on the provided arguments.
|
|
130
|
-
* @param {ExploreNFTsArgs} args - The SearchNFTsArgs object containing the search parameters.
|
|
131
|
-
* @returns {Promise<SearchNFTsResponse>} A Promise that resolves to the SearchNFTsResponse object.
|
|
132
|
-
* @throws An error if the 'top' value is greater than 35.
|
|
133
|
-
*/
|
|
134
|
-
this.getGlobalNFTs = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
135
|
-
var _e, _f, _g, _h;
|
|
136
|
-
if (args.top && args.top > 35) {
|
|
137
|
-
throw new Error('Top cannot be greater than 35');
|
|
138
|
-
}
|
|
139
|
-
const payloadBody = {
|
|
140
|
-
curated: args.onlyVerified || true,
|
|
141
|
-
filters: {
|
|
142
|
-
onSale: args.onlyOnSale || false,
|
|
143
|
-
marketplace: args.listedOnlyOn || undefined,
|
|
144
|
-
auctionTypes: args.onlyOnSale
|
|
145
|
-
? args.onlyAuctions
|
|
146
|
-
? ['NftBid', 'SftAll']
|
|
147
|
-
: ['Nft', 'SftOnePerPayment']
|
|
148
|
-
: undefined,
|
|
149
|
-
tokens: args.listedInToken || undefined,
|
|
150
|
-
attributes: args.attributes || undefined,
|
|
151
|
-
range: args.priceRange
|
|
152
|
-
? Object.assign(Object.assign({}, args.priceRange), { type: args.onlyAuctions
|
|
153
|
-
? 'saleInfoNft/current_bid_short'
|
|
154
|
-
: 'saleInfoNft/min_bid_short' }) : undefined,
|
|
155
|
-
rankRange: args.rankRange || undefined,
|
|
144
|
+
console.log(buffer);
|
|
145
|
+
const response = yield this.api.fetchWithTimeout(`/getNfts/${buffer}`, {
|
|
146
|
+
next: {
|
|
147
|
+
tags: ['getCollectionNFTs'],
|
|
156
148
|
},
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
orderBy: args.orderBy || undefined,
|
|
160
|
-
collections: args.collections || [],
|
|
161
|
-
select: args.onlySelectFields || undefined,
|
|
162
|
-
top: args.top || 35,
|
|
163
|
-
skip: args.skip || 0,
|
|
164
|
-
};
|
|
165
|
-
const buffer = Buffer.from(JSON.stringify(payloadBody)).toString('base64');
|
|
166
|
-
const response = yield this.api.fetchWithTimeout(`/exploreNFTs/${buffer}`);
|
|
167
|
-
return Object.assign(Object.assign({}, response), { getNextPagePayload: Object.assign(Object.assign({}, args), { skip: ((_e = args.skip) !== null && _e !== void 0 ? _e : 0) + ((_f = args.top) !== null && _f !== void 0 ? _f : 35) }), hasMoreResults: response.resultsCount > ((_g = args.skip) !== null && _g !== void 0 ? _g : 0) + ((_h = args.top) !== null && _h !== void 0 ? _h : 35) });
|
|
149
|
+
});
|
|
150
|
+
return Object.assign(Object.assign({}, response), { getNextPagePayload: Object.assign(Object.assign({}, args), { skip: ((_d = args.skip) !== null && _d !== void 0 ? _d : 0) + ((_e = args.top) !== null && _e !== void 0 ? _e : 35) }) });
|
|
168
151
|
});
|
|
169
152
|
/**
|
|
170
153
|
* @public
|
|
@@ -202,7 +185,11 @@ class CollectionModule {
|
|
|
202
185
|
skip: args.skip || 0,
|
|
203
186
|
};
|
|
204
187
|
const buffer = Buffer.from(JSON.stringify(payloadBody)).toString('base64');
|
|
205
|
-
return yield this.api.fetchWithTimeout(`/search/${buffer}
|
|
188
|
+
return yield this.api.fetchWithTimeout(`/search/${buffer}`, {
|
|
189
|
+
next: {
|
|
190
|
+
tags: ['suggestResults'],
|
|
191
|
+
},
|
|
192
|
+
});
|
|
206
193
|
});
|
|
207
194
|
/**
|
|
208
195
|
* Retrieves trading history based on the provided arguments.
|
|
@@ -235,7 +222,11 @@ class CollectionModule {
|
|
|
235
222
|
orderBy: [(args === null || args === void 0 ? void 0 : args.orderBy) || 'statistics.tradeData.weekEgldVolume desc'],
|
|
236
223
|
};
|
|
237
224
|
const buffer = Buffer.from(JSON.stringify(payloadBody)).toString('base64');
|
|
238
|
-
const response = yield this.api.fetchWithTimeout(`/collections/${buffer}
|
|
225
|
+
const response = yield this.api.fetchWithTimeout(`/collections/${buffer}`, {
|
|
226
|
+
next: {
|
|
227
|
+
tags: ['getCollections'],
|
|
228
|
+
},
|
|
229
|
+
});
|
|
239
230
|
return {
|
|
240
231
|
results: response,
|
|
241
232
|
resultsCount: response.length,
|
|
@@ -268,7 +259,11 @@ class CollectionModule {
|
|
|
268
259
|
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
269
260
|
throw new Error('Invalid collection ticker: ' + collection);
|
|
270
261
|
}
|
|
271
|
-
const response = yield this.api.fetchWithTimeout(`/getCollectionVolume/${collection}?after=${after}&before=${before}&bin=${bin}
|
|
262
|
+
const response = yield this.api.fetchWithTimeout(`/getCollectionVolume/${collection}?after=${after}&before=${before}&bin=${bin}`, {
|
|
263
|
+
next: {
|
|
264
|
+
tags: ['getCollectionVolume'],
|
|
265
|
+
},
|
|
266
|
+
});
|
|
272
267
|
return response;
|
|
273
268
|
});
|
|
274
269
|
/**
|
|
@@ -295,7 +290,11 @@ class CollectionModule {
|
|
|
295
290
|
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
296
291
|
throw new Error('Invalid collection ticker: ' + collection);
|
|
297
292
|
}
|
|
298
|
-
const response = yield this.api.fetchWithTimeout(`/getCollectionFloor/${collection}?after=${after}&before=${before}&bin=${bin}
|
|
293
|
+
const response = yield this.api.fetchWithTimeout(`/getCollectionFloor/${collection}?after=${after}&before=${before}&bin=${bin}`, {
|
|
294
|
+
next: {
|
|
295
|
+
tags: ['getCollectionFloor'],
|
|
296
|
+
},
|
|
297
|
+
});
|
|
299
298
|
return response;
|
|
300
299
|
});
|
|
301
300
|
/**
|
|
@@ -316,7 +315,11 @@ class CollectionModule {
|
|
|
316
315
|
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
317
316
|
throw new Error('Invalid collection ticker: ' + collection);
|
|
318
317
|
}
|
|
319
|
-
const response = yield this.api.fetchWithTimeout(`/getCollectionOwners/${collection}
|
|
318
|
+
const response = yield this.api.fetchWithTimeout(`/getCollectionOwners/${collection}`, {
|
|
319
|
+
next: {
|
|
320
|
+
tags: ['getCollectionOwners'],
|
|
321
|
+
},
|
|
322
|
+
});
|
|
320
323
|
return response;
|
|
321
324
|
});
|
|
322
325
|
this.api = api_1.default.init();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collection/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAc6B;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,KAAK,CAAC,6BAA6B,GAAG,UAAU,CAAC,CAAC;aAC7D;YACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,yBAAyB,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collection/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAc6B;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,KAAK,CAAC,6BAA6B,GAAG,UAAU,CAAC,CAAC;aAC7D;YACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,yBAAyB,UAAU,EAAE,EACrC;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,CAAC,sBAAsB,CAAC;iB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B,UAAU,EAAE,EAEpC;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,CAAC,qBAAqB,CAAC;iBAC9B;aACF,CACF,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QA/XA,IAAI,CAAC,GAAG,GAAG,aAAW,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;CA+XF;AAnYD,mCAmYC"}
|
package/dist/nft/index.js
CHANGED
|
@@ -43,7 +43,7 @@ class NFTModule {
|
|
|
43
43
|
if (!(0, regex_1.isValidNftIdentifier)(identifier)) {
|
|
44
44
|
throw new Error('Invalid identifier: ' + identifier);
|
|
45
45
|
}
|
|
46
|
-
const response = yield this.api.fetchWithTimeout(`/
|
|
46
|
+
const response = yield this.api.fetchWithTimeout(`/getSingleNft/${identifier}`);
|
|
47
47
|
return response;
|
|
48
48
|
});
|
|
49
49
|
/**
|
|
@@ -57,7 +57,7 @@ class NFTModule {
|
|
|
57
57
|
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
58
58
|
throw new Error('Invalid collection ticker: ' + collection);
|
|
59
59
|
}
|
|
60
|
-
const response = yield this.api.fetchWithTimeout(`/
|
|
60
|
+
const response = yield this.api.fetchWithTimeout(`/getSingleNft/${(0, helpers_1.getIdentifierFromColAndNonce)(collection, nonce)}`);
|
|
61
61
|
return response;
|
|
62
62
|
});
|
|
63
63
|
/**
|
|
@@ -77,7 +77,7 @@ class NFTModule {
|
|
|
77
77
|
nonceHex = '0' + nonceHex;
|
|
78
78
|
}
|
|
79
79
|
// fetch the NFT data
|
|
80
|
-
const response = yield this.api.fetchWithTimeout(`/
|
|
80
|
+
const response = yield this.api.fetchWithTimeout(`/getSingleNft/${[collection, nonceHex].join('-')}`);
|
|
81
81
|
return response;
|
|
82
82
|
});
|
|
83
83
|
/**
|
package/dist/nft/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nft/index.ts"],"names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4B,EAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CACnE,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;;WAMG;QAEI,kCAA6B,GAAG,CACrC,UAAkB,EAClB,QAAgB,EACE,EAAE;YACpB,iCAAiC;YACjC,IAAI,CAAC,IAAA,+BAAuB,EAAC,UAAU,CAAC,EAAE;gBACxC,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,UAAU,CAAC,CAAC;aAC7D;YACD,6BAA6B;YAC7B,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,KAAK,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;QAtFA,IAAI,CAAC,GAAG,GAAG,aAAW,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;CAsFF;AA1FD,4BA0FC"}
|
package/dist/staking/index.d.ts
CHANGED
|
@@ -9,6 +9,12 @@ export default class StakingModule {
|
|
|
9
9
|
* @returns {StakingPool[]}
|
|
10
10
|
*/
|
|
11
11
|
getAllStakingPools: () => Promise<StakingPool[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Returns all staking pools by collection
|
|
14
|
+
*
|
|
15
|
+
* @returns {StakingPool[]}
|
|
16
|
+
*/
|
|
17
|
+
getPoolsByTicker: (collection: string) => Promise<StakingPool[]>;
|
|
12
18
|
/**
|
|
13
19
|
* Returns the staking pool by id
|
|
14
20
|
*
|
package/dist/staking/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const api_1 = __importDefault(require("../utils/api"));
|
|
16
16
|
const helpers_1 = require("../utils/helpers");
|
|
17
|
+
const regex_1 = require("../utils/regex");
|
|
17
18
|
class StakingModule {
|
|
18
19
|
constructor() {
|
|
19
20
|
/**
|
|
@@ -25,6 +26,18 @@ class StakingModule {
|
|
|
25
26
|
const response = yield this.api.fetchWithTimeout('/getStakingPools');
|
|
26
27
|
return response;
|
|
27
28
|
});
|
|
29
|
+
/**
|
|
30
|
+
* Returns all staking pools by collection
|
|
31
|
+
*
|
|
32
|
+
* @returns {StakingPool[]}
|
|
33
|
+
*/
|
|
34
|
+
this.getPoolsByTicker = (collection) => __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
if (!(0, regex_1.isValidCollectionTicker)(collection)) {
|
|
36
|
+
throw new Error('Invalid collection ticker: ' + collection);
|
|
37
|
+
}
|
|
38
|
+
const response = yield this.api.fetchWithTimeout(`/getPoolsByTicker/${collection}`);
|
|
39
|
+
return response;
|
|
40
|
+
});
|
|
28
41
|
/**
|
|
29
42
|
* Returns the staking pool by id
|
|
30
43
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/staking/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,uDAAuC;AACvC,8CAAkD;
|
|
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,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ACR,CAAC;aACH,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAEF;;;;;;;;;;;YAWI;QACG,wBAAmB,GAAG,CAC3B,MAAc,EACd,OAAe,EACf,OAAiB,EACF,EAAE;YACjB,IAAI,OAAO,MAAM,KAAK,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;QAvGA,IAAI,CAAC,GAAG,GAAG,aAAW,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;CAuGF;AA3GD,gCA2GC"}
|
|
@@ -80,10 +80,10 @@ export interface ICollectionAttributes {
|
|
|
80
80
|
[traitType: string]: TraitValues;
|
|
81
81
|
}
|
|
82
82
|
export declare enum Marketplace {
|
|
83
|
-
XO = "
|
|
84
|
-
FM = "
|
|
85
|
-
DR = "
|
|
86
|
-
KG = "
|
|
83
|
+
XO = "xoxno",
|
|
84
|
+
FM = "frameit",
|
|
85
|
+
DR = "deadrare",
|
|
86
|
+
KG = "krogan"
|
|
87
87
|
}
|
|
88
88
|
export interface GlobalOffer {
|
|
89
89
|
attributes: MetadataAttribute[];
|
|
@@ -102,32 +102,32 @@ export interface GlobalOffer {
|
|
|
102
102
|
timestamp: number;
|
|
103
103
|
}
|
|
104
104
|
export declare enum FieldsToSelect {
|
|
105
|
-
Rank = "metadata
|
|
106
|
-
Attributes = "metadata
|
|
107
|
-
Description = "metadata
|
|
105
|
+
Rank = "metadata.rarity.rank",
|
|
106
|
+
Attributes = "metadata.attributes",
|
|
107
|
+
Description = "metadata.description",
|
|
108
108
|
Name = "name",
|
|
109
109
|
OnSale = "onSale",
|
|
110
|
-
SaleInfo = "
|
|
110
|
+
SaleInfo = "saleInfo",
|
|
111
111
|
Royalties = "royalties",
|
|
112
112
|
Identifier = "identifier",
|
|
113
113
|
Collection = "collection",
|
|
114
114
|
OriginalURL = "url",
|
|
115
115
|
Nonce = "nonce",
|
|
116
|
-
ContentType = "originalMedia
|
|
116
|
+
ContentType = "originalMedia.contentType",
|
|
117
117
|
WasProcessed = "wasProcessed",
|
|
118
118
|
AvifURL = "avifUrl",
|
|
119
119
|
WebpURL = "webpUrl",
|
|
120
120
|
Type = "type"
|
|
121
121
|
}
|
|
122
122
|
export declare enum SearchOrderBy {
|
|
123
|
-
PriceHighToLow = "
|
|
124
|
-
PriceLowToHigh = "
|
|
125
|
-
RarityHighToLow = "metadata
|
|
126
|
-
RarityLowToHigh = "metadata
|
|
123
|
+
PriceHighToLow = "saleInfo.minBidShort desc",
|
|
124
|
+
PriceLowToHigh = "saleInfo.minBidShort asc",
|
|
125
|
+
RarityHighToLow = "metadata.rarity.rank desc",
|
|
126
|
+
RarityLowToHigh = "metadata.rarity.rank asc",
|
|
127
127
|
NonceHighToLow = "nonce desc",
|
|
128
128
|
NonceLowToHigh = "nonce asc",
|
|
129
|
-
RecentListed = "
|
|
130
|
-
OldestListed = "
|
|
129
|
+
RecentListed = "saleInfo.timestamp desc",
|
|
130
|
+
OldestListed = "saleInfo.timestamp asc"
|
|
131
131
|
}
|
|
132
132
|
export declare enum SuggestOrderBy {
|
|
133
133
|
TotalVolumeHighToLow = "statistics/tradeData/totalEgldVolume desc",
|
|
@@ -172,12 +172,18 @@ export declare enum CollectionsFieldsToSelect {
|
|
|
172
172
|
Collection = "collection"
|
|
173
173
|
}
|
|
174
174
|
export interface Filter {
|
|
175
|
-
|
|
175
|
+
dataType?: string[];
|
|
176
176
|
onSale?: boolean;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
seller?: string[];
|
|
178
|
+
collection?: string[];
|
|
179
|
+
identifier?: string[];
|
|
180
|
+
type?: string[];
|
|
181
|
+
owner?: string[];
|
|
182
|
+
paymentToken?: string[];
|
|
183
|
+
marketplace?: string[];
|
|
184
|
+
auctionType?: string[];
|
|
185
|
+
activeAuction?: boolean;
|
|
186
|
+
priceRange?: {
|
|
181
187
|
min: number;
|
|
182
188
|
max: number;
|
|
183
189
|
type: string;
|
|
@@ -186,26 +192,34 @@ export interface Filter {
|
|
|
186
192
|
min?: number;
|
|
187
193
|
max?: number;
|
|
188
194
|
};
|
|
189
|
-
|
|
195
|
+
gameLevelRange?: {
|
|
190
196
|
min?: number;
|
|
191
197
|
max?: number;
|
|
192
198
|
};
|
|
199
|
+
customFilter?: string;
|
|
200
|
+
attributes?: NftMetadataAttributes[];
|
|
201
|
+
wasProcessed?: boolean;
|
|
202
|
+
verifiedOnly?: boolean;
|
|
203
|
+
isStaked?: boolean;
|
|
204
|
+
}
|
|
205
|
+
export interface NftMetadataAttributes {
|
|
206
|
+
trait_type: string;
|
|
207
|
+
value: string;
|
|
193
208
|
}
|
|
194
209
|
export interface SearchNFTs {
|
|
195
210
|
filters: Filter;
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
collection?: string;
|
|
211
|
+
select?: string[];
|
|
212
|
+
strictSelect?: boolean;
|
|
213
|
+
orderBy?: string[];
|
|
214
|
+
top?: number;
|
|
215
|
+
skip?: number;
|
|
216
|
+
includeCount?: boolean;
|
|
217
|
+
}
|
|
218
|
+
export interface GetNFTsArgs {
|
|
219
|
+
/** Listed by different users */
|
|
220
|
+
listedBy?: string[];
|
|
221
|
+
/** Owned by different users */
|
|
222
|
+
ownedBy?: string[];
|
|
209
223
|
/** If set, will return only NFTs from the specified collections */
|
|
210
224
|
collections?: string[];
|
|
211
225
|
/** If set, will return only NFTs from verified collections */
|
|
@@ -231,6 +245,8 @@ export interface GetCollectionNFTsArgs {
|
|
|
231
245
|
min: number;
|
|
232
246
|
max: number;
|
|
233
247
|
};
|
|
248
|
+
/** If set, will return the total count of the NFTs, recommended to be set true only for the first call, then false for the next pages */
|
|
249
|
+
includeCount?: boolean;
|
|
234
250
|
/** If set, will apply the extra manual filters on top of the main payload */
|
|
235
251
|
extraSearch?: string[];
|
|
236
252
|
/** If set, will return only NFTs with a name that contains the specified string */
|
|
@@ -239,6 +255,8 @@ export interface GetCollectionNFTsArgs {
|
|
|
239
255
|
top?: number;
|
|
240
256
|
/** The order by to use */
|
|
241
257
|
skip?: number;
|
|
258
|
+
/** Document type */
|
|
259
|
+
dataType?: string[];
|
|
242
260
|
/** The order of the results based on a field */
|
|
243
261
|
orderBy?: SearchOrderBy[];
|
|
244
262
|
/** If set, will return only the specified fields */
|
|
@@ -260,15 +278,11 @@ export interface SuggestNFTsArgs {
|
|
|
260
278
|
}
|
|
261
279
|
export interface SearchNFTsResponse {
|
|
262
280
|
/** The total count of the results for the specific query */
|
|
263
|
-
count
|
|
264
|
-
/** The results count for the current page */
|
|
265
|
-
resultsCount: number;
|
|
281
|
+
count?: number;
|
|
266
282
|
/** The results for the current page */
|
|
267
|
-
|
|
268
|
-
/** If the results are empty */
|
|
269
|
-
empty: boolean;
|
|
283
|
+
resources: NftData[];
|
|
270
284
|
/** The payload to use to get the next page */
|
|
271
|
-
getNextPagePayload:
|
|
285
|
+
getNextPagePayload: GetNFTsArgs;
|
|
272
286
|
/** If there are more results to fetch */
|
|
273
287
|
hasMoreResults: boolean;
|
|
274
288
|
}
|
package/dist/types/collection.js
CHANGED
|
@@ -3,41 +3,41 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CollectionsFieldsToSelect = exports.CollectionsOrderBy = exports.SuggestOrderBy = exports.SearchOrderBy = exports.FieldsToSelect = exports.Marketplace = void 0;
|
|
4
4
|
var Marketplace;
|
|
5
5
|
(function (Marketplace) {
|
|
6
|
-
Marketplace["XO"] = "
|
|
7
|
-
Marketplace["FM"] = "
|
|
8
|
-
Marketplace["DR"] = "
|
|
9
|
-
Marketplace["KG"] = "
|
|
10
|
-
})(Marketplace
|
|
6
|
+
Marketplace["XO"] = "xoxno";
|
|
7
|
+
Marketplace["FM"] = "frameit";
|
|
8
|
+
Marketplace["DR"] = "deadrare";
|
|
9
|
+
Marketplace["KG"] = "krogan";
|
|
10
|
+
})(Marketplace || (exports.Marketplace = Marketplace = {}));
|
|
11
11
|
var FieldsToSelect;
|
|
12
12
|
(function (FieldsToSelect) {
|
|
13
|
-
FieldsToSelect["Rank"] = "metadata
|
|
14
|
-
FieldsToSelect["Attributes"] = "metadata
|
|
15
|
-
FieldsToSelect["Description"] = "metadata
|
|
13
|
+
FieldsToSelect["Rank"] = "metadata.rarity.rank";
|
|
14
|
+
FieldsToSelect["Attributes"] = "metadata.attributes";
|
|
15
|
+
FieldsToSelect["Description"] = "metadata.description";
|
|
16
16
|
FieldsToSelect["Name"] = "name";
|
|
17
17
|
FieldsToSelect["OnSale"] = "onSale";
|
|
18
|
-
FieldsToSelect["SaleInfo"] = "
|
|
18
|
+
FieldsToSelect["SaleInfo"] = "saleInfo";
|
|
19
19
|
FieldsToSelect["Royalties"] = "royalties";
|
|
20
20
|
FieldsToSelect["Identifier"] = "identifier";
|
|
21
21
|
FieldsToSelect["Collection"] = "collection";
|
|
22
22
|
FieldsToSelect["OriginalURL"] = "url";
|
|
23
23
|
FieldsToSelect["Nonce"] = "nonce";
|
|
24
|
-
FieldsToSelect["ContentType"] = "originalMedia
|
|
24
|
+
FieldsToSelect["ContentType"] = "originalMedia.contentType";
|
|
25
25
|
FieldsToSelect["WasProcessed"] = "wasProcessed";
|
|
26
26
|
FieldsToSelect["AvifURL"] = "avifUrl";
|
|
27
27
|
FieldsToSelect["WebpURL"] = "webpUrl";
|
|
28
28
|
FieldsToSelect["Type"] = "type";
|
|
29
|
-
})(FieldsToSelect
|
|
29
|
+
})(FieldsToSelect || (exports.FieldsToSelect = FieldsToSelect = {}));
|
|
30
30
|
var SearchOrderBy;
|
|
31
31
|
(function (SearchOrderBy) {
|
|
32
|
-
SearchOrderBy["PriceHighToLow"] = "
|
|
33
|
-
SearchOrderBy["PriceLowToHigh"] = "
|
|
34
|
-
SearchOrderBy["RarityHighToLow"] = "metadata
|
|
35
|
-
SearchOrderBy["RarityLowToHigh"] = "metadata
|
|
32
|
+
SearchOrderBy["PriceHighToLow"] = "saleInfo.minBidShort desc";
|
|
33
|
+
SearchOrderBy["PriceLowToHigh"] = "saleInfo.minBidShort asc";
|
|
34
|
+
SearchOrderBy["RarityHighToLow"] = "metadata.rarity.rank desc";
|
|
35
|
+
SearchOrderBy["RarityLowToHigh"] = "metadata.rarity.rank asc";
|
|
36
36
|
SearchOrderBy["NonceHighToLow"] = "nonce desc";
|
|
37
37
|
SearchOrderBy["NonceLowToHigh"] = "nonce asc";
|
|
38
|
-
SearchOrderBy["RecentListed"] = "
|
|
39
|
-
SearchOrderBy["OldestListed"] = "
|
|
40
|
-
})(SearchOrderBy
|
|
38
|
+
SearchOrderBy["RecentListed"] = "saleInfo.timestamp desc";
|
|
39
|
+
SearchOrderBy["OldestListed"] = "saleInfo.timestamp asc";
|
|
40
|
+
})(SearchOrderBy || (exports.SearchOrderBy = SearchOrderBy = {}));
|
|
41
41
|
var SuggestOrderBy;
|
|
42
42
|
(function (SuggestOrderBy) {
|
|
43
43
|
SuggestOrderBy["TotalVolumeHighToLow"] = "statistics/tradeData/totalEgldVolume desc";
|
|
@@ -45,7 +45,7 @@ var SuggestOrderBy;
|
|
|
45
45
|
SuggestOrderBy["IsVerifiedTrueToFalse"] = "isVerified desc";
|
|
46
46
|
SuggestOrderBy["HasImageTrueToFalse"] = "profile desc";
|
|
47
47
|
SuggestOrderBy["HasBannerTrueToFalse"] = "banner desc";
|
|
48
|
-
})(SuggestOrderBy
|
|
48
|
+
})(SuggestOrderBy || (exports.SuggestOrderBy = SuggestOrderBy = {}));
|
|
49
49
|
var CollectionsOrderBy;
|
|
50
50
|
(function (CollectionsOrderBy) {
|
|
51
51
|
CollectionsOrderBy["WeekVolumeHighToLow"] = "statistics.tradeData.weekEgldVolume desc";
|
|
@@ -64,7 +64,7 @@ var CollectionsOrderBy;
|
|
|
64
64
|
CollectionsOrderBy["SupplyLowToHigh"] = "statistics.other.nftCount asc";
|
|
65
65
|
CollectionsOrderBy["FollowersHighToLow"] = "statistics.other.followCount desc";
|
|
66
66
|
CollectionsOrderBy["FollowersLowToHigh"] = "statistics.other.followCount asc";
|
|
67
|
-
})(CollectionsOrderBy
|
|
67
|
+
})(CollectionsOrderBy || (exports.CollectionsOrderBy = CollectionsOrderBy = {}));
|
|
68
68
|
var CollectionsFieldsToSelect;
|
|
69
69
|
(function (CollectionsFieldsToSelect) {
|
|
70
70
|
CollectionsFieldsToSelect["Profile"] = "profile";
|
|
@@ -82,5 +82,5 @@ var CollectionsFieldsToSelect;
|
|
|
82
82
|
CollectionsFieldsToSelect["IsMintable"] = "isMintable";
|
|
83
83
|
CollectionsFieldsToSelect["Statistics"] = "statistics";
|
|
84
84
|
CollectionsFieldsToSelect["Collection"] = "collection";
|
|
85
|
-
})(CollectionsFieldsToSelect
|
|
85
|
+
})(CollectionsFieldsToSelect || (exports.CollectionsFieldsToSelect = CollectionsFieldsToSelect = {}));
|
|
86
86
|
//# 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,
|
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../src/types/collection.ts"],"names":[],"mappings":";;;AAyFA,IAAY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AA8D,CAAA;IAC9D,mFAA6D,CAAA;IAC7D,wEAAkD,CAAA;IAClD,uEAAiD,CAAA;IACjD,8EAAwD,CAAA;IACxD,6EAAuD,CAAA;AACzD,CAAC,EAjBW,kBAAkB,kCAAlB,kBAAkB,QAiB7B;AAED,IAAY,yBAgBX;AAhBD,WAAY,yBAAyB;IACnC,gDAAmB,CAAA;IACnB,wDAA2B,CAAA;IAC3B,gDAAmB,CAAA;IACnB,4CAAe,CAAA;IACf,gDAAmB,CAAA;IACnB,0CAAa,CAAA;IACb,sDAAyB,CAAA;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"}
|
|
@@ -7,5 +7,5 @@ var AuctionType;
|
|
|
7
7
|
AuctionType[AuctionType["Nft"] = 1] = "Nft";
|
|
8
8
|
AuctionType[AuctionType["SftAll"] = 2] = "SftAll";
|
|
9
9
|
AuctionType[AuctionType["SftOnePerPayment"] = 3] = "SftOnePerPayment";
|
|
10
|
-
})(AuctionType
|
|
10
|
+
})(AuctionType || (exports.AuctionType = AuctionType = {}));
|
|
11
11
|
//# sourceMappingURL=interactions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../src/types/interactions.ts"],"names":[],"mappings":";;;AAiBA,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,iDAAM,CAAA;IACN,2CAAG,CAAA;IACH,iDAAM,CAAA;IACN,qEAAgB,CAAA;AAClB,CAAC,EALW,WAAW,
|
|
1
|
+
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../src/types/interactions.ts"],"names":[],"mappings":";;;AAiBA,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,iDAAM,CAAA;IACN,2CAAG,CAAA;IACH,iDAAM,CAAA;IACN,qEAAgB,CAAA;AAClB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB"}
|
package/dist/types/nft.d.ts
CHANGED
|
@@ -13,30 +13,37 @@ export interface NFTMetadata {
|
|
|
13
13
|
rank: number;
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
+
export interface Media {
|
|
17
|
+
originalMedia?: OriginalMedia;
|
|
18
|
+
avifUrl?: string;
|
|
19
|
+
webpUrl?: string;
|
|
20
|
+
retries?: number;
|
|
21
|
+
}
|
|
16
22
|
export interface OriginalMedia {
|
|
17
|
-
contentType
|
|
18
|
-
contentLength
|
|
23
|
+
contentType?: string;
|
|
24
|
+
contentLength?: number;
|
|
19
25
|
}
|
|
20
|
-
export interface
|
|
21
|
-
|
|
26
|
+
export interface SaleInfo {
|
|
27
|
+
auctionId: number;
|
|
22
28
|
seller: string;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
currentWinner?: string;
|
|
30
|
+
minBid: string;
|
|
31
|
+
maxBid?: string;
|
|
32
|
+
currentBid?: string;
|
|
33
|
+
startTime: number;
|
|
28
34
|
deadline: number;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
paymentToken: string;
|
|
36
|
+
paymentTokenNonce: number;
|
|
37
|
+
auctionType: string;
|
|
32
38
|
timestamp: number;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
minBidShort: number;
|
|
40
|
+
maxBidShort: number;
|
|
41
|
+
currentBidShort?: number;
|
|
42
|
+
currentBidUsd?: number;
|
|
43
|
+
quantity: number;
|
|
37
44
|
marketplace: string;
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
minBidUsd: string;
|
|
46
|
+
maxBidUsd?: string;
|
|
40
47
|
}
|
|
41
48
|
export interface NftValue {
|
|
42
49
|
floorValue: number;
|
|
@@ -64,36 +71,37 @@ export interface OffersInfo {
|
|
|
64
71
|
timestamp: number;
|
|
65
72
|
}
|
|
66
73
|
export interface NftData {
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
67
76
|
identifier: string;
|
|
68
|
-
collection: string;
|
|
69
|
-
attributes?: string;
|
|
70
77
|
nonce: number;
|
|
78
|
+
collection: string;
|
|
71
79
|
type: string;
|
|
72
|
-
|
|
73
|
-
creator?: string;
|
|
74
|
-
royalties: number;
|
|
80
|
+
supply?: number;
|
|
75
81
|
url: string;
|
|
76
|
-
avifUrl: string;
|
|
77
|
-
webpUrl: string;
|
|
78
82
|
wasProcessed: boolean;
|
|
83
|
+
royalties: number;
|
|
79
84
|
onSale: boolean;
|
|
85
|
+
metadata: NFTMetadata;
|
|
86
|
+
media: Media;
|
|
87
|
+
attributes?: string;
|
|
88
|
+
creator?: string;
|
|
80
89
|
hasOffers?: boolean;
|
|
81
90
|
collectionName: string;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
gameData: GameData[];
|
|
87
|
-
owner?: string;
|
|
88
|
-
ownerCount?: number;
|
|
89
|
-
ownerUsername?: string;
|
|
90
|
-
isVerified: boolean;
|
|
91
|
-
isVisible: boolean;
|
|
92
|
-
nftValue?: NftValue;
|
|
93
|
-
pool_id?: number;
|
|
94
|
-
isStaked?: boolean;
|
|
95
|
-
currentEpoch?: number;
|
|
96
|
-
hasUboundPeriod?: boolean;
|
|
97
|
-
unboundEpoch?: number;
|
|
91
|
+
saleInfo?: SaleInfo;
|
|
92
|
+
gameData?: GameData[];
|
|
93
|
+
owner?: Owner;
|
|
94
|
+
originalOwner?: Owner;
|
|
98
95
|
balance?: number;
|
|
96
|
+
collectionInfo?: CollectionInfo;
|
|
97
|
+
}
|
|
98
|
+
export interface CollectionInfo {
|
|
99
|
+
name: string;
|
|
100
|
+
isVerified: boolean;
|
|
101
|
+
profile: string;
|
|
102
|
+
}
|
|
103
|
+
export interface Owner {
|
|
104
|
+
username: string;
|
|
105
|
+
address: string;
|
|
106
|
+
profile: string;
|
|
99
107
|
}
|
package/dist/types/staking.js
CHANGED
|
@@ -5,11 +5,11 @@ var IssuingType;
|
|
|
5
5
|
(function (IssuingType) {
|
|
6
6
|
IssuingType["Dynamic"] = "Dynamic";
|
|
7
7
|
IssuingType["Fixed"] = "Fixed";
|
|
8
|
-
})(IssuingType
|
|
8
|
+
})(IssuingType || (exports.IssuingType = IssuingType = {}));
|
|
9
9
|
var PoolType;
|
|
10
10
|
(function (PoolType) {
|
|
11
11
|
PoolType["Duo"] = "Duo";
|
|
12
12
|
PoolType["Single"] = "Single";
|
|
13
13
|
PoolType["Perk"] = "Perk";
|
|
14
|
-
})(PoolType
|
|
14
|
+
})(PoolType || (exports.PoolType = PoolType = {}));
|
|
15
15
|
//# sourceMappingURL=staking.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staking.js","sourceRoot":"","sources":["../../src/types/staking.ts"],"names":[],"mappings":";;;AAkCA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,
|
|
1
|
+
{"version":3,"file":"staking.js","sourceRoot":"","sources":["../../src/types/staking.ts"],"names":[],"mappings":";;;AAkCA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAED,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,6BAAiB,CAAA;IACjB,yBAAa,CAAA;AACf,CAAC,EAJW,QAAQ,wBAAR,QAAQ,QAInB"}
|
package/dist/types/trading.js
CHANGED
|
@@ -7,7 +7,7 @@ var OrderByTradingActivity;
|
|
|
7
7
|
OrderByTradingActivity["PriceLowToHigh"] = "short_price asc";
|
|
8
8
|
OrderByTradingActivity["RecentPlaced"] = "timestamp desc";
|
|
9
9
|
OrderByTradingActivity["OldestPlaced"] = "timestamp asc";
|
|
10
|
-
})(OrderByTradingActivity
|
|
10
|
+
})(OrderByTradingActivity || (exports.OrderByTradingActivity = OrderByTradingActivity = {}));
|
|
11
11
|
var SelectFieldsTradingActivity;
|
|
12
12
|
(function (SelectFieldsTradingActivity) {
|
|
13
13
|
SelectFieldsTradingActivity[SelectFieldsTradingActivity["attributes"] = 0] = "attributes";
|
|
@@ -20,5 +20,5 @@ var SelectFieldsTradingActivity;
|
|
|
20
20
|
SelectFieldsTradingActivity[SelectFieldsTradingActivity["dataType"] = 7] = "dataType";
|
|
21
21
|
SelectFieldsTradingActivity[SelectFieldsTradingActivity["marketplace"] = 8] = "marketplace";
|
|
22
22
|
SelectFieldsTradingActivity[SelectFieldsTradingActivity["payment_token"] = 9] = "payment_token";
|
|
23
|
-
})(SelectFieldsTradingActivity
|
|
23
|
+
})(SelectFieldsTradingActivity || (exports.SelectFieldsTradingActivity = SelectFieldsTradingActivity = {}));
|
|
24
24
|
//# sourceMappingURL=trading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trading.js","sourceRoot":"","sources":["../../src/types/trading.ts"],"names":[],"mappings":";;;AAqEA,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,6DAAmC,CAAA;IACnC,4DAAkC,CAAA;IAClC,yDAA+B,CAAA;IAC/B,wDAA8B,CAAA;AAChC,CAAC,EALW,sBAAsB,
|
|
1
|
+
{"version":3,"file":"trading.js","sourceRoot":"","sources":["../../src/types/trading.ts"],"names":[],"mappings":";;;AAqEA,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,6DAAmC,CAAA;IACnC,4DAAkC,CAAA;IAClC,yDAA+B,CAAA;IAC/B,wDAA8B,CAAA;AAChC,CAAC,EALW,sBAAsB,sCAAtB,sBAAsB,QAKjC;AAED,IAAY,2BAWX;AAXD,WAAY,2BAA2B;IACrC,yFAAY,CAAA;IACZ,yFAAY,CAAA;IACZ,qFAAU,CAAA;IACV,+EAAO,CAAA;IACP,2FAAa,CAAA;IACb,+EAAO,CAAA;IACP,yEAAI,CAAA;IACJ,qFAAU,CAAA;IACV,2FAAa,CAAA;IACb,+FAAe,CAAA;AACjB,CAAC,EAXW,2BAA2B,2CAA3B,2BAA2B,QAWtC"}
|
package/dist/types/user.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MetadataAttribute } from './collection';
|
|
2
|
-
import { NftData } from './nft';
|
|
2
|
+
import { NftData, Owner } from './nft';
|
|
3
3
|
export interface IUserProfile {
|
|
4
4
|
dataType: 'userProfile';
|
|
5
5
|
hasKYC?: boolean;
|
|
@@ -41,8 +41,16 @@ export interface ISocials {
|
|
|
41
41
|
youtube?: string;
|
|
42
42
|
}
|
|
43
43
|
export interface UserInventory {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
collection: string;
|
|
45
|
+
inventoryCount: number;
|
|
46
|
+
listedCount: number;
|
|
47
|
+
stakedCount: number;
|
|
48
|
+
floorPrice: number;
|
|
49
|
+
name: string;
|
|
50
|
+
isVerified: boolean;
|
|
51
|
+
profile: string;
|
|
52
|
+
banner: string;
|
|
53
|
+
value: number;
|
|
46
54
|
}
|
|
47
55
|
export interface GroupedByCollection {
|
|
48
56
|
name: string;
|
|
@@ -60,20 +68,14 @@ export interface GroupedByCollection {
|
|
|
60
68
|
totalWorth: number;
|
|
61
69
|
}
|
|
62
70
|
export interface UserOffers {
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
hasMoreResults: boolean;
|
|
72
|
+
resources: OfferBody[];
|
|
65
73
|
}
|
|
66
|
-
export interface
|
|
67
|
-
|
|
68
|
-
type:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
isVerified: boolean;
|
|
72
|
-
isVisible: boolean;
|
|
73
|
-
offers: Offer[];
|
|
74
|
-
offersReceived: number;
|
|
75
|
-
offersSent: number;
|
|
76
|
-
globalOffers: GlobalOffer[];
|
|
74
|
+
export interface ArgsUserOffers {
|
|
75
|
+
address: string;
|
|
76
|
+
type: OfferType;
|
|
77
|
+
skip: number;
|
|
78
|
+
top: number;
|
|
77
79
|
}
|
|
78
80
|
export interface GlobalOffer {
|
|
79
81
|
dataType: string;
|
|
@@ -94,35 +96,30 @@ export interface GlobalOffer {
|
|
|
94
96
|
isActive: boolean;
|
|
95
97
|
}
|
|
96
98
|
export declare enum OfferType {
|
|
97
|
-
Received = "
|
|
98
|
-
Sent = "
|
|
99
|
+
Received = "received",
|
|
100
|
+
Sent = "sent"
|
|
99
101
|
}
|
|
100
|
-
export interface
|
|
101
|
-
|
|
102
|
+
export interface OfferBody {
|
|
103
|
+
dataType: string;
|
|
102
104
|
identifier: string;
|
|
103
|
-
webpUrl: string;
|
|
104
|
-
avifUrl: string;
|
|
105
|
-
onSale: boolean;
|
|
106
|
-
url: string;
|
|
107
105
|
collection: string;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
name: string;
|
|
112
|
-
nonce: number;
|
|
113
|
-
offer_id: number;
|
|
114
|
-
payment_token: string;
|
|
115
|
-
payment_nonce: number;
|
|
106
|
+
offerId: number;
|
|
107
|
+
paymentToken: string;
|
|
108
|
+
paymentTokenNonce: number;
|
|
116
109
|
price: string;
|
|
117
|
-
|
|
110
|
+
priceShort: number;
|
|
118
111
|
deadline: number;
|
|
119
112
|
timestamp: number;
|
|
120
|
-
owner:
|
|
113
|
+
owner: Owner;
|
|
121
114
|
quantity: number;
|
|
122
|
-
|
|
123
|
-
|
|
115
|
+
marketplace: string;
|
|
116
|
+
id: string;
|
|
117
|
+
_ts: number;
|
|
118
|
+
nftInfo: NftData;
|
|
124
119
|
isActive: boolean;
|
|
125
|
-
|
|
120
|
+
priceUsd: number;
|
|
121
|
+
floorPriceMargin: number;
|
|
122
|
+
floorPrice: number;
|
|
126
123
|
}
|
|
127
124
|
export type UserStakingInfo = {
|
|
128
125
|
pool_id: number;
|
package/dist/types/user.js
CHANGED
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Type = exports.OfferType = void 0;
|
|
4
4
|
var OfferType;
|
|
5
5
|
(function (OfferType) {
|
|
6
|
-
OfferType["Received"] = "
|
|
7
|
-
OfferType["Sent"] = "
|
|
8
|
-
})(OfferType
|
|
6
|
+
OfferType["Received"] = "received";
|
|
7
|
+
OfferType["Sent"] = "sent";
|
|
8
|
+
})(OfferType || (exports.OfferType = OfferType = {}));
|
|
9
9
|
var Type;
|
|
10
10
|
(function (Type) {
|
|
11
11
|
Type["NonFungibleESDT"] = "NonFungibleESDT";
|
|
12
|
-
})(Type
|
|
12
|
+
})(Type || (exports.Type = Type = {}));
|
|
13
13
|
//# sourceMappingURL=user.js.map
|
package/dist/types/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":";;;
|
|
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;AA0CD,IAAY,IAEX;AAFD,WAAY,IAAI;IACd,2CAAmC,CAAA;AACrC,CAAC,EAFW,IAAI,oBAAJ,IAAI,QAEf"}
|
package/dist/users/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IUserProfile, UserInventory, UserOffers, UserStakingInfo } from '../types/user';
|
|
1
|
+
import { GetNFTsArgs, SearchNFTsResponse, TradincActivityArgs, TradingActivityResponse } from '../types';
|
|
2
|
+
import { ArgsUserOffers, IUserProfile, UserInventory, UserOffers, UserStakingInfo } from '../types/user';
|
|
3
3
|
export default class UserModule {
|
|
4
4
|
private api;
|
|
5
|
+
private collection;
|
|
5
6
|
constructor();
|
|
6
7
|
/**
|
|
7
8
|
* Returns the user profile
|
|
@@ -16,28 +17,20 @@ export default class UserModule {
|
|
|
16
17
|
* @param {String} address - User's address
|
|
17
18
|
* @returns {UserInventory} User's inventory
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
+
getUserSummaryInventory: (address: string) => Promise<UserInventory[]>;
|
|
20
21
|
/**
|
|
21
22
|
* Fetches the user's NFTs listed on the marketplaces
|
|
22
23
|
* @param address - The user's address
|
|
23
24
|
* @returns {UserInventory} - A list of token ids and the price
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
|
+
getUserNFTs: (args: GetNFTsArgs) => Promise<SearchNFTsResponse>;
|
|
26
27
|
/**
|
|
27
28
|
* @name getUserOffers
|
|
28
29
|
* @description Fetches all offers sent or received associated with a user address
|
|
29
30
|
* @param {String} address - The user's wallet address
|
|
30
31
|
* @returns {UserOffers} - The user's listings
|
|
31
32
|
*/
|
|
32
|
-
getUserOffers: (
|
|
33
|
-
/**
|
|
34
|
-
* Gets all NFTs from a collection by a specific user address
|
|
35
|
-
*
|
|
36
|
-
* @param {String} address - Address of the user
|
|
37
|
-
* @param {String} collection - Collection ticker
|
|
38
|
-
* @returns {NftData[]} A list of NFTs
|
|
39
|
-
*/
|
|
40
|
-
getUserNFTsByCollection: (address: string, collection: string) => Promise<NftData[]>;
|
|
33
|
+
getUserOffers: (args: ArgsUserOffers) => Promise<UserOffers>;
|
|
41
34
|
/**
|
|
42
35
|
* Retrieves trading history based on the provided arguments.
|
|
43
36
|
*
|
package/dist/users/index.js
CHANGED
|
@@ -12,10 +12,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const collection_1 = __importDefault(require("../collection"));
|
|
15
16
|
const api_1 = __importDefault(require("../utils/api"));
|
|
16
17
|
const getActivity_1 = require("../utils/getActivity");
|
|
17
18
|
const helpers_1 = require("../utils/helpers");
|
|
18
|
-
const regex_1 = require("../utils/regex");
|
|
19
19
|
class UserModule {
|
|
20
20
|
constructor() {
|
|
21
21
|
/**
|
|
@@ -36,10 +36,10 @@ class UserModule {
|
|
|
36
36
|
* @param {String} address - User's address
|
|
37
37
|
* @returns {UserInventory} User's inventory
|
|
38
38
|
*/
|
|
39
|
-
this.
|
|
39
|
+
this.getUserSummaryInventory = (address) => __awaiter(this, void 0, void 0, function* () {
|
|
40
40
|
if (!(0, helpers_1.isAddressValid)(address))
|
|
41
41
|
throw new Error('Invalid address');
|
|
42
|
-
const response = yield this.api.fetchWithTimeout(`/
|
|
42
|
+
const response = yield this.api.fetchWithTimeout(`/user/${address}/inventory`);
|
|
43
43
|
return response;
|
|
44
44
|
});
|
|
45
45
|
/**
|
|
@@ -47,11 +47,8 @@ class UserModule {
|
|
|
47
47
|
* @param address - The user's address
|
|
48
48
|
* @returns {UserInventory} - A list of token ids and the price
|
|
49
49
|
*/
|
|
50
|
-
this.
|
|
51
|
-
|
|
52
|
-
throw new Error('Invalid address');
|
|
53
|
-
const response = yield this.api.fetchWithTimeout(`/accounts/${address}/listings`);
|
|
54
|
-
return response;
|
|
50
|
+
this.getUserNFTs = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
return yield this.collection.getNFTs(args);
|
|
55
52
|
});
|
|
56
53
|
/**
|
|
57
54
|
* @name getUserOffers
|
|
@@ -59,26 +56,10 @@ class UserModule {
|
|
|
59
56
|
* @param {String} address - The user's wallet address
|
|
60
57
|
* @returns {UserOffers} - The user's listings
|
|
61
58
|
*/
|
|
62
|
-
this.getUserOffers = (
|
|
63
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
64
|
-
throw new Error('Invalid address');
|
|
65
|
-
const response = yield this.api.fetchWithTimeout(`/accounts/${address}/listings`);
|
|
66
|
-
return response;
|
|
67
|
-
});
|
|
68
|
-
/**
|
|
69
|
-
* Gets all NFTs from a collection by a specific user address
|
|
70
|
-
*
|
|
71
|
-
* @param {String} address - Address of the user
|
|
72
|
-
* @param {String} collection - Collection ticker
|
|
73
|
-
* @returns {NftData[]} A list of NFTs
|
|
74
|
-
*/
|
|
75
|
-
this.getUserNFTsByCollection = (address, collection) => __awaiter(this, void 0, void 0, function* () {
|
|
76
|
-
if (!(0, helpers_1.isAddressValid)(address))
|
|
59
|
+
this.getUserOffers = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
if (!(0, helpers_1.isAddressValid)(args.address))
|
|
77
61
|
throw new Error('Invalid address');
|
|
78
|
-
|
|
79
|
-
throw new Error('Invalid collection ticker: ' + collection);
|
|
80
|
-
}
|
|
81
|
-
const response = yield this.api.fetchWithTimeout(`/getAccountInventory/${address}/${collection}`);
|
|
62
|
+
const response = yield this.api.fetchWithTimeout(`/user/${args.address}/offers?type=${args.type}&skip=${args.skip}&top=${args.top}`);
|
|
82
63
|
return response;
|
|
83
64
|
});
|
|
84
65
|
/**
|
|
@@ -104,6 +85,7 @@ class UserModule {
|
|
|
104
85
|
return response;
|
|
105
86
|
});
|
|
106
87
|
this.api = api_1.default.init();
|
|
88
|
+
this.collection = new collection_1.default();
|
|
107
89
|
}
|
|
108
90
|
}
|
|
109
91
|
exports.default = UserModule;
|
package/dist/users/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/users/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/users/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA6C;AAc7C,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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,GAAG,CAC1B,OAAe,EACa,EAAE;YAC9B,IAAI,CAAC,IAAA,wBAAc,EAAC,OAAO,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YAEjE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAC9C,uBAAuB,OAAO,EAAE,CACjC,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC;QAxFA,IAAI,CAAC,GAAG,GAAG,aAAW,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,IAAI,oBAAgB,EAAE,CAAC;IAC3C,CAAC;CAuFF;AA7FD,6BA6FC"}
|
package/dist/utils/api.js
CHANGED
|
@@ -15,11 +15,11 @@ var Chain;
|
|
|
15
15
|
(function (Chain) {
|
|
16
16
|
Chain["MAINNET"] = "1";
|
|
17
17
|
Chain["DEVNET"] = "D";
|
|
18
|
-
})(Chain
|
|
18
|
+
})(Chain || (exports.Chain = Chain = {}));
|
|
19
19
|
class XOXNOClient {
|
|
20
20
|
constructor(apiUrl = const_1.API_URL, apiKey = '', chain = Chain.MAINNET) {
|
|
21
21
|
this.fetchWithTimeout = (path, options = {}, timeout = 40000) => __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
var _a, _b;
|
|
22
|
+
var _a, _b, _c, _d;
|
|
23
23
|
const timestamp = Math.round(new Date().getTime() / 1000);
|
|
24
24
|
const headers = Object.assign(Object.assign({ 'Accept-Encoding': 'gzip,deflate,br', 'xo-time': `Sent-At:${timestamp}`, Referer: 'https://xoxno.sdk', 'User-Agent': 'XOXNO/1.0/SDK' }, (options.method === 'POST'
|
|
25
25
|
? { 'Content-Type': 'application/json' }
|
|
@@ -36,17 +36,17 @@ class XOXNOClient {
|
|
|
36
36
|
.join('&')
|
|
37
37
|
: ''}`, Object.assign(Object.assign(Object.assign(Object.assign({}, options), { signal: controller.signal }), (Object.keys(headers).length ? { headers } : {})), { method: (_b = options.method) !== null && _b !== void 0 ? _b : 'GET' }));
|
|
38
38
|
if (!res.ok)
|
|
39
|
-
throw new Error(res.
|
|
39
|
+
throw new Error((yield res.json()).message.toString());
|
|
40
40
|
return res.json();
|
|
41
41
|
}
|
|
42
42
|
catch (error) {
|
|
43
|
-
throw new Error('Something went wrong inside fetchWithTimeout' +
|
|
43
|
+
throw new Error((_d = 'Something went wrong inside fetchWithTimeout' +
|
|
44
44
|
' ' +
|
|
45
45
|
path +
|
|
46
46
|
' ' +
|
|
47
47
|
JSON.stringify(options) +
|
|
48
48
|
' ' +
|
|
49
|
-
error);
|
|
49
|
+
((_c = error === null || error === void 0 ? void 0 : error.message) === null || _c === void 0 ? void 0 : _c.toString())) !== null && _d !== void 0 ? _d : error.toString());
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
this.apiUrl = apiUrl;
|
package/dist/utils/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAaiB;AAEjB,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,sBAAa,CAAA;IACb,qBAAY,CAAA;AACd,CAAC,EAHW,KAAK,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAaiB;AAEjB,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,sBAAa,CAAA;IACb,qBAAY,CAAA;AACd,CAAC,EAHW,KAAK,qBAAL,KAAK,QAGhB;AACD,MAAqB,WAAW;IAe9B,YACE,SAAiB,eAAO,EACxB,MAAM,GAAG,EAAE,EACX,QAAe,KAAK,CAAC,OAAO;QAsCvB,qBAAgB,GAAG,CACxB,IAAY,EACZ,UAAmC,EAAE,EACrC,OAAO,GAAG,KAAK,EACH,EAAE;;YACd,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,I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W,CAAC,QAAQ,GAAG,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;SAC/D;QACD,OAAO,WAAW,CAAC,QAAQ,CAAC;IAC9B,CAAC;CAwDF;AA9GD,8BA8GC"}
|
|
@@ -41,7 +41,11 @@ const getActivity = (args, api) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
41
41
|
skip: args.skip || 0,
|
|
42
42
|
};
|
|
43
43
|
const buffer = Buffer.from(JSON.stringify(payloadBody)).toString('base64');
|
|
44
|
-
const response = yield api.fetchWithTimeout(`/getTradingActivity/${buffer}
|
|
44
|
+
const response = yield api.fetchWithTimeout(`/getTradingActivity/${buffer}`, {
|
|
45
|
+
next: {
|
|
46
|
+
tags: ['getActivity'],
|
|
47
|
+
},
|
|
48
|
+
});
|
|
45
49
|
return Object.assign(Object.assign({}, response), { getNextPagePayload: Object.assign(Object.assign({}, args), { skip: ((_a = args.skip) !== null && _a !== void 0 ? _a : 0) + ((_b = args.top) !== null && _b !== void 0 ? _b : 35) }), empty: response.resources.length === 0 });
|
|
46
50
|
});
|
|
47
51
|
exports.getActivity = getActivity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getActivity.js","sourceRoot":"","sources":["../../src/utils/getActivity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA;;;;;;GAMG;AACI,MAAM,WAAW,GAAG,CACzB,IAAyB,EACzB,GAAgB,EACkB,EAAE;;IACpC,IAAI,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,GAAG,EAAE,EAAE;QAC7B,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;KAClD;IAED,MAAM,WAAW,GAA+B;QAC9C,OAAO,EAAE;YACP,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,UAAU,EAAE,IAAI,CAAC,WAAW,IAAI,SAAS;YACzC,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,SAAS;YAClC,MAAM,EAAE,IAA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I,SAAS;YAC3C,MAAM,EAAE,IAAI,CAAC,OAAO,IAAI,SAAS;YACjC,KAAK,EAAE,IAAI,CAAC,UAAU;YACtB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B;QACD,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE;QACnB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC;KACrB,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC3E,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,gBAAgB,CACzC,uBAAuB,MAAM,EAAE,EAC/B;QACE,IAAI,EAAE;YACJ,IAAI,EAAE,CAAC,aAAa,CAAC;SACtB;KACF,CACF,CAAC;IAEF,uCACK,QAAQ,KACX,kBAAkB,kCACb,IAAI,KACP,IAAI,EAAE,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,IAAI,CAAC,GAAG,mCAAI,EAAE,CAAC,KAE3C,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,IACtC;AACJ,CAAC,CAAA,CAAC;AA7CW,QAAA,WAAW,eA6CtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xoxno/sdk-js",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0-alpha",
|
|
4
4
|
"description": "The SDK to interact with the XOXNO Protocol!",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -44,30 +44,30 @@
|
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://github.com/XOXNO/sdk-js#readme",
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@commitlint/cli": "^
|
|
48
|
-
"@commitlint/config-conventional": "^
|
|
47
|
+
"@commitlint/cli": "^18.2.0",
|
|
48
|
+
"@commitlint/config-conventional": "^18.1.0",
|
|
49
49
|
"@semantic-release/changelog": "^6.0.3",
|
|
50
50
|
"@semantic-release/git": "^10.0.1",
|
|
51
|
-
"@types/jest": "^29.5.
|
|
52
|
-
"@types/node": "^
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
54
|
-
"@typescript-eslint/parser": "^
|
|
51
|
+
"@types/jest": "^29.5.7",
|
|
52
|
+
"@types/node": "^20.8.10",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
|
54
|
+
"@typescript-eslint/parser": "^6.10.0",
|
|
55
55
|
"commitizen": "^4.3.0",
|
|
56
56
|
"cz-conventional-changelog": "^3.3.0",
|
|
57
|
-
"eslint": "^8.
|
|
58
|
-
"eslint-config-prettier": "^
|
|
59
|
-
"eslint-plugin-prettier": "^
|
|
57
|
+
"eslint": "^8.53.0",
|
|
58
|
+
"eslint-config-prettier": "^9.0.0",
|
|
59
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
60
60
|
"husky": "^8.0.3",
|
|
61
|
-
"jest": "^29.
|
|
62
|
-
"prettier": "^
|
|
63
|
-
"semantic-release": "^
|
|
64
|
-
"ts-jest": "^29.
|
|
65
|
-
"ts-loader": "^9.
|
|
66
|
-
"typedoc": "^0.
|
|
67
|
-
"typescript": "^5.
|
|
61
|
+
"jest": "^29.7.0",
|
|
62
|
+
"prettier": "^3.0.3",
|
|
63
|
+
"semantic-release": "^22.0.7",
|
|
64
|
+
"ts-jest": "^29.1.1",
|
|
65
|
+
"ts-loader": "^9.5.0",
|
|
66
|
+
"typedoc": "^0.25.3",
|
|
67
|
+
"typescript": "^5.2.2"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@multiversx/sdk-core": "^12.
|
|
71
|
-
"@multiversx/sdk-network-providers": "^
|
|
70
|
+
"@multiversx/sdk-core": "^12.12.0",
|
|
71
|
+
"@multiversx/sdk-network-providers": "^2.0.0"
|
|
72
72
|
}
|
|
73
73
|
}
|