@eluvio/elv-client-js 4.2.13 → 4.2.14
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/ElvClient-min.js +1 -1
- package/dist/ElvClient-node-min.js +1 -1
- package/dist/ElvFrameClient-min.js +1 -1
- package/dist/ElvPermissionsClient-min.js +1 -1
- package/dist/ElvWalletClient-min.js +1 -1
- package/dist/ElvWalletClient-node-min.js +1 -1
- package/dist/src/AuthorizationClient.js +723 -710
- package/dist/src/ContentObjectAudit.js +56 -56
- package/dist/src/Crypto.js +85 -85
- package/dist/src/ElvClient.js +502 -530
- package/dist/src/ElvWallet.js +28 -30
- package/dist/src/EthClient.js +311 -311
- package/dist/src/FrameClient.js +65 -64
- package/dist/src/HttpClient.js +60 -60
- package/dist/src/Id.js +2 -1
- package/dist/src/PermissionsClient.js +487 -499
- package/dist/src/RemoteSigner.js +178 -123
- package/dist/src/UserProfileClient.js +374 -392
- package/dist/src/Utils.js +66 -69
- package/dist/src/Validation.js +10 -10
- package/dist/src/client/ABRPublishing.js +239 -239
- package/dist/src/client/AccessGroups.js +474 -477
- package/dist/src/client/ContentAccess.js +1713 -1708
- package/dist/src/client/ContentManagement.js +871 -871
- package/dist/src/client/Contracts.js +736 -582
- package/dist/src/client/Files.js +684 -700
- package/dist/src/client/LiveConf.js +6 -1
- package/dist/src/client/LiveStream.js +686 -722
- package/dist/src/client/NFT.js +14 -14
- package/dist/src/client/NTP.js +84 -84
- package/dist/src/client/Shares.js +60 -53
- package/dist/src/walletClient/ClientMethods.js +951 -977
- package/dist/src/walletClient/Notifications.js +14 -14
- package/dist/src/walletClient/Profile.js +66 -66
- package/dist/src/walletClient/Utils.js +15 -15
- package/dist/src/walletClient/index.js +584 -581
- package/package.json +3 -2
- package/src/ElvClient.js +2 -1
- package/src/FrameClient.js +3 -0
- package/src/LogMessage.js +1 -1
- package/src/RemoteSigner.js +17 -3
- package/src/client/ABRPublishing.js +1 -1
- package/src/client/ContentAccess.js +16 -13
- package/src/client/Contracts.js +88 -7
- package/src/walletClient/index.js +15 -4
|
@@ -72,7 +72,7 @@ exports.UserAddress = function () {
|
|
|
72
72
|
* <li>- usedBalance - <i>(Only included if user has set up Solana link with the Phantom wallet)</i> Available USDC balance of the user's Solana wallet</li>
|
|
73
73
|
* </ul>
|
|
74
74
|
*/
|
|
75
|
-
exports.UserWalletBalance = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
75
|
+
exports.UserWalletBalance = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
76
76
|
var checkOnboard,
|
|
77
77
|
_yield$this$client$ut,
|
|
78
78
|
balance,
|
|
@@ -90,21 +90,19 @@ exports.UserWalletBalance = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regener
|
|
|
90
90
|
withdrawableWalletBalance,
|
|
91
91
|
rootUrl,
|
|
92
92
|
balances,
|
|
93
|
-
_args = arguments
|
|
94
|
-
|
|
95
|
-
_t2;
|
|
96
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
93
|
+
_args = arguments;
|
|
94
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
97
95
|
while (1) switch (_context.prev = _context.next) {
|
|
98
96
|
case 0:
|
|
99
97
|
checkOnboard = _args.length > 0 && _args[0] !== undefined ? _args[0] : false;
|
|
100
98
|
if (this.loggedIn) {
|
|
101
|
-
_context.next =
|
|
99
|
+
_context.next = 3;
|
|
102
100
|
break;
|
|
103
101
|
}
|
|
104
102
|
return _context.abrupt("return");
|
|
105
|
-
case
|
|
106
|
-
|
|
107
|
-
_context.next =
|
|
103
|
+
case 3:
|
|
104
|
+
_context.t0 = this.client.utils;
|
|
105
|
+
_context.next = 6;
|
|
108
106
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
109
107
|
path: UrlJoin("as", "wlt", "mkt", "bal"),
|
|
110
108
|
method: "GET",
|
|
@@ -112,11 +110,11 @@ exports.UserWalletBalance = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regener
|
|
|
112
110
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
113
111
|
}
|
|
114
112
|
});
|
|
115
|
-
case
|
|
116
|
-
|
|
117
|
-
_context.next =
|
|
118
|
-
return
|
|
119
|
-
case
|
|
113
|
+
case 6:
|
|
114
|
+
_context.t1 = _context.sent;
|
|
115
|
+
_context.next = 9;
|
|
116
|
+
return _context.t0.ResponseToJson.call(_context.t0, _context.t1);
|
|
117
|
+
case 9:
|
|
120
118
|
_yield$this$client$ut = _context.sent;
|
|
121
119
|
balance = _yield$this$client$ut.balance;
|
|
122
120
|
usage_hold = _yield$this$client$ut.usage_hold;
|
|
@@ -132,12 +130,12 @@ exports.UserWalletBalance = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regener
|
|
|
132
130
|
pendingWalletBalance = Math.max(0, totalWalletBalance - availableWalletBalance);
|
|
133
131
|
withdrawableWalletBalance = Math.max(0, totalWalletBalance - parseFloat(Math.max(payout_hold, lockedWalletBalance) || 0));
|
|
134
132
|
if (!(checkOnboard && stripe_id && !stripe_payouts_enabled)) {
|
|
135
|
-
_context.next =
|
|
133
|
+
_context.next = 30;
|
|
136
134
|
break;
|
|
137
135
|
}
|
|
138
136
|
// Refresh stripe enabled flag
|
|
139
137
|
rootUrl = new URL(UrlJoin(window.location.origin, window.location.pathname)).toString();
|
|
140
|
-
_context.next =
|
|
138
|
+
_context.next = 27;
|
|
141
139
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
142
140
|
path: UrlJoin("as", "wlt", "onb", "stripe"),
|
|
143
141
|
method: "POST",
|
|
@@ -151,12 +149,12 @@ exports.UserWalletBalance = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regener
|
|
|
151
149
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
152
150
|
}
|
|
153
151
|
});
|
|
154
|
-
case
|
|
155
|
-
_context.next =
|
|
152
|
+
case 27:
|
|
153
|
+
_context.next = 29;
|
|
156
154
|
return this.UserWalletBalance(false);
|
|
157
|
-
case
|
|
155
|
+
case 29:
|
|
158
156
|
return _context.abrupt("return", _context.sent);
|
|
159
|
-
case
|
|
157
|
+
case 30:
|
|
160
158
|
balances = {
|
|
161
159
|
totalWalletBalance: totalWalletBalance,
|
|
162
160
|
availableWalletBalance: availableWalletBalance,
|
|
@@ -176,7 +174,7 @@ exports.UserWalletBalance = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regener
|
|
|
176
174
|
}
|
|
177
175
|
*/
|
|
178
176
|
return _context.abrupt("return", balances);
|
|
179
|
-
case
|
|
177
|
+
case 33:
|
|
180
178
|
case "end":
|
|
181
179
|
return _context.stop();
|
|
182
180
|
}
|
|
@@ -195,43 +193,37 @@ exports.UserWalletBalance = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regener
|
|
|
195
193
|
*
|
|
196
194
|
* @returns {Promise<Array<String>>} - A list of item names
|
|
197
195
|
*/
|
|
198
|
-
exports.UserItemNames = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
196
|
+
exports.UserItemNames = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
199
197
|
var _ref3,
|
|
200
198
|
marketplaceParams,
|
|
201
199
|
userAddress,
|
|
202
200
|
filters,
|
|
203
|
-
_args2 = arguments
|
|
204
|
-
|
|
205
|
-
_t4,
|
|
206
|
-
_t5,
|
|
207
|
-
_t6,
|
|
208
|
-
_t7,
|
|
209
|
-
_t8;
|
|
210
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
201
|
+
_args2 = arguments;
|
|
202
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
211
203
|
while (1) switch (_context2.prev = _context2.next) {
|
|
212
204
|
case 0:
|
|
213
205
|
_ref3 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, marketplaceParams = _ref3.marketplaceParams, userAddress = _ref3.userAddress;
|
|
214
206
|
filters = [];
|
|
215
207
|
if (!marketplaceParams) {
|
|
216
|
-
_context2.next =
|
|
208
|
+
_context2.next = 10;
|
|
217
209
|
break;
|
|
218
210
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
_context2.next =
|
|
211
|
+
_context2.t0 = filters;
|
|
212
|
+
_context2.t1 = "tenant:eq:";
|
|
213
|
+
_context2.next = 7;
|
|
222
214
|
return this.MarketplaceInfo({
|
|
223
215
|
marketplaceParams: marketplaceParams
|
|
224
216
|
});
|
|
225
|
-
case
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
case
|
|
217
|
+
case 7:
|
|
218
|
+
_context2.t2 = _context2.sent.tenantId;
|
|
219
|
+
_context2.t3 = _context2.t1.concat.call(_context2.t1, _context2.t2);
|
|
220
|
+
_context2.t0.push.call(_context2.t0, _context2.t3);
|
|
221
|
+
case 10:
|
|
230
222
|
if (userAddress) {
|
|
231
223
|
filters.push("wlt:eq:".concat(Utils.FormatAddress(userAddress)));
|
|
232
224
|
}
|
|
233
|
-
|
|
234
|
-
_context2.next =
|
|
225
|
+
_context2.t4 = Utils;
|
|
226
|
+
_context2.next = 14;
|
|
235
227
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
236
228
|
path: UrlJoin("as", "wlt", "names"),
|
|
237
229
|
method: "GET",
|
|
@@ -239,13 +231,13 @@ exports.UserItemNames = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator
|
|
|
239
231
|
filter: filters
|
|
240
232
|
}
|
|
241
233
|
});
|
|
242
|
-
case
|
|
243
|
-
|
|
244
|
-
_context2.next =
|
|
245
|
-
return
|
|
246
|
-
case
|
|
234
|
+
case 14:
|
|
235
|
+
_context2.t5 = _context2.sent;
|
|
236
|
+
_context2.next = 17;
|
|
237
|
+
return _context2.t4.ResponseToJson.call(_context2.t4, _context2.t5);
|
|
238
|
+
case 17:
|
|
247
239
|
return _context2.abrupt("return", _context2.sent);
|
|
248
|
-
case
|
|
240
|
+
case 18:
|
|
249
241
|
case "end":
|
|
250
242
|
return _context2.stop();
|
|
251
243
|
}
|
|
@@ -264,14 +256,14 @@ exports.UserItemNames = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator
|
|
|
264
256
|
* @returns {Promise<Array<String>>} - A list of item editions
|
|
265
257
|
*/
|
|
266
258
|
exports.UserItemEditionNames = /*#__PURE__*/function () {
|
|
267
|
-
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
|
|
268
|
-
var displayName
|
|
269
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
259
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
|
|
260
|
+
var displayName;
|
|
261
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
270
262
|
while (1) switch (_context3.prev = _context3.next) {
|
|
271
263
|
case 0:
|
|
272
264
|
displayName = _ref4.displayName;
|
|
273
|
-
|
|
274
|
-
_context3.next =
|
|
265
|
+
_context3.t0 = Utils;
|
|
266
|
+
_context3.next = 4;
|
|
275
267
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
276
268
|
path: UrlJoin("as", "wlt", "editions"),
|
|
277
269
|
method: "GET",
|
|
@@ -279,13 +271,13 @@ exports.UserItemEditionNames = /*#__PURE__*/function () {
|
|
|
279
271
|
filter: "meta/display_name:eq:".concat(displayName)
|
|
280
272
|
}
|
|
281
273
|
});
|
|
282
|
-
case
|
|
283
|
-
|
|
284
|
-
_context3.next =
|
|
285
|
-
return
|
|
286
|
-
case
|
|
274
|
+
case 4:
|
|
275
|
+
_context3.t1 = _context3.sent;
|
|
276
|
+
_context3.next = 7;
|
|
277
|
+
return _context3.t0.ResponseToJson.call(_context3.t0, _context3.t1);
|
|
278
|
+
case 7:
|
|
287
279
|
return _context3.abrupt("return", _context3.sent);
|
|
288
|
-
case
|
|
280
|
+
case 8:
|
|
289
281
|
case "end":
|
|
290
282
|
return _context3.stop();
|
|
291
283
|
}
|
|
@@ -309,48 +301,42 @@ exports.UserItemEditionNames = /*#__PURE__*/function () {
|
|
|
309
301
|
*
|
|
310
302
|
* @returns {Promise<Array<String>>} - A list of item names
|
|
311
303
|
*/
|
|
312
|
-
exports.UserItemAttributes = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
304
|
+
exports.UserItemAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
313
305
|
var _ref7,
|
|
314
306
|
marketplaceParams,
|
|
315
307
|
displayName,
|
|
316
308
|
userAddress,
|
|
317
309
|
filters,
|
|
318
310
|
attributes,
|
|
319
|
-
_args4 = arguments
|
|
320
|
-
|
|
321
|
-
_t10,
|
|
322
|
-
_t11,
|
|
323
|
-
_t12,
|
|
324
|
-
_t13,
|
|
325
|
-
_t14;
|
|
326
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
311
|
+
_args4 = arguments;
|
|
312
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
327
313
|
while (1) switch (_context4.prev = _context4.next) {
|
|
328
314
|
case 0:
|
|
329
315
|
_ref7 = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, marketplaceParams = _ref7.marketplaceParams, displayName = _ref7.displayName, userAddress = _ref7.userAddress;
|
|
330
316
|
filters = [];
|
|
331
317
|
if (!marketplaceParams) {
|
|
332
|
-
_context4.next =
|
|
318
|
+
_context4.next = 10;
|
|
333
319
|
break;
|
|
334
320
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
_context4.next =
|
|
321
|
+
_context4.t0 = filters;
|
|
322
|
+
_context4.t1 = "tenant:eq:";
|
|
323
|
+
_context4.next = 7;
|
|
338
324
|
return this.MarketplaceInfo({
|
|
339
325
|
marketplaceParams: marketplaceParams
|
|
340
326
|
});
|
|
341
|
-
case
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
case
|
|
327
|
+
case 7:
|
|
328
|
+
_context4.t2 = _context4.sent.tenantId;
|
|
329
|
+
_context4.t3 = _context4.t1.concat.call(_context4.t1, _context4.t2);
|
|
330
|
+
_context4.t0.push.call(_context4.t0, _context4.t3);
|
|
331
|
+
case 10:
|
|
346
332
|
if (userAddress) {
|
|
347
333
|
filters.push("wlt:eq:".concat(Utils.FormatAddress(userAddress)));
|
|
348
334
|
}
|
|
349
335
|
if (displayName) {
|
|
350
336
|
filters.push("meta/display_name:eq:".concat(displayName));
|
|
351
337
|
}
|
|
352
|
-
|
|
353
|
-
_context4.next =
|
|
338
|
+
_context4.t4 = Utils;
|
|
339
|
+
_context4.next = 15;
|
|
354
340
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
355
341
|
path: UrlJoin("as", "wlt", "attributes"),
|
|
356
342
|
method: "GET",
|
|
@@ -358,11 +344,11 @@ exports.UserItemAttributes = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regene
|
|
|
358
344
|
filter: filters
|
|
359
345
|
}
|
|
360
346
|
});
|
|
361
|
-
case
|
|
362
|
-
|
|
363
|
-
_context4.next =
|
|
364
|
-
return
|
|
365
|
-
case
|
|
347
|
+
case 15:
|
|
348
|
+
_context4.t5 = _context4.sent;
|
|
349
|
+
_context4.next = 18;
|
|
350
|
+
return _context4.t4.ResponseToJson.call(_context4.t4, _context4.t5);
|
|
351
|
+
case 18:
|
|
366
352
|
attributes = _context4.sent;
|
|
367
353
|
return _context4.abrupt("return", attributes.map(function (_ref8) {
|
|
368
354
|
var trait_type = _ref8.trait_type,
|
|
@@ -375,7 +361,7 @@ exports.UserItemAttributes = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regene
|
|
|
375
361
|
var name = _ref9.name;
|
|
376
362
|
return !["Content Fabric Hash", "Total Minted Supply", "Creator"].includes(name);
|
|
377
363
|
}));
|
|
378
|
-
case
|
|
364
|
+
case 20:
|
|
379
365
|
case "end":
|
|
380
366
|
return _context4.stop();
|
|
381
367
|
}
|
|
@@ -403,31 +389,31 @@ exports.UserItemAttributes = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regene
|
|
|
403
389
|
*
|
|
404
390
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
405
391
|
*/
|
|
406
|
-
exports.UserItems = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
407
|
-
var
|
|
408
|
-
|
|
392
|
+
exports.UserItems = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
393
|
+
var _ref11,
|
|
394
|
+
_ref11$sortBy,
|
|
409
395
|
sortBy,
|
|
410
|
-
|
|
396
|
+
_ref11$includeFullMet,
|
|
411
397
|
includeFullMetadata,
|
|
412
398
|
_args5 = arguments;
|
|
413
|
-
return _regeneratorRuntime.wrap(function (_context5) {
|
|
399
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
414
400
|
while (1) switch (_context5.prev = _context5.next) {
|
|
415
401
|
case 0:
|
|
416
|
-
|
|
402
|
+
_ref11 = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}, _ref11$sortBy = _ref11.sortBy, sortBy = _ref11$sortBy === void 0 ? "default" : _ref11$sortBy, _ref11$includeFullMet = _ref11.includeFullMetadata, includeFullMetadata = _ref11$includeFullMet === void 0 ? false : _ref11$includeFullMet;
|
|
417
403
|
if (!(includeFullMetadata && this.loggedIn)) {
|
|
418
|
-
_context5.next =
|
|
404
|
+
_context5.next = 5;
|
|
419
405
|
break;
|
|
420
406
|
}
|
|
421
407
|
return _context5.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
422
408
|
mode: "owned-full-meta",
|
|
423
409
|
sortBy: sortBy
|
|
424
410
|
}, _args5[0] || {})));
|
|
425
|
-
case
|
|
411
|
+
case 5:
|
|
426
412
|
return _context5.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
427
413
|
mode: "owned",
|
|
428
414
|
sortBy: sortBy
|
|
429
415
|
}, _args5[0] || {})));
|
|
430
|
-
case
|
|
416
|
+
case 6:
|
|
431
417
|
case "end":
|
|
432
418
|
return _context5.stop();
|
|
433
419
|
}
|
|
@@ -448,22 +434,22 @@ exports.UserItems = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRunt
|
|
|
448
434
|
*
|
|
449
435
|
* @returns {Promise<Array<Object>>} - List of current user's listings
|
|
450
436
|
*/
|
|
451
|
-
exports.UserListings = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
452
|
-
var
|
|
437
|
+
exports.UserListings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
438
|
+
var _ref13,
|
|
453
439
|
userAddress,
|
|
454
|
-
|
|
440
|
+
_ref13$sortBy,
|
|
455
441
|
sortBy,
|
|
456
|
-
|
|
442
|
+
_ref13$sortDesc,
|
|
457
443
|
sortDesc,
|
|
458
444
|
contractAddress,
|
|
459
445
|
tokenId,
|
|
460
446
|
marketplaceParams,
|
|
461
447
|
_args6 = arguments;
|
|
462
|
-
return _regeneratorRuntime.wrap(function (_context6) {
|
|
448
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
463
449
|
while (1) switch (_context6.prev = _context6.next) {
|
|
464
450
|
case 0:
|
|
465
|
-
|
|
466
|
-
_context6.next =
|
|
451
|
+
_ref13 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, userAddress = _ref13.userAddress, _ref13$sortBy = _ref13.sortBy, sortBy = _ref13$sortBy === void 0 ? "created" : _ref13$sortBy, _ref13$sortDesc = _ref13.sortDesc, sortDesc = _ref13$sortDesc === void 0 ? false : _ref13$sortDesc, contractAddress = _ref13.contractAddress, tokenId = _ref13.tokenId, marketplaceParams = _ref13.marketplaceParams;
|
|
452
|
+
_context6.next = 3;
|
|
467
453
|
return this.FilteredQuery({
|
|
468
454
|
mode: "listings",
|
|
469
455
|
start: 0,
|
|
@@ -476,9 +462,9 @@ exports.UserListings = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorR
|
|
|
476
462
|
tokenId: tokenId,
|
|
477
463
|
includeCheckoutLocked: true
|
|
478
464
|
});
|
|
479
|
-
case
|
|
465
|
+
case 3:
|
|
480
466
|
return _context6.abrupt("return", _context6.sent.results);
|
|
481
|
-
case
|
|
467
|
+
case 4:
|
|
482
468
|
case "end":
|
|
483
469
|
return _context6.stop();
|
|
484
470
|
}
|
|
@@ -502,12 +488,12 @@ exports.UserListings = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorR
|
|
|
502
488
|
*
|
|
503
489
|
* @returns {Promise<Array<Object>>} - List of current user's sales
|
|
504
490
|
*/
|
|
505
|
-
exports.UserSales = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
506
|
-
var
|
|
491
|
+
exports.UserSales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
492
|
+
var _ref15,
|
|
507
493
|
userAddress,
|
|
508
|
-
|
|
494
|
+
_ref15$sortBy,
|
|
509
495
|
sortBy,
|
|
510
|
-
|
|
496
|
+
_ref15$sortDesc,
|
|
511
497
|
sortDesc,
|
|
512
498
|
contractAddress,
|
|
513
499
|
tokenId,
|
|
@@ -516,11 +502,11 @@ exports.UserSales = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRunt
|
|
|
516
502
|
lastNDays,
|
|
517
503
|
marketplaceParams,
|
|
518
504
|
_args7 = arguments;
|
|
519
|
-
return _regeneratorRuntime.wrap(function (_context7) {
|
|
505
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
520
506
|
while (1) switch (_context7.prev = _context7.next) {
|
|
521
507
|
case 0:
|
|
522
|
-
|
|
523
|
-
_context7.next =
|
|
508
|
+
_ref15 = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}, userAddress = _ref15.userAddress, _ref15$sortBy = _ref15.sortBy, sortBy = _ref15$sortBy === void 0 ? "created" : _ref15$sortBy, _ref15$sortDesc = _ref15.sortDesc, sortDesc = _ref15$sortDesc === void 0 ? false : _ref15$sortDesc, contractAddress = _ref15.contractAddress, tokenId = _ref15.tokenId, startTime = _ref15.startTime, endTime = _ref15.endTime, lastNDays = _ref15.lastNDays, marketplaceParams = _ref15.marketplaceParams;
|
|
509
|
+
_context7.next = 3;
|
|
524
510
|
return this.FilteredQuery({
|
|
525
511
|
mode: "sales",
|
|
526
512
|
start: 0,
|
|
@@ -535,9 +521,9 @@ exports.UserSales = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRunt
|
|
|
535
521
|
contractAddress: contractAddress,
|
|
536
522
|
tokenId: tokenId
|
|
537
523
|
});
|
|
538
|
-
case
|
|
524
|
+
case 3:
|
|
539
525
|
return _context7.abrupt("return", _context7.sent.results);
|
|
540
|
-
case
|
|
526
|
+
case 4:
|
|
541
527
|
case "end":
|
|
542
528
|
return _context7.stop();
|
|
543
529
|
}
|
|
@@ -561,12 +547,12 @@ exports.UserSales = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRunt
|
|
|
561
547
|
*
|
|
562
548
|
* @returns {Promise<Array<Object>>} - List of current user's sales
|
|
563
549
|
*/
|
|
564
|
-
exports.UserTransfers = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
565
|
-
var
|
|
550
|
+
exports.UserTransfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
551
|
+
var _ref17,
|
|
566
552
|
userAddress,
|
|
567
|
-
|
|
553
|
+
_ref17$sortBy,
|
|
568
554
|
sortBy,
|
|
569
|
-
|
|
555
|
+
_ref17$sortDesc,
|
|
570
556
|
sortDesc,
|
|
571
557
|
contractAddress,
|
|
572
558
|
tokenId,
|
|
@@ -575,11 +561,11 @@ exports.UserTransfers = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator
|
|
|
575
561
|
lastNDays,
|
|
576
562
|
marketplaceParams,
|
|
577
563
|
_args8 = arguments;
|
|
578
|
-
return _regeneratorRuntime.wrap(function (_context8) {
|
|
564
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
579
565
|
while (1) switch (_context8.prev = _context8.next) {
|
|
580
566
|
case 0:
|
|
581
|
-
|
|
582
|
-
_context8.next =
|
|
567
|
+
_ref17 = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {}, userAddress = _ref17.userAddress, _ref17$sortBy = _ref17.sortBy, sortBy = _ref17$sortBy === void 0 ? "created" : _ref17$sortBy, _ref17$sortDesc = _ref17.sortDesc, sortDesc = _ref17$sortDesc === void 0 ? false : _ref17$sortDesc, contractAddress = _ref17.contractAddress, tokenId = _ref17.tokenId, startTime = _ref17.startTime, endTime = _ref17.endTime, lastNDays = _ref17.lastNDays, marketplaceParams = _ref17.marketplaceParams;
|
|
568
|
+
_context8.next = 3;
|
|
583
569
|
return this.FilteredQuery({
|
|
584
570
|
mode: "transfers",
|
|
585
571
|
start: 0,
|
|
@@ -594,9 +580,9 @@ exports.UserTransfers = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator
|
|
|
594
580
|
endTime: endTime,
|
|
595
581
|
lastNDays: lastNDays
|
|
596
582
|
});
|
|
597
|
-
case
|
|
583
|
+
case 3:
|
|
598
584
|
return _context8.abrupt("return", _context8.sent.results);
|
|
599
|
-
case
|
|
585
|
+
case 4:
|
|
600
586
|
case "end":
|
|
601
587
|
return _context8.stop();
|
|
602
588
|
}
|
|
@@ -618,40 +604,40 @@ exports.UserTransfers = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator
|
|
|
618
604
|
* @returns {Promise<Object>} - The tenant configuration
|
|
619
605
|
*/
|
|
620
606
|
exports.TenantConfiguration = /*#__PURE__*/function () {
|
|
621
|
-
var
|
|
622
|
-
var tenantId, contractAddress
|
|
623
|
-
return _regeneratorRuntime.wrap(function (_context9) {
|
|
607
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref18) {
|
|
608
|
+
var tenantId, contractAddress;
|
|
609
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
624
610
|
while (1) switch (_context9.prev = _context9.next) {
|
|
625
611
|
case 0:
|
|
626
|
-
tenantId =
|
|
612
|
+
tenantId = _ref18.tenantId, contractAddress = _ref18.contractAddress;
|
|
627
613
|
_context9.prev = 1;
|
|
628
614
|
contractAddress = contractAddress ? Utils.FormatAddress(contractAddress) : undefined;
|
|
629
615
|
if (this.tenantConfigs[contractAddress || tenantId]) {
|
|
630
|
-
_context9.next =
|
|
616
|
+
_context9.next = 7;
|
|
631
617
|
break;
|
|
632
618
|
}
|
|
633
|
-
_context9.next =
|
|
619
|
+
_context9.next = 6;
|
|
634
620
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
635
621
|
path: contractAddress ? UrlJoin("as", "config", "nft", contractAddress) : UrlJoin("as", "config", "tnt", tenantId),
|
|
636
622
|
method: "GET"
|
|
637
623
|
}));
|
|
638
|
-
case
|
|
624
|
+
case 6:
|
|
639
625
|
this.tenantConfigs[contractAddress || tenantId] = _context9.sent;
|
|
640
|
-
case
|
|
626
|
+
case 7:
|
|
641
627
|
return _context9.abrupt("return", this.tenantConfigs[contractAddress || tenantId]);
|
|
642
|
-
case
|
|
643
|
-
_context9.prev =
|
|
644
|
-
|
|
645
|
-
this.Log("Failed to load tenant configuration", true,
|
|
628
|
+
case 10:
|
|
629
|
+
_context9.prev = 10;
|
|
630
|
+
_context9.t0 = _context9["catch"](1);
|
|
631
|
+
this.Log("Failed to load tenant configuration", true, _context9.t0);
|
|
646
632
|
return _context9.abrupt("return", {});
|
|
647
|
-
case
|
|
633
|
+
case 14:
|
|
648
634
|
case "end":
|
|
649
635
|
return _context9.stop();
|
|
650
636
|
}
|
|
651
|
-
}, _callee9, this, [[1,
|
|
637
|
+
}, _callee9, this, [[1, 10]]);
|
|
652
638
|
}));
|
|
653
639
|
return function (_x2) {
|
|
654
|
-
return
|
|
640
|
+
return _ref19.apply(this, arguments);
|
|
655
641
|
};
|
|
656
642
|
}();
|
|
657
643
|
|
|
@@ -663,33 +649,33 @@ exports.TenantConfiguration = /*#__PURE__*/function () {
|
|
|
663
649
|
* @param {string} currency - The currency for which to retrieve the USD exchange rate
|
|
664
650
|
*/
|
|
665
651
|
exports.ExchangeRate = /*#__PURE__*/function () {
|
|
666
|
-
var
|
|
652
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref20) {
|
|
667
653
|
var currency;
|
|
668
|
-
return _regeneratorRuntime.wrap(function (
|
|
669
|
-
while (1) switch (
|
|
654
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
655
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
670
656
|
case 0:
|
|
671
|
-
currency =
|
|
657
|
+
currency = _ref20.currency;
|
|
672
658
|
if (currency) {
|
|
673
|
-
|
|
659
|
+
_context10.next = 3;
|
|
674
660
|
break;
|
|
675
661
|
}
|
|
676
662
|
throw Error("Eluvio Wallet Client: Invalid or missing currency in ExchangeRate");
|
|
677
|
-
case
|
|
678
|
-
|
|
663
|
+
case 3:
|
|
664
|
+
_context10.next = 5;
|
|
679
665
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
680
666
|
path: UrlJoin("as", "xr", "ebanx", currency),
|
|
681
667
|
method: "GET"
|
|
682
668
|
}));
|
|
683
|
-
case
|
|
684
|
-
return
|
|
685
|
-
case
|
|
669
|
+
case 5:
|
|
670
|
+
return _context10.abrupt("return", _context10.sent);
|
|
671
|
+
case 6:
|
|
686
672
|
case "end":
|
|
687
|
-
return
|
|
673
|
+
return _context10.stop();
|
|
688
674
|
}
|
|
689
|
-
},
|
|
675
|
+
}, _callee10, this);
|
|
690
676
|
}));
|
|
691
677
|
return function (_x3) {
|
|
692
|
-
return
|
|
678
|
+
return _ref21.apply(this, arguments);
|
|
693
679
|
};
|
|
694
680
|
}();
|
|
695
681
|
|
|
@@ -703,35 +689,35 @@ exports.ExchangeRate = /*#__PURE__*/function () {
|
|
|
703
689
|
* @returns {Promise<string>} - The CSS of the tenant
|
|
704
690
|
*/
|
|
705
691
|
exports.TenantCSS = /*#__PURE__*/function () {
|
|
706
|
-
var
|
|
692
|
+
var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref22) {
|
|
707
693
|
var tenantSlug;
|
|
708
|
-
return _regeneratorRuntime.wrap(function (
|
|
709
|
-
while (1) switch (
|
|
694
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
695
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
710
696
|
case 0:
|
|
711
|
-
tenantSlug =
|
|
697
|
+
tenantSlug = _ref22.tenantSlug;
|
|
712
698
|
if (this.cachedCSS[tenantSlug]) {
|
|
713
|
-
|
|
699
|
+
_context11.next = 5;
|
|
714
700
|
break;
|
|
715
701
|
}
|
|
716
|
-
|
|
702
|
+
_context11.next = 4;
|
|
717
703
|
return this.client.ContentObjectMetadata({
|
|
718
704
|
libraryId: this.mainSiteLibraryId,
|
|
719
705
|
objectId: this.mainSiteId,
|
|
720
706
|
metadataSubtree: UrlJoin("/public", "asset_metadata", "tenants", tenantSlug, "info", "branding", "wallet_css"),
|
|
721
707
|
authorizationToken: this.publicStaticToken
|
|
722
708
|
});
|
|
723
|
-
case
|
|
724
|
-
this.cachedCSS[tenantSlug] =
|
|
725
|
-
case
|
|
726
|
-
return
|
|
727
|
-
case
|
|
709
|
+
case 4:
|
|
710
|
+
this.cachedCSS[tenantSlug] = _context11.sent;
|
|
711
|
+
case 5:
|
|
712
|
+
return _context11.abrupt("return", this.cachedCSS[tenantSlug] || "");
|
|
713
|
+
case 6:
|
|
728
714
|
case "end":
|
|
729
|
-
return
|
|
715
|
+
return _context11.stop();
|
|
730
716
|
}
|
|
731
|
-
},
|
|
717
|
+
}, _callee11, this);
|
|
732
718
|
}));
|
|
733
719
|
return function (_x4) {
|
|
734
|
-
return
|
|
720
|
+
return _ref23.apply(this, arguments);
|
|
735
721
|
};
|
|
736
722
|
}();
|
|
737
723
|
|
|
@@ -749,12 +735,12 @@ exports.TenantCSS = /*#__PURE__*/function () {
|
|
|
749
735
|
* @returns {Promise<Object>} - Stock info for items in the marketplace
|
|
750
736
|
*/
|
|
751
737
|
exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
752
|
-
var
|
|
738
|
+
var _ref25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref24) {
|
|
753
739
|
var marketplaceParams, tenantId, marketplaceInfo;
|
|
754
|
-
return _regeneratorRuntime.wrap(function (
|
|
755
|
-
while (1) switch (
|
|
740
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
741
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
756
742
|
case 0:
|
|
757
|
-
marketplaceParams =
|
|
743
|
+
marketplaceParams = _ref24.marketplaceParams, tenantId = _ref24.tenantId;
|
|
758
744
|
if (!tenantId) {
|
|
759
745
|
marketplaceInfo = this.MarketplaceInfo({
|
|
760
746
|
marketplaceParams: marketplaceParams
|
|
@@ -762,10 +748,10 @@ exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
|
762
748
|
tenantId = marketplaceInfo.tenantId;
|
|
763
749
|
}
|
|
764
750
|
if (!this.loggedIn) {
|
|
765
|
-
|
|
751
|
+
_context12.next = 6;
|
|
766
752
|
break;
|
|
767
753
|
}
|
|
768
|
-
|
|
754
|
+
_context12.next = 5;
|
|
769
755
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
770
756
|
path: UrlJoin("as", "wlt", "nft", "info", tenantId),
|
|
771
757
|
method: "GET",
|
|
@@ -773,24 +759,24 @@ exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
|
773
759
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
774
760
|
}
|
|
775
761
|
}));
|
|
776
|
-
case
|
|
777
|
-
return
|
|
778
|
-
case
|
|
779
|
-
|
|
762
|
+
case 5:
|
|
763
|
+
return _context12.abrupt("return", _context12.sent);
|
|
764
|
+
case 6:
|
|
765
|
+
_context12.next = 8;
|
|
780
766
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
781
767
|
path: UrlJoin("as", "nft", "stock", tenantId),
|
|
782
768
|
method: "GET"
|
|
783
769
|
}));
|
|
784
|
-
case
|
|
785
|
-
return
|
|
786
|
-
case
|
|
770
|
+
case 8:
|
|
771
|
+
return _context12.abrupt("return", _context12.sent);
|
|
772
|
+
case 9:
|
|
787
773
|
case "end":
|
|
788
|
-
return
|
|
774
|
+
return _context12.stop();
|
|
789
775
|
}
|
|
790
|
-
},
|
|
776
|
+
}, _callee12, this);
|
|
791
777
|
}));
|
|
792
778
|
return function (_x5) {
|
|
793
|
-
return
|
|
779
|
+
return _ref25.apply(this, arguments);
|
|
794
780
|
};
|
|
795
781
|
}();
|
|
796
782
|
|
|
@@ -807,13 +793,13 @@ exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
|
807
793
|
*
|
|
808
794
|
* @returns {Promise<Object>} - Info about the marketplace
|
|
809
795
|
*/
|
|
810
|
-
exports.MarketplaceInfo = function (
|
|
811
|
-
var marketplaceParams =
|
|
812
|
-
var
|
|
813
|
-
tenantSlug =
|
|
814
|
-
marketplaceSlug =
|
|
815
|
-
marketplaceId =
|
|
816
|
-
marketplaceHash =
|
|
796
|
+
exports.MarketplaceInfo = function (_ref26) {
|
|
797
|
+
var marketplaceParams = _ref26.marketplaceParams;
|
|
798
|
+
var _ref27 = marketplaceParams || {},
|
|
799
|
+
tenantSlug = _ref27.tenantSlug,
|
|
800
|
+
marketplaceSlug = _ref27.marketplaceSlug,
|
|
801
|
+
marketplaceId = _ref27.marketplaceId,
|
|
802
|
+
marketplaceHash = _ref27.marketplaceHash;
|
|
817
803
|
var marketplaceInfo;
|
|
818
804
|
if (tenantSlug && marketplaceSlug) {
|
|
819
805
|
marketplaceInfo = (this.availableMarketplaces[tenantSlug] || {})[marketplaceSlug];
|
|
@@ -837,39 +823,39 @@ exports.MarketplaceInfo = function (_ref24) {
|
|
|
837
823
|
* @returns {Promise<string>} - The CSS of the marketplace
|
|
838
824
|
*/
|
|
839
825
|
exports.MarketplaceCSS = /*#__PURE__*/function () {
|
|
840
|
-
var
|
|
826
|
+
var _ref29 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref28) {
|
|
841
827
|
var marketplaceParams, marketplaceInfo, marketplaceHash;
|
|
842
|
-
return _regeneratorRuntime.wrap(function (
|
|
843
|
-
while (1) switch (
|
|
828
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
829
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
844
830
|
case 0:
|
|
845
|
-
marketplaceParams =
|
|
831
|
+
marketplaceParams = _ref28.marketplaceParams;
|
|
846
832
|
marketplaceInfo = this.MarketplaceInfo({
|
|
847
833
|
marketplaceParams: marketplaceParams
|
|
848
834
|
});
|
|
849
835
|
marketplaceHash = marketplaceInfo.marketplaceHash;
|
|
850
836
|
if (this.cachedCSS[marketplaceHash]) {
|
|
851
|
-
|
|
837
|
+
_context13.next = 7;
|
|
852
838
|
break;
|
|
853
839
|
}
|
|
854
|
-
|
|
840
|
+
_context13.next = 6;
|
|
855
841
|
return this.client.ContentObjectMetadata({
|
|
856
842
|
versionHash: marketplaceHash,
|
|
857
843
|
metadataSubtree: "public/asset_metadata/info/branding/custom_css",
|
|
858
844
|
authorizationToken: this.publicStaticToken,
|
|
859
845
|
noAuth: true
|
|
860
846
|
});
|
|
861
|
-
case
|
|
862
|
-
this.cachedCSS[marketplaceHash] =
|
|
863
|
-
case
|
|
864
|
-
return
|
|
865
|
-
case
|
|
847
|
+
case 6:
|
|
848
|
+
this.cachedCSS[marketplaceHash] = _context13.sent;
|
|
849
|
+
case 7:
|
|
850
|
+
return _context13.abrupt("return", this.cachedCSS[marketplaceHash] || "");
|
|
851
|
+
case 8:
|
|
866
852
|
case "end":
|
|
867
|
-
return
|
|
853
|
+
return _context13.stop();
|
|
868
854
|
}
|
|
869
|
-
},
|
|
855
|
+
}, _callee13, this);
|
|
870
856
|
}));
|
|
871
857
|
return function (_x6) {
|
|
872
|
-
return
|
|
858
|
+
return _ref29.apply(this, arguments);
|
|
873
859
|
};
|
|
874
860
|
}();
|
|
875
861
|
|
|
@@ -883,29 +869,29 @@ exports.MarketplaceCSS = /*#__PURE__*/function () {
|
|
|
883
869
|
*
|
|
884
870
|
* @returns {Promise<Object>} - Info about available marketplaces
|
|
885
871
|
*/
|
|
886
|
-
exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
887
|
-
var
|
|
872
|
+
exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
|
873
|
+
var _ref31,
|
|
888
874
|
organizeById,
|
|
889
|
-
|
|
875
|
+
_ref31$forceReload,
|
|
890
876
|
forceReload,
|
|
891
|
-
|
|
892
|
-
return _regeneratorRuntime.wrap(function (
|
|
893
|
-
while (1) switch (
|
|
877
|
+
_args14 = arguments;
|
|
878
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
879
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
894
880
|
case 0:
|
|
895
|
-
|
|
881
|
+
_ref31 = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {}, organizeById = _ref31.organizeById, _ref31$forceReload = _ref31.forceReload, forceReload = _ref31$forceReload === void 0 ? false : _ref31$forceReload;
|
|
896
882
|
if (!forceReload) {
|
|
897
|
-
|
|
883
|
+
_context14.next = 4;
|
|
898
884
|
break;
|
|
899
885
|
}
|
|
900
|
-
|
|
886
|
+
_context14.next = 4;
|
|
901
887
|
return this.LoadAvailableMarketplaces(true);
|
|
902
|
-
case
|
|
903
|
-
return
|
|
904
|
-
case
|
|
888
|
+
case 4:
|
|
889
|
+
return _context14.abrupt("return", _objectSpread({}, organizeById ? this.availableMarketplacesById : this.availableMarketplaces));
|
|
890
|
+
case 5:
|
|
905
891
|
case "end":
|
|
906
|
-
return
|
|
892
|
+
return _context14.stop();
|
|
907
893
|
}
|
|
908
|
-
},
|
|
894
|
+
}, _callee14, this);
|
|
909
895
|
}));
|
|
910
896
|
|
|
911
897
|
/**
|
|
@@ -920,21 +906,21 @@ exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_reg
|
|
|
920
906
|
* @returns {Promise<Object>} - The full information for the marketplace
|
|
921
907
|
*/
|
|
922
908
|
exports.Marketplace = /*#__PURE__*/function () {
|
|
923
|
-
var
|
|
909
|
+
var _ref33 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref32) {
|
|
924
910
|
var marketplaceParams;
|
|
925
|
-
return _regeneratorRuntime.wrap(function (
|
|
926
|
-
while (1) switch (
|
|
911
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
912
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
927
913
|
case 0:
|
|
928
|
-
marketplaceParams =
|
|
929
|
-
return
|
|
930
|
-
case
|
|
914
|
+
marketplaceParams = _ref32.marketplaceParams;
|
|
915
|
+
return _context15.abrupt("return", this.LoadMarketplace(marketplaceParams));
|
|
916
|
+
case 2:
|
|
931
917
|
case "end":
|
|
932
|
-
return
|
|
918
|
+
return _context15.stop();
|
|
933
919
|
}
|
|
934
|
-
},
|
|
920
|
+
}, _callee15, this);
|
|
935
921
|
}));
|
|
936
922
|
return function (_x7) {
|
|
937
|
-
return
|
|
923
|
+
return _ref33.apply(this, arguments);
|
|
938
924
|
};
|
|
939
925
|
}();
|
|
940
926
|
|
|
@@ -950,27 +936,27 @@ exports.Marketplace = /*#__PURE__*/function () {
|
|
|
950
936
|
* @returns {Promise<Object>} - Information about the specified contract
|
|
951
937
|
*/
|
|
952
938
|
exports.NFTContractStats = /*#__PURE__*/function () {
|
|
953
|
-
var
|
|
939
|
+
var _ref35 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(_ref34) {
|
|
954
940
|
var contractAddress;
|
|
955
|
-
return _regeneratorRuntime.wrap(function (
|
|
956
|
-
while (1) switch (
|
|
941
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
942
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
957
943
|
case 0:
|
|
958
|
-
contractAddress =
|
|
959
|
-
|
|
944
|
+
contractAddress = _ref34.contractAddress;
|
|
945
|
+
_context16.next = 3;
|
|
960
946
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
961
947
|
path: UrlJoin("as", "nft", "info", contractAddress),
|
|
962
948
|
method: "GET"
|
|
963
949
|
}));
|
|
964
|
-
case
|
|
965
|
-
return
|
|
966
|
-
case
|
|
950
|
+
case 3:
|
|
951
|
+
return _context16.abrupt("return", _context16.sent);
|
|
952
|
+
case 4:
|
|
967
953
|
case "end":
|
|
968
|
-
return
|
|
954
|
+
return _context16.stop();
|
|
969
955
|
}
|
|
970
|
-
},
|
|
956
|
+
}, _callee16, this);
|
|
971
957
|
}));
|
|
972
958
|
return function (_x8) {
|
|
973
|
-
return
|
|
959
|
+
return _ref35.apply(this, arguments);
|
|
974
960
|
};
|
|
975
961
|
}();
|
|
976
962
|
|
|
@@ -983,77 +969,77 @@ exports.NFTContractStats = /*#__PURE__*/function () {
|
|
|
983
969
|
* @param {string} tokenId - The token ID of the NFT
|
|
984
970
|
*/
|
|
985
971
|
exports.NFT = /*#__PURE__*/function () {
|
|
986
|
-
var
|
|
987
|
-
var tokenId, contractAddress, nft, assetMetadata, localizedMetadata
|
|
988
|
-
return _regeneratorRuntime.wrap(function (
|
|
989
|
-
while (1) switch (
|
|
972
|
+
var _ref37 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref36) {
|
|
973
|
+
var tokenId, contractAddress, nft, assetMetadata, localizedMetadata;
|
|
974
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
975
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
990
976
|
case 0:
|
|
991
|
-
tokenId =
|
|
992
|
-
|
|
993
|
-
|
|
977
|
+
tokenId = _ref36.tokenId, contractAddress = _ref36.contractAddress;
|
|
978
|
+
_context17.t0 = FormatNFTDetails;
|
|
979
|
+
_context17.next = 4;
|
|
994
980
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
995
981
|
path: UrlJoin("as", "nft", "info", contractAddress, tokenId),
|
|
996
982
|
method: "GET"
|
|
997
983
|
}));
|
|
998
|
-
case
|
|
999
|
-
|
|
1000
|
-
nft =
|
|
1001
|
-
|
|
984
|
+
case 4:
|
|
985
|
+
_context17.t1 = _context17.sent;
|
|
986
|
+
nft = (0, _context17.t0)(_context17.t1);
|
|
987
|
+
_context17.next = 8;
|
|
1002
988
|
return this.client.ContentObjectMetadata({
|
|
1003
989
|
versionHash: nft.details.VersionHash,
|
|
1004
990
|
metadataSubtree: "public/asset_metadata/nft",
|
|
1005
991
|
produceLinkUrls: true
|
|
1006
992
|
});
|
|
1007
|
-
case
|
|
1008
|
-
|
|
1009
|
-
if (
|
|
1010
|
-
|
|
993
|
+
case 8:
|
|
994
|
+
_context17.t2 = _context17.sent;
|
|
995
|
+
if (_context17.t2) {
|
|
996
|
+
_context17.next = 11;
|
|
1011
997
|
break;
|
|
1012
998
|
}
|
|
1013
|
-
|
|
1014
|
-
case
|
|
1015
|
-
assetMetadata =
|
|
999
|
+
_context17.t2 = {};
|
|
1000
|
+
case 11:
|
|
1001
|
+
assetMetadata = _context17.t2;
|
|
1016
1002
|
nft.metadata = MergeWith({}, assetMetadata, nft.metadata, function (a, b) {
|
|
1017
1003
|
return b === null || b === "" ? a : undefined;
|
|
1018
1004
|
});
|
|
1019
1005
|
if (!this.localization) {
|
|
1020
|
-
|
|
1006
|
+
_context17.next = 21;
|
|
1021
1007
|
break;
|
|
1022
1008
|
}
|
|
1023
|
-
|
|
1009
|
+
_context17.next = 16;
|
|
1024
1010
|
return this.client.ContentObjectMetadata({
|
|
1025
1011
|
versionHash: nft.details.VersionHash,
|
|
1026
1012
|
metadataSubtree: UrlJoin("public", "asset_metadata", "localizations", this.localization, "nft"),
|
|
1027
1013
|
produceLinkUrls: true
|
|
1028
1014
|
});
|
|
1029
|
-
case
|
|
1030
|
-
|
|
1031
|
-
if (
|
|
1032
|
-
|
|
1015
|
+
case 16:
|
|
1016
|
+
_context17.t3 = _context17.sent;
|
|
1017
|
+
if (_context17.t3) {
|
|
1018
|
+
_context17.next = 19;
|
|
1033
1019
|
break;
|
|
1034
1020
|
}
|
|
1035
|
-
|
|
1036
|
-
case
|
|
1037
|
-
localizedMetadata =
|
|
1021
|
+
_context17.t3 = {};
|
|
1022
|
+
case 19:
|
|
1023
|
+
localizedMetadata = _context17.t3;
|
|
1038
1024
|
nft.metadata = MergeWith({}, nft.metadata, localizedMetadata, function (a, b) {
|
|
1039
1025
|
return b === null || b === "" ? a : undefined;
|
|
1040
1026
|
});
|
|
1041
|
-
case
|
|
1042
|
-
|
|
1027
|
+
case 21:
|
|
1028
|
+
_context17.next = 23;
|
|
1043
1029
|
return this.TenantConfiguration({
|
|
1044
1030
|
contractAddress: contractAddress
|
|
1045
1031
|
});
|
|
1046
|
-
case
|
|
1047
|
-
nft.config =
|
|
1048
|
-
return
|
|
1049
|
-
case
|
|
1032
|
+
case 23:
|
|
1033
|
+
nft.config = _context17.sent;
|
|
1034
|
+
return _context17.abrupt("return", FormatNFTMetadata(this, nft));
|
|
1035
|
+
case 25:
|
|
1050
1036
|
case "end":
|
|
1051
|
-
return
|
|
1037
|
+
return _context17.stop();
|
|
1052
1038
|
}
|
|
1053
|
-
},
|
|
1039
|
+
}, _callee17, this);
|
|
1054
1040
|
}));
|
|
1055
1041
|
return function (_x9) {
|
|
1056
|
-
return
|
|
1042
|
+
return _ref37.apply(this, arguments);
|
|
1057
1043
|
};
|
|
1058
1044
|
}();
|
|
1059
1045
|
|
|
@@ -1069,19 +1055,19 @@ exports.NFT = /*#__PURE__*/function () {
|
|
|
1069
1055
|
* @param {string} targetAddress - The address to which to transfer the NFT
|
|
1070
1056
|
*/
|
|
1071
1057
|
exports.TransferNFT = /*#__PURE__*/function () {
|
|
1072
|
-
var
|
|
1058
|
+
var _ref39 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(_ref38) {
|
|
1073
1059
|
var contractAddress, tokenId, targetAddress;
|
|
1074
|
-
return _regeneratorRuntime.wrap(function (
|
|
1075
|
-
while (1) switch (
|
|
1060
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
1061
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1076
1062
|
case 0:
|
|
1077
|
-
contractAddress =
|
|
1063
|
+
contractAddress = _ref38.contractAddress, tokenId = _ref38.tokenId, targetAddress = _ref38.targetAddress;
|
|
1078
1064
|
if (!(!targetAddress || !Utils.ValidAddress(targetAddress))) {
|
|
1079
|
-
|
|
1065
|
+
_context18.next = 3;
|
|
1080
1066
|
break;
|
|
1081
1067
|
}
|
|
1082
1068
|
throw Error("Eluvio Wallet Client: Invalid or missing target address in UserTransferNFT");
|
|
1083
|
-
case
|
|
1084
|
-
|
|
1069
|
+
case 3:
|
|
1070
|
+
_context18.next = 5;
|
|
1085
1071
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1086
1072
|
path: UrlJoin("as", "wlt", "mkt", "xfer"),
|
|
1087
1073
|
method: "POST",
|
|
@@ -1094,16 +1080,16 @@ exports.TransferNFT = /*#__PURE__*/function () {
|
|
|
1094
1080
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1095
1081
|
}
|
|
1096
1082
|
});
|
|
1097
|
-
case
|
|
1098
|
-
return
|
|
1099
|
-
case
|
|
1083
|
+
case 5:
|
|
1084
|
+
return _context18.abrupt("return", _context18.sent);
|
|
1085
|
+
case 6:
|
|
1100
1086
|
case "end":
|
|
1101
|
-
return
|
|
1087
|
+
return _context18.stop();
|
|
1102
1088
|
}
|
|
1103
|
-
},
|
|
1089
|
+
}, _callee18, this);
|
|
1104
1090
|
}));
|
|
1105
|
-
return function (
|
|
1106
|
-
return
|
|
1091
|
+
return function (_x10) {
|
|
1092
|
+
return _ref39.apply(this, arguments);
|
|
1107
1093
|
};
|
|
1108
1094
|
}();
|
|
1109
1095
|
|
|
@@ -1119,43 +1105,43 @@ exports.TransferNFT = /*#__PURE__*/function () {
|
|
|
1119
1105
|
* @returns {Promise<Object>} - The status of the listing
|
|
1120
1106
|
*/
|
|
1121
1107
|
exports.ListingStatus = /*#__PURE__*/function () {
|
|
1122
|
-
var
|
|
1123
|
-
var listingId
|
|
1124
|
-
return _regeneratorRuntime.wrap(function (
|
|
1125
|
-
while (1) switch (
|
|
1108
|
+
var _ref41 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref40) {
|
|
1109
|
+
var listingId;
|
|
1110
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
1111
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1126
1112
|
case 0:
|
|
1127
|
-
listingId =
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1113
|
+
listingId = _ref40.listingId;
|
|
1114
|
+
_context19.prev = 1;
|
|
1115
|
+
_context19.t0 = Utils;
|
|
1116
|
+
_context19.next = 5;
|
|
1131
1117
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1132
1118
|
path: UrlJoin("as", "mkt", "status", listingId),
|
|
1133
1119
|
method: "GET"
|
|
1134
1120
|
});
|
|
1135
|
-
case
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
return
|
|
1139
|
-
case
|
|
1140
|
-
return
|
|
1141
|
-
case
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
if (!(
|
|
1145
|
-
|
|
1121
|
+
case 5:
|
|
1122
|
+
_context19.t1 = _context19.sent;
|
|
1123
|
+
_context19.next = 8;
|
|
1124
|
+
return _context19.t0.ResponseToJson.call(_context19.t0, _context19.t1);
|
|
1125
|
+
case 8:
|
|
1126
|
+
return _context19.abrupt("return", _context19.sent);
|
|
1127
|
+
case 11:
|
|
1128
|
+
_context19.prev = 11;
|
|
1129
|
+
_context19.t2 = _context19["catch"](1);
|
|
1130
|
+
if (!(_context19.t2.status === 404)) {
|
|
1131
|
+
_context19.next = 15;
|
|
1146
1132
|
break;
|
|
1147
1133
|
}
|
|
1148
|
-
return
|
|
1149
|
-
case
|
|
1150
|
-
throw
|
|
1151
|
-
case
|
|
1134
|
+
return _context19.abrupt("return");
|
|
1135
|
+
case 15:
|
|
1136
|
+
throw _context19.t2;
|
|
1137
|
+
case 16:
|
|
1152
1138
|
case "end":
|
|
1153
|
-
return
|
|
1139
|
+
return _context19.stop();
|
|
1154
1140
|
}
|
|
1155
|
-
},
|
|
1141
|
+
}, _callee19, this, [[1, 11]]);
|
|
1156
1142
|
}));
|
|
1157
|
-
return function (
|
|
1158
|
-
return
|
|
1143
|
+
return function (_x11) {
|
|
1144
|
+
return _ref41.apply(this, arguments);
|
|
1159
1145
|
};
|
|
1160
1146
|
}();
|
|
1161
1147
|
|
|
@@ -1171,35 +1157,35 @@ exports.ListingStatus = /*#__PURE__*/function () {
|
|
|
1171
1157
|
* @returns {Promise<Object>} - The listing
|
|
1172
1158
|
*/
|
|
1173
1159
|
exports.Listing = /*#__PURE__*/function () {
|
|
1174
|
-
var
|
|
1175
|
-
var listingId
|
|
1176
|
-
return _regeneratorRuntime.wrap(function (
|
|
1177
|
-
while (1) switch (
|
|
1160
|
+
var _ref43 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(_ref42) {
|
|
1161
|
+
var listingId;
|
|
1162
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
1163
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1178
1164
|
case 0:
|
|
1179
|
-
listingId =
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1165
|
+
listingId = _ref42.listingId;
|
|
1166
|
+
_context20.t0 = FormatNFT;
|
|
1167
|
+
_context20.t1 = this;
|
|
1168
|
+
_context20.t2 = Utils;
|
|
1169
|
+
_context20.next = 6;
|
|
1184
1170
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1185
1171
|
path: UrlJoin("as", "mkt", "l", listingId),
|
|
1186
1172
|
method: "GET"
|
|
1187
1173
|
});
|
|
1188
|
-
case
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
return
|
|
1192
|
-
case
|
|
1193
|
-
|
|
1194
|
-
return
|
|
1195
|
-
case
|
|
1174
|
+
case 6:
|
|
1175
|
+
_context20.t3 = _context20.sent;
|
|
1176
|
+
_context20.next = 9;
|
|
1177
|
+
return _context20.t2.ResponseToJson.call(_context20.t2, _context20.t3);
|
|
1178
|
+
case 9:
|
|
1179
|
+
_context20.t4 = _context20.sent;
|
|
1180
|
+
return _context20.abrupt("return", (0, _context20.t0)(_context20.t1, _context20.t4));
|
|
1181
|
+
case 11:
|
|
1196
1182
|
case "end":
|
|
1197
|
-
return
|
|
1183
|
+
return _context20.stop();
|
|
1198
1184
|
}
|
|
1199
|
-
},
|
|
1185
|
+
}, _callee20, this);
|
|
1200
1186
|
}));
|
|
1201
|
-
return function (
|
|
1202
|
-
return
|
|
1187
|
+
return function (_x12) {
|
|
1188
|
+
return _ref43.apply(this, arguments);
|
|
1203
1189
|
};
|
|
1204
1190
|
}();
|
|
1205
1191
|
|
|
@@ -1238,19 +1224,19 @@ exports.Listing = /*#__PURE__*/function () {
|
|
|
1238
1224
|
*
|
|
1239
1225
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
1240
1226
|
*/
|
|
1241
|
-
exports.Listings = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1242
|
-
var
|
|
1243
|
-
return _regeneratorRuntime.wrap(function (
|
|
1244
|
-
while (1) switch (
|
|
1227
|
+
exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
|
|
1228
|
+
var _args21 = arguments;
|
|
1229
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
1230
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1245
1231
|
case 0:
|
|
1246
|
-
return
|
|
1232
|
+
return _context21.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1247
1233
|
mode: "listings"
|
|
1248
|
-
},
|
|
1234
|
+
}, _args21[0] || {})));
|
|
1249
1235
|
case 1:
|
|
1250
1236
|
case "end":
|
|
1251
|
-
return
|
|
1237
|
+
return _context21.stop();
|
|
1252
1238
|
}
|
|
1253
|
-
},
|
|
1239
|
+
}, _callee21, this);
|
|
1254
1240
|
}));
|
|
1255
1241
|
|
|
1256
1242
|
/**
|
|
@@ -1287,19 +1273,19 @@ exports.Listings = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRunti
|
|
|
1287
1273
|
*
|
|
1288
1274
|
* @returns {Promise<Object>} - Statistics about listings. All prices in USD.
|
|
1289
1275
|
*/
|
|
1290
|
-
exports.ListingStats = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1291
|
-
var
|
|
1292
|
-
return _regeneratorRuntime.wrap(function (
|
|
1293
|
-
while (1) switch (
|
|
1276
|
+
exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
|
|
1277
|
+
var _args22 = arguments;
|
|
1278
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
1279
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1294
1280
|
case 0:
|
|
1295
|
-
return
|
|
1281
|
+
return _context22.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1296
1282
|
mode: "listing-stats"
|
|
1297
|
-
},
|
|
1283
|
+
}, _args22[0] || {})));
|
|
1298
1284
|
case 1:
|
|
1299
1285
|
case "end":
|
|
1300
|
-
return
|
|
1286
|
+
return _context22.stop();
|
|
1301
1287
|
}
|
|
1302
|
-
},
|
|
1288
|
+
}, _callee22, this);
|
|
1303
1289
|
}));
|
|
1304
1290
|
|
|
1305
1291
|
/**
|
|
@@ -1335,19 +1321,19 @@ exports.ListingStats = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorR
|
|
|
1335
1321
|
*
|
|
1336
1322
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
1337
1323
|
*/
|
|
1338
|
-
exports.Sales = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1339
|
-
var
|
|
1340
|
-
return _regeneratorRuntime.wrap(function (
|
|
1341
|
-
while (1) switch (
|
|
1324
|
+
exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
|
|
1325
|
+
var _args23 = arguments;
|
|
1326
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
1327
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1342
1328
|
case 0:
|
|
1343
|
-
return
|
|
1329
|
+
return _context23.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1344
1330
|
mode: "sales"
|
|
1345
|
-
},
|
|
1331
|
+
}, _args23[0] || {})));
|
|
1346
1332
|
case 1:
|
|
1347
1333
|
case "end":
|
|
1348
|
-
return
|
|
1334
|
+
return _context23.stop();
|
|
1349
1335
|
}
|
|
1350
|
-
},
|
|
1336
|
+
}, _callee23, this);
|
|
1351
1337
|
}));
|
|
1352
1338
|
|
|
1353
1339
|
/**
|
|
@@ -1383,19 +1369,19 @@ exports.Sales = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.
|
|
|
1383
1369
|
*
|
|
1384
1370
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
1385
1371
|
*/
|
|
1386
|
-
exports.Transfers = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1387
|
-
var
|
|
1388
|
-
return _regeneratorRuntime.wrap(function (
|
|
1389
|
-
while (1) switch (
|
|
1372
|
+
exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
|
|
1373
|
+
var _args24 = arguments;
|
|
1374
|
+
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
1375
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1390
1376
|
case 0:
|
|
1391
|
-
return
|
|
1377
|
+
return _context24.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1392
1378
|
mode: "transfers"
|
|
1393
|
-
},
|
|
1379
|
+
}, _args24[0] || {})));
|
|
1394
1380
|
case 1:
|
|
1395
1381
|
case "end":
|
|
1396
|
-
return
|
|
1382
|
+
return _context24.stop();
|
|
1397
1383
|
}
|
|
1398
|
-
},
|
|
1384
|
+
}, _callee24, this);
|
|
1399
1385
|
}));
|
|
1400
1386
|
|
|
1401
1387
|
/**
|
|
@@ -1431,19 +1417,19 @@ exports.Transfers = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRunt
|
|
|
1431
1417
|
*
|
|
1432
1418
|
* @returns {Promise<Object>} - Statistics about sales. All prices in USD.
|
|
1433
1419
|
*/
|
|
1434
|
-
exports.SalesStats = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1435
|
-
var
|
|
1436
|
-
return _regeneratorRuntime.wrap(function (
|
|
1437
|
-
while (1) switch (
|
|
1420
|
+
exports.SalesStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
|
|
1421
|
+
var _args25 = arguments;
|
|
1422
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
1423
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1438
1424
|
case 0:
|
|
1439
|
-
return
|
|
1425
|
+
return _context25.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1440
1426
|
mode: "sales-stats"
|
|
1441
|
-
},
|
|
1427
|
+
}, _args25[0] || {})));
|
|
1442
1428
|
case 1:
|
|
1443
1429
|
case "end":
|
|
1444
|
-
return
|
|
1430
|
+
return _context25.stop();
|
|
1445
1431
|
}
|
|
1446
|
-
},
|
|
1432
|
+
}, _callee25, this);
|
|
1447
1433
|
}));
|
|
1448
1434
|
|
|
1449
1435
|
/**
|
|
@@ -1459,74 +1445,68 @@ exports.SalesStats = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRun
|
|
|
1459
1445
|
* @returns {Promise<Array|Object>} - Returns a list of leaderboard rankings or, if userAddress is specified, ranking for that user.
|
|
1460
1446
|
*/
|
|
1461
1447
|
exports.Leaderboard = /*#__PURE__*/function () {
|
|
1462
|
-
var
|
|
1448
|
+
var _ref50 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(_ref49) {
|
|
1463
1449
|
var userAddress,
|
|
1464
1450
|
marketplaceParams,
|
|
1465
1451
|
params,
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
_t30,
|
|
1470
|
-
_t31,
|
|
1471
|
-
_t32,
|
|
1472
|
-
_t33;
|
|
1473
|
-
return _regeneratorRuntime.wrap(function (_context24) {
|
|
1474
|
-
while (1) switch (_context24.prev = _context24.next) {
|
|
1452
|
+
_args26 = arguments;
|
|
1453
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
1454
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1475
1455
|
case 0:
|
|
1476
|
-
userAddress =
|
|
1456
|
+
userAddress = _ref49.userAddress, marketplaceParams = _ref49.marketplaceParams;
|
|
1477
1457
|
if (!userAddress) {
|
|
1478
|
-
|
|
1458
|
+
_context26.next = 20;
|
|
1479
1459
|
break;
|
|
1480
1460
|
}
|
|
1481
1461
|
params = {
|
|
1482
1462
|
addr: Utils.FormatAddress(userAddress)
|
|
1483
1463
|
};
|
|
1484
1464
|
if (!marketplaceParams) {
|
|
1485
|
-
|
|
1465
|
+
_context26.next = 10;
|
|
1486
1466
|
break;
|
|
1487
1467
|
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1468
|
+
_context26.t0 = "tenant:eq:";
|
|
1469
|
+
_context26.next = 7;
|
|
1490
1470
|
return this.MarketplaceInfo({
|
|
1491
1471
|
marketplaceParams: marketplaceParams
|
|
1492
1472
|
});
|
|
1493
|
-
case
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
params.filter = [
|
|
1497
|
-
case
|
|
1498
|
-
|
|
1499
|
-
|
|
1473
|
+
case 7:
|
|
1474
|
+
_context26.t1 = _context26.sent.tenantId;
|
|
1475
|
+
_context26.t2 = _context26.t0.concat.call(_context26.t0, _context26.t1);
|
|
1476
|
+
params.filter = [_context26.t2];
|
|
1477
|
+
case 10:
|
|
1478
|
+
_context26.t4 = Utils;
|
|
1479
|
+
_context26.next = 13;
|
|
1500
1480
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1501
1481
|
path: UrlJoin("as", "wlt", "ranks"),
|
|
1502
1482
|
method: "GET",
|
|
1503
1483
|
queryParams: params
|
|
1504
1484
|
});
|
|
1505
|
-
case
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
return
|
|
1509
|
-
case
|
|
1510
|
-
|
|
1511
|
-
if (
|
|
1512
|
-
|
|
1485
|
+
case 13:
|
|
1486
|
+
_context26.t5 = _context26.sent;
|
|
1487
|
+
_context26.next = 16;
|
|
1488
|
+
return _context26.t4.ResponseToJson.call(_context26.t4, _context26.t5);
|
|
1489
|
+
case 16:
|
|
1490
|
+
_context26.t3 = _context26.sent;
|
|
1491
|
+
if (_context26.t3) {
|
|
1492
|
+
_context26.next = 19;
|
|
1513
1493
|
break;
|
|
1514
1494
|
}
|
|
1515
|
-
|
|
1516
|
-
case
|
|
1517
|
-
return
|
|
1518
|
-
case
|
|
1519
|
-
return
|
|
1495
|
+
_context26.t3 = [];
|
|
1496
|
+
case 19:
|
|
1497
|
+
return _context26.abrupt("return", _context26.t3[0]);
|
|
1498
|
+
case 20:
|
|
1499
|
+
return _context26.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1520
1500
|
mode: "leaderboard"
|
|
1521
|
-
},
|
|
1522
|
-
case
|
|
1501
|
+
}, _args26[0] || {})));
|
|
1502
|
+
case 21:
|
|
1523
1503
|
case "end":
|
|
1524
|
-
return
|
|
1504
|
+
return _context26.stop();
|
|
1525
1505
|
}
|
|
1526
|
-
},
|
|
1506
|
+
}, _callee26, this);
|
|
1527
1507
|
}));
|
|
1528
|
-
return function (
|
|
1529
|
-
return
|
|
1508
|
+
return function (_x13) {
|
|
1509
|
+
return _ref50.apply(this, arguments);
|
|
1530
1510
|
};
|
|
1531
1511
|
}();
|
|
1532
1512
|
|
|
@@ -1545,19 +1525,19 @@ exports.Leaderboard = /*#__PURE__*/function () {
|
|
|
1545
1525
|
* @returns {Promise<string>} - The listing ID of the created listing
|
|
1546
1526
|
*/
|
|
1547
1527
|
exports.CreateListing = /*#__PURE__*/function () {
|
|
1548
|
-
var
|
|
1549
|
-
var contractAddress, tokenId, price, listingId
|
|
1550
|
-
return _regeneratorRuntime.wrap(function (
|
|
1551
|
-
while (1) switch (
|
|
1528
|
+
var _ref52 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(_ref51) {
|
|
1529
|
+
var contractAddress, tokenId, price, listingId;
|
|
1530
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
1531
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1552
1532
|
case 0:
|
|
1553
|
-
contractAddress =
|
|
1533
|
+
contractAddress = _ref51.contractAddress, tokenId = _ref51.tokenId, price = _ref51.price, listingId = _ref51.listingId;
|
|
1554
1534
|
contractAddress = Utils.FormatAddress(contractAddress);
|
|
1555
1535
|
if (!listingId) {
|
|
1556
|
-
|
|
1536
|
+
_context27.next = 12;
|
|
1557
1537
|
break;
|
|
1558
1538
|
}
|
|
1559
|
-
|
|
1560
|
-
|
|
1539
|
+
_context27.t0 = Utils;
|
|
1540
|
+
_context27.next = 6;
|
|
1561
1541
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1562
1542
|
path: UrlJoin("as", "wlt", "mkt"),
|
|
1563
1543
|
method: "PUT",
|
|
@@ -1569,15 +1549,15 @@ exports.CreateListing = /*#__PURE__*/function () {
|
|
|
1569
1549
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1570
1550
|
}
|
|
1571
1551
|
});
|
|
1572
|
-
case
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
return
|
|
1576
|
-
case
|
|
1577
|
-
return
|
|
1578
|
-
case
|
|
1579
|
-
|
|
1580
|
-
|
|
1552
|
+
case 6:
|
|
1553
|
+
_context27.t1 = _context27.sent;
|
|
1554
|
+
_context27.next = 9;
|
|
1555
|
+
return _context27.t0.ResponseToFormat.call(_context27.t0, "text", _context27.t1);
|
|
1556
|
+
case 9:
|
|
1557
|
+
return _context27.abrupt("return", _context27.sent);
|
|
1558
|
+
case 12:
|
|
1559
|
+
_context27.t2 = Utils;
|
|
1560
|
+
_context27.next = 15;
|
|
1581
1561
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1582
1562
|
path: UrlJoin("as", "wlt", "mkt"),
|
|
1583
1563
|
method: "POST",
|
|
@@ -1590,20 +1570,20 @@ exports.CreateListing = /*#__PURE__*/function () {
|
|
|
1590
1570
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1591
1571
|
}
|
|
1592
1572
|
});
|
|
1593
|
-
case
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
return
|
|
1597
|
-
case
|
|
1598
|
-
return
|
|
1599
|
-
case
|
|
1573
|
+
case 15:
|
|
1574
|
+
_context27.t3 = _context27.sent;
|
|
1575
|
+
_context27.next = 18;
|
|
1576
|
+
return _context27.t2.ResponseToJson.call(_context27.t2, _context27.t3);
|
|
1577
|
+
case 18:
|
|
1578
|
+
return _context27.abrupt("return", _context27.sent);
|
|
1579
|
+
case 19:
|
|
1600
1580
|
case "end":
|
|
1601
|
-
return
|
|
1581
|
+
return _context27.stop();
|
|
1602
1582
|
}
|
|
1603
|
-
},
|
|
1583
|
+
}, _callee27, this);
|
|
1604
1584
|
}));
|
|
1605
|
-
return function (
|
|
1606
|
-
return
|
|
1585
|
+
return function (_x14) {
|
|
1586
|
+
return _ref52.apply(this, arguments);
|
|
1607
1587
|
};
|
|
1608
1588
|
}();
|
|
1609
1589
|
|
|
@@ -1617,13 +1597,13 @@ exports.CreateListing = /*#__PURE__*/function () {
|
|
|
1617
1597
|
* @param {string} listingId - The ID of the listing to remove
|
|
1618
1598
|
*/
|
|
1619
1599
|
exports.RemoveListing = /*#__PURE__*/function () {
|
|
1620
|
-
var
|
|
1600
|
+
var _ref54 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(_ref53) {
|
|
1621
1601
|
var listingId;
|
|
1622
|
-
return _regeneratorRuntime.wrap(function (
|
|
1623
|
-
while (1) switch (
|
|
1602
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
1603
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1624
1604
|
case 0:
|
|
1625
|
-
listingId =
|
|
1626
|
-
|
|
1605
|
+
listingId = _ref53.listingId;
|
|
1606
|
+
_context28.next = 3;
|
|
1627
1607
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1628
1608
|
path: UrlJoin("as", "wlt", "mkt", listingId),
|
|
1629
1609
|
method: "DELETE",
|
|
@@ -1631,15 +1611,15 @@ exports.RemoveListing = /*#__PURE__*/function () {
|
|
|
1631
1611
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1632
1612
|
}
|
|
1633
1613
|
});
|
|
1634
|
-
case
|
|
1614
|
+
case 3:
|
|
1635
1615
|
case "end":
|
|
1636
|
-
return
|
|
1616
|
+
return _context28.stop();
|
|
1637
1617
|
}
|
|
1638
|
-
},
|
|
1618
|
+
}, _callee28, this);
|
|
1639
1619
|
}));
|
|
1640
|
-
return function (
|
|
1641
|
-
return
|
|
1642
|
-
};
|
|
1620
|
+
return function (_x15) {
|
|
1621
|
+
return _ref54.apply(this, arguments);
|
|
1622
|
+
};
|
|
1643
1623
|
}();
|
|
1644
1624
|
|
|
1645
1625
|
/**
|
|
@@ -1654,25 +1634,25 @@ exports.RemoveListing = /*#__PURE__*/function () {
|
|
|
1654
1634
|
* @returns {Promise<Array<String>>} - A list of item names
|
|
1655
1635
|
*/
|
|
1656
1636
|
exports.SalesNames = /*#__PURE__*/function () {
|
|
1657
|
-
var
|
|
1658
|
-
var marketplaceParams, tenantId
|
|
1659
|
-
return _regeneratorRuntime.wrap(function (
|
|
1660
|
-
while (1) switch (
|
|
1637
|
+
var _ref56 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(_ref55) {
|
|
1638
|
+
var marketplaceParams, tenantId;
|
|
1639
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
1640
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1661
1641
|
case 0:
|
|
1662
|
-
marketplaceParams =
|
|
1642
|
+
marketplaceParams = _ref55.marketplaceParams;
|
|
1663
1643
|
if (!marketplaceParams) {
|
|
1664
|
-
|
|
1644
|
+
_context29.next = 5;
|
|
1665
1645
|
break;
|
|
1666
1646
|
}
|
|
1667
|
-
|
|
1647
|
+
_context29.next = 4;
|
|
1668
1648
|
return this.MarketplaceInfo({
|
|
1669
1649
|
marketplaceParams: marketplaceParams
|
|
1670
1650
|
});
|
|
1671
|
-
case
|
|
1672
|
-
tenantId =
|
|
1673
|
-
case
|
|
1674
|
-
|
|
1675
|
-
|
|
1651
|
+
case 4:
|
|
1652
|
+
tenantId = _context29.sent.tenantId;
|
|
1653
|
+
case 5:
|
|
1654
|
+
_context29.t0 = Utils;
|
|
1655
|
+
_context29.next = 8;
|
|
1676
1656
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1677
1657
|
path: UrlJoin("as", "mkt", "names", "hst"),
|
|
1678
1658
|
method: "GET",
|
|
@@ -1680,20 +1660,20 @@ exports.SalesNames = /*#__PURE__*/function () {
|
|
|
1680
1660
|
filter: "tenant:eq:".concat(tenantId)
|
|
1681
1661
|
} : {}
|
|
1682
1662
|
});
|
|
1683
|
-
case
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
return
|
|
1687
|
-
case
|
|
1688
|
-
return
|
|
1689
|
-
case
|
|
1663
|
+
case 8:
|
|
1664
|
+
_context29.t1 = _context29.sent;
|
|
1665
|
+
_context29.next = 11;
|
|
1666
|
+
return _context29.t0.ResponseToJson.call(_context29.t0, _context29.t1);
|
|
1667
|
+
case 11:
|
|
1668
|
+
return _context29.abrupt("return", _context29.sent);
|
|
1669
|
+
case 12:
|
|
1690
1670
|
case "end":
|
|
1691
|
-
return
|
|
1671
|
+
return _context29.stop();
|
|
1692
1672
|
}
|
|
1693
|
-
},
|
|
1673
|
+
}, _callee29, this);
|
|
1694
1674
|
}));
|
|
1695
|
-
return function (
|
|
1696
|
-
return
|
|
1675
|
+
return function (_x16) {
|
|
1676
|
+
return _ref56.apply(this, arguments);
|
|
1697
1677
|
};
|
|
1698
1678
|
}();
|
|
1699
1679
|
|
|
@@ -1709,25 +1689,25 @@ exports.SalesNames = /*#__PURE__*/function () {
|
|
|
1709
1689
|
* @returns {Promise<Array<String>>} - A list of item names
|
|
1710
1690
|
*/
|
|
1711
1691
|
exports.ListingNames = /*#__PURE__*/function () {
|
|
1712
|
-
var
|
|
1713
|
-
var marketplaceParams, tenantId
|
|
1714
|
-
return _regeneratorRuntime.wrap(function (
|
|
1715
|
-
while (1) switch (
|
|
1692
|
+
var _ref58 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(_ref57) {
|
|
1693
|
+
var marketplaceParams, tenantId;
|
|
1694
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
1695
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1716
1696
|
case 0:
|
|
1717
|
-
marketplaceParams =
|
|
1697
|
+
marketplaceParams = _ref57.marketplaceParams;
|
|
1718
1698
|
if (!marketplaceParams) {
|
|
1719
|
-
|
|
1699
|
+
_context30.next = 5;
|
|
1720
1700
|
break;
|
|
1721
1701
|
}
|
|
1722
|
-
|
|
1702
|
+
_context30.next = 4;
|
|
1723
1703
|
return this.MarketplaceInfo({
|
|
1724
1704
|
marketplaceParams: marketplaceParams
|
|
1725
1705
|
});
|
|
1726
|
-
case
|
|
1727
|
-
tenantId =
|
|
1728
|
-
case
|
|
1729
|
-
|
|
1730
|
-
|
|
1706
|
+
case 4:
|
|
1707
|
+
tenantId = _context30.sent.tenantId;
|
|
1708
|
+
case 5:
|
|
1709
|
+
_context30.t0 = Utils;
|
|
1710
|
+
_context30.next = 8;
|
|
1731
1711
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1732
1712
|
path: UrlJoin("as", "mkt", "names"),
|
|
1733
1713
|
method: "GET",
|
|
@@ -1735,20 +1715,20 @@ exports.ListingNames = /*#__PURE__*/function () {
|
|
|
1735
1715
|
filter: "tenant:eq:".concat(tenantId)
|
|
1736
1716
|
} : {}
|
|
1737
1717
|
});
|
|
1738
|
-
case
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
return
|
|
1742
|
-
case
|
|
1743
|
-
return
|
|
1744
|
-
case
|
|
1718
|
+
case 8:
|
|
1719
|
+
_context30.t1 = _context30.sent;
|
|
1720
|
+
_context30.next = 11;
|
|
1721
|
+
return _context30.t0.ResponseToJson.call(_context30.t0, _context30.t1);
|
|
1722
|
+
case 11:
|
|
1723
|
+
return _context30.abrupt("return", _context30.sent);
|
|
1724
|
+
case 12:
|
|
1745
1725
|
case "end":
|
|
1746
|
-
return
|
|
1726
|
+
return _context30.stop();
|
|
1747
1727
|
}
|
|
1748
|
-
},
|
|
1728
|
+
}, _callee30, this);
|
|
1749
1729
|
}));
|
|
1750
|
-
return function (
|
|
1751
|
-
return
|
|
1730
|
+
return function (_x17) {
|
|
1731
|
+
return _ref58.apply(this, arguments);
|
|
1752
1732
|
};
|
|
1753
1733
|
}();
|
|
1754
1734
|
|
|
@@ -1762,14 +1742,14 @@ exports.ListingNames = /*#__PURE__*/function () {
|
|
|
1762
1742
|
* @returns {Promise<Array<String>>} - A list of item editions
|
|
1763
1743
|
*/
|
|
1764
1744
|
exports.ListingEditionNames = /*#__PURE__*/function () {
|
|
1765
|
-
var
|
|
1766
|
-
var displayName
|
|
1767
|
-
return _regeneratorRuntime.wrap(function (
|
|
1768
|
-
while (1) switch (
|
|
1745
|
+
var _ref60 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(_ref59) {
|
|
1746
|
+
var displayName;
|
|
1747
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
1748
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1769
1749
|
case 0:
|
|
1770
|
-
displayName =
|
|
1771
|
-
|
|
1772
|
-
|
|
1750
|
+
displayName = _ref59.displayName;
|
|
1751
|
+
_context31.t0 = Utils;
|
|
1752
|
+
_context31.next = 4;
|
|
1773
1753
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1774
1754
|
path: UrlJoin("as", "mkt", "editions"),
|
|
1775
1755
|
queryParams: {
|
|
@@ -1777,20 +1757,20 @@ exports.ListingEditionNames = /*#__PURE__*/function () {
|
|
|
1777
1757
|
},
|
|
1778
1758
|
method: "GET"
|
|
1779
1759
|
});
|
|
1780
|
-
case
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
return
|
|
1784
|
-
case
|
|
1785
|
-
return
|
|
1786
|
-
case
|
|
1760
|
+
case 4:
|
|
1761
|
+
_context31.t1 = _context31.sent;
|
|
1762
|
+
_context31.next = 7;
|
|
1763
|
+
return _context31.t0.ResponseToJson.call(_context31.t0, _context31.t1);
|
|
1764
|
+
case 7:
|
|
1765
|
+
return _context31.abrupt("return", _context31.sent);
|
|
1766
|
+
case 8:
|
|
1787
1767
|
case "end":
|
|
1788
|
-
return
|
|
1768
|
+
return _context31.stop();
|
|
1789
1769
|
}
|
|
1790
|
-
},
|
|
1770
|
+
}, _callee31, this);
|
|
1791
1771
|
}));
|
|
1792
|
-
return function (
|
|
1793
|
-
return
|
|
1772
|
+
return function (_x18) {
|
|
1773
|
+
return _ref60.apply(this, arguments);
|
|
1794
1774
|
};
|
|
1795
1775
|
}();
|
|
1796
1776
|
|
|
@@ -1806,44 +1786,38 @@ exports.ListingEditionNames = /*#__PURE__*/function () {
|
|
|
1806
1786
|
*
|
|
1807
1787
|
* @returns {Promise<Array<String>>} - A list of valid attributes
|
|
1808
1788
|
*/
|
|
1809
|
-
exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1810
|
-
var
|
|
1789
|
+
exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
|
|
1790
|
+
var _ref62,
|
|
1811
1791
|
marketplaceParams,
|
|
1812
1792
|
displayName,
|
|
1813
1793
|
filters,
|
|
1814
1794
|
attributes,
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
_t46,
|
|
1819
|
-
_t47,
|
|
1820
|
-
_t48,
|
|
1821
|
-
_t49;
|
|
1822
|
-
return _regeneratorRuntime.wrap(function (_context30) {
|
|
1823
|
-
while (1) switch (_context30.prev = _context30.next) {
|
|
1795
|
+
_args32 = arguments;
|
|
1796
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
1797
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1824
1798
|
case 0:
|
|
1825
|
-
|
|
1799
|
+
_ref62 = _args32.length > 0 && _args32[0] !== undefined ? _args32[0] : {}, marketplaceParams = _ref62.marketplaceParams, displayName = _ref62.displayName;
|
|
1826
1800
|
filters = [];
|
|
1827
1801
|
if (!marketplaceParams) {
|
|
1828
|
-
|
|
1802
|
+
_context32.next = 10;
|
|
1829
1803
|
break;
|
|
1830
1804
|
}
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1805
|
+
_context32.t0 = filters;
|
|
1806
|
+
_context32.t1 = "tenant:eq:";
|
|
1807
|
+
_context32.next = 7;
|
|
1834
1808
|
return this.MarketplaceInfo({
|
|
1835
1809
|
marketplaceParams: marketplaceParams
|
|
1836
1810
|
});
|
|
1837
|
-
case
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
case
|
|
1811
|
+
case 7:
|
|
1812
|
+
_context32.t2 = _context32.sent.tenantId;
|
|
1813
|
+
_context32.t3 = _context32.t1.concat.call(_context32.t1, _context32.t2);
|
|
1814
|
+
_context32.t0.push.call(_context32.t0, _context32.t3);
|
|
1815
|
+
case 10:
|
|
1842
1816
|
if (displayName) {
|
|
1843
1817
|
filters.push("nft/display_name:eq:".concat(displayName));
|
|
1844
1818
|
}
|
|
1845
|
-
|
|
1846
|
-
|
|
1819
|
+
_context32.t4 = Utils;
|
|
1820
|
+
_context32.next = 14;
|
|
1847
1821
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1848
1822
|
path: UrlJoin("as", "mkt", "attributes"),
|
|
1849
1823
|
method: "GET",
|
|
@@ -1851,28 +1825,28 @@ exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regener
|
|
|
1851
1825
|
filter: filters
|
|
1852
1826
|
}
|
|
1853
1827
|
});
|
|
1854
|
-
case
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
return
|
|
1858
|
-
case
|
|
1859
|
-
attributes =
|
|
1860
|
-
return
|
|
1861
|
-
var trait_type =
|
|
1862
|
-
values =
|
|
1828
|
+
case 14:
|
|
1829
|
+
_context32.t5 = _context32.sent;
|
|
1830
|
+
_context32.next = 17;
|
|
1831
|
+
return _context32.t4.ResponseToJson.call(_context32.t4, _context32.t5);
|
|
1832
|
+
case 17:
|
|
1833
|
+
attributes = _context32.sent;
|
|
1834
|
+
return _context32.abrupt("return", attributes.map(function (_ref63) {
|
|
1835
|
+
var trait_type = _ref63.trait_type,
|
|
1836
|
+
values = _ref63.values;
|
|
1863
1837
|
return {
|
|
1864
1838
|
name: trait_type,
|
|
1865
1839
|
values: values
|
|
1866
1840
|
};
|
|
1867
|
-
}).filter(function (
|
|
1868
|
-
var name =
|
|
1841
|
+
}).filter(function (_ref64) {
|
|
1842
|
+
var name = _ref64.name;
|
|
1869
1843
|
return !["Content Fabric Hash", "Total Minted Supply", "Creator"].includes(name);
|
|
1870
1844
|
}));
|
|
1871
|
-
case
|
|
1845
|
+
case 19:
|
|
1872
1846
|
case "end":
|
|
1873
|
-
return
|
|
1847
|
+
return _context32.stop();
|
|
1874
1848
|
}
|
|
1875
|
-
},
|
|
1849
|
+
}, _callee32, this);
|
|
1876
1850
|
}));
|
|
1877
1851
|
|
|
1878
1852
|
/* PURCHASE / CLAIM */
|
|
@@ -1889,13 +1863,13 @@ exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regener
|
|
|
1889
1863
|
* @returns {Promise<Object>} - Information about the claim, including the tenant associated with the item, the gift ID and the status op key
|
|
1890
1864
|
*/
|
|
1891
1865
|
exports.ClaimGift = /*#__PURE__*/function () {
|
|
1892
|
-
var
|
|
1866
|
+
var _ref66 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(_ref65) {
|
|
1893
1867
|
var code;
|
|
1894
|
-
return _regeneratorRuntime.wrap(function (
|
|
1895
|
-
while (1) switch (
|
|
1868
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
1869
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1896
1870
|
case 0:
|
|
1897
|
-
code =
|
|
1898
|
-
|
|
1871
|
+
code = _ref65.code;
|
|
1872
|
+
_context33.next = 3;
|
|
1899
1873
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
1900
1874
|
method: "POST",
|
|
1901
1875
|
path: UrlJoin("as", "wlt", "gifts", "claim"),
|
|
@@ -1906,16 +1880,16 @@ exports.ClaimGift = /*#__PURE__*/function () {
|
|
|
1906
1880
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1907
1881
|
}
|
|
1908
1882
|
}));
|
|
1909
|
-
case
|
|
1910
|
-
return
|
|
1911
|
-
case
|
|
1883
|
+
case 3:
|
|
1884
|
+
return _context33.abrupt("return", _context33.sent);
|
|
1885
|
+
case 4:
|
|
1912
1886
|
case "end":
|
|
1913
|
-
return
|
|
1887
|
+
return _context33.stop();
|
|
1914
1888
|
}
|
|
1915
|
-
},
|
|
1889
|
+
}, _callee33, this);
|
|
1916
1890
|
}));
|
|
1917
|
-
return function (
|
|
1918
|
-
return
|
|
1891
|
+
return function (_x19) {
|
|
1892
|
+
return _ref66.apply(this, arguments);
|
|
1919
1893
|
};
|
|
1920
1894
|
}();
|
|
1921
1895
|
|
|
@@ -1931,19 +1905,19 @@ exports.ClaimGift = /*#__PURE__*/function () {
|
|
|
1931
1905
|
* @param {string=} email - Email address of the user. If specified, this will bind the user to the tenant of the specified marketplace
|
|
1932
1906
|
*/
|
|
1933
1907
|
exports.ClaimItem = /*#__PURE__*/function () {
|
|
1934
|
-
var
|
|
1908
|
+
var _ref68 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(_ref67) {
|
|
1935
1909
|
var marketplaceParams, sku, email, marketplaceInfo;
|
|
1936
|
-
return _regeneratorRuntime.wrap(function (
|
|
1937
|
-
while (1) switch (
|
|
1910
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
1911
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1938
1912
|
case 0:
|
|
1939
|
-
marketplaceParams =
|
|
1940
|
-
|
|
1913
|
+
marketplaceParams = _ref67.marketplaceParams, sku = _ref67.sku, email = _ref67.email;
|
|
1914
|
+
_context34.next = 3;
|
|
1941
1915
|
return this.MarketplaceInfo({
|
|
1942
1916
|
marketplaceParams: marketplaceParams
|
|
1943
1917
|
});
|
|
1944
|
-
case
|
|
1945
|
-
marketplaceInfo =
|
|
1946
|
-
|
|
1918
|
+
case 3:
|
|
1919
|
+
marketplaceInfo = _context34.sent;
|
|
1920
|
+
_context34.next = 6;
|
|
1947
1921
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1948
1922
|
method: "POST",
|
|
1949
1923
|
path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
|
|
@@ -1957,14 +1931,14 @@ exports.ClaimItem = /*#__PURE__*/function () {
|
|
|
1957
1931
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1958
1932
|
}
|
|
1959
1933
|
});
|
|
1960
|
-
case
|
|
1934
|
+
case 6:
|
|
1961
1935
|
case "end":
|
|
1962
|
-
return
|
|
1936
|
+
return _context34.stop();
|
|
1963
1937
|
}
|
|
1964
|
-
},
|
|
1938
|
+
}, _callee34, this);
|
|
1965
1939
|
}));
|
|
1966
|
-
return function (
|
|
1967
|
-
return
|
|
1940
|
+
return function (_x20) {
|
|
1941
|
+
return _ref68.apply(this, arguments);
|
|
1968
1942
|
};
|
|
1969
1943
|
}();
|
|
1970
1944
|
|
|
@@ -1982,18 +1956,18 @@ exports.ClaimItem = /*#__PURE__*/function () {
|
|
|
1982
1956
|
* @param {string} cancelUrl - The URL to redirect back to upon cancellation of purchase
|
|
1983
1957
|
*/
|
|
1984
1958
|
exports.PurchaseItem = /*#__PURE__*/function () {
|
|
1985
|
-
var
|
|
1959
|
+
var _ref70 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(_ref69) {
|
|
1986
1960
|
var marketplaceParams, sku, confirmationId, successUrl, cancelUrl, marketplaceInfo;
|
|
1987
|
-
return _regeneratorRuntime.wrap(function (
|
|
1988
|
-
while (1) switch (
|
|
1961
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
1962
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1989
1963
|
case 0:
|
|
1990
|
-
marketplaceParams =
|
|
1991
|
-
|
|
1964
|
+
marketplaceParams = _ref69.marketplaceParams, sku = _ref69.sku, confirmationId = _ref69.confirmationId, successUrl = _ref69.successUrl, cancelUrl = _ref69.cancelUrl;
|
|
1965
|
+
_context35.next = 3;
|
|
1992
1966
|
return this.MarketplaceInfo({
|
|
1993
1967
|
marketplaceParams: marketplaceParams
|
|
1994
1968
|
});
|
|
1995
|
-
case
|
|
1996
|
-
marketplaceInfo =
|
|
1969
|
+
case 3:
|
|
1970
|
+
marketplaceInfo = _context35.sent;
|
|
1997
1971
|
window.location.href = this.FlowURL({
|
|
1998
1972
|
type: "action",
|
|
1999
1973
|
flow: "purchase",
|
|
@@ -2007,14 +1981,14 @@ exports.PurchaseItem = /*#__PURE__*/function () {
|
|
|
2007
1981
|
auth: this.ClientAuthToken()
|
|
2008
1982
|
}
|
|
2009
1983
|
});
|
|
2010
|
-
case
|
|
1984
|
+
case 5:
|
|
2011
1985
|
case "end":
|
|
2012
|
-
return
|
|
1986
|
+
return _context35.stop();
|
|
2013
1987
|
}
|
|
2014
|
-
},
|
|
1988
|
+
}, _callee35, this);
|
|
2015
1989
|
}));
|
|
2016
|
-
return function (
|
|
2017
|
-
return
|
|
1990
|
+
return function (_x21) {
|
|
1991
|
+
return _ref70.apply(this, arguments);
|
|
2018
1992
|
};
|
|
2019
1993
|
}();
|
|
2020
1994
|
|
|
@@ -2032,23 +2006,23 @@ exports.PurchaseItem = /*#__PURE__*/function () {
|
|
|
2032
2006
|
* @param {string} cancelUrl - The URL to redirect back to upon cancellation of purchase
|
|
2033
2007
|
*/
|
|
2034
2008
|
exports.PurchaseListing = /*#__PURE__*/function () {
|
|
2035
|
-
var
|
|
2009
|
+
var _ref72 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(_ref71) {
|
|
2036
2010
|
var marketplaceParams, listingId, confirmationId, successUrl, cancelUrl, marketplaceInfo;
|
|
2037
|
-
return _regeneratorRuntime.wrap(function (
|
|
2038
|
-
while (1) switch (
|
|
2011
|
+
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
2012
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
2039
2013
|
case 0:
|
|
2040
|
-
marketplaceParams =
|
|
2014
|
+
marketplaceParams = _ref71.marketplaceParams, listingId = _ref71.listingId, confirmationId = _ref71.confirmationId, successUrl = _ref71.successUrl, cancelUrl = _ref71.cancelUrl;
|
|
2041
2015
|
if (!marketplaceParams) {
|
|
2042
|
-
|
|
2016
|
+
_context36.next = 5;
|
|
2043
2017
|
break;
|
|
2044
2018
|
}
|
|
2045
|
-
|
|
2019
|
+
_context36.next = 4;
|
|
2046
2020
|
return this.MarketplaceInfo({
|
|
2047
2021
|
marketplaceParams: marketplaceParams
|
|
2048
2022
|
});
|
|
2049
|
-
case
|
|
2050
|
-
marketplaceInfo =
|
|
2051
|
-
case
|
|
2023
|
+
case 4:
|
|
2024
|
+
marketplaceInfo = _context36.sent;
|
|
2025
|
+
case 5:
|
|
2052
2026
|
window.location.href = this.FlowURL({
|
|
2053
2027
|
type: "action",
|
|
2054
2028
|
flow: "purchase",
|
|
@@ -2062,14 +2036,14 @@ exports.PurchaseListing = /*#__PURE__*/function () {
|
|
|
2062
2036
|
auth: this.ClientAuthToken()
|
|
2063
2037
|
}
|
|
2064
2038
|
});
|
|
2065
|
-
case
|
|
2039
|
+
case 6:
|
|
2066
2040
|
case "end":
|
|
2067
|
-
return
|
|
2041
|
+
return _context36.stop();
|
|
2068
2042
|
}
|
|
2069
|
-
},
|
|
2043
|
+
}, _callee36, this);
|
|
2070
2044
|
}));
|
|
2071
|
-
return function (
|
|
2072
|
-
return
|
|
2045
|
+
return function (_x22) {
|
|
2046
|
+
return _ref72.apply(this, arguments);
|
|
2073
2047
|
};
|
|
2074
2048
|
}();
|
|
2075
2049
|
|
|
@@ -2086,51 +2060,51 @@ exports.PurchaseListing = /*#__PURE__*/function () {
|
|
|
2086
2060
|
* @returns {Promise<Object>} - The status of the purchase
|
|
2087
2061
|
*/
|
|
2088
2062
|
exports.ListingPurchaseStatus = /*#__PURE__*/function () {
|
|
2089
|
-
var
|
|
2090
|
-
var listingId, confirmationId, listingStatus, statuses
|
|
2091
|
-
return _regeneratorRuntime.wrap(function (
|
|
2092
|
-
while (1) switch (
|
|
2063
|
+
var _ref74 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(_ref73) {
|
|
2064
|
+
var listingId, confirmationId, listingStatus, statuses;
|
|
2065
|
+
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
|
|
2066
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
2093
2067
|
case 0:
|
|
2094
|
-
listingId =
|
|
2095
|
-
|
|
2096
|
-
|
|
2068
|
+
listingId = _ref73.listingId, confirmationId = _ref73.confirmationId;
|
|
2069
|
+
_context37.prev = 1;
|
|
2070
|
+
_context37.next = 4;
|
|
2097
2071
|
return this.ListingStatus({
|
|
2098
2072
|
listingId: listingId
|
|
2099
2073
|
});
|
|
2100
|
-
case
|
|
2101
|
-
listingStatus =
|
|
2074
|
+
case 4:
|
|
2075
|
+
listingStatus = _context37.sent;
|
|
2102
2076
|
if (listingStatus) {
|
|
2103
|
-
|
|
2077
|
+
_context37.next = 7;
|
|
2104
2078
|
break;
|
|
2105
2079
|
}
|
|
2106
2080
|
throw Error("Unable to find info for listing " + listingId);
|
|
2107
|
-
case
|
|
2108
|
-
|
|
2081
|
+
case 7:
|
|
2082
|
+
_context37.next = 9;
|
|
2109
2083
|
return this.MintingStatus({
|
|
2110
2084
|
tenantId: listingStatus.tenant
|
|
2111
2085
|
});
|
|
2112
|
-
case
|
|
2113
|
-
statuses =
|
|
2114
|
-
return
|
|
2086
|
+
case 9:
|
|
2087
|
+
statuses = _context37.sent;
|
|
2088
|
+
return _context37.abrupt("return", statuses.find(function (status) {
|
|
2115
2089
|
return status.op === "nft-transfer" && status.extra && status.extra[0] === confirmationId;
|
|
2116
2090
|
}) || {
|
|
2117
2091
|
status: "none"
|
|
2118
2092
|
});
|
|
2119
|
-
case
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
this.Log(
|
|
2123
|
-
return
|
|
2093
|
+
case 13:
|
|
2094
|
+
_context37.prev = 13;
|
|
2095
|
+
_context37.t0 = _context37["catch"](1);
|
|
2096
|
+
this.Log(_context37.t0, true);
|
|
2097
|
+
return _context37.abrupt("return", {
|
|
2124
2098
|
status: "unknown"
|
|
2125
2099
|
});
|
|
2126
|
-
case
|
|
2100
|
+
case 17:
|
|
2127
2101
|
case "end":
|
|
2128
|
-
return
|
|
2102
|
+
return _context37.stop();
|
|
2129
2103
|
}
|
|
2130
|
-
},
|
|
2104
|
+
}, _callee37, this, [[1, 13]]);
|
|
2131
2105
|
}));
|
|
2132
|
-
return function (
|
|
2133
|
-
return
|
|
2106
|
+
return function (_x23) {
|
|
2107
|
+
return _ref74.apply(this, arguments);
|
|
2134
2108
|
};
|
|
2135
2109
|
}();
|
|
2136
2110
|
|
|
@@ -2145,45 +2119,45 @@ exports.ListingPurchaseStatus = /*#__PURE__*/function () {
|
|
|
2145
2119
|
* @returns {Promise<Object>} - The minting status of the purchaseed item(s)
|
|
2146
2120
|
*/
|
|
2147
2121
|
exports.PurchaseStatus = /*#__PURE__*/function () {
|
|
2148
|
-
var
|
|
2149
|
-
var marketplaceParams, confirmationId, marketplaceInfo, statuses
|
|
2150
|
-
return _regeneratorRuntime.wrap(function (
|
|
2151
|
-
while (1) switch (
|
|
2122
|
+
var _ref76 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(_ref75) {
|
|
2123
|
+
var marketplaceParams, confirmationId, marketplaceInfo, statuses;
|
|
2124
|
+
return _regeneratorRuntime.wrap(function _callee38$(_context38) {
|
|
2125
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
2152
2126
|
case 0:
|
|
2153
|
-
marketplaceParams =
|
|
2154
|
-
|
|
2155
|
-
|
|
2127
|
+
marketplaceParams = _ref75.marketplaceParams, confirmationId = _ref75.confirmationId;
|
|
2128
|
+
_context38.prev = 1;
|
|
2129
|
+
_context38.next = 4;
|
|
2156
2130
|
return this.MarketplaceInfo({
|
|
2157
2131
|
marketplaceParams: marketplaceParams
|
|
2158
2132
|
});
|
|
2159
|
-
case
|
|
2160
|
-
marketplaceInfo =
|
|
2161
|
-
|
|
2133
|
+
case 4:
|
|
2134
|
+
marketplaceInfo = _context38.sent;
|
|
2135
|
+
_context38.next = 7;
|
|
2162
2136
|
return this.MintingStatus({
|
|
2163
2137
|
tenantId: marketplaceInfo.tenantId
|
|
2164
2138
|
});
|
|
2165
|
-
case
|
|
2166
|
-
statuses =
|
|
2167
|
-
return
|
|
2139
|
+
case 7:
|
|
2140
|
+
statuses = _context38.sent;
|
|
2141
|
+
return _context38.abrupt("return", statuses.find(function (status) {
|
|
2168
2142
|
return status.op === "nft-buy" && status.confirmationId === confirmationId;
|
|
2169
2143
|
}) || {
|
|
2170
2144
|
status: "none"
|
|
2171
2145
|
});
|
|
2172
|
-
case
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
this.Log(
|
|
2176
|
-
return
|
|
2146
|
+
case 11:
|
|
2147
|
+
_context38.prev = 11;
|
|
2148
|
+
_context38.t0 = _context38["catch"](1);
|
|
2149
|
+
this.Log(_context38.t0, true);
|
|
2150
|
+
return _context38.abrupt("return", {
|
|
2177
2151
|
status: "unknown"
|
|
2178
2152
|
});
|
|
2179
|
-
case
|
|
2153
|
+
case 15:
|
|
2180
2154
|
case "end":
|
|
2181
|
-
return
|
|
2155
|
+
return _context38.stop();
|
|
2182
2156
|
}
|
|
2183
|
-
},
|
|
2157
|
+
}, _callee38, this, [[1, 11]]);
|
|
2184
2158
|
}));
|
|
2185
|
-
return function (
|
|
2186
|
-
return
|
|
2159
|
+
return function (_x24) {
|
|
2160
|
+
return _ref76.apply(this, arguments);
|
|
2187
2161
|
};
|
|
2188
2162
|
}();
|
|
2189
2163
|
|
|
@@ -2198,45 +2172,45 @@ exports.PurchaseStatus = /*#__PURE__*/function () {
|
|
|
2198
2172
|
* @returns {Promise<Object>} - The minting status of the claim
|
|
2199
2173
|
*/
|
|
2200
2174
|
exports.ClaimStatus = /*#__PURE__*/function () {
|
|
2201
|
-
var
|
|
2202
|
-
var marketplaceParams, sku, marketplaceInfo, statuses
|
|
2203
|
-
return _regeneratorRuntime.wrap(function (
|
|
2204
|
-
while (1) switch (
|
|
2175
|
+
var _ref78 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(_ref77) {
|
|
2176
|
+
var marketplaceParams, sku, marketplaceInfo, statuses;
|
|
2177
|
+
return _regeneratorRuntime.wrap(function _callee39$(_context39) {
|
|
2178
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
2205
2179
|
case 0:
|
|
2206
|
-
marketplaceParams =
|
|
2207
|
-
|
|
2208
|
-
|
|
2180
|
+
marketplaceParams = _ref77.marketplaceParams, sku = _ref77.sku;
|
|
2181
|
+
_context39.prev = 1;
|
|
2182
|
+
_context39.next = 4;
|
|
2209
2183
|
return this.MarketplaceInfo({
|
|
2210
2184
|
marketplaceParams: marketplaceParams
|
|
2211
2185
|
});
|
|
2212
|
-
case
|
|
2213
|
-
marketplaceInfo =
|
|
2214
|
-
|
|
2186
|
+
case 4:
|
|
2187
|
+
marketplaceInfo = _context39.sent;
|
|
2188
|
+
_context39.next = 7;
|
|
2215
2189
|
return this.MintingStatus({
|
|
2216
2190
|
tenantId: marketplaceInfo.tenantId
|
|
2217
2191
|
});
|
|
2218
|
-
case
|
|
2219
|
-
statuses =
|
|
2220
|
-
return
|
|
2192
|
+
case 7:
|
|
2193
|
+
statuses = _context39.sent;
|
|
2194
|
+
return _context39.abrupt("return", statuses.find(function (status) {
|
|
2221
2195
|
return status.op === "nft-claim" && status.marketplaceId === marketplaceInfo.marketplaceId && status.confirmationId === sku;
|
|
2222
2196
|
}) || {
|
|
2223
2197
|
status: "none"
|
|
2224
2198
|
});
|
|
2225
|
-
case
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
this.Log(
|
|
2229
|
-
return
|
|
2199
|
+
case 11:
|
|
2200
|
+
_context39.prev = 11;
|
|
2201
|
+
_context39.t0 = _context39["catch"](1);
|
|
2202
|
+
this.Log(_context39.t0, true);
|
|
2203
|
+
return _context39.abrupt("return", {
|
|
2230
2204
|
status: "unknown"
|
|
2231
2205
|
});
|
|
2232
|
-
case
|
|
2206
|
+
case 15:
|
|
2233
2207
|
case "end":
|
|
2234
|
-
return
|
|
2208
|
+
return _context39.stop();
|
|
2235
2209
|
}
|
|
2236
|
-
},
|
|
2210
|
+
}, _callee39, this, [[1, 11]]);
|
|
2237
2211
|
}));
|
|
2238
|
-
return function (
|
|
2239
|
-
return
|
|
2212
|
+
return function (_x25) {
|
|
2213
|
+
return _ref78.apply(this, arguments);
|
|
2240
2214
|
};
|
|
2241
2215
|
}();
|
|
2242
2216
|
|
|
@@ -2252,25 +2226,25 @@ exports.ClaimStatus = /*#__PURE__*/function () {
|
|
|
2252
2226
|
* @returns {Promise<Object>} - The transfer status of the gift claim
|
|
2253
2227
|
*/
|
|
2254
2228
|
exports.GiftClaimStatus = /*#__PURE__*/function () {
|
|
2255
|
-
var
|
|
2256
|
-
var marketplaceParams, confirmationId, giftId, marketplaceInfo, statuses, responses
|
|
2257
|
-
return _regeneratorRuntime.wrap(function (
|
|
2258
|
-
while (1) switch (
|
|
2229
|
+
var _ref80 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(_ref79) {
|
|
2230
|
+
var marketplaceParams, confirmationId, giftId, marketplaceInfo, statuses, responses;
|
|
2231
|
+
return _regeneratorRuntime.wrap(function _callee40$(_context40) {
|
|
2232
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2259
2233
|
case 0:
|
|
2260
|
-
marketplaceParams =
|
|
2261
|
-
|
|
2262
|
-
|
|
2234
|
+
marketplaceParams = _ref79.marketplaceParams, confirmationId = _ref79.confirmationId, giftId = _ref79.giftId;
|
|
2235
|
+
_context40.prev = 1;
|
|
2236
|
+
_context40.next = 4;
|
|
2263
2237
|
return this.MarketplaceInfo({
|
|
2264
2238
|
marketplaceParams: marketplaceParams
|
|
2265
2239
|
});
|
|
2266
|
-
case
|
|
2267
|
-
marketplaceInfo =
|
|
2268
|
-
|
|
2240
|
+
case 4:
|
|
2241
|
+
marketplaceInfo = _context40.sent;
|
|
2242
|
+
_context40.next = 7;
|
|
2269
2243
|
return this.MintingStatus({
|
|
2270
2244
|
tenantId: marketplaceInfo.tenantId
|
|
2271
2245
|
});
|
|
2272
|
-
case
|
|
2273
|
-
statuses =
|
|
2246
|
+
case 7:
|
|
2247
|
+
statuses = _context40.sent;
|
|
2274
2248
|
// Status is a list of transfer statuses, may be multiple if quantity > 1
|
|
2275
2249
|
responses = statuses.filter(function (status) {
|
|
2276
2250
|
return status.op === "nft-transfer" && (confirmationId && status.confirmationId === confirmationId || giftId && status.giftId === giftId);
|
|
@@ -2278,38 +2252,38 @@ exports.GiftClaimStatus = /*#__PURE__*/function () {
|
|
|
2278
2252
|
status: "none"
|
|
2279
2253
|
};
|
|
2280
2254
|
if (!(responses.length === 0)) {
|
|
2281
|
-
|
|
2255
|
+
_context40.next = 13;
|
|
2282
2256
|
break;
|
|
2283
2257
|
}
|
|
2284
|
-
return
|
|
2258
|
+
return _context40.abrupt("return", {
|
|
2285
2259
|
status: "none"
|
|
2286
2260
|
});
|
|
2287
|
-
case
|
|
2261
|
+
case 13:
|
|
2288
2262
|
if (!responses.find(function (response) {
|
|
2289
2263
|
return response.status === "failed";
|
|
2290
2264
|
})) {
|
|
2291
|
-
|
|
2265
|
+
_context40.next = 17;
|
|
2292
2266
|
break;
|
|
2293
2267
|
}
|
|
2294
|
-
return
|
|
2268
|
+
return _context40.abrupt("return", {
|
|
2295
2269
|
status: "failed",
|
|
2296
2270
|
op: "nft-transfer",
|
|
2297
2271
|
transfer_statuses: responses
|
|
2298
2272
|
});
|
|
2299
|
-
case
|
|
2273
|
+
case 17:
|
|
2300
2274
|
if (!responses.find(function (response) {
|
|
2301
2275
|
return response.status !== "complete";
|
|
2302
2276
|
})) {
|
|
2303
|
-
|
|
2277
|
+
_context40.next = 21;
|
|
2304
2278
|
break;
|
|
2305
2279
|
}
|
|
2306
|
-
return
|
|
2280
|
+
return _context40.abrupt("return", {
|
|
2307
2281
|
status: "pending",
|
|
2308
2282
|
op: "nft-transfer",
|
|
2309
2283
|
transfer_statuses: responses
|
|
2310
2284
|
});
|
|
2311
|
-
case
|
|
2312
|
-
return
|
|
2285
|
+
case 21:
|
|
2286
|
+
return _context40.abrupt("return", {
|
|
2313
2287
|
status: "complete",
|
|
2314
2288
|
op: "nft-transfer",
|
|
2315
2289
|
transfer_statuses: responses,
|
|
@@ -2320,24 +2294,24 @@ exports.GiftClaimStatus = /*#__PURE__*/function () {
|
|
|
2320
2294
|
};
|
|
2321
2295
|
})
|
|
2322
2296
|
});
|
|
2323
|
-
case
|
|
2324
|
-
|
|
2297
|
+
case 22:
|
|
2298
|
+
_context40.next = 28;
|
|
2325
2299
|
break;
|
|
2326
|
-
case
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
this.Log(
|
|
2330
|
-
return
|
|
2300
|
+
case 24:
|
|
2301
|
+
_context40.prev = 24;
|
|
2302
|
+
_context40.t0 = _context40["catch"](1);
|
|
2303
|
+
this.Log(_context40.t0, true);
|
|
2304
|
+
return _context40.abrupt("return", {
|
|
2331
2305
|
status: "unknown"
|
|
2332
2306
|
});
|
|
2333
|
-
case
|
|
2307
|
+
case 28:
|
|
2334
2308
|
case "end":
|
|
2335
|
-
return
|
|
2309
|
+
return _context40.stop();
|
|
2336
2310
|
}
|
|
2337
|
-
},
|
|
2311
|
+
}, _callee40, this, [[1, 24]]);
|
|
2338
2312
|
}));
|
|
2339
|
-
return function (
|
|
2340
|
-
return
|
|
2313
|
+
return function (_x26) {
|
|
2314
|
+
return _ref80.apply(this, arguments);
|
|
2341
2315
|
};
|
|
2342
2316
|
}();
|
|
2343
2317
|
|
|
@@ -2352,45 +2326,45 @@ exports.GiftClaimStatus = /*#__PURE__*/function () {
|
|
|
2352
2326
|
* @returns {Promise<Object>} - The mint status of the entitlement claim
|
|
2353
2327
|
*/
|
|
2354
2328
|
exports.EntitlementClaimStatus = /*#__PURE__*/function () {
|
|
2355
|
-
var
|
|
2356
|
-
var marketplaceParams, purchaseId, marketplaceInfo, statuses, responses
|
|
2357
|
-
return _regeneratorRuntime.wrap(function (
|
|
2358
|
-
while (1) switch (
|
|
2329
|
+
var _ref82 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(_ref81) {
|
|
2330
|
+
var marketplaceParams, purchaseId, marketplaceInfo, statuses, responses;
|
|
2331
|
+
return _regeneratorRuntime.wrap(function _callee41$(_context41) {
|
|
2332
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2359
2333
|
case 0:
|
|
2360
|
-
marketplaceParams =
|
|
2361
|
-
|
|
2362
|
-
|
|
2334
|
+
marketplaceParams = _ref81.marketplaceParams, purchaseId = _ref81.purchaseId;
|
|
2335
|
+
_context41.prev = 1;
|
|
2336
|
+
_context41.next = 4;
|
|
2363
2337
|
return this.MarketplaceInfo({
|
|
2364
2338
|
marketplaceParams: marketplaceParams
|
|
2365
2339
|
});
|
|
2366
|
-
case
|
|
2367
|
-
marketplaceInfo =
|
|
2368
|
-
|
|
2340
|
+
case 4:
|
|
2341
|
+
marketplaceInfo = _context41.sent;
|
|
2342
|
+
_context41.next = 7;
|
|
2369
2343
|
return this.MintingStatus({
|
|
2370
2344
|
tenantId: marketplaceInfo.tenantId
|
|
2371
2345
|
});
|
|
2372
|
-
case
|
|
2373
|
-
statuses =
|
|
2346
|
+
case 7:
|
|
2347
|
+
statuses = _context41.sent;
|
|
2374
2348
|
responses = statuses.filter(function (status) {
|
|
2375
2349
|
return status.op === "nft-claim-entitlement" && purchaseId && purchaseId == status.confirmationId;
|
|
2376
2350
|
}) || {
|
|
2377
2351
|
status: "none"
|
|
2378
2352
|
};
|
|
2379
2353
|
if (!(responses.length === 0)) {
|
|
2380
|
-
|
|
2354
|
+
_context41.next = 13;
|
|
2381
2355
|
break;
|
|
2382
2356
|
}
|
|
2383
|
-
return
|
|
2357
|
+
return _context41.abrupt("return", {
|
|
2384
2358
|
status: "none"
|
|
2385
2359
|
});
|
|
2386
|
-
case
|
|
2360
|
+
case 13:
|
|
2387
2361
|
if (!responses.find(function (response) {
|
|
2388
2362
|
return response.status === "complete";
|
|
2389
2363
|
})) {
|
|
2390
|
-
|
|
2364
|
+
_context41.next = 17;
|
|
2391
2365
|
break;
|
|
2392
2366
|
}
|
|
2393
|
-
return
|
|
2367
|
+
return _context41.abrupt("return", {
|
|
2394
2368
|
status: "complete",
|
|
2395
2369
|
op: "nft-claim-entitlement",
|
|
2396
2370
|
items: [{
|
|
@@ -2398,40 +2372,40 @@ exports.EntitlementClaimStatus = /*#__PURE__*/function () {
|
|
|
2398
2372
|
token_id: responses[0].tokenId
|
|
2399
2373
|
}]
|
|
2400
2374
|
});
|
|
2401
|
-
case
|
|
2375
|
+
case 17:
|
|
2402
2376
|
if (!responses.find(function (response) {
|
|
2403
2377
|
return response.status === "error";
|
|
2404
2378
|
})) {
|
|
2405
|
-
|
|
2379
|
+
_context41.next = 21;
|
|
2406
2380
|
break;
|
|
2407
2381
|
}
|
|
2408
|
-
return
|
|
2382
|
+
return _context41.abrupt("return", {
|
|
2409
2383
|
status: "error",
|
|
2410
2384
|
op: "nft-claim-entitlement"
|
|
2411
2385
|
});
|
|
2412
|
-
case
|
|
2413
|
-
return
|
|
2386
|
+
case 21:
|
|
2387
|
+
return _context41.abrupt("return", {
|
|
2414
2388
|
status: "pending",
|
|
2415
2389
|
op: "nft-claim-entitlement"
|
|
2416
2390
|
});
|
|
2417
|
-
case
|
|
2418
|
-
|
|
2391
|
+
case 22:
|
|
2392
|
+
_context41.next = 28;
|
|
2419
2393
|
break;
|
|
2420
|
-
case
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
this.Log(
|
|
2424
|
-
return
|
|
2394
|
+
case 24:
|
|
2395
|
+
_context41.prev = 24;
|
|
2396
|
+
_context41.t0 = _context41["catch"](1);
|
|
2397
|
+
this.Log(_context41.t0, true);
|
|
2398
|
+
return _context41.abrupt("return", {
|
|
2425
2399
|
status: "unknown"
|
|
2426
2400
|
});
|
|
2427
|
-
case
|
|
2401
|
+
case 28:
|
|
2428
2402
|
case "end":
|
|
2429
|
-
return
|
|
2403
|
+
return _context41.stop();
|
|
2430
2404
|
}
|
|
2431
|
-
},
|
|
2405
|
+
}, _callee41, this, [[1, 24]]);
|
|
2432
2406
|
}));
|
|
2433
|
-
return function (
|
|
2434
|
-
return
|
|
2407
|
+
return function (_x27) {
|
|
2408
|
+
return _ref82.apply(this, arguments);
|
|
2435
2409
|
};
|
|
2436
2410
|
}();
|
|
2437
2411
|
|
|
@@ -2446,45 +2420,45 @@ exports.EntitlementClaimStatus = /*#__PURE__*/function () {
|
|
|
2446
2420
|
* @returns {Promise<Object>} - The status of the pack opening
|
|
2447
2421
|
*/
|
|
2448
2422
|
exports.PackOpenStatus = /*#__PURE__*/function () {
|
|
2449
|
-
var
|
|
2450
|
-
var contractAddress, tokenId, tenantConfig, statuses
|
|
2451
|
-
return _regeneratorRuntime.wrap(function (
|
|
2452
|
-
while (1) switch (
|
|
2423
|
+
var _ref84 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(_ref83) {
|
|
2424
|
+
var contractAddress, tokenId, tenantConfig, statuses;
|
|
2425
|
+
return _regeneratorRuntime.wrap(function _callee42$(_context42) {
|
|
2426
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2453
2427
|
case 0:
|
|
2454
|
-
contractAddress =
|
|
2455
|
-
|
|
2456
|
-
|
|
2428
|
+
contractAddress = _ref83.contractAddress, tokenId = _ref83.tokenId;
|
|
2429
|
+
_context42.prev = 1;
|
|
2430
|
+
_context42.next = 4;
|
|
2457
2431
|
return this.TenantConfiguration({
|
|
2458
2432
|
contractAddress: contractAddress
|
|
2459
2433
|
});
|
|
2460
|
-
case
|
|
2461
|
-
tenantConfig =
|
|
2462
|
-
|
|
2434
|
+
case 4:
|
|
2435
|
+
tenantConfig = _context42.sent;
|
|
2436
|
+
_context42.next = 7;
|
|
2463
2437
|
return this.MintingStatus({
|
|
2464
2438
|
tenantId: tenantConfig.tenant
|
|
2465
2439
|
});
|
|
2466
|
-
case
|
|
2467
|
-
statuses =
|
|
2468
|
-
return
|
|
2440
|
+
case 7:
|
|
2441
|
+
statuses = _context42.sent;
|
|
2442
|
+
return _context42.abrupt("return", statuses.find(function (status) {
|
|
2469
2443
|
return status.op === "nft-open" && Utils.EqualAddress(contractAddress, status.address) && status.tokenId === tokenId;
|
|
2470
2444
|
}) || {
|
|
2471
2445
|
status: "none"
|
|
2472
2446
|
});
|
|
2473
|
-
case
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
this.Log(
|
|
2477
|
-
return
|
|
2447
|
+
case 11:
|
|
2448
|
+
_context42.prev = 11;
|
|
2449
|
+
_context42.t0 = _context42["catch"](1);
|
|
2450
|
+
this.Log(_context42.t0, true);
|
|
2451
|
+
return _context42.abrupt("return", {
|
|
2478
2452
|
status: "unknown"
|
|
2479
2453
|
});
|
|
2480
|
-
case
|
|
2454
|
+
case 15:
|
|
2481
2455
|
case "end":
|
|
2482
|
-
return
|
|
2456
|
+
return _context42.stop();
|
|
2483
2457
|
}
|
|
2484
|
-
},
|
|
2458
|
+
}, _callee42, this, [[1, 11]]);
|
|
2485
2459
|
}));
|
|
2486
|
-
return function (
|
|
2487
|
-
return
|
|
2460
|
+
return function (_x28) {
|
|
2461
|
+
return _ref84.apply(this, arguments);
|
|
2488
2462
|
};
|
|
2489
2463
|
}();
|
|
2490
2464
|
|
|
@@ -2499,39 +2473,39 @@ exports.PackOpenStatus = /*#__PURE__*/function () {
|
|
|
2499
2473
|
* @returns {Promise<Object>} - The status of the collection redemption
|
|
2500
2474
|
*/
|
|
2501
2475
|
exports.CollectionRedemptionStatus = /*#__PURE__*/function () {
|
|
2502
|
-
var
|
|
2503
|
-
var marketplaceParams, confirmationId, statuses
|
|
2504
|
-
return _regeneratorRuntime.wrap(function (
|
|
2505
|
-
while (1) switch (
|
|
2476
|
+
var _ref86 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(_ref85) {
|
|
2477
|
+
var marketplaceParams, confirmationId, statuses;
|
|
2478
|
+
return _regeneratorRuntime.wrap(function _callee43$(_context43) {
|
|
2479
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2506
2480
|
case 0:
|
|
2507
|
-
marketplaceParams =
|
|
2508
|
-
|
|
2509
|
-
|
|
2481
|
+
marketplaceParams = _ref85.marketplaceParams, confirmationId = _ref85.confirmationId;
|
|
2482
|
+
_context43.prev = 1;
|
|
2483
|
+
_context43.next = 4;
|
|
2510
2484
|
return this.MintingStatus({
|
|
2511
2485
|
marketplaceParams: marketplaceParams
|
|
2512
2486
|
});
|
|
2513
|
-
case
|
|
2514
|
-
statuses =
|
|
2515
|
-
return
|
|
2487
|
+
case 4:
|
|
2488
|
+
statuses = _context43.sent;
|
|
2489
|
+
return _context43.abrupt("return", statuses.find(function (status) {
|
|
2516
2490
|
return status.op === "nft-redeem" && status.confirmationId === confirmationId;
|
|
2517
2491
|
}) || {
|
|
2518
2492
|
status: "none"
|
|
2519
2493
|
});
|
|
2520
|
-
case
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
this.Log(
|
|
2524
|
-
return
|
|
2494
|
+
case 8:
|
|
2495
|
+
_context43.prev = 8;
|
|
2496
|
+
_context43.t0 = _context43["catch"](1);
|
|
2497
|
+
this.Log(_context43.t0, true);
|
|
2498
|
+
return _context43.abrupt("return", {
|
|
2525
2499
|
status: "unknown"
|
|
2526
2500
|
});
|
|
2527
|
-
case
|
|
2501
|
+
case 12:
|
|
2528
2502
|
case "end":
|
|
2529
|
-
return
|
|
2503
|
+
return _context43.stop();
|
|
2530
2504
|
}
|
|
2531
|
-
},
|
|
2505
|
+
}, _callee43, this, [[1, 8]]);
|
|
2532
2506
|
}));
|
|
2533
|
-
return function (
|
|
2534
|
-
return
|
|
2507
|
+
return function (_x29) {
|
|
2508
|
+
return _ref86.apply(this, arguments);
|
|
2535
2509
|
};
|
|
2536
2510
|
}();
|
|
2537
2511
|
|
|
@@ -2549,51 +2523,51 @@ exports.CollectionRedemptionStatus = /*#__PURE__*/function () {
|
|
|
2549
2523
|
* @returns {Promise<Object>} - The status of the offer redemption
|
|
2550
2524
|
*/
|
|
2551
2525
|
exports.RedeemableOfferStatus = /*#__PURE__*/function () {
|
|
2552
|
-
var
|
|
2553
|
-
var tenantId, marketplaceParams, contractAddress, tokenId, offerId, statuses
|
|
2554
|
-
return _regeneratorRuntime.wrap(function (
|
|
2555
|
-
while (1) switch (
|
|
2526
|
+
var _ref88 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(_ref87) {
|
|
2527
|
+
var tenantId, marketplaceParams, contractAddress, tokenId, offerId, statuses;
|
|
2528
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
2529
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2556
2530
|
case 0:
|
|
2557
|
-
tenantId =
|
|
2558
|
-
|
|
2559
|
-
|
|
2531
|
+
tenantId = _ref87.tenantId, marketplaceParams = _ref87.marketplaceParams, contractAddress = _ref87.contractAddress, tokenId = _ref87.tokenId, offerId = _ref87.offerId;
|
|
2532
|
+
_context44.prev = 1;
|
|
2533
|
+
_context44.next = 4;
|
|
2560
2534
|
return this.MintingStatus({
|
|
2561
2535
|
marketplaceParams: marketplaceParams,
|
|
2562
2536
|
tenantId: tenantId
|
|
2563
2537
|
});
|
|
2564
|
-
case
|
|
2565
|
-
statuses =
|
|
2538
|
+
case 4:
|
|
2539
|
+
statuses = _context44.sent;
|
|
2566
2540
|
contractAddress = Utils.FormatAddress(contractAddress);
|
|
2567
|
-
return
|
|
2541
|
+
return _context44.abrupt("return", statuses.find(function (status) {
|
|
2568
2542
|
return status.op === "nft-offer-redeem" && Utils.EqualAddress(status.address, contractAddress) && status.tokenId === (tokenId || "").toString() && status.offerId === (offerId || "").toString();
|
|
2569
2543
|
}) || {
|
|
2570
2544
|
status: "none"
|
|
2571
2545
|
});
|
|
2572
|
-
case
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
this.Log(
|
|
2576
|
-
return
|
|
2546
|
+
case 9:
|
|
2547
|
+
_context44.prev = 9;
|
|
2548
|
+
_context44.t0 = _context44["catch"](1);
|
|
2549
|
+
this.Log(_context44.t0, true);
|
|
2550
|
+
return _context44.abrupt("return", {
|
|
2577
2551
|
status: "unknown"
|
|
2578
2552
|
});
|
|
2579
|
-
case
|
|
2553
|
+
case 13:
|
|
2580
2554
|
case "end":
|
|
2581
|
-
return
|
|
2555
|
+
return _context44.stop();
|
|
2582
2556
|
}
|
|
2583
|
-
},
|
|
2557
|
+
}, _callee44, this, [[1, 9]]);
|
|
2584
2558
|
}));
|
|
2585
|
-
return function (
|
|
2586
|
-
return
|
|
2559
|
+
return function (_x30) {
|
|
2560
|
+
return _ref88.apply(this, arguments);
|
|
2587
2561
|
};
|
|
2588
2562
|
}();
|
|
2589
2563
|
exports.RedeemableCustomFulfillmentInfo = /*#__PURE__*/function () {
|
|
2590
|
-
var
|
|
2564
|
+
var _ref90 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(_ref89) {
|
|
2591
2565
|
var redeemableTransactionId;
|
|
2592
|
-
return _regeneratorRuntime.wrap(function (
|
|
2593
|
-
while (1) switch (
|
|
2566
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
2567
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2594
2568
|
case 0:
|
|
2595
|
-
redeemableTransactionId =
|
|
2596
|
-
|
|
2569
|
+
redeemableTransactionId = _ref89.redeemableTransactionId;
|
|
2570
|
+
_context45.next = 3;
|
|
2597
2571
|
return Utils.ResponseToJson(this.stateStoreClient.Request({
|
|
2598
2572
|
method: "GET",
|
|
2599
2573
|
path: UrlJoin("code-fulfillment", this.network === "main" ? "main" : "demov3", "fulfill", redeemableTransactionId),
|
|
@@ -2601,29 +2575,29 @@ exports.RedeemableCustomFulfillmentInfo = /*#__PURE__*/function () {
|
|
|
2601
2575
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
2602
2576
|
}
|
|
2603
2577
|
}));
|
|
2604
|
-
case
|
|
2605
|
-
return
|
|
2606
|
-
case
|
|
2578
|
+
case 3:
|
|
2579
|
+
return _context45.abrupt("return", _context45.sent);
|
|
2580
|
+
case 4:
|
|
2607
2581
|
case "end":
|
|
2608
|
-
return
|
|
2582
|
+
return _context45.stop();
|
|
2609
2583
|
}
|
|
2610
|
-
},
|
|
2584
|
+
}, _callee45, this);
|
|
2611
2585
|
}));
|
|
2612
|
-
return function (
|
|
2613
|
-
return
|
|
2586
|
+
return function (_x31) {
|
|
2587
|
+
return _ref90.apply(this, arguments);
|
|
2614
2588
|
};
|
|
2615
2589
|
}();
|
|
2616
2590
|
|
|
2617
2591
|
/* EVENTS */
|
|
2618
2592
|
|
|
2619
2593
|
exports.LoadDrop = /*#__PURE__*/function () {
|
|
2620
|
-
var
|
|
2594
|
+
var _ref92 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(_ref91) {
|
|
2621
2595
|
var _this = this;
|
|
2622
|
-
var tenantSlug, eventSlug, dropId, event, eventId
|
|
2623
|
-
return _regeneratorRuntime.wrap(function (
|
|
2624
|
-
while (1) switch (
|
|
2596
|
+
var tenantSlug, eventSlug, dropId, event, eventId;
|
|
2597
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context46) {
|
|
2598
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2625
2599
|
case 0:
|
|
2626
|
-
tenantSlug =
|
|
2600
|
+
tenantSlug = _ref91.tenantSlug, eventSlug = _ref91.eventSlug, dropId = _ref91.dropId;
|
|
2627
2601
|
if (!this.drops) {
|
|
2628
2602
|
this.drops = {};
|
|
2629
2603
|
}
|
|
@@ -2634,10 +2608,10 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
2634
2608
|
this.drops[tenantSlug][eventSlug] = {};
|
|
2635
2609
|
}
|
|
2636
2610
|
if (this.drops[tenantSlug][eventSlug][dropId]) {
|
|
2637
|
-
|
|
2611
|
+
_context46.next = 13;
|
|
2638
2612
|
break;
|
|
2639
2613
|
}
|
|
2640
|
-
|
|
2614
|
+
_context46.next = 7;
|
|
2641
2615
|
return this.client.ContentObjectMetadata({
|
|
2642
2616
|
libraryId: this.mainSiteLibraryId,
|
|
2643
2617
|
objectId: this.mainSiteId,
|
|
@@ -2649,15 +2623,15 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
2649
2623
|
select: [".", "drops"],
|
|
2650
2624
|
noAuth: true
|
|
2651
2625
|
});
|
|
2652
|
-
case
|
|
2653
|
-
|
|
2654
|
-
if (
|
|
2655
|
-
|
|
2626
|
+
case 7:
|
|
2627
|
+
_context46.t0 = _context46.sent;
|
|
2628
|
+
if (_context46.t0) {
|
|
2629
|
+
_context46.next = 10;
|
|
2656
2630
|
break;
|
|
2657
2631
|
}
|
|
2658
|
-
|
|
2659
|
-
case
|
|
2660
|
-
event =
|
|
2632
|
+
_context46.t0 = [];
|
|
2633
|
+
case 10:
|
|
2634
|
+
event = _context46.t0;
|
|
2661
2635
|
eventId = Utils.DecodeVersionHash(event["."].source).objectId;
|
|
2662
2636
|
event.drops.forEach(function (drop) {
|
|
2663
2637
|
drop = _objectSpread(_objectSpread({}, drop), {}, {
|
|
@@ -2666,32 +2640,32 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
2666
2640
|
_this.drops[tenantSlug][eventSlug][drop.uuid] = drop;
|
|
2667
2641
|
_this.drops[drop.uuid] = drop;
|
|
2668
2642
|
});
|
|
2669
|
-
case
|
|
2670
|
-
return
|
|
2671
|
-
case
|
|
2643
|
+
case 13:
|
|
2644
|
+
return _context46.abrupt("return", this.drops[dropId]);
|
|
2645
|
+
case 14:
|
|
2672
2646
|
case "end":
|
|
2673
|
-
return
|
|
2647
|
+
return _context46.stop();
|
|
2674
2648
|
}
|
|
2675
|
-
},
|
|
2649
|
+
}, _callee46, this);
|
|
2676
2650
|
}));
|
|
2677
|
-
return function (
|
|
2678
|
-
return
|
|
2651
|
+
return function (_x32) {
|
|
2652
|
+
return _ref92.apply(this, arguments);
|
|
2679
2653
|
};
|
|
2680
2654
|
}();
|
|
2681
2655
|
exports.SubmitDropVote = /*#__PURE__*/function () {
|
|
2682
|
-
var
|
|
2656
|
+
var _ref94 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(_ref93) {
|
|
2683
2657
|
var marketplaceParams, eventId, dropId, sku, marketplaceInfo;
|
|
2684
|
-
return _regeneratorRuntime.wrap(function (
|
|
2685
|
-
while (1) switch (
|
|
2658
|
+
return _regeneratorRuntime.wrap(function _callee47$(_context47) {
|
|
2659
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2686
2660
|
case 0:
|
|
2687
|
-
marketplaceParams =
|
|
2688
|
-
|
|
2661
|
+
marketplaceParams = _ref93.marketplaceParams, eventId = _ref93.eventId, dropId = _ref93.dropId, sku = _ref93.sku;
|
|
2662
|
+
_context47.next = 3;
|
|
2689
2663
|
return this.MarketplaceInfo({
|
|
2690
2664
|
marketplaceParams: marketplaceParams
|
|
2691
2665
|
});
|
|
2692
|
-
case
|
|
2693
|
-
marketplaceInfo =
|
|
2694
|
-
|
|
2666
|
+
case 3:
|
|
2667
|
+
marketplaceInfo = _context47.sent;
|
|
2668
|
+
_context47.next = 6;
|
|
2695
2669
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2696
2670
|
path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
|
|
2697
2671
|
method: "POST",
|
|
@@ -2705,25 +2679,25 @@ exports.SubmitDropVote = /*#__PURE__*/function () {
|
|
|
2705
2679
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
2706
2680
|
}
|
|
2707
2681
|
});
|
|
2708
|
-
case
|
|
2682
|
+
case 6:
|
|
2709
2683
|
case "end":
|
|
2710
|
-
return
|
|
2684
|
+
return _context47.stop();
|
|
2711
2685
|
}
|
|
2712
|
-
},
|
|
2686
|
+
}, _callee47, this);
|
|
2713
2687
|
}));
|
|
2714
|
-
return function (
|
|
2715
|
-
return
|
|
2688
|
+
return function (_x33) {
|
|
2689
|
+
return _ref94.apply(this, arguments);
|
|
2716
2690
|
};
|
|
2717
2691
|
}();
|
|
2718
2692
|
exports.DropStatus = /*#__PURE__*/function () {
|
|
2719
|
-
var
|
|
2720
|
-
var marketplace, eventId, dropId, response
|
|
2721
|
-
return _regeneratorRuntime.wrap(function (
|
|
2722
|
-
while (1) switch (
|
|
2693
|
+
var _ref96 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(_ref95) {
|
|
2694
|
+
var marketplace, eventId, dropId, response;
|
|
2695
|
+
return _regeneratorRuntime.wrap(function _callee48$(_context48) {
|
|
2696
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2723
2697
|
case 0:
|
|
2724
|
-
marketplace =
|
|
2725
|
-
|
|
2726
|
-
|
|
2698
|
+
marketplace = _ref95.marketplace, eventId = _ref95.eventId, dropId = _ref95.dropId;
|
|
2699
|
+
_context48.prev = 1;
|
|
2700
|
+
_context48.next = 4;
|
|
2727
2701
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2728
2702
|
path: UrlJoin("as", "wlt", "act", marketplace.tenant_id, eventId, dropId),
|
|
2729
2703
|
method: "GET",
|
|
@@ -2731,26 +2705,26 @@ exports.DropStatus = /*#__PURE__*/function () {
|
|
|
2731
2705
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
2732
2706
|
}
|
|
2733
2707
|
}));
|
|
2734
|
-
case
|
|
2735
|
-
response =
|
|
2736
|
-
return
|
|
2708
|
+
case 4:
|
|
2709
|
+
response = _context48.sent;
|
|
2710
|
+
return _context48.abrupt("return", response.sort(function (a, b) {
|
|
2737
2711
|
return a.ts > b.ts ? 1 : -1;
|
|
2738
2712
|
})[0] || {
|
|
2739
2713
|
status: "none"
|
|
2740
2714
|
});
|
|
2741
|
-
case
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
this.Log(
|
|
2745
|
-
return
|
|
2746
|
-
case
|
|
2715
|
+
case 8:
|
|
2716
|
+
_context48.prev = 8;
|
|
2717
|
+
_context48.t0 = _context48["catch"](1);
|
|
2718
|
+
this.Log(_context48.t0, true);
|
|
2719
|
+
return _context48.abrupt("return", "");
|
|
2720
|
+
case 12:
|
|
2747
2721
|
case "end":
|
|
2748
|
-
return
|
|
2722
|
+
return _context48.stop();
|
|
2749
2723
|
}
|
|
2750
|
-
},
|
|
2724
|
+
}, _callee48, this, [[1, 8]]);
|
|
2751
2725
|
}));
|
|
2752
|
-
return function (
|
|
2753
|
-
return
|
|
2726
|
+
return function (_x34) {
|
|
2727
|
+
return _ref96.apply(this, arguments);
|
|
2754
2728
|
};
|
|
2755
2729
|
}();
|
|
2756
2730
|
|
|
@@ -2772,12 +2746,12 @@ exports.DropStatus = /*#__PURE__*/function () {
|
|
|
2772
2746
|
* @returns {Promise<Array<Object>>} - Offers matching the specified filters
|
|
2773
2747
|
*/
|
|
2774
2748
|
exports.MarketplaceOffers = /*#__PURE__*/function () {
|
|
2775
|
-
var
|
|
2776
|
-
var contractAddress, tokenId, buyerAddress, sellerAddress, statuses,
|
|
2777
|
-
return _regeneratorRuntime.wrap(function (
|
|
2778
|
-
while (1) switch (
|
|
2749
|
+
var _ref98 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(_ref97) {
|
|
2750
|
+
var contractAddress, tokenId, buyerAddress, sellerAddress, statuses, _ref97$start, start, _ref97$limit, limit, path, queryParams, offers;
|
|
2751
|
+
return _regeneratorRuntime.wrap(function _callee49$(_context49) {
|
|
2752
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2779
2753
|
case 0:
|
|
2780
|
-
contractAddress =
|
|
2754
|
+
contractAddress = _ref97.contractAddress, tokenId = _ref97.tokenId, buyerAddress = _ref97.buyerAddress, sellerAddress = _ref97.sellerAddress, statuses = _ref97.statuses, _ref97$start = _ref97.start, start = _ref97$start === void 0 ? 0 : _ref97$start, _ref97$limit = _ref97.limit, limit = _ref97$limit === void 0 ? 10 : _ref97$limit;
|
|
2781
2755
|
path = UrlJoin("as", "mkt", "offers", "ls");
|
|
2782
2756
|
if (buyerAddress) {
|
|
2783
2757
|
path = UrlJoin(path, "b", Utils.FormatAddress(buyerAddress));
|
|
@@ -2797,29 +2771,29 @@ exports.MarketplaceOffers = /*#__PURE__*/function () {
|
|
|
2797
2771
|
if (statuses && statuses.length > 0) {
|
|
2798
2772
|
queryParams.include = statuses.join(",");
|
|
2799
2773
|
}
|
|
2800
|
-
|
|
2774
|
+
_context49.next = 8;
|
|
2801
2775
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2802
2776
|
path: path,
|
|
2803
2777
|
method: "GET",
|
|
2804
2778
|
queryParams: queryParams
|
|
2805
2779
|
}));
|
|
2806
|
-
case
|
|
2807
|
-
offers =
|
|
2808
|
-
return
|
|
2780
|
+
case 8:
|
|
2781
|
+
offers = _context49.sent;
|
|
2782
|
+
return _context49.abrupt("return", offers.map(function (offer) {
|
|
2809
2783
|
return _objectSpread(_objectSpread({}, offer), {}, {
|
|
2810
2784
|
created: offer.created * 1000,
|
|
2811
2785
|
updated: offer.updated * 1000,
|
|
2812
2786
|
expiration: offer.expiration * 1000
|
|
2813
2787
|
});
|
|
2814
2788
|
}));
|
|
2815
|
-
case
|
|
2789
|
+
case 10:
|
|
2816
2790
|
case "end":
|
|
2817
|
-
return
|
|
2791
|
+
return _context49.stop();
|
|
2818
2792
|
}
|
|
2819
|
-
},
|
|
2793
|
+
}, _callee49, this);
|
|
2820
2794
|
}));
|
|
2821
|
-
return function (
|
|
2822
|
-
return
|
|
2795
|
+
return function (_x35) {
|
|
2796
|
+
return _ref98.apply(this, arguments);
|
|
2823
2797
|
};
|
|
2824
2798
|
}();
|
|
2825
2799
|
|
|
@@ -2839,17 +2813,17 @@ exports.MarketplaceOffers = /*#__PURE__*/function () {
|
|
|
2839
2813
|
* @returns {Promise<Object>} - Info about the created/updated offer
|
|
2840
2814
|
*/
|
|
2841
2815
|
exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
|
|
2842
|
-
var
|
|
2816
|
+
var _ref100 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(_ref99) {
|
|
2843
2817
|
var contractAddress, tokenId, offerId, price, expiresAt, response;
|
|
2844
|
-
return _regeneratorRuntime.wrap(function (
|
|
2845
|
-
while (1) switch (
|
|
2818
|
+
return _regeneratorRuntime.wrap(function _callee50$(_context50) {
|
|
2819
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2846
2820
|
case 0:
|
|
2847
|
-
contractAddress =
|
|
2821
|
+
contractAddress = _ref99.contractAddress, tokenId = _ref99.tokenId, offerId = _ref99.offerId, price = _ref99.price, expiresAt = _ref99.expiresAt;
|
|
2848
2822
|
if (!offerId) {
|
|
2849
|
-
|
|
2823
|
+
_context50.next = 7;
|
|
2850
2824
|
break;
|
|
2851
2825
|
}
|
|
2852
|
-
|
|
2826
|
+
_context50.next = 4;
|
|
2853
2827
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2854
2828
|
path: UrlJoin("as", "wlt", "mkt", "offers", offerId),
|
|
2855
2829
|
method: "PUT",
|
|
@@ -2861,12 +2835,12 @@ exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2861
2835
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
2862
2836
|
}
|
|
2863
2837
|
}));
|
|
2864
|
-
case
|
|
2865
|
-
response =
|
|
2866
|
-
|
|
2838
|
+
case 4:
|
|
2839
|
+
response = _context50.sent;
|
|
2840
|
+
_context50.next = 10;
|
|
2867
2841
|
break;
|
|
2868
|
-
case
|
|
2869
|
-
|
|
2842
|
+
case 7:
|
|
2843
|
+
_context50.next = 9;
|
|
2870
2844
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2871
2845
|
path: UrlJoin("as", "wlt", "mkt", "offers", contractAddress, tokenId),
|
|
2872
2846
|
method: "POST",
|
|
@@ -2880,18 +2854,18 @@ exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2880
2854
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
2881
2855
|
}
|
|
2882
2856
|
}));
|
|
2883
|
-
case
|
|
2884
|
-
response =
|
|
2885
|
-
case
|
|
2886
|
-
return
|
|
2887
|
-
case
|
|
2857
|
+
case 9:
|
|
2858
|
+
response = _context50.sent;
|
|
2859
|
+
case 10:
|
|
2860
|
+
return _context50.abrupt("return", response.offer_id);
|
|
2861
|
+
case 11:
|
|
2888
2862
|
case "end":
|
|
2889
|
-
return
|
|
2863
|
+
return _context50.stop();
|
|
2890
2864
|
}
|
|
2891
|
-
},
|
|
2865
|
+
}, _callee50, this);
|
|
2892
2866
|
}));
|
|
2893
|
-
return function (
|
|
2894
|
-
return
|
|
2867
|
+
return function (_x36) {
|
|
2868
|
+
return _ref100.apply(this, arguments);
|
|
2895
2869
|
};
|
|
2896
2870
|
}();
|
|
2897
2871
|
|
|
@@ -2905,13 +2879,13 @@ exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2905
2879
|
* @param {string} offerId - The ID of the offer
|
|
2906
2880
|
*/
|
|
2907
2881
|
exports.RemoveMarketplaceOffer = /*#__PURE__*/function () {
|
|
2908
|
-
var
|
|
2882
|
+
var _ref102 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(_ref101) {
|
|
2909
2883
|
var offerId;
|
|
2910
|
-
return _regeneratorRuntime.wrap(function (
|
|
2911
|
-
while (1) switch (
|
|
2884
|
+
return _regeneratorRuntime.wrap(function _callee51$(_context51) {
|
|
2885
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2912
2886
|
case 0:
|
|
2913
|
-
offerId =
|
|
2914
|
-
|
|
2887
|
+
offerId = _ref101.offerId;
|
|
2888
|
+
_context51.next = 3;
|
|
2915
2889
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2916
2890
|
path: UrlJoin("as", "wlt", "mkt", "offers", offerId),
|
|
2917
2891
|
method: "DELETE",
|
|
@@ -2919,16 +2893,16 @@ exports.RemoveMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2919
2893
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
2920
2894
|
}
|
|
2921
2895
|
});
|
|
2922
|
-
case
|
|
2923
|
-
return
|
|
2924
|
-
case
|
|
2896
|
+
case 3:
|
|
2897
|
+
return _context51.abrupt("return", _context51.sent);
|
|
2898
|
+
case 4:
|
|
2925
2899
|
case "end":
|
|
2926
|
-
return
|
|
2900
|
+
return _context51.stop();
|
|
2927
2901
|
}
|
|
2928
|
-
},
|
|
2902
|
+
}, _callee51, this);
|
|
2929
2903
|
}));
|
|
2930
|
-
return function (
|
|
2931
|
-
return
|
|
2904
|
+
return function (_x37) {
|
|
2905
|
+
return _ref102.apply(this, arguments);
|
|
2932
2906
|
};
|
|
2933
2907
|
}();
|
|
2934
2908
|
|
|
@@ -2942,13 +2916,13 @@ exports.RemoveMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2942
2916
|
* @param {string} offerId - The ID of the offer
|
|
2943
2917
|
*/
|
|
2944
2918
|
exports.AcceptMarketplaceOffer = /*#__PURE__*/function () {
|
|
2945
|
-
var
|
|
2919
|
+
var _ref104 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(_ref103) {
|
|
2946
2920
|
var offerId;
|
|
2947
|
-
return _regeneratorRuntime.wrap(function (
|
|
2948
|
-
while (1) switch (
|
|
2921
|
+
return _regeneratorRuntime.wrap(function _callee52$(_context52) {
|
|
2922
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2949
2923
|
case 0:
|
|
2950
|
-
offerId =
|
|
2951
|
-
|
|
2924
|
+
offerId = _ref103.offerId;
|
|
2925
|
+
_context52.next = 3;
|
|
2952
2926
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2953
2927
|
path: UrlJoin("as", "wlt", "mkt", "offers", "accept", offerId),
|
|
2954
2928
|
method: "PUT",
|
|
@@ -2956,16 +2930,16 @@ exports.AcceptMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2956
2930
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
2957
2931
|
}
|
|
2958
2932
|
});
|
|
2959
|
-
case
|
|
2960
|
-
return
|
|
2961
|
-
case
|
|
2933
|
+
case 3:
|
|
2934
|
+
return _context52.abrupt("return", _context52.sent);
|
|
2935
|
+
case 4:
|
|
2962
2936
|
case "end":
|
|
2963
|
-
return
|
|
2937
|
+
return _context52.stop();
|
|
2964
2938
|
}
|
|
2965
|
-
},
|
|
2939
|
+
}, _callee52, this);
|
|
2966
2940
|
}));
|
|
2967
|
-
return function (
|
|
2968
|
-
return
|
|
2941
|
+
return function (_x38) {
|
|
2942
|
+
return _ref104.apply(this, arguments);
|
|
2969
2943
|
};
|
|
2970
2944
|
}();
|
|
2971
2945
|
|
|
@@ -2979,13 +2953,13 @@ exports.AcceptMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2979
2953
|
* @param {string} offerId - The ID of the offer
|
|
2980
2954
|
*/
|
|
2981
2955
|
exports.RejectMarketplaceOffer = /*#__PURE__*/function () {
|
|
2982
|
-
var
|
|
2956
|
+
var _ref106 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(_ref105) {
|
|
2983
2957
|
var offerId;
|
|
2984
|
-
return _regeneratorRuntime.wrap(function (
|
|
2985
|
-
while (1) switch (
|
|
2958
|
+
return _regeneratorRuntime.wrap(function _callee53$(_context53) {
|
|
2959
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2986
2960
|
case 0:
|
|
2987
|
-
offerId =
|
|
2988
|
-
|
|
2961
|
+
offerId = _ref105.offerId;
|
|
2962
|
+
_context53.next = 3;
|
|
2989
2963
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2990
2964
|
path: UrlJoin("as", "wlt", "mkt", "offers", "decline", offerId),
|
|
2991
2965
|
method: "PUT",
|
|
@@ -2993,16 +2967,16 @@ exports.RejectMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
2993
2967
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
2994
2968
|
}
|
|
2995
2969
|
});
|
|
2996
|
-
case
|
|
2997
|
-
return
|
|
2998
|
-
case
|
|
2970
|
+
case 3:
|
|
2971
|
+
return _context53.abrupt("return", _context53.sent);
|
|
2972
|
+
case 4:
|
|
2999
2973
|
case "end":
|
|
3000
|
-
return
|
|
2974
|
+
return _context53.stop();
|
|
3001
2975
|
}
|
|
3002
|
-
},
|
|
2976
|
+
}, _callee53, this);
|
|
3003
2977
|
}));
|
|
3004
|
-
return function (
|
|
3005
|
-
return
|
|
2978
|
+
return function (_x39) {
|
|
2979
|
+
return _ref106.apply(this, arguments);
|
|
3006
2980
|
};
|
|
3007
2981
|
}();
|
|
3008
2982
|
|
|
@@ -3019,29 +2993,29 @@ exports.RejectMarketplaceOffer = /*#__PURE__*/function () {
|
|
|
3019
2993
|
* @returns {Promise<Object>} - Info about the voting event, including the current user's votes and the current total voting tally
|
|
3020
2994
|
*/
|
|
3021
2995
|
exports.VoteStatus = /*#__PURE__*/function () {
|
|
3022
|
-
var
|
|
2996
|
+
var _ref108 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(_ref107) {
|
|
3023
2997
|
var tenantId, votingEventId;
|
|
3024
|
-
return _regeneratorRuntime.wrap(function (
|
|
3025
|
-
while (1) switch (
|
|
2998
|
+
return _regeneratorRuntime.wrap(function _callee54$(_context54) {
|
|
2999
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
3026
3000
|
case 0:
|
|
3027
|
-
tenantId =
|
|
3028
|
-
|
|
3001
|
+
tenantId = _ref107.tenantId, votingEventId = _ref107.votingEventId;
|
|
3002
|
+
_context54.next = 3;
|
|
3029
3003
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
3030
3004
|
path: UrlJoin("as", "votes", tenantId, votingEventId),
|
|
3031
3005
|
headers: {
|
|
3032
3006
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
3033
3007
|
}
|
|
3034
3008
|
}));
|
|
3035
|
-
case
|
|
3036
|
-
return
|
|
3037
|
-
case
|
|
3009
|
+
case 3:
|
|
3010
|
+
return _context54.abrupt("return", _context54.sent);
|
|
3011
|
+
case 4:
|
|
3038
3012
|
case "end":
|
|
3039
|
-
return
|
|
3013
|
+
return _context54.stop();
|
|
3040
3014
|
}
|
|
3041
|
-
},
|
|
3015
|
+
}, _callee54, this);
|
|
3042
3016
|
}));
|
|
3043
|
-
return function (
|
|
3044
|
-
return
|
|
3017
|
+
return function (_x40) {
|
|
3018
|
+
return _ref108.apply(this, arguments);
|
|
3045
3019
|
};
|
|
3046
3020
|
}();
|
|
3047
3021
|
|
|
@@ -3059,13 +3033,13 @@ exports.VoteStatus = /*#__PURE__*/function () {
|
|
|
3059
3033
|
* @returns {Promise<Object>} - Info about the voting event, including the current user's votes and the current total voting tally
|
|
3060
3034
|
*/
|
|
3061
3035
|
exports.CastVote = /*#__PURE__*/function () {
|
|
3062
|
-
var
|
|
3036
|
+
var _ref110 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(_ref109) {
|
|
3063
3037
|
var tenantId, votingEventId, sku;
|
|
3064
|
-
return _regeneratorRuntime.wrap(function (
|
|
3065
|
-
while (1) switch (
|
|
3038
|
+
return _regeneratorRuntime.wrap(function _callee55$(_context55) {
|
|
3039
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
3066
3040
|
case 0:
|
|
3067
|
-
tenantId =
|
|
3068
|
-
|
|
3041
|
+
tenantId = _ref109.tenantId, votingEventId = _ref109.votingEventId, sku = _ref109.sku;
|
|
3042
|
+
_context55.next = 3;
|
|
3069
3043
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
3070
3044
|
path: UrlJoin("as", "votes", tenantId, votingEventId, sku),
|
|
3071
3045
|
method: "POST",
|
|
@@ -3073,16 +3047,16 @@ exports.CastVote = /*#__PURE__*/function () {
|
|
|
3073
3047
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
3074
3048
|
}
|
|
3075
3049
|
}));
|
|
3076
|
-
case
|
|
3077
|
-
return
|
|
3078
|
-
case
|
|
3050
|
+
case 3:
|
|
3051
|
+
return _context55.abrupt("return", _context55.sent);
|
|
3052
|
+
case 4:
|
|
3079
3053
|
case "end":
|
|
3080
|
-
return
|
|
3054
|
+
return _context55.stop();
|
|
3081
3055
|
}
|
|
3082
|
-
},
|
|
3056
|
+
}, _callee55, this);
|
|
3083
3057
|
}));
|
|
3084
|
-
return function (
|
|
3085
|
-
return
|
|
3058
|
+
return function (_x41) {
|
|
3059
|
+
return _ref110.apply(this, arguments);
|
|
3086
3060
|
};
|
|
3087
3061
|
}();
|
|
3088
3062
|
|
|
@@ -3100,13 +3074,13 @@ exports.CastVote = /*#__PURE__*/function () {
|
|
|
3100
3074
|
* @returns {Promise<Object>} - Info about the voting event, including the current user's votes and the current total voting tally
|
|
3101
3075
|
*/
|
|
3102
3076
|
exports.RevokeVote = /*#__PURE__*/function () {
|
|
3103
|
-
var
|
|
3077
|
+
var _ref112 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(_ref111) {
|
|
3104
3078
|
var tenantId, votingEventId, sku;
|
|
3105
|
-
return _regeneratorRuntime.wrap(function (
|
|
3106
|
-
while (1) switch (
|
|
3079
|
+
return _regeneratorRuntime.wrap(function _callee56$(_context56) {
|
|
3080
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
3107
3081
|
case 0:
|
|
3108
|
-
tenantId =
|
|
3109
|
-
|
|
3082
|
+
tenantId = _ref111.tenantId, votingEventId = _ref111.votingEventId, sku = _ref111.sku;
|
|
3083
|
+
_context56.next = 3;
|
|
3110
3084
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
3111
3085
|
path: UrlJoin("as", "votes", tenantId, votingEventId, sku),
|
|
3112
3086
|
method: "DELETE",
|
|
@@ -3114,15 +3088,15 @@ exports.RevokeVote = /*#__PURE__*/function () {
|
|
|
3114
3088
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
3115
3089
|
}
|
|
3116
3090
|
}));
|
|
3117
|
-
case
|
|
3118
|
-
return
|
|
3119
|
-
case
|
|
3091
|
+
case 3:
|
|
3092
|
+
return _context56.abrupt("return", _context56.sent);
|
|
3093
|
+
case 4:
|
|
3120
3094
|
case "end":
|
|
3121
|
-
return
|
|
3095
|
+
return _context56.stop();
|
|
3122
3096
|
}
|
|
3123
|
-
},
|
|
3097
|
+
}, _callee56, this);
|
|
3124
3098
|
}));
|
|
3125
|
-
return function (
|
|
3126
|
-
return
|
|
3099
|
+
return function (_x42) {
|
|
3100
|
+
return _ref112.apply(this, arguments);
|
|
3127
3101
|
};
|
|
3128
3102
|
}();
|