@eluvio/elv-client-js 4.0.143 → 4.0.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/ElvClient-min.js +15 -14
  2. package/dist/ElvClient-node-min.js +14 -13
  3. package/dist/ElvFrameClient-min.js +10 -10
  4. package/dist/ElvPermissionsClient-min.js +9 -9
  5. package/dist/ElvWalletClient-min.js +15 -14
  6. package/dist/ElvWalletClient-node-min.js +14 -13
  7. package/dist/src/AuthorizationClient.js +11 -14
  8. package/dist/src/ContentObjectAudit.js +3 -3
  9. package/dist/src/ContentObjectVerification.js +3 -3
  10. package/dist/src/Crypto.js +2 -2
  11. package/dist/src/ElvClient.js +532 -401
  12. package/dist/src/ElvWallet.js +7 -5
  13. package/dist/src/EthClient.js +9 -10
  14. package/dist/src/FrameClient.js +10 -11
  15. package/dist/src/HttpClient.js +5 -5
  16. package/dist/src/Id.js +1 -2
  17. package/dist/src/PermissionsClient.js +31 -19
  18. package/dist/src/RemoteSigner.js +10 -11
  19. package/dist/src/UserProfileClient.js +35 -20
  20. package/dist/src/Utils.js +2 -3
  21. package/dist/src/Validation.js +10 -2
  22. package/dist/src/client/ABRPublishing.js +438 -238
  23. package/dist/src/client/AccessGroups.js +2 -2
  24. package/dist/src/client/ContentAccess.js +281 -344
  25. package/dist/src/client/ContentManagement.js +100 -84
  26. package/dist/src/client/Contracts.js +430 -2
  27. package/dist/src/client/Files.js +2 -2
  28. package/dist/src/client/LiveConf.js +43 -26
  29. package/dist/src/client/LiveStream.js +65 -63
  30. package/dist/src/client/NFT.js +2 -2
  31. package/dist/src/client/Shares.js +47 -24
  32. package/dist/src/walletClient/ClientMethods.js +2 -2
  33. package/dist/src/walletClient/Profile.js +2 -2
  34. package/dist/src/walletClient/Utils.js +2 -2
  35. package/dist/src/walletClient/index.js +359 -280
  36. package/package.json +2 -2
  37. package/src/FrameClient.js +1 -0
  38. package/src/Validation.js +9 -3
  39. package/src/client/ABRPublishing.js +176 -160
  40. package/src/client/Contracts.js +258 -0
  41. package/src/walletClient/index.js +13 -0
@@ -7,8 +7,8 @@ var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
7
7
  var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
8
8
  var _createClass = require("@babel/runtime/helpers/createClass");
9
9
  var _excluded = ["code", "address", "type", "authToken", "expiresAt"];
10
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
12
  var _require = require("../ElvClient"),
13
13
  ElvClient = _require.ElvClient;
14
14
  var Configuration = require("./Configuration");
@@ -79,7 +79,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
79
79
  this.utils = client.utils;
80
80
  this.ForbiddenMethods = ElvWalletClient.ForbiddenMethods;
81
81
  }
