@eluvio/elv-client-js 3.2.15 → 3.2.19
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/ElvWalletClient-min.js +9 -9
- package/dist/ElvWalletClient-node-min.js +10 -10
- package/dist/src/walletClient/ClientMethods.js +793 -481
- package/dist/src/walletClient/Configuration.js +2 -0
- package/dist/src/walletClient/Profile.js +368 -0
- package/dist/src/walletClient/Utils.js +33 -29
- package/dist/src/walletClient/index.js +90 -63
- package/package-lock.json +42401 -0
- package/package.json +1 -1
- package/src/walletClient/ClientMethods.js +151 -13
- package/src/walletClient/Configuration.js +2 -0
- package/src/walletClient/Profile.js +182 -0
- package/src/walletClient/Utils.js +29 -24
- package/src/walletClient/index.js +39 -18
|
@@ -72,7 +72,7 @@ exports.UserAddress = function () {
|
|
|
72
72
|
* Retrieve the fund balances for the current user
|
|
73
73
|
*
|
|
74
74
|
* @methodGroup User
|
|
75
|
-
* @returns {Promise<
|
|
75
|
+
* @returns {Promise<Object>} - Returns balances for the user. All values are in USD.
|
|
76
76
|
* <ul>
|
|
77
77
|
* <li>- totalWalletBalance - Total balance of the users sales and wallet balance purchases</li>
|
|
78
78
|
* <li>- availableWalletBalance - Balance available for purchasing items</li>
|
|
@@ -280,13 +280,233 @@ exports.UserItemInfo = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
|
|
|
280
280
|
}
|
|
281
281
|
}, _callee2, this);
|
|
282
282
|
}));
|
|
283
|
+
/**
|
|
284
|
+
* Retrieve all valid names for filtering user items. Full item names are required for filtering results by name.
|
|
285
|
+
*
|
|
286
|
+
* Specify marketplace information to filter the results to only items offered in that marketplace.
|
|
287
|
+
*
|
|
288
|
+
* @methodGroup User
|
|
289
|
+
* @namedParams
|
|
290
|
+
* @param {string=} userAddress - Address of a user
|
|
291
|
+
* @param {Object=} marketplaceParams - Parameters of a marketplace to filter results by
|
|
292
|
+
*
|
|
293
|
+
* @returns {Promise<Array<String>>} - A list of item names
|
|
294
|
+
*/
|
|
295
|
+
|
|
296
|
+
exports.UserItemNames = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
297
|
+
var _ref5,
|
|
298
|
+
marketplaceParams,
|
|
299
|
+
userAddress,
|
|
300
|
+
filters,
|
|
301
|
+
_args3 = arguments;
|
|
302
|
+
|
|
303
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
304
|
+
while (1) {
|
|
305
|
+
switch (_context3.prev = _context3.next) {
|
|
306
|
+
case 0:
|
|
307
|
+
_ref5 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, marketplaceParams = _ref5.marketplaceParams, userAddress = _ref5.userAddress;
|
|
308
|
+
filters = [];
|
|
309
|
+
|
|
310
|
+
if (!marketplaceParams) {
|
|
311
|
+
_context3.next = 10;
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
_context3.t0 = filters;
|
|
316
|
+
_context3.t1 = "tenant:eq:";
|
|
317
|
+
_context3.next = 7;
|
|
318
|
+
return this.MarketplaceInfo({
|
|
319
|
+
marketplaceParams: marketplaceParams
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
case 7:
|
|
323
|
+
_context3.t2 = _context3.sent.tenantId;
|
|
324
|
+
_context3.t3 = _context3.t1.concat.call(_context3.t1, _context3.t2);
|
|
325
|
+
|
|
326
|
+
_context3.t0.push.call(_context3.t0, _context3.t3);
|
|
327
|
+
|
|
328
|
+
case 10:
|
|
329
|
+
if (userAddress) {
|
|
330
|
+
filters.push("wlt:eq:".concat(Utils.FormatAddress(userAddress)));
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
_context3.t4 = Utils;
|
|
334
|
+
_context3.next = 14;
|
|
335
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
336
|
+
path: UrlJoin("as", "wlt", "names"),
|
|
337
|
+
method: "GET",
|
|
338
|
+
queryParams: {
|
|
339
|
+
filter: filters
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
case 14:
|
|
344
|
+
_context3.t5 = _context3.sent;
|
|
345
|
+
_context3.next = 17;
|
|
346
|
+
return _context3.t4.ResponseToJson.call(_context3.t4, _context3.t5);
|
|
347
|
+
|
|
348
|
+
case 17:
|
|
349
|
+
return _context3.abrupt("return", _context3.sent);
|
|
350
|
+
|
|
351
|
+
case 18:
|
|
352
|
+
case "end":
|
|
353
|
+
return _context3.stop();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}, _callee3, this);
|
|
357
|
+
}));
|
|
358
|
+
/**
|
|
359
|
+
* Retrieve all valid edition names for filtering the specified item. Full edition names are required for filtering results by edition.
|
|
360
|
+
*
|
|
361
|
+
* Specify marketplace information to filter the results to only items offered in that marketplace.
|
|
362
|
+
*
|
|
363
|
+
* @methodGroup User
|
|
364
|
+
* @namedParams
|
|
365
|
+
* @param {string} displayName - Name of an item
|
|
366
|
+
*
|
|
367
|
+
* @returns {Promise<Array<String>>} - A list of item editions
|
|
368
|
+
*/
|
|
369
|
+
|
|
370
|
+
exports.UserItemEditionNames = /*#__PURE__*/function () {
|
|
371
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref6) {
|
|
372
|
+
var displayName;
|
|
373
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
374
|
+
while (1) {
|
|
375
|
+
switch (_context4.prev = _context4.next) {
|
|
376
|
+
case 0:
|
|
377
|
+
displayName = _ref6.displayName;
|
|
378
|
+
_context4.t0 = Utils;
|
|
379
|
+
_context4.next = 4;
|
|
380
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
381
|
+
path: UrlJoin("as", "wlt", "editions"),
|
|
382
|
+
method: "GET",
|
|
383
|
+
queryParams: {
|
|
384
|
+
filter: "meta/display_name:eq:".concat(displayName)
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
case 4:
|
|
389
|
+
_context4.t1 = _context4.sent;
|
|
390
|
+
_context4.next = 7;
|
|
391
|
+
return _context4.t0.ResponseToJson.call(_context4.t0, _context4.t1);
|
|
392
|
+
|
|
393
|
+
case 7:
|
|
394
|
+
return _context4.abrupt("return", _context4.sent);
|
|
395
|
+
|
|
396
|
+
case 8:
|
|
397
|
+
case "end":
|
|
398
|
+
return _context4.stop();
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}, _callee4, this);
|
|
402
|
+
}));
|
|
403
|
+
|
|
404
|
+
return function (_x) {
|
|
405
|
+
return _ref7.apply(this, arguments);
|
|
406
|
+
};
|
|
407
|
+
}();
|
|
408
|
+
/**
|
|
409
|
+
* Retrieve all valid attribute names and values. Full attribute names and values are required for filtering results by attribute.
|
|
410
|
+
*
|
|
411
|
+
* Specify marketplace information to filter the results to only items offered in that marketplace.
|
|
412
|
+
*
|
|
413
|
+
* @methodGroup User
|
|
414
|
+
* @namedParams
|
|
415
|
+
* @param {string=} userAddress - Address of a user
|
|
416
|
+
* @param {string=} displayName - Name of an item
|
|
417
|
+
* @param {Object=} marketplaceParams - Parameters of a marketplace to filter results by
|
|
418
|
+
*
|
|
419
|
+
* @returns {Promise<Array<String>>} - A list of item names
|
|
420
|
+
*/
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
exports.UserItemAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
424
|
+
var _ref9,
|
|
425
|
+
marketplaceParams,
|
|
426
|
+
displayName,
|
|
427
|
+
userAddress,
|
|
428
|
+
filters,
|
|
429
|
+
attributes,
|
|
430
|
+
_args5 = arguments;
|
|
431
|
+
|
|
432
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
433
|
+
while (1) {
|
|
434
|
+
switch (_context5.prev = _context5.next) {
|
|
435
|
+
case 0:
|
|
436
|
+
_ref9 = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}, marketplaceParams = _ref9.marketplaceParams, displayName = _ref9.displayName, userAddress = _ref9.userAddress;
|
|
437
|
+
filters = [];
|
|
438
|
+
|
|
439
|
+
if (!marketplaceParams) {
|
|
440
|
+
_context5.next = 10;
|
|
441
|
+
break;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
_context5.t0 = filters;
|
|
445
|
+
_context5.t1 = "tenant:eq:";
|
|
446
|
+
_context5.next = 7;
|
|
447
|
+
return this.MarketplaceInfo({
|
|
448
|
+
marketplaceParams: marketplaceParams
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
case 7:
|
|
452
|
+
_context5.t2 = _context5.sent.tenantId;
|
|
453
|
+
_context5.t3 = _context5.t1.concat.call(_context5.t1, _context5.t2);
|
|
454
|
+
|
|
455
|
+
_context5.t0.push.call(_context5.t0, _context5.t3);
|
|
456
|
+
|
|
457
|
+
case 10:
|
|
458
|
+
if (userAddress) {
|
|
459
|
+
filters.push("wlt:eq:".concat(Utils.FormatAddress(userAddress)));
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
if (displayName) {
|
|
463
|
+
filters.push("meta/display_name:eq:".concat(displayName));
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
_context5.t4 = Utils;
|
|
467
|
+
_context5.next = 15;
|
|
468
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
469
|
+
path: UrlJoin("as", "wlt", "attributes"),
|
|
470
|
+
method: "GET",
|
|
471
|
+
queryParams: {
|
|
472
|
+
filter: filters
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
case 15:
|
|
477
|
+
_context5.t5 = _context5.sent;
|
|
478
|
+
_context5.next = 18;
|
|
479
|
+
return _context5.t4.ResponseToJson.call(_context5.t4, _context5.t5);
|
|
480
|
+
|
|
481
|
+
case 18:
|
|
482
|
+
attributes = _context5.sent;
|
|
483
|
+
return _context5.abrupt("return", attributes.map(function (_ref10) {
|
|
484
|
+
var trait_type = _ref10.trait_type,
|
|
485
|
+
values = _ref10.values;
|
|
486
|
+
return {
|
|
487
|
+
name: trait_type,
|
|
488
|
+
values: values
|
|
489
|
+
};
|
|
490
|
+
}).filter(function (_ref11) {
|
|
491
|
+
var name = _ref11.name;
|
|
492
|
+
return !["Content Fabric Hash", "Total Minted Supply", "Creator"].includes(name);
|
|
493
|
+
}));
|
|
494
|
+
|
|
495
|
+
case 20:
|
|
496
|
+
case "end":
|
|
497
|
+
return _context5.stop();
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}, _callee5, this);
|
|
501
|
+
}));
|
|
283
502
|
/**
|
|
284
503
|
* <b><i>Requires login</i></b>
|
|
285
504
|
*
|
|
286
|
-
* Retrieve items owned by the current user matching the specified parameters.
|
|
505
|
+
* Retrieve items owned by the specified or current user matching the specified parameters.
|
|
287
506
|
*
|
|
288
507
|
* @methodGroup User
|
|
289
508
|
* @namedParams
|
|
509
|
+
* @param {string=} userAddress - Address of a user. If not specified, will return results for current user
|
|
290
510
|
* @param {integer=} start=0 - PAGINATION: Index from which the results should start
|
|
291
511
|
* @param {integer=} limit=50 - PAGINATION: Maximum number of results to return
|
|
292
512
|
* @param {string=} sortBy="created" - Sort order. Options: `default`, `meta/display_name`
|
|
@@ -300,28 +520,29 @@ exports.UserItemInfo = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
|
|
|
300
520
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
301
521
|
*/
|
|
302
522
|
|
|
303
|
-
exports.UserItems = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
304
|
-
var
|
|
305
|
-
return _regeneratorRuntime.wrap(function
|
|
523
|
+
exports.UserItems = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
524
|
+
var _args6 = arguments;
|
|
525
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
306
526
|
while (1) {
|
|
307
|
-
switch (
|
|
527
|
+
switch (_context6.prev = _context6.next) {
|
|
308
528
|
case 0:
|
|
309
|
-
return
|
|
529
|
+
return _context6.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
310
530
|
mode: "owned"
|
|
311
|
-
},
|
|
531
|
+
}, _args6[0] || {})));
|
|
312
532
|
|
|
313
533
|
case 1:
|
|
314
534
|
case "end":
|
|
315
|
-
return
|
|
535
|
+
return _context6.stop();
|
|
316
536
|
}
|
|
317
537
|
}
|
|
318
|
-
},
|
|
538
|
+
}, _callee6, this);
|
|
319
539
|
}));
|
|
320
540
|
/**
|
|
321
541
|
* Return all listings for the current user. Not paginated.
|
|
322
542
|
*
|
|
323
543
|
* @methodGroup User
|
|
324
544
|
* @namedParams
|
|
545
|
+
* @param {string=} userAddress - Address of a user. If not specified, will return results for current user
|
|
325
546
|
* @param {string=} sortBy="created" - Sort order. Options: `created`, `info/token_id`, `info/ordinal`, `price`, `nft/display_name`
|
|
326
547
|
* @param {boolean=} sortDesc=false - Sort results descending instead of ascending
|
|
327
548
|
* @param {Object=} marketplaceParams - Filter results by marketplace
|
|
@@ -331,50 +552,53 @@ exports.UserItems = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
|
|
|
331
552
|
* @returns {Promise<Array<Object>>} - List of current user's listings
|
|
332
553
|
*/
|
|
333
554
|
|
|
334
|
-
exports.UserListings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
335
|
-
var
|
|
336
|
-
|
|
555
|
+
exports.UserListings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
556
|
+
var _ref14,
|
|
557
|
+
userAddress,
|
|
558
|
+
_ref14$sortBy,
|
|
337
559
|
sortBy,
|
|
338
|
-
|
|
560
|
+
_ref14$sortDesc,
|
|
339
561
|
sortDesc,
|
|
340
562
|
contractAddress,
|
|
341
563
|
tokenId,
|
|
342
564
|
marketplaceParams,
|
|
343
|
-
|
|
565
|
+
_args7 = arguments;
|
|
344
566
|
|
|
345
|
-
return _regeneratorRuntime.wrap(function
|
|
567
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
346
568
|
while (1) {
|
|
347
|
-
switch (
|
|
569
|
+
switch (_context7.prev = _context7.next) {
|
|
348
570
|
case 0:
|
|
349
|
-
|
|
350
|
-
|
|
571
|
+
_ref14 = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}, userAddress = _ref14.userAddress, _ref14$sortBy = _ref14.sortBy, sortBy = _ref14$sortBy === void 0 ? "created" : _ref14$sortBy, _ref14$sortDesc = _ref14.sortDesc, sortDesc = _ref14$sortDesc === void 0 ? false : _ref14$sortDesc, contractAddress = _ref14.contractAddress, tokenId = _ref14.tokenId, marketplaceParams = _ref14.marketplaceParams;
|
|
572
|
+
_context7.next = 3;
|
|
351
573
|
return this.FilteredQuery({
|
|
352
574
|
mode: "listings",
|
|
353
575
|
start: 0,
|
|
354
576
|
limit: 10000,
|
|
355
577
|
sortBy: sortBy,
|
|
356
578
|
sortDesc: sortDesc,
|
|
357
|
-
sellerAddress: this.UserAddress(),
|
|
579
|
+
sellerAddress: userAddress || this.UserAddress(),
|
|
358
580
|
marketplaceParams: marketplaceParams,
|
|
359
581
|
contractAddress: contractAddress,
|
|
360
|
-
tokenId: tokenId
|
|
582
|
+
tokenId: tokenId,
|
|
583
|
+
includeCheckoutLocked: true
|
|
361
584
|
});
|
|
362
585
|
|
|
363
586
|
case 3:
|
|
364
|
-
return
|
|
587
|
+
return _context7.abrupt("return", _context7.sent.results);
|
|
365
588
|
|
|
366
589
|
case 4:
|
|
367
590
|
case "end":
|
|
368
|
-
return
|
|
591
|
+
return _context7.stop();
|
|
369
592
|
}
|
|
370
593
|
}
|
|
371
|
-
},
|
|
594
|
+
}, _callee7, this);
|
|
372
595
|
}));
|
|
373
596
|
/**
|
|
374
597
|
* Return all sales for the current user. Not paginated.
|
|
375
598
|
*
|
|
376
599
|
* @methodGroup User
|
|
377
600
|
* @namedParams
|
|
601
|
+
* @param {string=} userAddress - Address of a user. If not specified, will return results for current user
|
|
378
602
|
* @param {string=} sortBy="created" - Sort order. Options: `created`, `price`, `name`
|
|
379
603
|
* @param {boolean=} sortDesc=false - Sort results descending instead of ascending
|
|
380
604
|
* @param {Object=} marketplaceParams - Filter results by marketplace
|
|
@@ -385,50 +609,52 @@ exports.UserListings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
|
|
|
385
609
|
* @returns {Promise<Array<Object>>} - List of current user's sales
|
|
386
610
|
*/
|
|
387
611
|
|
|
388
|
-
exports.UserSales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
389
|
-
var
|
|
390
|
-
|
|
612
|
+
exports.UserSales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
613
|
+
var _ref16,
|
|
614
|
+
userAddress,
|
|
615
|
+
_ref16$sortBy,
|
|
391
616
|
sortBy,
|
|
392
|
-
|
|
617
|
+
_ref16$sortDesc,
|
|
393
618
|
sortDesc,
|
|
394
619
|
contractAddress,
|
|
395
620
|
tokenId,
|
|
396
621
|
marketplaceParams,
|
|
397
|
-
|
|
622
|
+
_args8 = arguments;
|
|
398
623
|
|
|
399
|
-
return _regeneratorRuntime.wrap(function
|
|
624
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
400
625
|
while (1) {
|
|
401
|
-
switch (
|
|
626
|
+
switch (_context8.prev = _context8.next) {
|
|
402
627
|
case 0:
|
|
403
|
-
|
|
404
|
-
|
|
628
|
+
_ref16 = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {}, userAddress = _ref16.userAddress, _ref16$sortBy = _ref16.sortBy, sortBy = _ref16$sortBy === void 0 ? "created" : _ref16$sortBy, _ref16$sortDesc = _ref16.sortDesc, sortDesc = _ref16$sortDesc === void 0 ? false : _ref16$sortDesc, contractAddress = _ref16.contractAddress, tokenId = _ref16.tokenId, marketplaceParams = _ref16.marketplaceParams;
|
|
629
|
+
_context8.next = 3;
|
|
405
630
|
return this.FilteredQuery({
|
|
406
631
|
mode: "sales",
|
|
407
632
|
start: 0,
|
|
408
633
|
limit: 10000,
|
|
409
634
|
sortBy: sortBy,
|
|
410
635
|
sortDesc: sortDesc,
|
|
411
|
-
sellerAddress: this.UserAddress(),
|
|
636
|
+
sellerAddress: userAddress || this.UserAddress(),
|
|
412
637
|
marketplaceParams: marketplaceParams,
|
|
413
638
|
contractAddress: contractAddress,
|
|
414
639
|
tokenId: tokenId
|
|
415
640
|
});
|
|
416
641
|
|
|
417
642
|
case 3:
|
|
418
|
-
return
|
|
643
|
+
return _context8.abrupt("return", _context8.sent.results);
|
|
419
644
|
|
|
420
645
|
case 4:
|
|
421
646
|
case "end":
|
|
422
|
-
return
|
|
647
|
+
return _context8.stop();
|
|
423
648
|
}
|
|
424
649
|
}
|
|
425
|
-
},
|
|
650
|
+
}, _callee8, this);
|
|
426
651
|
}));
|
|
427
652
|
/**
|
|
428
653
|
* Return all transfers and sales for the current user. Not paginated.
|
|
429
654
|
*
|
|
430
655
|
* @methodGroup User
|
|
431
656
|
* @namedParams
|
|
657
|
+
* @param {string=} userAddress - Address of a user. If not specified, will return results for current user
|
|
432
658
|
* @param {string=} sortBy="created" - Sort order. Options: `created`, `price`, `name`
|
|
433
659
|
* @param {boolean=} sortDesc=false - Sort results descending instead of ascending
|
|
434
660
|
* @param {Object=} marketplaceParams - Filter results by marketplace
|
|
@@ -439,44 +665,45 @@ exports.UserSales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
|
|
|
439
665
|
* @returns {Promise<Array<Object>>} - List of current user's sales
|
|
440
666
|
*/
|
|
441
667
|
|
|
442
|
-
exports.UserTransfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
443
|
-
var
|
|
444
|
-
|
|
668
|
+
exports.UserTransfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
669
|
+
var _ref18,
|
|
670
|
+
userAddress,
|
|
671
|
+
_ref18$sortBy,
|
|
445
672
|
sortBy,
|
|
446
|
-
|
|
673
|
+
_ref18$sortDesc,
|
|
447
674
|
sortDesc,
|
|
448
675
|
contractAddress,
|
|
449
676
|
tokenId,
|
|
450
677
|
marketplaceParams,
|
|
451
|
-
|
|
678
|
+
_args9 = arguments;
|
|
452
679
|
|
|
453
|
-
return _regeneratorRuntime.wrap(function
|
|
680
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
454
681
|
while (1) {
|
|
455
|
-
switch (
|
|
682
|
+
switch (_context9.prev = _context9.next) {
|
|
456
683
|
case 0:
|
|
457
|
-
|
|
458
|
-
|
|
684
|
+
_ref18 = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {}, userAddress = _ref18.userAddress, _ref18$sortBy = _ref18.sortBy, sortBy = _ref18$sortBy === void 0 ? "created" : _ref18$sortBy, _ref18$sortDesc = _ref18.sortDesc, sortDesc = _ref18$sortDesc === void 0 ? false : _ref18$sortDesc, contractAddress = _ref18.contractAddress, tokenId = _ref18.tokenId, marketplaceParams = _ref18.marketplaceParams;
|
|
685
|
+
_context9.next = 3;
|
|
459
686
|
return this.FilteredQuery({
|
|
460
687
|
mode: "transfers",
|
|
461
688
|
start: 0,
|
|
462
689
|
limit: 10000,
|
|
463
690
|
sortBy: sortBy,
|
|
464
691
|
sortDesc: sortDesc,
|
|
465
|
-
sellerAddress: this.UserAddress(),
|
|
692
|
+
sellerAddress: userAddress || this.UserAddress(),
|
|
466
693
|
marketplaceParams: marketplaceParams,
|
|
467
694
|
contractAddress: contractAddress,
|
|
468
695
|
tokenId: tokenId
|
|
469
696
|
});
|
|
470
697
|
|
|
471
698
|
case 3:
|
|
472
|
-
return
|
|
699
|
+
return _context9.abrupt("return", _context9.sent.results);
|
|
473
700
|
|
|
474
701
|
case 4:
|
|
475
702
|
case "end":
|
|
476
|
-
return
|
|
703
|
+
return _context9.stop();
|
|
477
704
|
}
|
|
478
705
|
}
|
|
479
|
-
},
|
|
706
|
+
}, _callee9, this);
|
|
480
707
|
}));
|
|
481
708
|
/* TENANT */
|
|
482
709
|
|
|
@@ -490,43 +717,43 @@ exports.UserTransfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerato
|
|
|
490
717
|
* @param {string=} tenantId - The ID of the tenant for which to retrieve configuration
|
|
491
718
|
* @param {string=} contractAddress - The ID of an nft contract for which to retrieve configuration
|
|
492
719
|
*
|
|
493
|
-
* @returns {Promise<
|
|
720
|
+
* @returns {Promise<Object>} - The tenant configuration
|
|
494
721
|
*/
|
|
495
722
|
|
|
496
723
|
exports.TenantConfiguration = /*#__PURE__*/function () {
|
|
497
|
-
var
|
|
724
|
+
var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref19) {
|
|
498
725
|
var tenantId, contractAddress;
|
|
499
|
-
return _regeneratorRuntime.wrap(function
|
|
726
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
500
727
|
while (1) {
|
|
501
|
-
switch (
|
|
728
|
+
switch (_context10.prev = _context10.next) {
|
|
502
729
|
case 0:
|
|
503
|
-
tenantId =
|
|
504
|
-
|
|
505
|
-
|
|
730
|
+
tenantId = _ref19.tenantId, contractAddress = _ref19.contractAddress;
|
|
731
|
+
_context10.prev = 1;
|
|
732
|
+
_context10.next = 4;
|
|
506
733
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
507
734
|
path: contractAddress ? UrlJoin("as", "config", "nft", contractAddress) : UrlJoin("as", "config", "tnt", tenantId),
|
|
508
735
|
method: "GET"
|
|
509
736
|
}));
|
|
510
737
|
|
|
511
738
|
case 4:
|
|
512
|
-
return
|
|
739
|
+
return _context10.abrupt("return", _context10.sent);
|
|
513
740
|
|
|
514
741
|
case 7:
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
this.Log("Failed to load tenant configuration", true,
|
|
518
|
-
return
|
|
742
|
+
_context10.prev = 7;
|
|
743
|
+
_context10.t0 = _context10["catch"](1);
|
|
744
|
+
this.Log("Failed to load tenant configuration", true, _context10.t0);
|
|
745
|
+
return _context10.abrupt("return", {});
|
|
519
746
|
|
|
520
747
|
case 11:
|
|
521
748
|
case "end":
|
|
522
|
-
return
|
|
749
|
+
return _context10.stop();
|
|
523
750
|
}
|
|
524
751
|
}
|
|
525
|
-
},
|
|
752
|
+
}, _callee10, this, [[1, 7]]);
|
|
526
753
|
}));
|
|
527
754
|
|
|
528
|
-
return function (
|
|
529
|
-
return
|
|
755
|
+
return function (_x2) {
|
|
756
|
+
return _ref20.apply(this, arguments);
|
|
530
757
|
};
|
|
531
758
|
}();
|
|
532
759
|
/* MARKETPLACE */
|
|
@@ -545,13 +772,13 @@ exports.TenantConfiguration = /*#__PURE__*/function () {
|
|
|
545
772
|
|
|
546
773
|
|
|
547
774
|
exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
548
|
-
var
|
|
775
|
+
var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref21) {
|
|
549
776
|
var marketplaceParams, tenantId, marketplaceInfo;
|
|
550
|
-
return _regeneratorRuntime.wrap(function
|
|
777
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
551
778
|
while (1) {
|
|
552
|
-
switch (
|
|
779
|
+
switch (_context11.prev = _context11.next) {
|
|
553
780
|
case 0:
|
|
554
|
-
marketplaceParams =
|
|
781
|
+
marketplaceParams = _ref21.marketplaceParams, tenantId = _ref21.tenantId;
|
|
555
782
|
|
|
556
783
|
if (!tenantId) {
|
|
557
784
|
marketplaceInfo = this.MarketplaceInfo({
|
|
@@ -561,11 +788,11 @@ exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
|
561
788
|
}
|
|
562
789
|
|
|
563
790
|
if (!this.loggedIn) {
|
|
564
|
-
|
|
791
|
+
_context11.next = 6;
|
|
565
792
|
break;
|
|
566
793
|
}
|
|
567
794
|
|
|
568
|
-
|
|
795
|
+
_context11.next = 5;
|
|
569
796
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
570
797
|
path: UrlJoin("as", "wlt", "nft", "info", tenantId),
|
|
571
798
|
method: "GET",
|
|
@@ -575,28 +802,28 @@ exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
|
575
802
|
}));
|
|
576
803
|
|
|
577
804
|
case 5:
|
|
578
|
-
return
|
|
805
|
+
return _context11.abrupt("return", _context11.sent);
|
|
579
806
|
|
|
580
807
|
case 6:
|
|
581
|
-
|
|
808
|
+
_context11.next = 8;
|
|
582
809
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
583
810
|
path: UrlJoin("as", "nft", "stock", tenantId),
|
|
584
811
|
method: "GET"
|
|
585
812
|
}));
|
|
586
813
|
|
|
587
814
|
case 8:
|
|
588
|
-
return
|
|
815
|
+
return _context11.abrupt("return", _context11.sent);
|
|
589
816
|
|
|
590
817
|
case 9:
|
|
591
818
|
case "end":
|
|
592
|
-
return
|
|
819
|
+
return _context11.stop();
|
|
593
820
|
}
|
|
594
821
|
}
|
|
595
|
-
},
|
|
822
|
+
}, _callee11, this);
|
|
596
823
|
}));
|
|
597
824
|
|
|
598
|
-
return function (
|
|
599
|
-
return
|
|
825
|
+
return function (_x3) {
|
|
826
|
+
return _ref22.apply(this, arguments);
|
|
600
827
|
};
|
|
601
828
|
}();
|
|
602
829
|
/**
|
|
@@ -614,14 +841,14 @@ exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
|
614
841
|
*/
|
|
615
842
|
|
|
616
843
|
|
|
617
|
-
exports.MarketplaceInfo = function (
|
|
618
|
-
var marketplaceParams =
|
|
844
|
+
exports.MarketplaceInfo = function (_ref23) {
|
|
845
|
+
var marketplaceParams = _ref23.marketplaceParams;
|
|
619
846
|
|
|
620
|
-
var
|
|
621
|
-
tenantSlug =
|
|
622
|
-
marketplaceSlug =
|
|
623
|
-
marketplaceId =
|
|
624
|
-
marketplaceHash =
|
|
847
|
+
var _ref24 = marketplaceParams || {},
|
|
848
|
+
tenantSlug = _ref24.tenantSlug,
|
|
849
|
+
marketplaceSlug = _ref24.marketplaceSlug,
|
|
850
|
+
marketplaceId = _ref24.marketplaceId,
|
|
851
|
+
marketplaceHash = _ref24.marketplaceHash;
|
|
625
852
|
|
|
626
853
|
var marketplaceInfo;
|
|
627
854
|
|
|
@@ -650,24 +877,24 @@ exports.MarketplaceInfo = function (_ref15) {
|
|
|
650
877
|
|
|
651
878
|
|
|
652
879
|
exports.MarketplaceCSS = /*#__PURE__*/function () {
|
|
653
|
-
var
|
|
880
|
+
var _ref26 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref25) {
|
|
654
881
|
var marketplaceParams, marketplaceInfo, marketplaceHash;
|
|
655
|
-
return _regeneratorRuntime.wrap(function
|
|
882
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
656
883
|
while (1) {
|
|
657
|
-
switch (
|
|
884
|
+
switch (_context12.prev = _context12.next) {
|
|
658
885
|
case 0:
|
|
659
|
-
marketplaceParams =
|
|
886
|
+
marketplaceParams = _ref25.marketplaceParams;
|
|
660
887
|
marketplaceInfo = this.MarketplaceInfo({
|
|
661
888
|
marketplaceParams: marketplaceParams
|
|
662
889
|
});
|
|
663
890
|
marketplaceHash = marketplaceInfo.marketplaceHash;
|
|
664
891
|
|
|
665
892
|
if (this.cachedCSS[marketplaceHash]) {
|
|
666
|
-
|
|
893
|
+
_context12.next = 7;
|
|
667
894
|
break;
|
|
668
895
|
}
|
|
669
896
|
|
|
670
|
-
|
|
897
|
+
_context12.next = 6;
|
|
671
898
|
return this.client.ContentObjectMetadata({
|
|
672
899
|
versionHash: marketplaceHash,
|
|
673
900
|
metadataSubtree: "public/asset_metadata/info/branding/custom_css",
|
|
@@ -676,21 +903,21 @@ exports.MarketplaceCSS = /*#__PURE__*/function () {
|
|
|
676
903
|
});
|
|
677
904
|
|
|
678
905
|
case 6:
|
|
679
|
-
this.cachedCSS[marketplaceHash] =
|
|
906
|
+
this.cachedCSS[marketplaceHash] = _context12.sent;
|
|
680
907
|
|
|
681
908
|
case 7:
|
|
682
|
-
return
|
|
909
|
+
return _context12.abrupt("return", this.cachedCSS[marketplaceHash] || "");
|
|
683
910
|
|
|
684
911
|
case 8:
|
|
685
912
|
case "end":
|
|
686
|
-
return
|
|
913
|
+
return _context12.stop();
|
|
687
914
|
}
|
|
688
915
|
}
|
|
689
|
-
},
|
|
916
|
+
}, _callee12, this);
|
|
690
917
|
}));
|
|
691
918
|
|
|
692
|
-
return function (
|
|
693
|
-
return
|
|
919
|
+
return function (_x4) {
|
|
920
|
+
return _ref26.apply(this, arguments);
|
|
694
921
|
};
|
|
695
922
|
}();
|
|
696
923
|
/**
|
|
@@ -701,40 +928,40 @@ exports.MarketplaceCSS = /*#__PURE__*/function () {
|
|
|
701
928
|
* @param {boolean=} organizeById - By default, the returned marketplace info is organized by tenant and marketplace slug. If this option is enabled, the marketplaces will be organized by marketplace ID instead.
|
|
702
929
|
* @param {boolean=} forceReload=false - If specified, a new request will be made to check the currently available marketplaces instead of returning cached info
|
|
703
930
|
*
|
|
704
|
-
* @returns {Promise<
|
|
931
|
+
* @returns {Promise<Object>} - Info about available marketplaces
|
|
705
932
|
*/
|
|
706
933
|
|
|
707
934
|
|
|
708
|
-
exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
709
|
-
var
|
|
935
|
+
exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
|
936
|
+
var _ref28,
|
|
710
937
|
organizeById,
|
|
711
|
-
|
|
938
|
+
_ref28$forceReload,
|
|
712
939
|
forceReload,
|
|
713
|
-
|
|
940
|
+
_args13 = arguments;
|
|
714
941
|
|
|
715
|
-
return _regeneratorRuntime.wrap(function
|
|
942
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
716
943
|
while (1) {
|
|
717
|
-
switch (
|
|
944
|
+
switch (_context13.prev = _context13.next) {
|
|
718
945
|
case 0:
|
|
719
|
-
|
|
946
|
+
_ref28 = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {}, organizeById = _ref28.organizeById, _ref28$forceReload = _ref28.forceReload, forceReload = _ref28$forceReload === void 0 ? false : _ref28$forceReload;
|
|
720
947
|
|
|
721
948
|
if (!forceReload) {
|
|
722
|
-
|
|
949
|
+
_context13.next = 4;
|
|
723
950
|
break;
|
|
724
951
|
}
|
|
725
952
|
|
|
726
|
-
|
|
953
|
+
_context13.next = 4;
|
|
727
954
|
return this.LoadAvailableMarketplaces(true);
|
|
728
955
|
|
|
729
956
|
case 4:
|
|
730
|
-
return
|
|
957
|
+
return _context13.abrupt("return", _objectSpread({}, organizeById ? this.availableMarketplacesById : this.availableMarketplaces));
|
|
731
958
|
|
|
732
959
|
case 5:
|
|
733
960
|
case "end":
|
|
734
|
-
return
|
|
961
|
+
return _context13.stop();
|
|
735
962
|
}
|
|
736
963
|
}
|
|
737
|
-
},
|
|
964
|
+
}, _callee13, this);
|
|
738
965
|
}));
|
|
739
966
|
/**
|
|
740
967
|
* Retrieve full information about the specified marketplace
|
|
@@ -749,25 +976,25 @@ exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_re
|
|
|
749
976
|
*/
|
|
750
977
|
|
|
751
978
|
exports.Marketplace = /*#__PURE__*/function () {
|
|
752
|
-
var
|
|
979
|
+
var _ref30 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref29) {
|
|
753
980
|
var marketplaceParams;
|
|
754
|
-
return _regeneratorRuntime.wrap(function
|
|
981
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
755
982
|
while (1) {
|
|
756
|
-
switch (
|
|
983
|
+
switch (_context14.prev = _context14.next) {
|
|
757
984
|
case 0:
|
|
758
|
-
marketplaceParams =
|
|
759
|
-
return
|
|
985
|
+
marketplaceParams = _ref29.marketplaceParams;
|
|
986
|
+
return _context14.abrupt("return", this.LoadMarketplace(marketplaceParams));
|
|
760
987
|
|
|
761
988
|
case 2:
|
|
762
989
|
case "end":
|
|
763
|
-
return
|
|
990
|
+
return _context14.stop();
|
|
764
991
|
}
|
|
765
992
|
}
|
|
766
|
-
},
|
|
993
|
+
}, _callee14, this);
|
|
767
994
|
}));
|
|
768
995
|
|
|
769
|
-
return function (
|
|
770
|
-
return
|
|
996
|
+
return function (_x5) {
|
|
997
|
+
return _ref30.apply(this, arguments);
|
|
771
998
|
};
|
|
772
999
|
}();
|
|
773
1000
|
/* NFTS */
|
|
@@ -784,32 +1011,32 @@ exports.Marketplace = /*#__PURE__*/function () {
|
|
|
784
1011
|
|
|
785
1012
|
|
|
786
1013
|
exports.NFTContractStats = /*#__PURE__*/function () {
|
|
787
|
-
var
|
|
1014
|
+
var _ref32 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref31) {
|
|
788
1015
|
var contractAddress;
|
|
789
|
-
return _regeneratorRuntime.wrap(function
|
|
1016
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
790
1017
|
while (1) {
|
|
791
|
-
switch (
|
|
1018
|
+
switch (_context15.prev = _context15.next) {
|
|
792
1019
|
case 0:
|
|
793
|
-
contractAddress =
|
|
794
|
-
|
|
1020
|
+
contractAddress = _ref31.contractAddress;
|
|
1021
|
+
_context15.next = 3;
|
|
795
1022
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
796
1023
|
path: UrlJoin("as", "nft", "info", contractAddress),
|
|
797
1024
|
method: "GET"
|
|
798
1025
|
}));
|
|
799
1026
|
|
|
800
1027
|
case 3:
|
|
801
|
-
return
|
|
1028
|
+
return _context15.abrupt("return", _context15.sent);
|
|
802
1029
|
|
|
803
1030
|
case 4:
|
|
804
1031
|
case "end":
|
|
805
|
-
return
|
|
1032
|
+
return _context15.stop();
|
|
806
1033
|
}
|
|
807
1034
|
}
|
|
808
|
-
},
|
|
1035
|
+
}, _callee15, this);
|
|
809
1036
|
}));
|
|
810
1037
|
|
|
811
|
-
return function (
|
|
812
|
-
return
|
|
1038
|
+
return function (_x6) {
|
|
1039
|
+
return _ref32.apply(this, arguments);
|
|
813
1040
|
};
|
|
814
1041
|
}();
|
|
815
1042
|
/**
|
|
@@ -823,27 +1050,27 @@ exports.NFTContractStats = /*#__PURE__*/function () {
|
|
|
823
1050
|
|
|
824
1051
|
|
|
825
1052
|
exports.NFT = /*#__PURE__*/function () {
|
|
826
|
-
var
|
|
1053
|
+
var _ref34 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(_ref33) {
|
|
827
1054
|
var tokenId, contractAddress, nft;
|
|
828
|
-
return _regeneratorRuntime.wrap(function
|
|
1055
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
829
1056
|
while (1) {
|
|
830
|
-
switch (
|
|
1057
|
+
switch (_context16.prev = _context16.next) {
|
|
831
1058
|
case 0:
|
|
832
|
-
tokenId =
|
|
833
|
-
|
|
834
|
-
|
|
1059
|
+
tokenId = _ref33.tokenId, contractAddress = _ref33.contractAddress;
|
|
1060
|
+
_context16.t0 = FormatNFTDetails;
|
|
1061
|
+
_context16.next = 4;
|
|
835
1062
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
836
1063
|
path: UrlJoin("as", "nft", "info", contractAddress, tokenId),
|
|
837
1064
|
method: "GET"
|
|
838
1065
|
}));
|
|
839
1066
|
|
|
840
1067
|
case 4:
|
|
841
|
-
|
|
842
|
-
nft = (0,
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
1068
|
+
_context16.t1 = _context16.sent;
|
|
1069
|
+
nft = (0, _context16.t0)(_context16.t1);
|
|
1070
|
+
_context16.t2 = _objectSpread;
|
|
1071
|
+
_context16.t3 = _objectSpread;
|
|
1072
|
+
_context16.t4 = {};
|
|
1073
|
+
_context16.next = 11;
|
|
847
1074
|
return this.client.ContentObjectMetadata({
|
|
848
1075
|
versionHash: nft.details.VersionHash,
|
|
849
1076
|
metadataSubtree: "public/asset_metadata/nft",
|
|
@@ -851,39 +1078,39 @@ exports.NFT = /*#__PURE__*/function () {
|
|
|
851
1078
|
});
|
|
852
1079
|
|
|
853
1080
|
case 11:
|
|
854
|
-
|
|
1081
|
+
_context16.t5 = _context16.sent;
|
|
855
1082
|
|
|
856
|
-
if (
|
|
857
|
-
|
|
1083
|
+
if (_context16.t5) {
|
|
1084
|
+
_context16.next = 14;
|
|
858
1085
|
break;
|
|
859
1086
|
}
|
|
860
1087
|
|
|
861
|
-
|
|
1088
|
+
_context16.t5 = {};
|
|
862
1089
|
|
|
863
1090
|
case 14:
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
nft.metadata = (0,
|
|
868
|
-
|
|
1091
|
+
_context16.t6 = _context16.t5;
|
|
1092
|
+
_context16.t7 = (0, _context16.t3)(_context16.t4, _context16.t6);
|
|
1093
|
+
_context16.t8 = nft.metadata || {};
|
|
1094
|
+
nft.metadata = (0, _context16.t2)(_context16.t7, _context16.t8);
|
|
1095
|
+
_context16.next = 20;
|
|
869
1096
|
return this.TenantConfiguration({
|
|
870
1097
|
contractAddress: contractAddress
|
|
871
1098
|
});
|
|
872
1099
|
|
|
873
1100
|
case 20:
|
|
874
|
-
nft.config =
|
|
875
|
-
return
|
|
1101
|
+
nft.config = _context16.sent;
|
|
1102
|
+
return _context16.abrupt("return", FormatNFTMetadata(this, nft));
|
|
876
1103
|
|
|
877
1104
|
case 22:
|
|
878
1105
|
case "end":
|
|
879
|
-
return
|
|
1106
|
+
return _context16.stop();
|
|
880
1107
|
}
|
|
881
1108
|
}
|
|
882
|
-
},
|
|
1109
|
+
}, _callee16, this);
|
|
883
1110
|
}));
|
|
884
1111
|
|
|
885
|
-
return function (
|
|
886
|
-
return
|
|
1112
|
+
return function (_x7) {
|
|
1113
|
+
return _ref34.apply(this, arguments);
|
|
887
1114
|
};
|
|
888
1115
|
}();
|
|
889
1116
|
/**
|
|
@@ -900,23 +1127,23 @@ exports.NFT = /*#__PURE__*/function () {
|
|
|
900
1127
|
|
|
901
1128
|
|
|
902
1129
|
exports.TransferNFT = /*#__PURE__*/function () {
|
|
903
|
-
var
|
|
1130
|
+
var _ref36 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref35) {
|
|
904
1131
|
var contractAddress, tokenId, targetAddress;
|
|
905
|
-
return _regeneratorRuntime.wrap(function
|
|
1132
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
906
1133
|
while (1) {
|
|
907
|
-
switch (
|
|
1134
|
+
switch (_context17.prev = _context17.next) {
|
|
908
1135
|
case 0:
|
|
909
|
-
contractAddress =
|
|
1136
|
+
contractAddress = _ref35.contractAddress, tokenId = _ref35.tokenId, targetAddress = _ref35.targetAddress;
|
|
910
1137
|
|
|
911
1138
|
if (!(!targetAddress || !Utils.ValidAddress(targetAddress))) {
|
|
912
|
-
|
|
1139
|
+
_context17.next = 3;
|
|
913
1140
|
break;
|
|
914
1141
|
}
|
|
915
1142
|
|
|
916
1143
|
throw Error("Eluvio Wallet Client: Invalid or missing target address in UserTransferNFT");
|
|
917
1144
|
|
|
918
1145
|
case 3:
|
|
919
|
-
|
|
1146
|
+
_context17.next = 5;
|
|
920
1147
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
921
1148
|
path: UrlJoin("as", "wlt", "mkt", "xfer"),
|
|
922
1149
|
method: "POST",
|
|
@@ -931,18 +1158,18 @@ exports.TransferNFT = /*#__PURE__*/function () {
|
|
|
931
1158
|
});
|
|
932
1159
|
|
|
933
1160
|
case 5:
|
|
934
|
-
return
|
|
1161
|
+
return _context17.abrupt("return", _context17.sent);
|
|
935
1162
|
|
|
936
1163
|
case 6:
|
|
937
1164
|
case "end":
|
|
938
|
-
return
|
|
1165
|
+
return _context17.stop();
|
|
939
1166
|
}
|
|
940
1167
|
}
|
|
941
|
-
},
|
|
1168
|
+
}, _callee17, this);
|
|
942
1169
|
}));
|
|
943
1170
|
|
|
944
|
-
return function (
|
|
945
|
-
return
|
|
1171
|
+
return function (_x8) {
|
|
1172
|
+
return _ref36.apply(this, arguments);
|
|
946
1173
|
};
|
|
947
1174
|
}();
|
|
948
1175
|
/** LISTINGS */
|
|
@@ -959,53 +1186,53 @@ exports.TransferNFT = /*#__PURE__*/function () {
|
|
|
959
1186
|
|
|
960
1187
|
|
|
961
1188
|
exports.ListingStatus = /*#__PURE__*/function () {
|
|
962
|
-
var
|
|
1189
|
+
var _ref38 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(_ref37) {
|
|
963
1190
|
var listingId;
|
|
964
|
-
return _regeneratorRuntime.wrap(function
|
|
1191
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
965
1192
|
while (1) {
|
|
966
|
-
switch (
|
|
1193
|
+
switch (_context18.prev = _context18.next) {
|
|
967
1194
|
case 0:
|
|
968
|
-
listingId =
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1195
|
+
listingId = _ref37.listingId;
|
|
1196
|
+
_context18.prev = 1;
|
|
1197
|
+
_context18.t0 = Utils;
|
|
1198
|
+
_context18.next = 5;
|
|
972
1199
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
973
1200
|
path: UrlJoin("as", "mkt", "status", listingId),
|
|
974
1201
|
method: "GET"
|
|
975
1202
|
});
|
|
976
1203
|
|
|
977
1204
|
case 5:
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
return
|
|
1205
|
+
_context18.t1 = _context18.sent;
|
|
1206
|
+
_context18.next = 8;
|
|
1207
|
+
return _context18.t0.ResponseToJson.call(_context18.t0, _context18.t1);
|
|
981
1208
|
|
|
982
1209
|
case 8:
|
|
983
|
-
return
|
|
1210
|
+
return _context18.abrupt("return", _context18.sent);
|
|
984
1211
|
|
|
985
1212
|
case 11:
|
|
986
|
-
|
|
987
|
-
|
|
1213
|
+
_context18.prev = 11;
|
|
1214
|
+
_context18.t2 = _context18["catch"](1);
|
|
988
1215
|
|
|
989
|
-
if (!(
|
|
990
|
-
|
|
1216
|
+
if (!(_context18.t2.status === 404)) {
|
|
1217
|
+
_context18.next = 15;
|
|
991
1218
|
break;
|
|
992
1219
|
}
|
|
993
1220
|
|
|
994
|
-
return
|
|
1221
|
+
return _context18.abrupt("return");
|
|
995
1222
|
|
|
996
1223
|
case 15:
|
|
997
|
-
throw
|
|
1224
|
+
throw _context18.t2;
|
|
998
1225
|
|
|
999
1226
|
case 16:
|
|
1000
1227
|
case "end":
|
|
1001
|
-
return
|
|
1228
|
+
return _context18.stop();
|
|
1002
1229
|
}
|
|
1003
1230
|
}
|
|
1004
|
-
},
|
|
1231
|
+
}, _callee18, this, [[1, 11]]);
|
|
1005
1232
|
}));
|
|
1006
1233
|
|
|
1007
|
-
return function (
|
|
1008
|
-
return
|
|
1234
|
+
return function (_x9) {
|
|
1235
|
+
return _ref38.apply(this, arguments);
|
|
1009
1236
|
};
|
|
1010
1237
|
}();
|
|
1011
1238
|
/**
|
|
@@ -1022,40 +1249,41 @@ exports.ListingStatus = /*#__PURE__*/function () {
|
|
|
1022
1249
|
|
|
1023
1250
|
|
|
1024
1251
|
exports.Listing = /*#__PURE__*/function () {
|
|
1025
|
-
var
|
|
1252
|
+
var _ref40 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref39) {
|
|
1026
1253
|
var listingId;
|
|
1027
|
-
return _regeneratorRuntime.wrap(function
|
|
1254
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
1028
1255
|
while (1) {
|
|
1029
|
-
switch (
|
|
1256
|
+
switch (_context19.prev = _context19.next) {
|
|
1030
1257
|
case 0:
|
|
1031
|
-
listingId =
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1258
|
+
listingId = _ref39.listingId;
|
|
1259
|
+
_context19.t0 = FormatNFT;
|
|
1260
|
+
_context19.t1 = this;
|
|
1261
|
+
_context19.t2 = Utils;
|
|
1262
|
+
_context19.next = 6;
|
|
1035
1263
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1036
1264
|
path: UrlJoin("as", "mkt", "l", listingId),
|
|
1037
1265
|
method: "GET"
|
|
1038
1266
|
});
|
|
1039
1267
|
|
|
1040
|
-
case
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
return
|
|
1268
|
+
case 6:
|
|
1269
|
+
_context19.t3 = _context19.sent;
|
|
1270
|
+
_context19.next = 9;
|
|
1271
|
+
return _context19.t2.ResponseToJson.call(_context19.t2, _context19.t3);
|
|
1044
1272
|
|
|
1045
|
-
case
|
|
1046
|
-
|
|
1047
|
-
return
|
|
1273
|
+
case 9:
|
|
1274
|
+
_context19.t4 = _context19.sent;
|
|
1275
|
+
return _context19.abrupt("return", (0, _context19.t0)(_context19.t1, _context19.t4));
|
|
1048
1276
|
|
|
1049
|
-
case
|
|
1277
|
+
case 11:
|
|
1050
1278
|
case "end":
|
|
1051
|
-
return
|
|
1279
|
+
return _context19.stop();
|
|
1052
1280
|
}
|
|
1053
1281
|
}
|
|
1054
|
-
},
|
|
1282
|
+
}, _callee19, this);
|
|
1055
1283
|
}));
|
|
1056
1284
|
|
|
1057
|
-
return function (
|
|
1058
|
-
return
|
|
1285
|
+
return function (_x10) {
|
|
1286
|
+
return _ref40.apply(this, arguments);
|
|
1059
1287
|
};
|
|
1060
1288
|
}();
|
|
1061
1289
|
/**
|
|
@@ -1087,27 +1315,28 @@ exports.Listing = /*#__PURE__*/function () {
|
|
|
1087
1315
|
* @param {Object=} marketplaceParams - Filter results by marketplace
|
|
1088
1316
|
* @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
|
|
1089
1317
|
* @param {integer=} lastNDays - Filter by results listed in the past N days
|
|
1318
|
+
* @param {boolean=} includeCheckoutLocked - If specified, listings which are currently in the checkout process (and not so currently purchasable) will be included in the results. By default they are excluded.
|
|
1090
1319
|
*
|
|
1091
1320
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
1092
1321
|
*/
|
|
1093
1322
|
|
|
1094
1323
|
|
|
1095
|
-
exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1096
|
-
var
|
|
1097
|
-
return _regeneratorRuntime.wrap(function
|
|
1324
|
+
exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
|
|
1325
|
+
var _args20 = arguments;
|
|
1326
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
1098
1327
|
while (1) {
|
|
1099
|
-
switch (
|
|
1328
|
+
switch (_context20.prev = _context20.next) {
|
|
1100
1329
|
case 0:
|
|
1101
|
-
return
|
|
1330
|
+
return _context20.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1102
1331
|
mode: "listings"
|
|
1103
|
-
},
|
|
1332
|
+
}, _args20[0] || {})));
|
|
1104
1333
|
|
|
1105
1334
|
case 1:
|
|
1106
1335
|
case "end":
|
|
1107
|
-
return
|
|
1336
|
+
return _context20.stop();
|
|
1108
1337
|
}
|
|
1109
1338
|
}
|
|
1110
|
-
},
|
|
1339
|
+
}, _callee20, this);
|
|
1111
1340
|
}));
|
|
1112
1341
|
/**
|
|
1113
1342
|
* Retrieve stats for listings matching the specified parameters.
|
|
@@ -1142,22 +1371,22 @@ exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRunt
|
|
|
1142
1371
|
* @returns {Promise<Object>} - Statistics about listings. All prices in USD.
|
|
1143
1372
|
*/
|
|
1144
1373
|
|
|
1145
|
-
exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1146
|
-
var
|
|
1147
|
-
return _regeneratorRuntime.wrap(function
|
|
1374
|
+
exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
|
|
1375
|
+
var _args21 = arguments;
|
|
1376
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
1148
1377
|
while (1) {
|
|
1149
|
-
switch (
|
|
1378
|
+
switch (_context21.prev = _context21.next) {
|
|
1150
1379
|
case 0:
|
|
1151
|
-
return
|
|
1380
|
+
return _context21.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1152
1381
|
mode: "listing-stats"
|
|
1153
|
-
},
|
|
1382
|
+
}, _args21[0] || {})));
|
|
1154
1383
|
|
|
1155
1384
|
case 1:
|
|
1156
1385
|
case "end":
|
|
1157
|
-
return
|
|
1386
|
+
return _context21.stop();
|
|
1158
1387
|
}
|
|
1159
1388
|
}
|
|
1160
|
-
},
|
|
1389
|
+
}, _callee21, this);
|
|
1161
1390
|
}));
|
|
1162
1391
|
/**
|
|
1163
1392
|
* Retrieve sales matching the specified parameters.
|
|
@@ -1191,22 +1420,22 @@ exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
|
|
|
1191
1420
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
1192
1421
|
*/
|
|
1193
1422
|
|
|
1194
|
-
exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1195
|
-
var
|
|
1196
|
-
return _regeneratorRuntime.wrap(function
|
|
1423
|
+
exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
|
|
1424
|
+
var _args22 = arguments;
|
|
1425
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
1197
1426
|
while (1) {
|
|
1198
|
-
switch (
|
|
1427
|
+
switch (_context22.prev = _context22.next) {
|
|
1199
1428
|
case 0:
|
|
1200
|
-
return
|
|
1429
|
+
return _context22.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1201
1430
|
mode: "sales"
|
|
1202
|
-
},
|
|
1431
|
+
}, _args22[0] || {})));
|
|
1203
1432
|
|
|
1204
1433
|
case 1:
|
|
1205
1434
|
case "end":
|
|
1206
|
-
return
|
|
1435
|
+
return _context22.stop();
|
|
1207
1436
|
}
|
|
1208
1437
|
}
|
|
1209
|
-
},
|
|
1438
|
+
}, _callee22, this);
|
|
1210
1439
|
}));
|
|
1211
1440
|
/**
|
|
1212
1441
|
* Retrieve sales and transfers matching the specified parameters.
|
|
@@ -1240,22 +1469,22 @@ exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
|
1240
1469
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
1241
1470
|
*/
|
|
1242
1471
|
|
|
1243
|
-
exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1244
|
-
var
|
|
1245
|
-
return _regeneratorRuntime.wrap(function
|
|
1472
|
+
exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
|
|
1473
|
+
var _args23 = arguments;
|
|
1474
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
1246
1475
|
while (1) {
|
|
1247
|
-
switch (
|
|
1476
|
+
switch (_context23.prev = _context23.next) {
|
|
1248
1477
|
case 0:
|
|
1249
|
-
return
|
|
1478
|
+
return _context23.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1250
1479
|
mode: "transfers"
|
|
1251
|
-
},
|
|
1480
|
+
}, _args23[0] || {})));
|
|
1252
1481
|
|
|
1253
1482
|
case 1:
|
|
1254
1483
|
case "end":
|
|
1255
|
-
return
|
|
1484
|
+
return _context23.stop();
|
|
1256
1485
|
}
|
|
1257
1486
|
}
|
|
1258
|
-
},
|
|
1487
|
+
}, _callee23, this);
|
|
1259
1488
|
}));
|
|
1260
1489
|
/**
|
|
1261
1490
|
* Retrieve stats for listings matching the specified parameters.
|
|
@@ -1289,23 +1518,105 @@ exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
|
|
|
1289
1518
|
* @returns {Promise<Object>} - Statistics about sales. All prices in USD.
|
|
1290
1519
|
*/
|
|
1291
1520
|
|
|
1292
|
-
exports.SalesStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1293
|
-
var
|
|
1294
|
-
return _regeneratorRuntime.wrap(function
|
|
1521
|
+
exports.SalesStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
|
|
1522
|
+
var _args24 = arguments;
|
|
1523
|
+
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
1295
1524
|
while (1) {
|
|
1296
|
-
switch (
|
|
1525
|
+
switch (_context24.prev = _context24.next) {
|
|
1297
1526
|
case 0:
|
|
1298
|
-
return
|
|
1527
|
+
return _context24.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1299
1528
|
mode: "sales-stats"
|
|
1300
|
-
},
|
|
1529
|
+
}, _args24[0] || {})));
|
|
1301
1530
|
|
|
1302
1531
|
case 1:
|
|
1303
1532
|
case "end":
|
|
1304
|
-
return
|
|
1533
|
+
return _context24.stop();
|
|
1305
1534
|
}
|
|
1306
1535
|
}
|
|
1307
|
-
},
|
|
1536
|
+
}, _callee24, this);
|
|
1308
1537
|
}));
|
|
1538
|
+
|
|
1539
|
+
exports.Leaderboard = /*#__PURE__*/function () {
|
|
1540
|
+
var _ref47 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref46) {
|
|
1541
|
+
var userAddress,
|
|
1542
|
+
marketplaceParams,
|
|
1543
|
+
params,
|
|
1544
|
+
_args25 = arguments;
|
|
1545
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
1546
|
+
while (1) {
|
|
1547
|
+
switch (_context25.prev = _context25.next) {
|
|
1548
|
+
case 0:
|
|
1549
|
+
userAddress = _ref46.userAddress, marketplaceParams = _ref46.marketplaceParams;
|
|
1550
|
+
|
|
1551
|
+
if (!userAddress) {
|
|
1552
|
+
_context25.next = 20;
|
|
1553
|
+
break;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
params = {
|
|
1557
|
+
addr: Utils.FormatAddress(userAddress)
|
|
1558
|
+
};
|
|
1559
|
+
|
|
1560
|
+
if (!marketplaceParams) {
|
|
1561
|
+
_context25.next = 10;
|
|
1562
|
+
break;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
_context25.t0 = "tenant:eq:";
|
|
1566
|
+
_context25.next = 7;
|
|
1567
|
+
return this.MarketplaceInfo({
|
|
1568
|
+
marketplaceParams: marketplaceParams
|
|
1569
|
+
});
|
|
1570
|
+
|
|
1571
|
+
case 7:
|
|
1572
|
+
_context25.t1 = _context25.sent.tenantId;
|
|
1573
|
+
_context25.t2 = _context25.t0.concat.call(_context25.t0, _context25.t1);
|
|
1574
|
+
params.filter = [_context25.t2];
|
|
1575
|
+
|
|
1576
|
+
case 10:
|
|
1577
|
+
_context25.t4 = Utils;
|
|
1578
|
+
_context25.next = 13;
|
|
1579
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
1580
|
+
path: UrlJoin("as", "wlt", "ranks"),
|
|
1581
|
+
method: "GET",
|
|
1582
|
+
queryParams: params
|
|
1583
|
+
});
|
|
1584
|
+
|
|
1585
|
+
case 13:
|
|
1586
|
+
_context25.t5 = _context25.sent;
|
|
1587
|
+
_context25.next = 16;
|
|
1588
|
+
return _context25.t4.ResponseToJson.call(_context25.t4, _context25.t5);
|
|
1589
|
+
|
|
1590
|
+
case 16:
|
|
1591
|
+
_context25.t3 = _context25.sent;
|
|
1592
|
+
|
|
1593
|
+
if (_context25.t3) {
|
|
1594
|
+
_context25.next = 19;
|
|
1595
|
+
break;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
_context25.t3 = [];
|
|
1599
|
+
|
|
1600
|
+
case 19:
|
|
1601
|
+
return _context25.abrupt("return", _context25.t3[0]);
|
|
1602
|
+
|
|
1603
|
+
case 20:
|
|
1604
|
+
return _context25.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1605
|
+
mode: "leaderboard"
|
|
1606
|
+
}, _args25[0] || {})));
|
|
1607
|
+
|
|
1608
|
+
case 21:
|
|
1609
|
+
case "end":
|
|
1610
|
+
return _context25.stop();
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
}, _callee25, this);
|
|
1614
|
+
}));
|
|
1615
|
+
|
|
1616
|
+
return function (_x11) {
|
|
1617
|
+
return _ref47.apply(this, arguments);
|
|
1618
|
+
};
|
|
1619
|
+
}();
|
|
1309
1620
|
/**
|
|
1310
1621
|
* <b><i>Requires login</i></b>
|
|
1311
1622
|
*
|
|
@@ -1321,23 +1632,24 @@ exports.SalesStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRu
|
|
|
1321
1632
|
* @returns {Promise<string>} - The listing ID of the created listing
|
|
1322
1633
|
*/
|
|
1323
1634
|
|
|
1635
|
+
|
|
1324
1636
|
exports.CreateListing = /*#__PURE__*/function () {
|
|
1325
|
-
var
|
|
1637
|
+
var _ref49 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(_ref48) {
|
|
1326
1638
|
var contractAddress, tokenId, price, listingId;
|
|
1327
|
-
return _regeneratorRuntime.wrap(function
|
|
1639
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
1328
1640
|
while (1) {
|
|
1329
|
-
switch (
|
|
1641
|
+
switch (_context26.prev = _context26.next) {
|
|
1330
1642
|
case 0:
|
|
1331
|
-
contractAddress =
|
|
1643
|
+
contractAddress = _ref48.contractAddress, tokenId = _ref48.tokenId, price = _ref48.price, listingId = _ref48.listingId;
|
|
1332
1644
|
contractAddress = Utils.FormatAddress(contractAddress);
|
|
1333
1645
|
|
|
1334
1646
|
if (!listingId) {
|
|
1335
|
-
|
|
1647
|
+
_context26.next = 12;
|
|
1336
1648
|
break;
|
|
1337
1649
|
}
|
|
1338
1650
|
|
|
1339
|
-
|
|
1340
|
-
|
|
1651
|
+
_context26.t0 = Utils;
|
|
1652
|
+
_context26.next = 6;
|
|
1341
1653
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1342
1654
|
path: UrlJoin("as", "wlt", "mkt"),
|
|
1343
1655
|
method: "PUT",
|
|
@@ -1351,16 +1663,16 @@ exports.CreateListing = /*#__PURE__*/function () {
|
|
|
1351
1663
|
});
|
|
1352
1664
|
|
|
1353
1665
|
case 6:
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
return
|
|
1666
|
+
_context26.t1 = _context26.sent;
|
|
1667
|
+
_context26.next = 9;
|
|
1668
|
+
return _context26.t0.ResponseToFormat.call(_context26.t0, "text", _context26.t1);
|
|
1357
1669
|
|
|
1358
1670
|
case 9:
|
|
1359
|
-
return
|
|
1671
|
+
return _context26.abrupt("return", _context26.sent);
|
|
1360
1672
|
|
|
1361
1673
|
case 12:
|
|
1362
|
-
|
|
1363
|
-
|
|
1674
|
+
_context26.t2 = Utils;
|
|
1675
|
+
_context26.next = 15;
|
|
1364
1676
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1365
1677
|
path: UrlJoin("as", "wlt", "mkt"),
|
|
1366
1678
|
method: "POST",
|
|
@@ -1375,23 +1687,23 @@ exports.CreateListing = /*#__PURE__*/function () {
|
|
|
1375
1687
|
});
|
|
1376
1688
|
|
|
1377
1689
|
case 15:
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
return
|
|
1690
|
+
_context26.t3 = _context26.sent;
|
|
1691
|
+
_context26.next = 18;
|
|
1692
|
+
return _context26.t2.ResponseToJson.call(_context26.t2, _context26.t3);
|
|
1381
1693
|
|
|
1382
1694
|
case 18:
|
|
1383
|
-
return
|
|
1695
|
+
return _context26.abrupt("return", _context26.sent);
|
|
1384
1696
|
|
|
1385
1697
|
case 19:
|
|
1386
1698
|
case "end":
|
|
1387
|
-
return
|
|
1699
|
+
return _context26.stop();
|
|
1388
1700
|
}
|
|
1389
1701
|
}
|
|
1390
|
-
},
|
|
1702
|
+
}, _callee26, this);
|
|
1391
1703
|
}));
|
|
1392
1704
|
|
|
1393
|
-
return function (
|
|
1394
|
-
return
|
|
1705
|
+
return function (_x12) {
|
|
1706
|
+
return _ref49.apply(this, arguments);
|
|
1395
1707
|
};
|
|
1396
1708
|
}();
|
|
1397
1709
|
/**
|
|
@@ -1406,14 +1718,14 @@ exports.CreateListing = /*#__PURE__*/function () {
|
|
|
1406
1718
|
|
|
1407
1719
|
|
|
1408
1720
|
exports.RemoveListing = /*#__PURE__*/function () {
|
|
1409
|
-
var
|
|
1721
|
+
var _ref51 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(_ref50) {
|
|
1410
1722
|
var listingId;
|
|
1411
|
-
return _regeneratorRuntime.wrap(function
|
|
1723
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
1412
1724
|
while (1) {
|
|
1413
|
-
switch (
|
|
1725
|
+
switch (_context27.prev = _context27.next) {
|
|
1414
1726
|
case 0:
|
|
1415
|
-
listingId =
|
|
1416
|
-
|
|
1727
|
+
listingId = _ref50.listingId;
|
|
1728
|
+
_context27.next = 3;
|
|
1417
1729
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1418
1730
|
path: UrlJoin("as", "wlt", "mkt", listingId),
|
|
1419
1731
|
method: "DELETE",
|
|
@@ -1424,14 +1736,14 @@ exports.RemoveListing = /*#__PURE__*/function () {
|
|
|
1424
1736
|
|
|
1425
1737
|
case 3:
|
|
1426
1738
|
case "end":
|
|
1427
|
-
return
|
|
1739
|
+
return _context27.stop();
|
|
1428
1740
|
}
|
|
1429
1741
|
}
|
|
1430
|
-
},
|
|
1742
|
+
}, _callee27, this);
|
|
1431
1743
|
}));
|
|
1432
1744
|
|
|
1433
|
-
return function (
|
|
1434
|
-
return
|
|
1745
|
+
return function (_x13) {
|
|
1746
|
+
return _ref51.apply(this, arguments);
|
|
1435
1747
|
};
|
|
1436
1748
|
}();
|
|
1437
1749
|
/**
|
|
@@ -1448,30 +1760,30 @@ exports.RemoveListing = /*#__PURE__*/function () {
|
|
|
1448
1760
|
|
|
1449
1761
|
|
|
1450
1762
|
exports.ListingNames = /*#__PURE__*/function () {
|
|
1451
|
-
var
|
|
1763
|
+
var _ref53 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(_ref52) {
|
|
1452
1764
|
var marketplaceParams, tenantId;
|
|
1453
|
-
return _regeneratorRuntime.wrap(function
|
|
1765
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
1454
1766
|
while (1) {
|
|
1455
|
-
switch (
|
|
1767
|
+
switch (_context28.prev = _context28.next) {
|
|
1456
1768
|
case 0:
|
|
1457
|
-
marketplaceParams =
|
|
1769
|
+
marketplaceParams = _ref52.marketplaceParams;
|
|
1458
1770
|
|
|
1459
1771
|
if (!marketplaceParams) {
|
|
1460
|
-
|
|
1772
|
+
_context28.next = 5;
|
|
1461
1773
|
break;
|
|
1462
1774
|
}
|
|
1463
1775
|
|
|
1464
|
-
|
|
1776
|
+
_context28.next = 4;
|
|
1465
1777
|
return this.MarketplaceInfo({
|
|
1466
1778
|
marketplaceParams: marketplaceParams
|
|
1467
1779
|
});
|
|
1468
1780
|
|
|
1469
1781
|
case 4:
|
|
1470
|
-
tenantId =
|
|
1782
|
+
tenantId = _context28.sent.tenantId;
|
|
1471
1783
|
|
|
1472
1784
|
case 5:
|
|
1473
|
-
|
|
1474
|
-
|
|
1785
|
+
_context28.t0 = Utils;
|
|
1786
|
+
_context28.next = 8;
|
|
1475
1787
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1476
1788
|
path: UrlJoin("as", "mkt", "names"),
|
|
1477
1789
|
method: "GET",
|
|
@@ -1481,23 +1793,23 @@ exports.ListingNames = /*#__PURE__*/function () {
|
|
|
1481
1793
|
});
|
|
1482
1794
|
|
|
1483
1795
|
case 8:
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
return
|
|
1796
|
+
_context28.t1 = _context28.sent;
|
|
1797
|
+
_context28.next = 11;
|
|
1798
|
+
return _context28.t0.ResponseToJson.call(_context28.t0, _context28.t1);
|
|
1487
1799
|
|
|
1488
1800
|
case 11:
|
|
1489
|
-
return
|
|
1801
|
+
return _context28.abrupt("return", _context28.sent);
|
|
1490
1802
|
|
|
1491
1803
|
case 12:
|
|
1492
1804
|
case "end":
|
|
1493
|
-
return
|
|
1805
|
+
return _context28.stop();
|
|
1494
1806
|
}
|
|
1495
1807
|
}
|
|
1496
|
-
},
|
|
1808
|
+
}, _callee28, this);
|
|
1497
1809
|
}));
|
|
1498
1810
|
|
|
1499
|
-
return function (
|
|
1500
|
-
return
|
|
1811
|
+
return function (_x14) {
|
|
1812
|
+
return _ref53.apply(this, arguments);
|
|
1501
1813
|
};
|
|
1502
1814
|
}();
|
|
1503
1815
|
/**
|
|
@@ -1512,15 +1824,15 @@ exports.ListingNames = /*#__PURE__*/function () {
|
|
|
1512
1824
|
|
|
1513
1825
|
|
|
1514
1826
|
exports.ListingEditionNames = /*#__PURE__*/function () {
|
|
1515
|
-
var
|
|
1827
|
+
var _ref55 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(_ref54) {
|
|
1516
1828
|
var displayName;
|
|
1517
|
-
return _regeneratorRuntime.wrap(function
|
|
1829
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
1518
1830
|
while (1) {
|
|
1519
|
-
switch (
|
|
1831
|
+
switch (_context29.prev = _context29.next) {
|
|
1520
1832
|
case 0:
|
|
1521
|
-
displayName =
|
|
1522
|
-
|
|
1523
|
-
|
|
1833
|
+
displayName = _ref54.displayName;
|
|
1834
|
+
_context29.t0 = Utils;
|
|
1835
|
+
_context29.next = 4;
|
|
1524
1836
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1525
1837
|
path: UrlJoin("as", "mkt", "editions"),
|
|
1526
1838
|
queryParams: {
|
|
@@ -1530,27 +1842,27 @@ exports.ListingEditionNames = /*#__PURE__*/function () {
|
|
|
1530
1842
|
});
|
|
1531
1843
|
|
|
1532
1844
|
case 4:
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
return
|
|
1845
|
+
_context29.t1 = _context29.sent;
|
|
1846
|
+
_context29.next = 7;
|
|
1847
|
+
return _context29.t0.ResponseToJson.call(_context29.t0, _context29.t1);
|
|
1536
1848
|
|
|
1537
1849
|
case 7:
|
|
1538
|
-
return
|
|
1850
|
+
return _context29.abrupt("return", _context29.sent);
|
|
1539
1851
|
|
|
1540
1852
|
case 8:
|
|
1541
1853
|
case "end":
|
|
1542
|
-
return
|
|
1854
|
+
return _context29.stop();
|
|
1543
1855
|
}
|
|
1544
1856
|
}
|
|
1545
|
-
},
|
|
1857
|
+
}, _callee29, this);
|
|
1546
1858
|
}));
|
|
1547
1859
|
|
|
1548
|
-
return function (
|
|
1549
|
-
return
|
|
1860
|
+
return function (_x15) {
|
|
1861
|
+
return _ref55.apply(this, arguments);
|
|
1550
1862
|
};
|
|
1551
1863
|
}();
|
|
1552
1864
|
/**
|
|
1553
|
-
* Retrieve names of all valid attributes for listed
|
|
1865
|
+
* Retrieve names of all valid attributes for listed items. Full attribute names and values are required for filtering listing results by attributes.
|
|
1554
1866
|
*
|
|
1555
1867
|
* Specify marketplace information to filter the results to only items offered in that marketplace.
|
|
1556
1868
|
*
|
|
@@ -1563,46 +1875,46 @@ exports.ListingEditionNames = /*#__PURE__*/function () {
|
|
|
1563
1875
|
*/
|
|
1564
1876
|
|
|
1565
1877
|
|
|
1566
|
-
exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1567
|
-
var
|
|
1878
|
+
exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
|
|
1879
|
+
var _ref57,
|
|
1568
1880
|
marketplaceParams,
|
|
1569
1881
|
displayName,
|
|
1570
1882
|
filters,
|
|
1571
1883
|
attributes,
|
|
1572
|
-
|
|
1884
|
+
_args30 = arguments;
|
|
1573
1885
|
|
|
1574
|
-
return _regeneratorRuntime.wrap(function
|
|
1886
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
1575
1887
|
while (1) {
|
|
1576
|
-
switch (
|
|
1888
|
+
switch (_context30.prev = _context30.next) {
|
|
1577
1889
|
case 0:
|
|
1578
|
-
|
|
1890
|
+
_ref57 = _args30.length > 0 && _args30[0] !== undefined ? _args30[0] : {}, marketplaceParams = _ref57.marketplaceParams, displayName = _ref57.displayName;
|
|
1579
1891
|
filters = [];
|
|
1580
1892
|
|
|
1581
1893
|
if (!marketplaceParams) {
|
|
1582
|
-
|
|
1894
|
+
_context30.next = 10;
|
|
1583
1895
|
break;
|
|
1584
1896
|
}
|
|
1585
1897
|
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1898
|
+
_context30.t0 = filters;
|
|
1899
|
+
_context30.t1 = "tenant:eq:";
|
|
1900
|
+
_context30.next = 7;
|
|
1589
1901
|
return this.MarketplaceInfo({
|
|
1590
1902
|
marketplaceParams: marketplaceParams
|
|
1591
1903
|
});
|
|
1592
1904
|
|
|
1593
1905
|
case 7:
|
|
1594
|
-
|
|
1595
|
-
|
|
1906
|
+
_context30.t2 = _context30.sent.tenantId;
|
|
1907
|
+
_context30.t3 = _context30.t1.concat.call(_context30.t1, _context30.t2);
|
|
1596
1908
|
|
|
1597
|
-
|
|
1909
|
+
_context30.t0.push.call(_context30.t0, _context30.t3);
|
|
1598
1910
|
|
|
1599
1911
|
case 10:
|
|
1600
1912
|
if (displayName) {
|
|
1601
1913
|
filters.push("nft/display_name:eq:".concat(displayName));
|
|
1602
1914
|
}
|
|
1603
1915
|
|
|
1604
|
-
|
|
1605
|
-
|
|
1916
|
+
_context30.t4 = Utils;
|
|
1917
|
+
_context30.next = 14;
|
|
1606
1918
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1607
1919
|
path: UrlJoin("as", "mkt", "attributes"),
|
|
1608
1920
|
method: "GET",
|
|
@@ -1612,30 +1924,30 @@ exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regene
|
|
|
1612
1924
|
});
|
|
1613
1925
|
|
|
1614
1926
|
case 14:
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
return
|
|
1927
|
+
_context30.t5 = _context30.sent;
|
|
1928
|
+
_context30.next = 17;
|
|
1929
|
+
return _context30.t4.ResponseToJson.call(_context30.t4, _context30.t5);
|
|
1618
1930
|
|
|
1619
1931
|
case 17:
|
|
1620
|
-
attributes =
|
|
1621
|
-
return
|
|
1622
|
-
var trait_type =
|
|
1623
|
-
values =
|
|
1932
|
+
attributes = _context30.sent;
|
|
1933
|
+
return _context30.abrupt("return", attributes.map(function (_ref58) {
|
|
1934
|
+
var trait_type = _ref58.trait_type,
|
|
1935
|
+
values = _ref58.values;
|
|
1624
1936
|
return {
|
|
1625
1937
|
name: trait_type,
|
|
1626
1938
|
values: values
|
|
1627
1939
|
};
|
|
1628
|
-
}).filter(function (
|
|
1629
|
-
var name =
|
|
1940
|
+
}).filter(function (_ref59) {
|
|
1941
|
+
var name = _ref59.name;
|
|
1630
1942
|
return !["Content Fabric Hash", "Total Minted Supply", "Creator"].includes(name);
|
|
1631
1943
|
}));
|
|
1632
1944
|
|
|
1633
1945
|
case 19:
|
|
1634
1946
|
case "end":
|
|
1635
|
-
return
|
|
1947
|
+
return _context30.stop();
|
|
1636
1948
|
}
|
|
1637
1949
|
}
|
|
1638
|
-
},
|
|
1950
|
+
}, _callee30, this);
|
|
1639
1951
|
}));
|
|
1640
1952
|
/* PURCHASE / CLAIM */
|
|
1641
1953
|
|
|
@@ -1651,21 +1963,21 @@ exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regene
|
|
|
1651
1963
|
*/
|
|
1652
1964
|
|
|
1653
1965
|
exports.ClaimItem = /*#__PURE__*/function () {
|
|
1654
|
-
var
|
|
1966
|
+
var _ref61 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(_ref60) {
|
|
1655
1967
|
var marketplaceParams, sku, marketplaceInfo;
|
|
1656
|
-
return _regeneratorRuntime.wrap(function
|
|
1968
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
1657
1969
|
while (1) {
|
|
1658
|
-
switch (
|
|
1970
|
+
switch (_context31.prev = _context31.next) {
|
|
1659
1971
|
case 0:
|
|
1660
|
-
marketplaceParams =
|
|
1661
|
-
|
|
1972
|
+
marketplaceParams = _ref60.marketplaceParams, sku = _ref60.sku;
|
|
1973
|
+
_context31.next = 3;
|
|
1662
1974
|
return this.MarketplaceInfo({
|
|
1663
1975
|
marketplaceParams: marketplaceParams
|
|
1664
1976
|
});
|
|
1665
1977
|
|
|
1666
1978
|
case 3:
|
|
1667
|
-
marketplaceInfo =
|
|
1668
|
-
|
|
1979
|
+
marketplaceInfo = _context31.sent;
|
|
1980
|
+
_context31.next = 6;
|
|
1669
1981
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
1670
1982
|
method: "POST",
|
|
1671
1983
|
path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
|
|
@@ -1681,14 +1993,14 @@ exports.ClaimItem = /*#__PURE__*/function () {
|
|
|
1681
1993
|
|
|
1682
1994
|
case 6:
|
|
1683
1995
|
case "end":
|
|
1684
|
-
return
|
|
1996
|
+
return _context31.stop();
|
|
1685
1997
|
}
|
|
1686
1998
|
}
|
|
1687
|
-
},
|
|
1999
|
+
}, _callee31, this);
|
|
1688
2000
|
}));
|
|
1689
2001
|
|
|
1690
|
-
return function (
|
|
1691
|
-
return
|
|
2002
|
+
return function (_x16) {
|
|
2003
|
+
return _ref61.apply(this, arguments);
|
|
1692
2004
|
};
|
|
1693
2005
|
}();
|
|
1694
2006
|
/* MINTING STATUS */
|
|
@@ -1706,61 +2018,61 @@ exports.ClaimItem = /*#__PURE__*/function () {
|
|
|
1706
2018
|
|
|
1707
2019
|
|
|
1708
2020
|
exports.ListingPurchaseStatus = /*#__PURE__*/function () {
|
|
1709
|
-
var
|
|
2021
|
+
var _ref63 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(_ref62) {
|
|
1710
2022
|
var listingId, confirmationId, listingStatus, statuses;
|
|
1711
|
-
return _regeneratorRuntime.wrap(function
|
|
2023
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
1712
2024
|
while (1) {
|
|
1713
|
-
switch (
|
|
2025
|
+
switch (_context32.prev = _context32.next) {
|
|
1714
2026
|
case 0:
|
|
1715
|
-
listingId =
|
|
1716
|
-
|
|
1717
|
-
|
|
2027
|
+
listingId = _ref62.listingId, confirmationId = _ref62.confirmationId;
|
|
2028
|
+
_context32.prev = 1;
|
|
2029
|
+
_context32.next = 4;
|
|
1718
2030
|
return this.ListingStatus({
|
|
1719
2031
|
listingId: listingId
|
|
1720
2032
|
});
|
|
1721
2033
|
|
|
1722
2034
|
case 4:
|
|
1723
|
-
listingStatus =
|
|
2035
|
+
listingStatus = _context32.sent;
|
|
1724
2036
|
|
|
1725
2037
|
if (listingStatus) {
|
|
1726
|
-
|
|
2038
|
+
_context32.next = 7;
|
|
1727
2039
|
break;
|
|
1728
2040
|
}
|
|
1729
2041
|
|
|
1730
2042
|
throw Error("Unable to find info for listing " + listingId);
|
|
1731
2043
|
|
|
1732
2044
|
case 7:
|
|
1733
|
-
|
|
2045
|
+
_context32.next = 9;
|
|
1734
2046
|
return this.MintingStatus({
|
|
1735
2047
|
tenantId: listingStatus.tenant
|
|
1736
2048
|
});
|
|
1737
2049
|
|
|
1738
2050
|
case 9:
|
|
1739
|
-
statuses =
|
|
1740
|
-
return
|
|
2051
|
+
statuses = _context32.sent;
|
|
2052
|
+
return _context32.abrupt("return", statuses.find(function (status) {
|
|
1741
2053
|
return status.op === "nft-transfer" && status.extra && status.extra[0] === confirmationId;
|
|
1742
2054
|
}) || {
|
|
1743
2055
|
status: "none"
|
|
1744
2056
|
});
|
|
1745
2057
|
|
|
1746
2058
|
case 13:
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
this.Log(
|
|
1750
|
-
return
|
|
2059
|
+
_context32.prev = 13;
|
|
2060
|
+
_context32.t0 = _context32["catch"](1);
|
|
2061
|
+
this.Log(_context32.t0, true);
|
|
2062
|
+
return _context32.abrupt("return", {
|
|
1751
2063
|
status: "unknown"
|
|
1752
2064
|
});
|
|
1753
2065
|
|
|
1754
2066
|
case 17:
|
|
1755
2067
|
case "end":
|
|
1756
|
-
return
|
|
2068
|
+
return _context32.stop();
|
|
1757
2069
|
}
|
|
1758
2070
|
}
|
|
1759
|
-
},
|
|
2071
|
+
}, _callee32, this, [[1, 13]]);
|
|
1760
2072
|
}));
|
|
1761
2073
|
|
|
1762
|
-
return function (
|
|
1763
|
-
return
|
|
2074
|
+
return function (_x17) {
|
|
2075
|
+
return _ref63.apply(this, arguments);
|
|
1764
2076
|
};
|
|
1765
2077
|
}();
|
|
1766
2078
|
/**
|
|
@@ -1776,52 +2088,52 @@ exports.ListingPurchaseStatus = /*#__PURE__*/function () {
|
|
|
1776
2088
|
|
|
1777
2089
|
|
|
1778
2090
|
exports.PurchaseStatus = /*#__PURE__*/function () {
|
|
1779
|
-
var
|
|
2091
|
+
var _ref65 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(_ref64) {
|
|
1780
2092
|
var marketplaceParams, confirmationId, marketplaceInfo, statuses;
|
|
1781
|
-
return _regeneratorRuntime.wrap(function
|
|
2093
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
1782
2094
|
while (1) {
|
|
1783
|
-
switch (
|
|
2095
|
+
switch (_context33.prev = _context33.next) {
|
|
1784
2096
|
case 0:
|
|
1785
|
-
marketplaceParams =
|
|
1786
|
-
|
|
1787
|
-
|
|
2097
|
+
marketplaceParams = _ref64.marketplaceParams, confirmationId = _ref64.confirmationId;
|
|
2098
|
+
_context33.prev = 1;
|
|
2099
|
+
_context33.next = 4;
|
|
1788
2100
|
return this.MarketplaceInfo({
|
|
1789
2101
|
marketplaceParams: marketplaceParams
|
|
1790
2102
|
});
|
|
1791
2103
|
|
|
1792
2104
|
case 4:
|
|
1793
|
-
marketplaceInfo =
|
|
1794
|
-
|
|
2105
|
+
marketplaceInfo = _context33.sent;
|
|
2106
|
+
_context33.next = 7;
|
|
1795
2107
|
return this.MintingStatus({
|
|
1796
2108
|
tenantId: marketplaceInfo.tenant_id
|
|
1797
2109
|
});
|
|
1798
2110
|
|
|
1799
2111
|
case 7:
|
|
1800
|
-
statuses =
|
|
1801
|
-
return
|
|
2112
|
+
statuses = _context33.sent;
|
|
2113
|
+
return _context33.abrupt("return", statuses.find(function (status) {
|
|
1802
2114
|
return status.op === "nft-buy" && status.confirmationId === confirmationId;
|
|
1803
2115
|
}) || {
|
|
1804
2116
|
status: "none"
|
|
1805
2117
|
});
|
|
1806
2118
|
|
|
1807
2119
|
case 11:
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
this.Log(
|
|
1811
|
-
return
|
|
2120
|
+
_context33.prev = 11;
|
|
2121
|
+
_context33.t0 = _context33["catch"](1);
|
|
2122
|
+
this.Log(_context33.t0, true);
|
|
2123
|
+
return _context33.abrupt("return", {
|
|
1812
2124
|
status: "unknown"
|
|
1813
2125
|
});
|
|
1814
2126
|
|
|
1815
2127
|
case 15:
|
|
1816
2128
|
case "end":
|
|
1817
|
-
return
|
|
2129
|
+
return _context33.stop();
|
|
1818
2130
|
}
|
|
1819
2131
|
}
|
|
1820
|
-
},
|
|
2132
|
+
}, _callee33, this, [[1, 11]]);
|
|
1821
2133
|
}));
|
|
1822
2134
|
|
|
1823
|
-
return function (
|
|
1824
|
-
return
|
|
2135
|
+
return function (_x18) {
|
|
2136
|
+
return _ref65.apply(this, arguments);
|
|
1825
2137
|
};
|
|
1826
2138
|
}();
|
|
1827
2139
|
/**
|
|
@@ -1837,52 +2149,52 @@ exports.PurchaseStatus = /*#__PURE__*/function () {
|
|
|
1837
2149
|
|
|
1838
2150
|
|
|
1839
2151
|
exports.ClaimStatus = /*#__PURE__*/function () {
|
|
1840
|
-
var
|
|
2152
|
+
var _ref67 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(_ref66) {
|
|
1841
2153
|
var marketplaceParams, sku, marketplaceInfo, statuses;
|
|
1842
|
-
return _regeneratorRuntime.wrap(function
|
|
2154
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
1843
2155
|
while (1) {
|
|
1844
|
-
switch (
|
|
2156
|
+
switch (_context34.prev = _context34.next) {
|
|
1845
2157
|
case 0:
|
|
1846
|
-
marketplaceParams =
|
|
1847
|
-
|
|
1848
|
-
|
|
2158
|
+
marketplaceParams = _ref66.marketplaceParams, sku = _ref66.sku;
|
|
2159
|
+
_context34.prev = 1;
|
|
2160
|
+
_context34.next = 4;
|
|
1849
2161
|
return this.MarketplaceInfo({
|
|
1850
2162
|
marketplaceParams: marketplaceParams
|
|
1851
2163
|
});
|
|
1852
2164
|
|
|
1853
2165
|
case 4:
|
|
1854
|
-
marketplaceInfo =
|
|
1855
|
-
|
|
2166
|
+
marketplaceInfo = _context34.sent;
|
|
2167
|
+
_context34.next = 7;
|
|
1856
2168
|
return this.MintingStatus({
|
|
1857
2169
|
tenantId: marketplaceInfo.tenantId
|
|
1858
2170
|
});
|
|
1859
2171
|
|
|
1860
2172
|
case 7:
|
|
1861
|
-
statuses =
|
|
1862
|
-
return
|
|
2173
|
+
statuses = _context34.sent;
|
|
2174
|
+
return _context34.abrupt("return", statuses.find(function (status) {
|
|
1863
2175
|
return status.op === "nft-claim" && status.marketplaceId === marketplaceInfo.marketplaceId && status.confirmationId === sku;
|
|
1864
2176
|
}) || {
|
|
1865
2177
|
status: "none"
|
|
1866
2178
|
});
|
|
1867
2179
|
|
|
1868
2180
|
case 11:
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
this.Log(
|
|
1872
|
-
return
|
|
2181
|
+
_context34.prev = 11;
|
|
2182
|
+
_context34.t0 = _context34["catch"](1);
|
|
2183
|
+
this.Log(_context34.t0, true);
|
|
2184
|
+
return _context34.abrupt("return", {
|
|
1873
2185
|
status: "unknown"
|
|
1874
2186
|
});
|
|
1875
2187
|
|
|
1876
2188
|
case 15:
|
|
1877
2189
|
case "end":
|
|
1878
|
-
return
|
|
2190
|
+
return _context34.stop();
|
|
1879
2191
|
}
|
|
1880
2192
|
}
|
|
1881
|
-
},
|
|
2193
|
+
}, _callee34, this, [[1, 11]]);
|
|
1882
2194
|
}));
|
|
1883
2195
|
|
|
1884
|
-
return function (
|
|
1885
|
-
return
|
|
2196
|
+
return function (_x19) {
|
|
2197
|
+
return _ref67.apply(this, arguments);
|
|
1886
2198
|
};
|
|
1887
2199
|
}();
|
|
1888
2200
|
/**
|
|
@@ -1898,52 +2210,52 @@ exports.ClaimStatus = /*#__PURE__*/function () {
|
|
|
1898
2210
|
|
|
1899
2211
|
|
|
1900
2212
|
exports.PackOpenStatus = /*#__PURE__*/function () {
|
|
1901
|
-
var
|
|
2213
|
+
var _ref69 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(_ref68) {
|
|
1902
2214
|
var contractAddress, tokenId, tenantConfig, statuses;
|
|
1903
|
-
return _regeneratorRuntime.wrap(function
|
|
2215
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
1904
2216
|
while (1) {
|
|
1905
|
-
switch (
|
|
2217
|
+
switch (_context35.prev = _context35.next) {
|
|
1906
2218
|
case 0:
|
|
1907
|
-
contractAddress =
|
|
1908
|
-
|
|
1909
|
-
|
|
2219
|
+
contractAddress = _ref68.contractAddress, tokenId = _ref68.tokenId;
|
|
2220
|
+
_context35.prev = 1;
|
|
2221
|
+
_context35.next = 4;
|
|
1910
2222
|
return this.TenantConfiguration({
|
|
1911
2223
|
contractAddress: contractAddress
|
|
1912
2224
|
});
|
|
1913
2225
|
|
|
1914
2226
|
case 4:
|
|
1915
|
-
tenantConfig =
|
|
1916
|
-
|
|
2227
|
+
tenantConfig = _context35.sent;
|
|
2228
|
+
_context35.next = 7;
|
|
1917
2229
|
return this.MintingStatus({
|
|
1918
2230
|
tenantId: tenantConfig.tenant
|
|
1919
2231
|
});
|
|
1920
2232
|
|
|
1921
2233
|
case 7:
|
|
1922
|
-
statuses =
|
|
1923
|
-
return
|
|
2234
|
+
statuses = _context35.sent;
|
|
2235
|
+
return _context35.abrupt("return", statuses.find(function (status) {
|
|
1924
2236
|
return status.op === "nft-open" && Utils.EqualAddress(contractAddress, status.address) && status.tokenId === tokenId;
|
|
1925
2237
|
}) || {
|
|
1926
2238
|
status: "none"
|
|
1927
2239
|
});
|
|
1928
2240
|
|
|
1929
2241
|
case 11:
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
this.Log(
|
|
1933
|
-
return
|
|
2242
|
+
_context35.prev = 11;
|
|
2243
|
+
_context35.t0 = _context35["catch"](1);
|
|
2244
|
+
this.Log(_context35.t0, true);
|
|
2245
|
+
return _context35.abrupt("return", {
|
|
1934
2246
|
status: "unknown"
|
|
1935
2247
|
});
|
|
1936
2248
|
|
|
1937
2249
|
case 15:
|
|
1938
2250
|
case "end":
|
|
1939
|
-
return
|
|
2251
|
+
return _context35.stop();
|
|
1940
2252
|
}
|
|
1941
2253
|
}
|
|
1942
|
-
},
|
|
2254
|
+
}, _callee35, this, [[1, 11]]);
|
|
1943
2255
|
}));
|
|
1944
2256
|
|
|
1945
|
-
return function (
|
|
1946
|
-
return
|
|
2257
|
+
return function (_x20) {
|
|
2258
|
+
return _ref69.apply(this, arguments);
|
|
1947
2259
|
};
|
|
1948
2260
|
}();
|
|
1949
2261
|
/**
|
|
@@ -1959,60 +2271,60 @@ exports.PackOpenStatus = /*#__PURE__*/function () {
|
|
|
1959
2271
|
|
|
1960
2272
|
|
|
1961
2273
|
exports.CollectionRedemptionStatus = /*#__PURE__*/function () {
|
|
1962
|
-
var
|
|
2274
|
+
var _ref71 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(_ref70) {
|
|
1963
2275
|
var marketplaceParams, confirmationId, statuses;
|
|
1964
|
-
return _regeneratorRuntime.wrap(function
|
|
2276
|
+
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
1965
2277
|
while (1) {
|
|
1966
|
-
switch (
|
|
2278
|
+
switch (_context36.prev = _context36.next) {
|
|
1967
2279
|
case 0:
|
|
1968
|
-
marketplaceParams =
|
|
1969
|
-
|
|
1970
|
-
|
|
2280
|
+
marketplaceParams = _ref70.marketplaceParams, confirmationId = _ref70.confirmationId;
|
|
2281
|
+
_context36.prev = 1;
|
|
2282
|
+
_context36.next = 4;
|
|
1971
2283
|
return this.MintingStatus({
|
|
1972
2284
|
marketplaceParams: marketplaceParams
|
|
1973
2285
|
});
|
|
1974
2286
|
|
|
1975
2287
|
case 4:
|
|
1976
|
-
statuses =
|
|
1977
|
-
return
|
|
2288
|
+
statuses = _context36.sent;
|
|
2289
|
+
return _context36.abrupt("return", statuses.find(function (status) {
|
|
1978
2290
|
return status.op === "nft-redeem" && status.confirmationId === confirmationId;
|
|
1979
2291
|
}) || {
|
|
1980
2292
|
status: "none"
|
|
1981
2293
|
});
|
|
1982
2294
|
|
|
1983
2295
|
case 8:
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
this.Log(
|
|
1987
|
-
return
|
|
2296
|
+
_context36.prev = 8;
|
|
2297
|
+
_context36.t0 = _context36["catch"](1);
|
|
2298
|
+
this.Log(_context36.t0, true);
|
|
2299
|
+
return _context36.abrupt("return", {
|
|
1988
2300
|
status: "unknown"
|
|
1989
2301
|
});
|
|
1990
2302
|
|
|
1991
2303
|
case 12:
|
|
1992
2304
|
case "end":
|
|
1993
|
-
return
|
|
2305
|
+
return _context36.stop();
|
|
1994
2306
|
}
|
|
1995
2307
|
}
|
|
1996
|
-
},
|
|
2308
|
+
}, _callee36, this, [[1, 8]]);
|
|
1997
2309
|
}));
|
|
1998
2310
|
|
|
1999
|
-
return function (
|
|
2000
|
-
return
|
|
2311
|
+
return function (_x21) {
|
|
2312
|
+
return _ref71.apply(this, arguments);
|
|
2001
2313
|
};
|
|
2002
2314
|
}();
|
|
2003
2315
|
/* EVENTS */
|
|
2004
2316
|
|
|
2005
2317
|
|
|
2006
2318
|
exports.LoadDrop = /*#__PURE__*/function () {
|
|
2007
|
-
var
|
|
2319
|
+
var _ref73 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(_ref72) {
|
|
2008
2320
|
var _this2 = this;
|
|
2009
2321
|
|
|
2010
2322
|
var tenantSlug, eventSlug, dropId, mainSiteHash, event, eventId;
|
|
2011
|
-
return _regeneratorRuntime.wrap(function
|
|
2323
|
+
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
|
|
2012
2324
|
while (1) {
|
|
2013
|
-
switch (
|
|
2325
|
+
switch (_context37.prev = _context37.next) {
|
|
2014
2326
|
case 0:
|
|
2015
|
-
tenantSlug =
|
|
2327
|
+
tenantSlug = _ref72.tenantSlug, eventSlug = _ref72.eventSlug, dropId = _ref72.dropId;
|
|
2016
2328
|
|
|
2017
2329
|
if (!this.drops) {
|
|
2018
2330
|
this.drops = {};
|
|
@@ -2027,18 +2339,18 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
2027
2339
|
}
|
|
2028
2340
|
|
|
2029
2341
|
if (this.drops[tenantSlug][eventSlug][dropId]) {
|
|
2030
|
-
|
|
2342
|
+
_context37.next = 16;
|
|
2031
2343
|
break;
|
|
2032
2344
|
}
|
|
2033
2345
|
|
|
2034
|
-
|
|
2346
|
+
_context37.next = 7;
|
|
2035
2347
|
return this.client.LatestVersionHash({
|
|
2036
2348
|
objectId: this.mainSiteId
|
|
2037
2349
|
});
|
|
2038
2350
|
|
|
2039
2351
|
case 7:
|
|
2040
|
-
mainSiteHash =
|
|
2041
|
-
|
|
2352
|
+
mainSiteHash = _context37.sent;
|
|
2353
|
+
_context37.next = 10;
|
|
2042
2354
|
return this.client.ContentObjectMetadata({
|
|
2043
2355
|
versionHash: mainSiteHash,
|
|
2044
2356
|
metadataSubtree: UrlJoin("public", "asset_metadata", "tenants", tenantSlug, "sites", eventSlug, "info"),
|
|
@@ -2051,17 +2363,17 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
2051
2363
|
});
|
|
2052
2364
|
|
|
2053
2365
|
case 10:
|
|
2054
|
-
|
|
2366
|
+
_context37.t0 = _context37.sent;
|
|
2055
2367
|
|
|
2056
|
-
if (
|
|
2057
|
-
|
|
2368
|
+
if (_context37.t0) {
|
|
2369
|
+
_context37.next = 13;
|
|
2058
2370
|
break;
|
|
2059
2371
|
}
|
|
2060
2372
|
|
|
2061
|
-
|
|
2373
|
+
_context37.t0 = [];
|
|
2062
2374
|
|
|
2063
2375
|
case 13:
|
|
2064
|
-
event =
|
|
2376
|
+
event = _context37.t0;
|
|
2065
2377
|
eventId = Utils.DecodeVersionHash(event["."].source).objectId;
|
|
2066
2378
|
event.drops.forEach(function (drop) {
|
|
2067
2379
|
drop = _objectSpread(_objectSpread({}, drop), {}, {
|
|
@@ -2072,37 +2384,37 @@ exports.LoadDrop = /*#__PURE__*/function () {
|
|
|
2072
2384
|
});
|
|
2073
2385
|
|
|
2074
2386
|
case 16:
|
|
2075
|
-
return
|
|
2387
|
+
return _context37.abrupt("return", this.drops[dropId]);
|
|
2076
2388
|
|
|
2077
2389
|
case 17:
|
|
2078
2390
|
case "end":
|
|
2079
|
-
return
|
|
2391
|
+
return _context37.stop();
|
|
2080
2392
|
}
|
|
2081
2393
|
}
|
|
2082
|
-
},
|
|
2394
|
+
}, _callee37, this);
|
|
2083
2395
|
}));
|
|
2084
2396
|
|
|
2085
|
-
return function (
|
|
2086
|
-
return
|
|
2397
|
+
return function (_x22) {
|
|
2398
|
+
return _ref73.apply(this, arguments);
|
|
2087
2399
|
};
|
|
2088
2400
|
}();
|
|
2089
2401
|
|
|
2090
2402
|
exports.SubmitDropVote = /*#__PURE__*/function () {
|
|
2091
|
-
var
|
|
2403
|
+
var _ref75 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(_ref74) {
|
|
2092
2404
|
var marketplaceParams, eventId, dropId, sku, marketplaceInfo;
|
|
2093
|
-
return _regeneratorRuntime.wrap(function
|
|
2405
|
+
return _regeneratorRuntime.wrap(function _callee38$(_context38) {
|
|
2094
2406
|
while (1) {
|
|
2095
|
-
switch (
|
|
2407
|
+
switch (_context38.prev = _context38.next) {
|
|
2096
2408
|
case 0:
|
|
2097
|
-
marketplaceParams =
|
|
2098
|
-
|
|
2409
|
+
marketplaceParams = _ref74.marketplaceParams, eventId = _ref74.eventId, dropId = _ref74.dropId, sku = _ref74.sku;
|
|
2410
|
+
_context38.next = 3;
|
|
2099
2411
|
return this.MarketplaceInfo({
|
|
2100
2412
|
marketplaceParams: marketplaceParams
|
|
2101
2413
|
});
|
|
2102
2414
|
|
|
2103
2415
|
case 3:
|
|
2104
|
-
marketplaceInfo =
|
|
2105
|
-
|
|
2416
|
+
marketplaceInfo = _context38.sent;
|
|
2417
|
+
_context38.next = 6;
|
|
2106
2418
|
return this.client.authClient.MakeAuthServiceRequest({
|
|
2107
2419
|
path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
|
|
2108
2420
|
method: "POST",
|
|
@@ -2119,27 +2431,27 @@ exports.SubmitDropVote = /*#__PURE__*/function () {
|
|
|
2119
2431
|
|
|
2120
2432
|
case 6:
|
|
2121
2433
|
case "end":
|
|
2122
|
-
return
|
|
2434
|
+
return _context38.stop();
|
|
2123
2435
|
}
|
|
2124
2436
|
}
|
|
2125
|
-
},
|
|
2437
|
+
}, _callee38, this);
|
|
2126
2438
|
}));
|
|
2127
2439
|
|
|
2128
|
-
return function (
|
|
2129
|
-
return
|
|
2440
|
+
return function (_x23) {
|
|
2441
|
+
return _ref75.apply(this, arguments);
|
|
2130
2442
|
};
|
|
2131
2443
|
}();
|
|
2132
2444
|
|
|
2133
2445
|
exports.DropStatus = /*#__PURE__*/function () {
|
|
2134
|
-
var
|
|
2446
|
+
var _ref77 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(_ref76) {
|
|
2135
2447
|
var marketplace, eventId, dropId, response;
|
|
2136
|
-
return _regeneratorRuntime.wrap(function
|
|
2448
|
+
return _regeneratorRuntime.wrap(function _callee39$(_context39) {
|
|
2137
2449
|
while (1) {
|
|
2138
|
-
switch (
|
|
2450
|
+
switch (_context39.prev = _context39.next) {
|
|
2139
2451
|
case 0:
|
|
2140
|
-
marketplace =
|
|
2141
|
-
|
|
2142
|
-
|
|
2452
|
+
marketplace = _ref76.marketplace, eventId = _ref76.eventId, dropId = _ref76.dropId;
|
|
2453
|
+
_context39.prev = 1;
|
|
2454
|
+
_context39.next = 4;
|
|
2143
2455
|
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2144
2456
|
path: UrlJoin("as", "wlt", "act", marketplace.tenant_id, eventId, dropId),
|
|
2145
2457
|
method: "GET",
|
|
@@ -2149,28 +2461,28 @@ exports.DropStatus = /*#__PURE__*/function () {
|
|
|
2149
2461
|
}));
|
|
2150
2462
|
|
|
2151
2463
|
case 4:
|
|
2152
|
-
response =
|
|
2153
|
-
return
|
|
2464
|
+
response = _context39.sent;
|
|
2465
|
+
return _context39.abrupt("return", response.sort(function (a, b) {
|
|
2154
2466
|
return a.ts > b.ts ? 1 : -1;
|
|
2155
2467
|
})[0] || {
|
|
2156
2468
|
status: "none"
|
|
2157
2469
|
});
|
|
2158
2470
|
|
|
2159
2471
|
case 8:
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
this.Log(
|
|
2163
|
-
return
|
|
2472
|
+
_context39.prev = 8;
|
|
2473
|
+
_context39.t0 = _context39["catch"](1);
|
|
2474
|
+
this.Log(_context39.t0, true);
|
|
2475
|
+
return _context39.abrupt("return", "");
|
|
2164
2476
|
|
|
2165
2477
|
case 12:
|
|
2166
2478
|
case "end":
|
|
2167
|
-
return
|
|
2479
|
+
return _context39.stop();
|
|
2168
2480
|
}
|
|
2169
2481
|
}
|
|
2170
|
-
},
|
|
2482
|
+
}, _callee39, this, [[1, 8]]);
|
|
2171
2483
|
}));
|
|
2172
2484
|
|
|
2173
|
-
return function (
|
|
2174
|
-
return
|
|
2485
|
+
return function (_x24) {
|
|
2486
|
+
return _ref77.apply(this, arguments);
|
|
2175
2487
|
};
|
|
2176
2488
|
}();
|