82
- _createClass(ElvWalletClient, [{
82
+ return _createClass(ElvWalletClient, [{
83
83
  key: "Log",
84
84
  value: function Log(message) {
85
85
  var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -136,7 +136,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
136
136
  */
137
137
  }, {
138
138
  key: "PersonalSign",
139
- value: function () {
139
+ value: (function () {
140
140
  var _PersonalSign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
141
141
  var message, parameters, url;
142
142
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
@@ -265,7 +265,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
265
265
  return _PersonalSign.apply(this, arguments);
266
266
  }
267
267
  return PersonalSign;
268
- }()
268
+ }())
269
269
  }, {
270
270
  key: "LogInURL",
271
271
  value: function () {
@@ -344,7 +344,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
344
344
  */
345
345
  }, {
346
346
  key: "LogIn",
347
- value: function () {
347
+ value: (function () {
348
348
  var _LogIn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref5) {
349
349
  var _this = this;
350
350
  var _ref5$method, method, provider, _ref5$mode, mode, callbackUrl, marketplaceParams, _ref5$clearLogin, clearLogin, callback, loginUrl;
@@ -463,9 +463,10 @@ var ElvWalletClient = /*#__PURE__*/function () {
463
463
  *
464
464
  * @methodGroup Login
465
465
  */
466
+ )
466
467
  }, {
467
468
  key: "LogOut",
468
- value: function () {
469
+ value: (function () {
469
470
  var _LogOut = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
470
471
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
471
472
  while (1) switch (_context8.prev = _context8.next) {
@@ -508,7 +509,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
508
509
  return _LogOut.apply(this, arguments);
509
510
  }
510
511
  return LogOut;
511
- }()
512
+ }())
512
513
  }, {
513
514
  key: "TokenStatus",
514
515
  value: function () {
@@ -548,7 +549,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
548
549
  */
549
550
  }, {
550
551
  key: "Authenticate",
551
- value: function () {
552
+ value: (function () {
552
553
  var _Authenticate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref7) {
553
554
  var token, decodedToken;
554
555
  return _regeneratorRuntime.wrap(function _callee10$(_context10) {
@@ -605,6 +606,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
605
606
  * @param {string=} email - Email address of the user. If not specified, this method will attempt to extract the email from the ID token.
606
607
  * @param {Array<string>=} signerURIs - (Only if using custom OAuth) - URIs corresponding to the key server(s) to use
607
608
  * @param {boolean=} shareEmail=false - Whether or not the user consents to sharing their email
609
+ * @param {number=} tokenDuration=24 - Token expiration duration, in hours
608
610
  *
609
611
  * @returns {Promise<Object>} - Returns an authorization tokens that can be used to initialize the client using <a href="#Authenticate">Authenticate</a>.
610
612
  * Save this token to avoid having to reauthenticate with OAuth. This token expires after 24 hours.
@@ -614,26 +616,26 @@ var ElvWalletClient = /*#__PURE__*/function () {
614
616
  * - signingToken - Identical to `authToken`, but also includes the ability to perform arbitrary signatures with the custodial wallet. This token should be protected and should not be
615
617
  * shared with third parties.
616
618
  */
619
+ )
617
620
  }, {
618
621
  key: "AuthenticateOAuth",
619
- value: function () {
622
+ value: (function () {
620
623
  var _AuthenticateOAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref8) {
621
- var idToken, tenantId, email, signerURIs, _ref8$shareEmail, shareEmail, _ref8$extraData, extraData, nonce, _ref8$createRemoteTok, createRemoteToken, _ref8$force, force, tokenDuration, fabricToken, expiresAt, tokenResponse, address, decodedToken;
624
+ var idToken, tenantId, email, signerURIs, _ref8$shareEmail, shareEmail, _ref8$extraData, extraData, nonce, _ref8$createRemoteTok, createRemoteToken, _ref8$force, force, _ref8$tokenDuration, tokenDuration, fabricToken, expiresAt, tokenResponse, address, decodedToken;
622
625
  return _regeneratorRuntime.wrap(function _callee11$(_context11) {
623
626
  while (1) switch (_context11.prev = _context11.next) {
624
627
  case 0:
625
- idToken = _ref8.idToken, tenantId = _ref8.tenantId, email = _ref8.email, signerURIs = _ref8.signerURIs, _ref8$shareEmail = _ref8.shareEmail, shareEmail = _ref8$shareEmail === void 0 ? false : _ref8$shareEmail, _ref8$extraData = _ref8.extraData, extraData = _ref8$extraData === void 0 ? {} : _ref8$extraData, nonce = _ref8.nonce, _ref8$createRemoteTok = _ref8.createRemoteToken, createRemoteToken = _ref8$createRemoteTok === void 0 ? true : _ref8$createRemoteTok, _ref8$force = _ref8.force, force = _ref8$force === void 0 ? false : _ref8$force;
626
- tokenDuration = 24;
628
+ idToken = _ref8.idToken, tenantId = _ref8.tenantId, email = _ref8.email, signerURIs = _ref8.signerURIs, _ref8$shareEmail = _ref8.shareEmail, shareEmail = _ref8$shareEmail === void 0 ? false : _ref8$shareEmail, _ref8$extraData = _ref8.extraData, extraData = _ref8$extraData === void 0 ? {} : _ref8$extraData, nonce = _ref8.nonce, _ref8$createRemoteTok = _ref8.createRemoteToken, createRemoteToken = _ref8$createRemoteTok === void 0 ? true : _ref8$createRemoteTok, _ref8$force = _ref8.force, force = _ref8$force === void 0 ? false : _ref8$force, _ref8$tokenDuration = _ref8.tokenDuration, tokenDuration = _ref8$tokenDuration === void 0 ? 24 : _ref8$tokenDuration;
627
629
  if (!(!tenantId && this.selectedMarketplaceInfo)) {
628
- _context11.next = 6;
630
+ _context11.next = 5;
629
631
  break;
630
632
  }
631
- _context11.next = 5;
633
+ _context11.next = 4;
632
634
  return this.AvailableMarketplaces();
633
- case 5:
635
+ case 4:
634
636
  tenantId = this.selectedMarketplaceInfo.tenantId;
635
- case 6:
636
- _context11.next = 8;
637
+ case 5:
638
+ _context11.next = 7;
637
639
  return this.client.SetRemoteSigner({
638
640
  idToken: idToken,
639
641
  tenantId: tenantId,
@@ -643,54 +645,55 @@ var ElvWalletClient = /*#__PURE__*/function () {
643
645
  }),
644
646
  unsignedPublicAuth: true
645
647
  });
646
- case 8:
648
+ case 7:
647
649
  if (!(createRemoteToken && this.client.signer.remoteSigner)) {
648
- _context11.next = 17;
650
+ _context11.next = 16;
649
651
  break;
650
652
  }
651
- expiresAt = Date.now() + 24 * 60 * 60 * 1000;
652
- _context11.next = 12;
653
+ expiresAt = Date.now() + tokenDuration * 60 * 60 * 1000;
654
+ _context11.next = 11;
653
655
  return this.client.signer.RetrieveCSAT({
654
656
  email: email,
655
657
  nonce: nonce,
656
658
  tenantId: tenantId,
657
- force: force
659
+ force: force,
660
+ duration: tokenDuration
658
661
  });
659
- case 12:
662
+ case 11:
660
663
  tokenResponse = _context11.sent;
661
664
  fabricToken = tokenResponse.token;
662
665
  nonce = tokenResponse.nonce;
663
- _context11.next = 21;
666
+ _context11.next = 20;
664
667
  break;
665
- case 17:
668
+ case 16:
666
669
  expiresAt = Date.now() + tokenDuration * 60 * 60 * 1000;
667
- _context11.next = 20;
670
+ _context11.next = 19;
668
671
  return this.client.CreateFabricToken({
669
- duration: tokenDuration * 60 * 60 * 1000,
672
+ duration: parseInt(tokenDuration * 60 * 60 * 1000),
670
673
  context: email ? {
671
674
  usr: {
672
675
  email: email
673
676
  }
674
677
  } : {}
675
678
  });
676
- case 20:
679
+ case 19:
677
680
  fabricToken = _context11.sent;
678
- case 21:
681
+ case 20:
679
682
  address = this.client.utils.FormatAddress(this.client.CurrentAccountAddress());
680
683
  if (email) {
681
- _context11.next = 31;
684
+ _context11.next = 30;
682
685
  break;
683
686
  }
684
- _context11.prev = 23;
687
+ _context11.prev = 22;
685
688
  decodedToken = JSON.parse(this.utils.FromB64URL(idToken.split(".")[1]));
686
689
  email = decodedToken.email;
687
- _context11.next = 31;
690
+ _context11.next = 30;
688
691
  break;
689
- case 28:
690
- _context11.prev = 28;
691
- _context11.t0 = _context11["catch"](23);
692
+ case 27:
693
+ _context11.prev = 27;
694
+ _context11.t0 = _context11["catch"](22);
692
695
  throw Error("Failed to decode ID token");
693
- case 31:
696
+ case 30:
694
697
  this.client.SetStaticToken({
695
698
  token: fabricToken
696
699
  });
@@ -720,11 +723,11 @@ var ElvWalletClient = /*#__PURE__*/function () {
720
723
  nonce: nonce
721
724
  })
722
725
  });
723
- case 33:
726
+ case 32:
724
727
  case "end":
725
728
  return _context11.stop();
726
729
  }
727
- }, _callee11, this, [[23, 28]]);
730
+ }, _callee11, this, [[22, 27]]);
728
731
  }));
729
732
  function AuthenticateOAuth(_x13) {
730
733
  return _AuthenticateOAuth.apply(this, arguments);
@@ -744,9 +747,10 @@ var ElvWalletClient = /*#__PURE__*/function () {
744
747
  * @returns {Promise<string>} - Returns an authorization token that can be used to initialize the client using <a href="#Authenticate">Authenticate</a>.
745
748
  * Save this token to avoid having to reauthenticate. This token expires after 24 hours.
746
749
  */
750
+ )
747
751
  }, {
748
752
  key: "AuthenticateExternalWallet",
749
- value: function () {
753
+ value: (function () {
750
754
  var _AuthenticateExternalWallet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref9) {
751
755
  var _this2 = this;
752
756
  var address, _ref9$tokenDuration, tokenDuration, _ref9$walletName, walletName, Sign, expiresAt, fabricToken;
@@ -815,6 +819,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
815
819
  *
816
820
  * @returns {string} - The client auth token
817
821
  */
822
+ )
818
823
  }, {
819
824
  key: "ClientAuthToken",
820
825
  value: function ClientAuthToken() {
@@ -1080,51 +1085,100 @@ var ElvWalletClient = /*#__PURE__*/function () {
1080
1085
  return GetCodeAuth;
1081
1086
  }() // Internal loading methods
1082
1087
  }, {
1083
- key: "LoadAvailableMarketplaces",
1088
+ key: "TopLevelInfo",
1084
1089
  value: function () {
1085
- var _LoadAvailableMarketplaces = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
1086
- var _this4 = this;
1090
+ var _TopLevelInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
1087
1091
  var forceReload,
1088
- marketplaces,
1089
- availableMarketplaces,
1090
- availableMarketplacesById,
1091
1092
  _args18 = arguments;
1092
1093
  return _regeneratorRuntime.wrap(function _callee18$(_context18) {
1093
1094
  while (1) switch (_context18.prev = _context18.next) {
1094
1095
  case 0:
1095
1096
  forceReload = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : false;
1096
- if (!(!forceReload && Object.keys(this.availableMarketplaces) > 0)) {
1097
- _context18.next = 3;
1098
- break;
1097
+ if (!this.topLevelInfoPromise || forceReload) {
1098
+ this.topLevelInfoPromise = this.client.utils.ResponseToJson(this.client.MakeAuthServiceRequest({
1099
+ path: "/as/mw/toplevel",
1100
+ queryParams: {
1101
+ env: this.mode
1102
+ }
1103
+ }));
1099
1104
  }
1100
- return _context18.abrupt("return");
1101
- case 3:
1102
- marketplaces = this.topLevelInfo.marketplaces;
1103
- availableMarketplaces = _objectSpread({}, this.availableMarketplaces || {});
1104
- availableMarketplacesById = _objectSpread({}, this.availableMarketplacesById || {});
1105
- marketplaces.map(function (marketplaceInfo) {
1106
- var marketplaceId = Utils.DecodeVersionHash(marketplaceInfo.source_hash).objectId;
1107
- var marketplaceSlug = marketplaceInfo.slug || marketplaceInfo.name;
1108
- availableMarketplaces[marketplaceInfo.tenant_slug] = availableMarketplaces[marketplaceInfo.tenant_slug] || {};
1109
- availableMarketplaces[marketplaceInfo.tenant_slug][marketplaceSlug] = _objectSpread(_objectSpread({}, marketplaceInfo), {}, {
1110
- tenantName: marketplaceInfo.tenant_slug,
1111
- tenantSlug: marketplaceInfo.tenant_slug,
1112
- tenantId: marketplaceInfo.tenant_id,
1113
- marketplaceSlug: marketplaceSlug,
1114
- marketplaceId: marketplaceId,
1115
- marketplaceHash: marketplaceInfo.source_hash
1116
- });
1117
- availableMarketplacesById[marketplaceId] = availableMarketplaces[marketplaceInfo.tenant_slug][marketplaceSlug];
1118
- _this4.marketplaceHashes[marketplaceId] = marketplaceInfo.source_hash;
1119
- });
1120
- this.availableMarketplaces = availableMarketplaces;
1121
- this.availableMarketplacesById = availableMarketplacesById;
1122
- case 9:
1105
+ _context18.next = 4;
1106
+ return this.topLevelInfoPromise;
1107
+ case 4:
1108
+ return _context18.abrupt("return", _context18.sent);
1109
+ case 5:
1123
1110
  case "end":
1124
1111
  return _context18.stop();
1125
1112
  }
1126
1113
  }, _callee18, this);
1127
1114
  }));
1115
+ function TopLevelInfo() {
1116
+ return _TopLevelInfo.apply(this, arguments);
1117
+ }
1118
+ return TopLevelInfo;
1119
+ }()
1120
+ }, {
1121
+ key: "LoadAvailableMarketplaces",
1122
+ value: function () {
1123
+ var _LoadAvailableMarketplaces = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
1124
+ var _this4 = this;
1125
+ var forceReload,
1126
+ _args20 = arguments;
1127
+ return _regeneratorRuntime.wrap(function _callee20$(_context20) {
1128
+ while (1) switch (_context20.prev = _context20.next) {
1129
+ case 0:
1130
+ forceReload = _args20.length > 0 && _args20[0] !== undefined ? _args20[0] : false;
1131
+ if (!this.availableMarketplacesPromise || forceReload) {
1132
+ this.availableMarketplacesPromise = new Promise( /*#__PURE__*/function () {
1133
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(resolve) {
1134
+ var topLevelInfo, marketplaces, availableMarketplaces, availableMarketplacesById;
1135
+ return _regeneratorRuntime.wrap(function _callee19$(_context19) {
1136
+ while (1) switch (_context19.prev = _context19.next) {
1137
+ case 0:
1138
+ _context19.next = 2;
1139
+ return _this4.TopLevelInfo();
1140
+ case 2:
1141
+ topLevelInfo = _context19.sent;
1142
+ marketplaces = topLevelInfo.marketplaces;
1143
+ availableMarketplaces = _objectSpread({}, _this4.availableMarketplaces || {});
1144
+ availableMarketplacesById = _objectSpread({}, _this4.availableMarketplacesById || {});
1145
+ marketplaces.map(function (marketplaceInfo) {
1146
+ var marketplaceId = Utils.DecodeVersionHash(marketplaceInfo.source_hash).objectId;
1147
+ var marketplaceSlug = marketplaceInfo.slug || marketplaceInfo.name;
1148
+ availableMarketplaces[marketplaceInfo.tenant_slug] = availableMarketplaces[marketplaceInfo.tenant_slug] || {};
1149
+ availableMarketplaces[marketplaceInfo.tenant_slug][marketplaceSlug] = _objectSpread(_objectSpread({}, marketplaceInfo), {}, {
1150
+ tenantName: marketplaceInfo.tenant_slug,
1151
+ tenantSlug: marketplaceInfo.tenant_slug,
1152
+ tenantId: marketplaceInfo.tenant_id,
1153
+ marketplaceSlug: marketplaceSlug,
1154
+ marketplaceId: marketplaceId,
1155
+ marketplaceHash: marketplaceInfo.source_hash
1156
+ });
1157
+ availableMarketplacesById[marketplaceId] = availableMarketplaces[marketplaceInfo.tenant_slug][marketplaceSlug];
1158
+ _this4.marketplaceHashes[marketplaceId] = marketplaceInfo.source_hash;
1159
+ });
1160
+ _this4.availableMarketplaces = availableMarketplaces;
1161
+ _this4.availableMarketplacesById = availableMarketplacesById;
1162
+ resolve();
1163
+ case 10:
1164
+ case "end":
1165
+ return _context19.stop();
1166
+ }
1167
+ }, _callee19);
1168
+ }));
1169
+ return function (_x19) {
1170
+ return _ref17.apply(this, arguments);
1171
+ };
1172
+ }());
1173
+ }
1174
+ _context20.next = 4;
1175
+ return this.availableMarketplacesPromise;
1176
+ case 4:
1177
+ case "end":
1178
+ return _context20.stop();
1179
+ }
1180
+ }, _callee20, this);
1181
+ }));
1128
1182
  function LoadAvailableMarketplaces() {
1129
1183
  return _LoadAvailableMarketplaces.apply(this, arguments);
1130
1184
  }
@@ -1133,25 +1187,25 @@ var ElvWalletClient = /*#__PURE__*/function () {
1133
1187
  }, {
1134
1188
  key: "LatestMarketplaceHash",
1135
1189
  value: function () {
1136
- var _LatestMarketplaceHash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref17) {
1190
+ var _LatestMarketplaceHash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(_ref18) {
1137
1191
  var marketplaceParams, marketplaceInfo, marketplaceLink;
1138
- return _regeneratorRuntime.wrap(function _callee19$(_context19) {
1139
- while (1) switch (_context19.prev = _context19.next) {
1192
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
1193
+ while (1) switch (_context21.prev = _context21.next) {
1140
1194
  case 0:
1141
- marketplaceParams = _ref17.marketplaceParams;
1142
- _context19.next = 3;
1195
+ marketplaceParams = _ref18.marketplaceParams;
1196
+ _context21.next = 3;
1143
1197
  return this.MarketplaceInfo({
1144
1198
  marketplaceParams: marketplaceParams
1145
1199
  });
1146
1200
  case 3:
1147
- marketplaceInfo = _context19.sent;
1201
+ marketplaceInfo = _context21.sent;
1148
1202
  if (!(this.previewMarketplaceId && Utils.EqualHash(this.previewMarketplaceId, marketplaceInfo.marketplaceId))) {
1149
- _context19.next = 6;
1203
+ _context21.next = 6;
1150
1204
  break;
1151
1205
  }
1152
- return _context19.abrupt("return", this.previewMarketplaceHash);
1206
+ return _context21.abrupt("return", this.previewMarketplaceHash);
1153
1207
  case 6:
1154
- _context19.next = 8;
1208
+ _context21.next = 8;
1155
1209
  return this.client.ContentObjectMetadata({
1156
1210
  libraryId: this.mainSiteLibraryId,
1157
1211
  objectId: this.mainSiteId,
@@ -1160,15 +1214,15 @@ var ElvWalletClient = /*#__PURE__*/function () {
1160
1214
  noAuth: true
1161
1215
  });
1162
1216
  case 8:
1163
- marketplaceLink = _context19.sent;
1164
- return _context19.abrupt("return", LinkTargetHash(marketplaceLink));
1217
+ marketplaceLink = _context21.sent;
1218
+ return _context21.abrupt("return", LinkTargetHash(marketplaceLink));
1165
1219
  case 10:
1166
1220
  case "end":
1167
- return _context19.stop();
1221
+ return _context21.stop();
1168
1222
  }
1169
- }, _callee19, this);
1223
+ }, _callee21, this);
1170
1224
  }));
1171
- function LatestMarketplaceHash(_x19) {
1225
+ function LatestMarketplaceHash(_x20) {
1172
1226
  return _LatestMarketplaceHash.apply(this, arguments);
1173
1227
  }
1174
1228
  return LatestMarketplaceHash;
@@ -1176,34 +1230,37 @@ var ElvWalletClient = /*#__PURE__*/function () {
1176
1230
  }, {
1177
1231
  key: "LoadMarketplace",
1178
1232
  value: function () {
1179
- var _LoadMarketplace = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(marketplaceParams) {
1233
+ var _LoadMarketplace = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(marketplaceParams) {
1180
1234
  var _this5 = this;
1181
1235
  var marketplaceInfo, marketplaceId, marketplaceHash, marketplace;
1182
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
1183
- while (1) switch (_context21.prev = _context21.next) {
1236
+ return _regeneratorRuntime.wrap(function _callee23$(_context23) {
1237
+ while (1) switch (_context23.prev = _context23.next) {
1184
1238
  case 0:
1239
+ _context23.next = 2;
1240
+ return this.LoadAvailableMarketplaces();
1241
+ case 2:
1185
1242
  marketplaceInfo = this.MarketplaceInfo({
1186
1243
  marketplaceParams: marketplaceParams
1187
1244
  });
1188
1245
  marketplaceId = marketplaceInfo.marketplaceId;
1189
- _context21.next = 4;
1246
+ _context23.next = 6;
1190
1247
  return this.LatestMarketplaceHash({
1191
1248
  marketplaceParams: marketplaceParams
1192
1249
  });
1193
- case 4:
1194
- marketplaceHash = _context21.sent;
1250
+ case 6:
1251
+ marketplaceHash = _context23.sent;
1195
1252
  if (this.cachedMarketplaces[marketplaceId] && this.cachedMarketplaces[marketplaceId].versionHash !== marketplaceHash) {
1196
1253
  delete this.cachedMarketplaces[marketplaceId];
1197
1254
  }
1198
1255
  if (this.cachedMarketplaces[marketplaceId]) {
1199
- _context21.next = 34;
1256
+ _context23.next = 36;
1200
1257
  break;
1201
1258
  }
1202
1259
  if (!(this.previewMarketplaceId && Utils.EqualHash(marketplaceId, this.previewMarketplaceId))) {
1203
- _context21.next = 13;
1260
+ _context23.next = 15;
1204
1261
  break;
1205
1262
  }
1206
- _context21.next = 10;
1263
+ _context23.next = 12;
1207
1264
  return this.client.ContentObjectMetadata({
1208
1265
  versionHash: this.previewMarketplaceHash,
1209
1266
  metadataSubtree: "/public/asset_metadata/info",
@@ -1215,12 +1272,12 @@ var ElvWalletClient = /*#__PURE__*/function () {
1215
1272
  produceLinkUrls: true,
1216
1273
  authorizationToken: this.publicStaticToken
1217
1274
  });
1218
- case 10:
1219
- marketplace = _context21.sent;
1220
- _context21.next = 16;
1275
+ case 12:
1276
+ marketplace = _context23.sent;
1277
+ _context23.next = 18;
1221
1278
  break;
1222
- case 13:
1223
- _context21.next = 15;
1279
+ case 15:
1280
+ _context23.next = 17;
1224
1281
  return this.client.ContentObjectMetadata({
1225
1282
  libraryId: this.mainSiteLibraryId,
1226
1283
  objectId: this.mainSiteId,
@@ -1233,14 +1290,14 @@ var ElvWalletClient = /*#__PURE__*/function () {
1233
1290
  produceLinkUrls: true,
1234
1291
  authorizationToken: this.publicStaticToken
1235
1292
  });
1236
- case 15:
1237
- marketplace = _context21.sent;
1238
- case 16:
1293
+ case 17:
1294
+ marketplace = _context23.sent;
1295
+ case 18:
1239
1296
  if (!marketplace.branding.use_tenant_styling) {
1240
- _context21.next = 23;
1297
+ _context23.next = 25;
1241
1298
  break;
1242
1299
  }
1243
- _context21.next = 19;
1300
+ _context23.next = 21;
1244
1301
  return this.client.ContentObjectMetadata({
1245
1302
  libraryId: this.mainSiteLibraryId,
1246
1303
  objectId: this.mainSiteId,
@@ -1248,38 +1305,38 @@ var ElvWalletClient = /*#__PURE__*/function () {
1248
1305
  authorizationToken: this.publicStaticToken,
1249
1306
  produceLinkUrls: true
1250
1307
  });
1251
- case 19:
1252
- _context21.t0 = _context21.sent;
1253
- if (_context21.t0) {
1254
- _context21.next = 22;
1308
+ case 21:
1309
+ _context23.t0 = _context23.sent;
1310
+ if (_context23.t0) {
1311
+ _context23.next = 24;
1255
1312
  break;
1256
1313
  }
1257
- _context21.t0 = {};
1258
- case 22:
1259
- marketplace.tenantBranding = _context21.t0;
1260
- case 23:
1261
- _context21.next = 25;
1314
+ _context23.t0 = {};
1315
+ case 24:
1316
+ marketplace.tenantBranding = _context23.t0;
1317
+ case 25:
1318
+ _context23.next = 27;
1262
1319
  return Promise.all(marketplace.items.map( /*#__PURE__*/function () {
1263
- var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(item, index) {
1320
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(item, index) {
1264
1321
  var authorizationToken;
1265
- return _regeneratorRuntime.wrap(function _callee20$(_context20) {
1266
- while (1) switch (_context20.prev = _context20.next) {
1322
+ return _regeneratorRuntime.wrap(function _callee22$(_context22) {
1323
+ while (1) switch (_context22.prev = _context22.next) {
1267
1324
  case 0:
1268
1325
  if (!item.requires_permissions) {
1269
- _context20.next = 14;
1326
+ _context22.next = 14;
1270
1327
  break;
1271
1328
  }
1272
1329
  if (_this5.loggedIn) {
1273
- _context20.next = 5;
1330
+ _context22.next = 5;
1274
1331
  break;
1275
1332
  }
1276
- _context20.next = 4;
1333
+ _context22.next = 4;
1277
1334
  return _this5.client.CreateFabricToken({});
1278
1335
  case 4:
1279
- authorizationToken = _context20.sent;
1336
+ authorizationToken = _context22.sent;
1280
1337
  case 5:
1281
- _context20.prev = 5;
1282
- _context20.next = 8;
1338
+ _context22.prev = 5;
1339
+ _context22.next = 8;
1283
1340
  return _this5.client.ContentObjectMetadata({
1284
1341
  versionHash: LinkTargetHash(item.nft_template),
1285
1342
  metadataSubtree: "permissioned",
@@ -1287,29 +1344,29 @@ var ElvWalletClient = /*#__PURE__*/function () {
1287
1344
  });
1288
1345
  case 8:
1289
1346
  item.authorized = true;
1290
- _context20.next = 14;
1347
+ _context22.next = 14;
1291
1348
  break;
1292
1349
  case 11:
1293
- _context20.prev = 11;
1294
- _context20.t0 = _context20["catch"](5);
1350
+ _context22.prev = 11;
1351
+ _context22.t0 = _context22["catch"](5);
1295
1352
  item.authorized = false;
1296
1353
  case 14:
1297
1354
  item.nftTemplateMetadata = (item.nft_template || {}).nft || {};
1298
1355
  item.nftTemplateHash = ((item.nft_template || {})["."] || {}).source;
1299
1356
  item.itemIndex = index;
1300
- return _context20.abrupt("return", item);
1357
+ return _context22.abrupt("return", item);
1301
1358
  case 18:
1302
1359
  case "end":
1303
- return _context20.stop();
1360
+ return _context22.stop();
1304
1361
  }
1305
- }, _callee20, null, [[5, 11]]);
1362
+ }, _callee22, null, [[5, 11]]);
1306
1363
  }));
1307
- return function (_x21, _x22) {
1308
- return _ref18.apply(this, arguments);
1364
+ return function (_x22, _x23) {
1365
+ return _ref19.apply(this, arguments);
1309
1366
  };
1310
1367
  }()));
1311
- case 25:
1312
- marketplace.items = _context21.sent;
1368
+ case 27:
1369
+ marketplace.items = _context23.sent;
1313
1370
  marketplace.collections = (marketplace.collections || []).map(function (collection, collectionIndex) {
1314
1371
  return _objectSpread(_objectSpread({}, collection), {}, {
1315
1372
  collectionIndex: collectionIndex
@@ -1344,15 +1401,15 @@ var ElvWalletClient = /*#__PURE__*/function () {
1344
1401
  } catch (error) {}
1345
1402
  });
1346
1403
  this.cachedMarketplaces[marketplaceId] = marketplace;
1347
- case 34:
1348
- return _context21.abrupt("return", this.cachedMarketplaces[marketplaceId]);
1349
- case 35:
1404
+ case 36:
1405
+ return _context23.abrupt("return", this.cachedMarketplaces[marketplaceId]);
1406
+ case 37:
1350
1407
  case "end":
1351
- return _context21.stop();
1408
+ return _context23.stop();
1352
1409
  }
1353
- }, _callee21, this);
1410
+ }, _callee23, this);
1354
1411
  }));
1355
- function LoadMarketplace(_x20) {
1412
+ function LoadMarketplace(_x21) {
1356
1413
  return _LoadMarketplace.apply(this, arguments);
1357
1414
  }
1358
1415
  return LoadMarketplace;
@@ -1360,14 +1417,14 @@ var ElvWalletClient = /*#__PURE__*/function () {
1360
1417
  }, {
1361
1418
  key: "FilteredQuery",
1362
1419
  value: function () {
1363
- var _FilteredQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
1420
+ var _FilteredQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
1364
1421
  var _this6 = this;
1365
- var _ref19,
1366
- _ref19$mode,
1422
+ var _ref20,
1423
+ _ref20$mode,
1367
1424
  mode,
1368
- _ref19$sortBy,
1425
+ _ref20$sortBy,
1369
1426
  sortBy,
1370
- _ref19$sortDesc,
1427
+ _ref20$sortDesc,
1371
1428
  sortDesc,
1372
1429
  filter,
1373
1430
  editionFilters,
@@ -1383,15 +1440,15 @@ var ElvWalletClient = /*#__PURE__*/function () {
1383
1440
  capLimit,
1384
1441
  userAddress,
1385
1442
  sellerAddress,
1386
- _ref19$lastNDays,
1443
+ _ref20$lastNDays,
1387
1444
  lastNDays,
1388
1445
  startTime,
1389
1446
  endTime,
1390
- _ref19$includeCheckou,
1447
+ _ref20$includeCheckou,
1391
1448
  includeCheckoutLocked,
1392
- _ref19$start,
1449
+ _ref20$start,
1393
1450
  start,
1394
- _ref19$limit,
1451
+ _ref20$limit,
1395
1452
  limit,
1396
1453
  params,
1397
1454
  marketplaceInfo,
@@ -1399,15 +1456,15 @@ var ElvWalletClient = /*#__PURE__*/function () {
1399
1456
  filters,
1400
1457
  headers,
1401
1458
  path,
1402
- _ref21,
1459
+ _ref22,
1403
1460
  contents,
1404
1461
  paging,
1405
1462
  modesToFormat,
1406
- _args22 = arguments;
1407
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
1408
- while (1) switch (_context22.prev = _context22.next) {
1463
+ _args24 = arguments;
1464
+ return _regeneratorRuntime.wrap(function _callee24$(_context24) {
1465
+ while (1) switch (_context24.prev = _context24.next) {
1409
1466
  case 0:
1410
- _ref19 = _args22.length > 0 && _args22[0] !== undefined ? _args22[0] : {}, _ref19$mode = _ref19.mode, mode = _ref19$mode === void 0 ? "listings" : _ref19$mode, _ref19$sortBy = _ref19.sortBy, sortBy = _ref19$sortBy === void 0 ? "created" : _ref19$sortBy, _ref19$sortDesc = _ref19.sortDesc, sortDesc = _ref19$sortDesc === void 0 ? false : _ref19$sortDesc, filter = _ref19.filter, editionFilters = _ref19.editionFilters, attributeFilters = _ref19.attributeFilters, contractAddress = _ref19.contractAddress, tokenId = _ref19.tokenId, currency = _ref19.currency, marketplaceParams = _ref19.marketplaceParams, tenantId = _ref19.tenantId, collectionIndexes = _ref19.collectionIndexes, priceRange = _ref19.priceRange, tokenIdRange = _ref19.tokenIdRange, capLimit = _ref19.capLimit, userAddress = _ref19.userAddress, sellerAddress = _ref19.sellerAddress, _ref19$lastNDays = _ref19.lastNDays, lastNDays = _ref19$lastNDays === void 0 ? -1 : _ref19$lastNDays, startTime = _ref19.startTime, endTime = _ref19.endTime, _ref19$includeCheckou = _ref19.includeCheckoutLocked, includeCheckoutLocked = _ref19$includeCheckou === void 0 ? false : _ref19$includeCheckou, _ref19$start = _ref19.start, start = _ref19$start === void 0 ? 0 : _ref19$start, _ref19$limit = _ref19.limit, limit = _ref19$limit === void 0 ? 50 : _ref19$limit;
1467
+ _ref20 = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {}, _ref20$mode = _ref20.mode, mode = _ref20$mode === void 0 ? "listings" : _ref20$mode, _ref20$sortBy = _ref20.sortBy, sortBy = _ref20$sortBy === void 0 ? "created" : _ref20$sortBy, _ref20$sortDesc = _ref20.sortDesc, sortDesc = _ref20$sortDesc === void 0 ? false : _ref20$sortDesc, filter = _ref20.filter, editionFilters = _ref20.editionFilters, attributeFilters = _ref20.attributeFilters, contractAddress = _ref20.contractAddress, tokenId = _ref20.tokenId, currency = _ref20.currency, marketplaceParams = _ref20.marketplaceParams, tenantId = _ref20.tenantId, collectionIndexes = _ref20.collectionIndexes, priceRange = _ref20.priceRange, tokenIdRange = _ref20.tokenIdRange, capLimit = _ref20.capLimit, userAddress = _ref20.userAddress, sellerAddress = _ref20.sellerAddress, _ref20$lastNDays = _ref20.lastNDays, lastNDays = _ref20$lastNDays === void 0 ? -1 : _ref20$lastNDays, startTime = _ref20.startTime, endTime = _ref20.endTime, _ref20$includeCheckou = _ref20.includeCheckoutLocked, includeCheckoutLocked = _ref20$includeCheckou === void 0 ? false : _ref20$includeCheckou, _ref20$start = _ref20.start, start = _ref20$start === void 0 ? 0 : _ref20$start, _ref20$limit = _ref20.limit, limit = _ref20$limit === void 0 ? 50 : _ref20$limit;
1411
1468
  collectionIndexes = (collectionIndexes || []).map(function (i) {
1412
1469
  return parseInt(i);
1413
1470
  });
@@ -1426,27 +1483,27 @@ var ElvWalletClient = /*#__PURE__*/function () {
1426
1483
  params.checkout = true;
1427
1484
  }
1428
1485
  if (!marketplaceParams) {
1429
- _context22.next = 14;
1486
+ _context24.next = 14;
1430
1487
  break;
1431
1488
  }
1432
- _context22.next = 9;
1489
+ _context24.next = 9;
1433
1490
  return this.MarketplaceInfo({
1434
1491
  marketplaceParams: marketplaceParams
1435
1492
  });
1436
1493
  case 9:
1437
- marketplaceInfo = _context22.sent;
1494
+ marketplaceInfo = _context24.sent;
1438
1495
  if (!(collectionIndexes.length > 0)) {
1439
- _context22.next = 14;
1496
+ _context24.next = 14;
1440
1497
  break;
1441
1498
  }
1442
- _context22.next = 13;
1499
+ _context24.next = 13;
1443
1500
  return this.Marketplace({
1444
1501
  marketplaceParams: marketplaceParams
1445
1502
  });
1446
1503
  case 13:
1447
- marketplace = _context22.sent;
1504
+ marketplace = _context24.sent;
1448
1505
  case 14:
1449
- _context22.prev = 14;
1506
+ _context24.prev = 14;
1450
1507
  filters = [];
1451
1508
  if (sellerAddress) {
1452
1509
  filters.push("seller:eq:".concat(this.client.utils.FormatAddress(sellerAddress)));
@@ -1506,9 +1563,9 @@ var ElvWalletClient = /*#__PURE__*/function () {
1506
1563
  });
1507
1564
  }
1508
1565
  if (attributeFilters) {
1509
- attributeFilters.map(function (_ref20) {
1510
- var name = _ref20.name,
1511
- value = _ref20.value;
1566
+ attributeFilters.map(function (_ref21) {
1567
+ var name = _ref21.name,
1568
+ value = _ref21.value;
1512
1569
  if (!name || !value) {
1513
1570
  return;
1514
1571
  }
@@ -1547,50 +1604,50 @@ var ElvWalletClient = /*#__PURE__*/function () {
1547
1604
  if (capLimit) {
1548
1605
  filters.push("info/cap:le:".concat(parseInt(capLimit)));
1549
1606
  }
1550
- _context22.t0 = mode;
1551
- _context22.next = _context22.t0 === "owned" ? 29 : _context22.t0 === "owned-full-meta" ? 31 : _context22.t0 === "listings" ? 34 : _context22.t0 === "transfers" ? 36 : _context22.t0 === "sales" ? 40 : _context22.t0 === "listing-stats" ? 44 : _context22.t0 === "sales-stats" ? 46 : _context22.t0 === "leaderboard" ? 49 : 51;
1607
+ _context24.t0 = mode;
1608
+ _context24.next = _context24.t0 === "owned" ? 29 : _context24.t0 === "owned-full-meta" ? 31 : _context24.t0 === "listings" ? 34 : _context24.t0 === "transfers" ? 36 : _context24.t0 === "sales" ? 40 : _context24.t0 === "listing-stats" ? 44 : _context24.t0 === "sales-stats" ? 46 : _context24.t0 === "leaderboard" ? 49 : 51;
1552
1609
  break;
1553
1610
  case 29:
1554
1611
  path = UrlJoin("as", "wlt", userAddress || this.UserAddress());
1555
- return _context22.abrupt("break", 51);
1612
+ return _context24.abrupt("break", 51);
1556
1613
  case 31:
1557
1614
  path = UrlJoin("as", "apigw", "nfts");
1558
1615
  headers = {
1559
1616
  Authorization: "Bearer ".concat(this.AuthToken())
1560
1617
  };
1561
- return _context22.abrupt("break", 51);
1618
+ return _context24.abrupt("break", 51);
1562
1619
  case 34:
1563
1620
  path = UrlJoin("as", "mkt", "f");
1564
- return _context22.abrupt("break", 51);
1621
+ return _context24.abrupt("break", 51);
1565
1622
  case 36:
1566
1623
  path = UrlJoin("as", "mkt", "hst", "f");
1567
1624
  filters.push("action:eq:TRANSFERRED");
1568
1625
  filters.push("action:eq:SOLD");
1569
- return _context22.abrupt("break", 51);
1626
+ return _context24.abrupt("break", 51);
1570
1627
  case 40:
1571
1628
  path = UrlJoin("as", "mkt", "hst", "f");
1572
1629
  filters.push("action:eq:SOLD");
1573
1630
  filters.push("seller:co:0x");
1574
- return _context22.abrupt("break", 51);
1631
+ return _context24.abrupt("break", 51);
1575
1632
  case 44:
1576
1633
  path = UrlJoin("as", "mkt", "stats", "listed");
1577
- return _context22.abrupt("break", 51);
1634
+ return _context24.abrupt("break", 51);
1578
1635
  case 46:
1579
1636
  path = UrlJoin("as", "mkt", "stats", "sold");
1580
1637
  filters.push("seller:co:0x");
1581
- return _context22.abrupt("break", 51);
1638
+ return _context24.abrupt("break", 51);
1582
1639
  case 49:
1583
1640
  path = UrlJoin("as", "wlt", "leaders");
1584
- return _context22.abrupt("break", 51);
1641
+ return _context24.abrupt("break", 51);
1585
1642
  case 51:
1586
1643
  if (filters.length > 0) {
1587
1644
  params.filter = filters;
1588
1645
  }
1589
1646
  if (!mode.includes("stats")) {
1590
- _context22.next = 56;
1647
+ _context24.next = 56;
1591
1648
  break;
1592
1649
  }
1593
- _context22.next = 55;
1650
+ _context24.next = 55;
1594
1651
  return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
1595
1652
  path: path,
1596
1653
  method: "GET",
@@ -1598,10 +1655,10 @@ var ElvWalletClient = /*#__PURE__*/function () {
1598
1655
  headers: headers
1599
1656
  }));
1600
1657
  case 55:
1601
- return _context22.abrupt("return", _context22.sent);
1658
+ return _context24.abrupt("return", _context24.sent);
1602
1659
  case 56:
1603
- _context22.t2 = Utils;
1604
- _context22.next = 59;
1660
+ _context24.t2 = Utils;
1661
+ _context24.next = 59;
1605
1662
  return this.client.authClient.MakeAuthServiceRequest({
1606
1663
  path: path,
1607
1664
  method: "GET",
@@ -1609,22 +1666,22 @@ var ElvWalletClient = /*#__PURE__*/function () {
1609
1666
  headers: headers
1610
1667
  });
1611
1668
  case 59:
1612
- _context22.t3 = _context22.sent;
1613
- _context22.next = 62;
1614
- return _context22.t2.ResponseToJson.call(_context22.t2, _context22.t3);
1669
+ _context24.t3 = _context24.sent;
1670
+ _context24.next = 62;
1671
+ return _context24.t2.ResponseToJson.call(_context24.t2, _context24.t3);
1615
1672
  case 62:
1616
- _context22.t1 = _context22.sent;
1617
- if (_context22.t1) {
1618
- _context22.next = 65;
1673
+ _context24.t1 = _context24.sent;
1674
+ if (_context24.t1) {
1675
+ _context24.next = 65;
1619
1676
  break;
1620
1677
  }
1621
- _context22.t1 = [];
1678
+ _context24.t1 = [];
1622
1679
  case 65:
1623
- _ref21 = _context22.t1;
1624
- contents = _ref21.contents;
1625
- paging = _ref21.paging;
1680
+ _ref22 = _context24.t1;
1681
+ contents = _ref22.contents;
1682
+ paging = _ref22.paging;
1626
1683
  modesToFormat = ["owned", "listings", "owned-full-meta"];
1627
- return _context22.abrupt("return", {
1684
+ return _context24.abrupt("return", {
1628
1685
  paging: {
1629
1686
  start: params.start,
1630
1687
  limit: params.limit,
@@ -1636,13 +1693,13 @@ var ElvWalletClient = /*#__PURE__*/function () {
1636
1693
  })
1637
1694
  });
1638
1695
  case 72:
1639
- _context22.prev = 72;
1640
- _context22.t4 = _context22["catch"](14);
1641
- if (!(_context22.t4.status && _context22.t4.status.toString() === "404")) {
1642
- _context22.next = 76;
1696
+ _context24.prev = 72;
1697
+ _context24.t4 = _context24["catch"](14);
1698
+ if (!(_context24.t4.status && _context24.t4.status.toString() === "404")) {
1699
+ _context24.next = 76;
1643
1700
  break;
1644
1701
  }
1645
- return _context22.abrupt("return", {
1702
+ return _context24.abrupt("return", {
1646
1703
  paging: {
1647
1704
  start: params.start,
1648
1705
  limit: params.limit,
@@ -1652,12 +1709,12 @@ var ElvWalletClient = /*#__PURE__*/function () {
1652
1709
  results: []
1653
1710
  });
1654
1711
  case 76:
1655
- throw _context22.t4;
1712
+ throw _context24.t4;
1656
1713
  case 77:
1657
1714
  case "end":
1658
- return _context22.stop();
1715
+ return _context24.stop();
1659
1716
  }
1660
- }, _callee22, this, [[14, 72]]);
1717
+ }, _callee24, this, [[14, 72]]);
1661
1718
  }));
1662
1719
  function FilteredQuery() {
1663
1720
  return _FilteredQuery.apply(this, arguments);
@@ -1667,26 +1724,26 @@ var ElvWalletClient = /*#__PURE__*/function () {
1667
1724
  }, {
1668
1725
  key: "MintingStatus",
1669
1726
  value: function () {
1670
- var _MintingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(_ref22) {
1727
+ var _MintingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref23) {
1671
1728
  var marketplaceParams, tenantId, marketplaceInfo, response;
1672
- return _regeneratorRuntime.wrap(function _callee23$(_context23) {
1673
- while (1) switch (_context23.prev = _context23.next) {
1729
+ return _regeneratorRuntime.wrap(function _callee25$(_context25) {
1730
+ while (1) switch (_context25.prev = _context25.next) {
1674
1731
  case 0:
1675
- marketplaceParams = _ref22.marketplaceParams, tenantId = _ref22.tenantId;
1732
+ marketplaceParams = _ref23.marketplaceParams, tenantId = _ref23.tenantId;
1676
1733
  if (tenantId) {
1677
- _context23.next = 6;
1734
+ _context25.next = 6;
1678
1735
  break;
1679
1736
  }
1680
- _context23.next = 4;
1737
+ _context25.next = 4;
1681
1738
  return this.MarketplaceInfo({
1682
1739
  marketplaceParams: marketplaceParams || this.selectedMarketplaceInfo
1683
1740
  });
1684
1741
  case 4:
1685
- marketplaceInfo = _context23.sent;
1742
+ marketplaceInfo = _context25.sent;
1686
1743
  tenantId = marketplaceInfo.tenantId;
1687
1744
  case 6:
1688
- _context23.prev = 6;
1689
- _context23.next = 9;
1745
+ _context25.prev = 6;
1746
+ _context25.next = 9;
1690
1747
  return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
1691
1748
  path: UrlJoin("as", "wlt", "status", "act", tenantId),
1692
1749
  method: "GET",
@@ -1695,8 +1752,8 @@ var ElvWalletClient = /*#__PURE__*/function () {
1695
1752
  }
1696
1753
  }));
1697
1754
  case 9:
1698
- response = _context23.sent;
1699
- return _context23.abrupt("return", response.map(function (status) {
1755
+ response = _context25.sent;
1756
+ return _context25.abrupt("return", response.map(function (status) {
1700
1757
  var _status$op$split = status.op.split(":"),
1701
1758
  _status$op$split2 = _slicedToArray(_status$op$split, 3),
1702
1759
  op = _status$op$split2[0],
@@ -1759,17 +1816,17 @@ var ElvWalletClient = /*#__PURE__*/function () {
1759
1816
  return a.ts < b.ts ? 1 : -1;
1760
1817
  }));
1761
1818
  case 13:
1762
- _context23.prev = 13;
1763
- _context23.t0 = _context23["catch"](6);
1764
- this.Log("Failed to retrieve minting status", true, _context23.t0);
1765
- return _context23.abrupt("return", []);
1819
+ _context25.prev = 13;
1820
+ _context25.t0 = _context25["catch"](6);
1821
+ this.Log("Failed to retrieve minting status", true, _context25.t0);
1822
+ return _context25.abrupt("return", []);
1766
1823
  case 17:
1767
1824
  case "end":
1768
- return _context23.stop();
1825
+ return _context25.stop();
1769
1826
  }
1770
- }, _callee23, this, [[6, 13]]);
1827
+ }, _callee25, this, [[6, 13]]);
1771
1828
  }));
1772
- function MintingStatus(_x23) {
1829
+ function MintingStatus(_x24) {
1773
1830
  return _MintingStatus.apply(this, arguments);
1774
1831
  }
1775
1832
  return MintingStatus;
@@ -1777,17 +1834,17 @@ var ElvWalletClient = /*#__PURE__*/function () {
1777
1834
  }, {
1778
1835
  key: "DeployTenant",
1779
1836
  value: function () {
1780
- var _DeployTenant = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(_ref23) {
1781
- var tenantId, _ref23$tenantSlug, tenantSlug, tenantHash, _ref23$environment, environment, tenantLink, deployedTenantHash, body, token;
1782
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
1783
- while (1) switch (_context24.prev = _context24.next) {
1837
+ var _DeployTenant = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(_ref24) {
1838
+ var tenantId, _ref24$tenantSlug, tenantSlug, tenantHash, _ref24$environment, environment, tenantLink, deployedTenantHash, body, token;
1839
+ return _regeneratorRuntime.wrap(function _callee26$(_context26) {
1840
+ while (1) switch (_context26.prev = _context26.next) {
1784
1841
  case 0:
1785
- tenantId = _ref23.tenantId, _ref23$tenantSlug = _ref23.tenantSlug, tenantSlug = _ref23$tenantSlug === void 0 ? "" : _ref23$tenantSlug, tenantHash = _ref23.tenantHash, _ref23$environment = _ref23.environment, environment = _ref23$environment === void 0 ? "production" : _ref23$environment;
1842
+ tenantId = _ref24.tenantId, _ref24$tenantSlug = _ref24.tenantSlug, tenantSlug = _ref24$tenantSlug === void 0 ? "" : _ref24$tenantSlug, tenantHash = _ref24.tenantHash, _ref24$environment = _ref24.environment, environment = _ref24$environment === void 0 ? "production" : _ref24$environment;
1786
1843
  if (tenantHash) {
1787
- _context24.next = 11;
1844
+ _context26.next = 11;
1788
1845
  break;
1789
1846
  }
1790
- _context24.next = 4;
1847
+ _context26.next = 4;
1791
1848
  return this.client.ContentObjectMetadata({
1792
1849
  libraryId: this.mainSiteLibraryId,
1793
1850
  objectId: this.mainSiteId,
@@ -1799,31 +1856,31 @@ var ElvWalletClient = /*#__PURE__*/function () {
1799
1856
  select: ["."]
1800
1857
  });
1801
1858
  case 4:
1802
- tenantLink = _context24.sent;
1859
+ tenantLink = _context26.sent;
1803
1860
  if (tenantLink) {
1804
- _context24.next = 7;
1861
+ _context26.next = 7;
1805
1862
  break;
1806
1863
  }
1807
1864
  throw Error("Eluvio Wallet Client: Invalid or missing tenancy: ".concat(tenantSlug));
1808
1865
  case 7:
1809
1866
  deployedTenantHash = tenantLink["."].source;
1810
- _context24.next = 10;
1867
+ _context26.next = 10;
1811
1868
  return this.client.LatestVersionHash({
1812
1869
  versionHash: deployedTenantHash
1813
1870
  });
1814
1871
  case 10:
1815
- tenantHash = _context24.sent;
1872
+ tenantHash = _context26.sent;
1816
1873
  case 11:
1817
1874
  body = {
1818
1875
  content_hash: tenantHash,
1819
1876
  env: environment,
1820
1877
  ts: Date.now()
1821
1878
  };
1822
- _context24.next = 14;
1879
+ _context26.next = 14;
1823
1880
  return this.client.Sign(JSON.stringify(body));
1824
1881
  case 14:
1825
- token = _context24.sent;
1826
- _context24.next = 17;
1882
+ token = _context26.sent;
1883
+ _context26.next = 17;
1827
1884
  return this.client.authClient.MakeAuthServiceRequest({
1828
1885
  path: UrlJoin("as", "tnt", "config", tenantId, "metadata"),
1829
1886
  method: "POST",
@@ -1834,15 +1891,51 @@ var ElvWalletClient = /*#__PURE__*/function () {
1834
1891
  });
1835
1892
  case 17:
1836
1893
  case "end":
1837
- return _context24.stop();
1894
+ return _context26.stop();
1838
1895
  }
1839
- }, _callee24, this);
1896
+ }, _callee26, this);
1840
1897
  }));
1841
- function DeployTenant(_x24) {
1898
+ function DeployTenant(_x25) {
1842
1899
  return _DeployTenant.apply(this, arguments);
1843
1900
  }
1844
1901
  return DeployTenant;
1845
1902
  }()
1903
+ }, {
1904
+ key: "PurgeUrl",
1905
+ value: function () {
1906
+ var _PurgeUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(_ref25) {
1907
+ var tenantId, url, body, token;
1908
+ return _regeneratorRuntime.wrap(function _callee27$(_context27) {
1909
+ while (1) switch (_context27.prev = _context27.next) {
1910
+ case 0:
1911
+ tenantId = _ref25.tenantId, url = _ref25.url;
1912
+ body = {
1913
+ url: url
1914
+ };
1915
+ _context27.next = 4;
1916
+ return this.client.CreateFabricToken({});
1917
+ case 4:
1918
+ token = _context27.sent;
1919
+ _context27.next = 7;
1920
+ return this.client.authClient.MakeAuthServiceRequest({
1921
+ path: UrlJoin("as", "tnt", tenantId, "purge"),
1922
+ method: "POST",
1923
+ body: body,
1924
+ headers: {
1925
+ Authorization: "Bearer ".concat(token)
1926
+ }
1927
+ });
1928
+ case 7:
1929
+ case "end":
1930
+ return _context27.stop();
1931
+ }
1932
+ }, _callee27, this);
1933
+ }));
1934
+ function PurgeUrl(_x26) {
1935
+ return _PurgeUrl.apply(this, arguments);
1936
+ }
1937
+ return PurgeUrl;
1938
+ }()
1846
1939
  }], [{
1847
1940
  key: "ForbiddenMethods",
1848
1941
  value: function ForbiddenMethods() {
@@ -1878,49 +1971,49 @@ var ElvWalletClient = /*#__PURE__*/function () {
1878
1971
  */
1879
1972
  }, {
1880
1973
  key: "Initialize",
1881
- value: function () {
1882
- var _Initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref24) {
1883
- var client, _ref24$appId, appId, _ref24$network, network, _ref24$mode, mode, localization, marketplaceParams, previewMarketplaceId, _ref24$storeAuthToken, storeAuthToken, _ref24$skipMarketplac, skipMarketplaceLoad, _ref25, tenantSlug, marketplaceSlug, marketplaceId, marketplaceHash, previewMarketplaceHash, walletClient, url, savedToken;
1884
- return _regeneratorRuntime.wrap(function _callee25$(_context25) {
1885
- while (1) switch (_context25.prev = _context25.next) {
1974
+ value: (function () {
1975
+ var _Initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(_ref26) {
1976
+ var client, _ref26$appId, appId, _ref26$network, network, _ref26$mode, mode, localization, marketplaceParams, previewMarketplaceId, _ref26$storeAuthToken, storeAuthToken, _ref26$skipMarketplac, skipMarketplaceLoad, _ref27, tenantSlug, marketplaceSlug, marketplaceId, marketplaceHash, previewMarketplaceHash, walletClient, url, savedToken;
1977
+ return _regeneratorRuntime.wrap(function _callee28$(_context28) {
1978
+ while (1) switch (_context28.prev = _context28.next) {
1886
1979
  case 0:
1887
- client = _ref24.client, _ref24$appId = _ref24.appId, appId = _ref24$appId === void 0 ? "general" : _ref24$appId, _ref24$network = _ref24.network, network = _ref24$network === void 0 ? "main" : _ref24$network, _ref24$mode = _ref24.mode, mode = _ref24$mode === void 0 ? "production" : _ref24$mode, localization = _ref24.localization, marketplaceParams = _ref24.marketplaceParams, previewMarketplaceId = _ref24.previewMarketplaceId, _ref24$storeAuthToken = _ref24.storeAuthToken, storeAuthToken = _ref24$storeAuthToken === void 0 ? true : _ref24$storeAuthToken, _ref24$skipMarketplac = _ref24.skipMarketplaceLoad, skipMarketplaceLoad = _ref24$skipMarketplac === void 0 ? false : _ref24$skipMarketplac;
1888
- _ref25 = marketplaceParams || {}, tenantSlug = _ref25.tenantSlug, marketplaceSlug = _ref25.marketplaceSlug, marketplaceId = _ref25.marketplaceId, marketplaceHash = _ref25.marketplaceHash;
1980
+ client = _ref26.client, _ref26$appId = _ref26.appId, appId = _ref26$appId === void 0 ? "general" : _ref26$appId, _ref26$network = _ref26.network, network = _ref26$network === void 0 ? "main" : _ref26$network, _ref26$mode = _ref26.mode, mode = _ref26$mode === void 0 ? "production" : _ref26$mode, localization = _ref26.localization, marketplaceParams = _ref26.marketplaceParams, previewMarketplaceId = _ref26.previewMarketplaceId, _ref26$storeAuthToken = _ref26.storeAuthToken, storeAuthToken = _ref26$storeAuthToken === void 0 ? true : _ref26$storeAuthToken, _ref26$skipMarketplac = _ref26.skipMarketplaceLoad, skipMarketplaceLoad = _ref26$skipMarketplac === void 0 ? false : _ref26$skipMarketplac;
1981
+ _ref27 = marketplaceParams || {}, tenantSlug = _ref27.tenantSlug, marketplaceSlug = _ref27.marketplaceSlug, marketplaceId = _ref27.marketplaceId, marketplaceHash = _ref27.marketplaceHash;
1889
1982
  if (Configuration[network]) {
1890
- _context25.next = 6;
1983
+ _context28.next = 6;
1891
1984
  break;
1892
1985
  }
1893
1986
  throw Error("ElvWalletClient: Invalid network ".concat(network));
1894
1987
  case 6:
1895
1988
  if (Configuration[network][mode]) {
1896
- _context25.next = 8;
1989
+ _context28.next = 8;
1897
1990
  break;
1898
1991
  }
1899
1992
  throw Error("ElvWalletClient: Invalid mode ".concat(mode));
1900
1993
  case 8:
1901
1994
  if (client) {
1902
- _context25.next = 12;
1995
+ _context28.next = 12;
1903
1996
  break;
1904
1997
  }
1905
- _context25.next = 11;
1998
+ _context28.next = 11;
1906
1999
  return ElvClient.FromNetworkName({
1907
2000
  networkName: network,
1908
2001
  assumeV3: true
1909
2002
  });
1910
2003
  case 11:
1911
- client = _context25.sent;
2004
+ client = _context28.sent;
1912
2005
  case 12:
1913
2006
  previewMarketplaceHash = previewMarketplaceId;
1914
2007
  if (!(previewMarketplaceHash && !previewMarketplaceHash.startsWith("hq__"))) {
1915
- _context25.next = 17;
2008
+ _context28.next = 17;
1916
2009
  break;
1917
2010
  }
1918
- _context25.next = 16;
2011
+ _context28.next = 16;
1919
2012
  return client.LatestVersionHash({
1920
2013
  objectId: previewMarketplaceId
1921
2014
  });
1922
2015
  case 16:
1923
- previewMarketplaceHash = _context25.sent;
2016
+ previewMarketplaceHash = _context28.sent;
1924
2017
  case 17:
1925
2018
  walletClient = new ElvWalletClient({
1926
2019
  appId: appId,
@@ -1938,76 +2031,62 @@ var ElvWalletClient = /*#__PURE__*/function () {
1938
2031
  storeAuthToken: storeAuthToken
1939
2032
  });
1940
2033
  if (!(inBrowser && window.location && window.location.href)) {
1941
- _context25.next = 37;
2034
+ _context28.next = 37;
1942
2035
  break;
1943
2036
  }
1944
2037
  url = new URL(window.location.href);
1945
2038
  if (!url.searchParams.get("elvToken")) {
1946
- _context25.next = 27;
2039
+ _context28.next = 27;
1947
2040
  break;
1948
2041
  }
1949
- _context25.next = 23;
2042
+ _context28.next = 23;
1950
2043
  return walletClient.Authenticate({
1951
2044
  token: url.searchParams.get("elvToken")
1952
2045
  });
1953
2046
  case 23:
1954
2047
  url.searchParams["delete"]("elvToken");
1955
2048
  window.history.replaceState("", "", url);
1956
- _context25.next = 37;
2049
+ _context28.next = 37;
1957
2050
  break;
1958
2051
  case 27:
1959
2052
  if (!(storeAuthToken && localStorageAvailable)) {
1960
- _context25.next = 37;
2053
+ _context28.next = 37;
1961
2054
  break;
1962
2055
  }
1963
- _context25.prev = 28;
2056
+ _context28.prev = 28;
1964
2057
  // Load saved auth token
1965
2058
  savedToken = localStorage.getItem("__elv-token-".concat(network));
1966
2059
  if (!savedToken) {
1967
- _context25.next = 33;
2060
+ _context28.next = 33;
1968
2061
  break;
1969
2062
  }
1970
- _context25.next = 33;
2063
+ _context28.next = 33;
1971
2064
  return walletClient.Authenticate({
1972
2065
  token: savedToken
1973
2066
  });
1974
2067
  case 33:
1975
- _context25.next = 37;
2068
+ _context28.next = 37;
1976
2069
  break;
1977
2070
  case 35:
1978
- _context25.prev = 35;
1979
- _context25.t0 = _context25["catch"](28);
2071
+ _context28.prev = 35;
2072
+ _context28.t0 = _context28["catch"](28);
1980
2073
  case 37:
1981
- _context25.next = 39;
1982
- return client.utils.ResponseToJson(client.MakeAuthServiceRequest({
1983
- path: "/as/mw/toplevel",
1984
- queryParams: {
1985
- env: mode
1986
- }
1987
- }));
1988
- case 39:
1989
- walletClient.topLevelInfo = _context25.sent;
1990
- if (skipMarketplaceLoad) {
1991
- _context25.next = 43;
1992
- break;
2074
+ if (!skipMarketplaceLoad) {
2075
+ walletClient.LoadAvailableMarketplaces();
1993
2076
  }
1994
- _context25.next = 43;
1995
- return walletClient.LoadAvailableMarketplaces();
1996
- case 43:
1997
- return _context25.abrupt("return", walletClient);
1998
- case 44:
2077
+ return _context28.abrupt("return", walletClient);
2078
+ case 39:
1999
2079
  case "end":
2000
- return _context25.stop();
2080
+ return _context28.stop();
2001
2081
  }
2002
- }, _callee25, null, [[28, 35]]);
2082
+ }, _callee28, null, [[28, 35]]);
2003
2083
  }));
2004
- function Initialize(_x25) {
2084
+ function Initialize(_x27) {
2005
2085
  return _Initialize.apply(this, arguments);
2006
2086
  }
2007
2087
  return Initialize;
2008
- }()
2088
+ }())
2009
2089
  }]);
2010
- return ElvWalletClient;
2011
2090
  }();
2012
2091
  Object.assign(ElvWalletClient.prototype, require("./ClientMethods"));
2013
2092
  Object.assign(ElvWalletClient.prototype, require("./Profile"));