@eluvio/elv-client-js 4.2.11 → 4.2.13

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 (40) hide show
  1. package/dist/ElvClient-min.js +1 -1
  2. package/dist/ElvClient-node-min.js +1 -1
  3. package/dist/ElvFrameClient-min.js +1 -1
  4. package/dist/ElvPermissionsClient-min.js +1 -1
  5. package/dist/ElvWalletClient-min.js +1 -1
  6. package/dist/ElvWalletClient-node-min.js +1 -1
  7. package/dist/src/AuthorizationClient.js +710 -723
  8. package/dist/src/ContentObjectAudit.js +56 -56
  9. package/dist/src/Crypto.js +85 -85
  10. package/dist/src/ElvClient.js +530 -500
  11. package/dist/src/ElvWallet.js +30 -28
  12. package/dist/src/EthClient.js +311 -311
  13. package/dist/src/FrameClient.js +63 -64
  14. package/dist/src/HttpClient.js +60 -60
  15. package/dist/src/Id.js +1 -2
  16. package/dist/src/PermissionsClient.js +499 -487
  17. package/dist/src/RemoteSigner.js +114 -163
  18. package/dist/src/UserProfileClient.js +392 -374
  19. package/dist/src/Utils.js +69 -66
  20. package/dist/src/Validation.js +10 -10
  21. package/dist/src/client/ABRPublishing.js +238 -238
  22. package/dist/src/client/AccessGroups.js +477 -474
  23. package/dist/src/client/ContentAccess.js +1707 -1711
  24. package/dist/src/client/ContentManagement.js +871 -871
  25. package/dist/src/client/Contracts.js +575 -578
  26. package/dist/src/client/Files.js +700 -684
  27. package/dist/src/client/LiveConf.js +1 -6
  28. package/dist/src/client/LiveStream.js +723 -686
  29. package/dist/src/client/NFT.js +14 -14
  30. package/dist/src/client/NTP.js +84 -84
  31. package/dist/src/client/Shares.js +53 -60
  32. package/dist/src/walletClient/ClientMethods.js +977 -951
  33. package/dist/src/walletClient/Notifications.js +14 -14
  34. package/dist/src/walletClient/Profile.js +66 -66
  35. package/dist/src/walletClient/Utils.js +15 -15
  36. package/dist/src/walletClient/index.js +579 -581
  37. package/package.json +1 -1
  38. package/src/client/ContentAccess.js +1 -1
  39. package/src/client/LiveStream.js +2 -1
  40. package/dist/src/ContentObjectVerification.js +0 -281
@@ -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,56 +136,56 @@ var ElvWalletClient = /*#__PURE__*/function () {
136
136
  */
137
137
  }, {
138
138
  key: "PersonalSign",
139
- value: function () {
140
- var _PersonalSign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
139
+ value: (function () {
140
+ var _PersonalSign = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
141
141
  var message, parameters, url;
142
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
142
+ return _regeneratorRuntime.wrap(function (_context3) {
143
143
  while (1) switch (_context3.prev = _context3.next) {
144
144
  case 0:
145
145
  message = _ref2.message;
146
146
  if (this.loggedIn) {
147
- _context3.next = 3;
147
+ _context3.next = 1;
148
148
  break;
149
149
  }
150
150
  throw Error("ElvWalletClient: Unable to perform signature - Not logged in");
151
- case 3:
151
+ case 1:
152
152
  if (!this.CanSign()) {
153
- _context3.next = 19;
153
+ _context3.next = 6;
154
154
  break;
155
155
  }
156
156
  if (!this.__authorization.clusterToken) {
157
- _context3.next = 12;
157
+ _context3.next = 3;
158
158
  break;
159
159
  }
160
160
  // Custodial wallet sign
161
161
 
162
162
  message = _typeof(message) === "object" ? JSON.stringify(message) : message;
163
163
  message = Ethers.utils.keccak256(Buffer.from("\x19Ethereum Signed Message:\n".concat(message.length).concat(message), "utf-8"));
164
- _context3.next = 9;
164
+ _context3.next = 2;
165
165
  return this.client.authClient.Sign(message);
166
- case 9:
166
+ case 2:
167
167
  return _context3.abrupt("return", _context3.sent);
168
- case 12:
168
+ case 3:
169
169
  if (!(this.UserInfo().walletName.toLowerCase() === "metamask")) {
170
- _context3.next = 16;
170
+ _context3.next = 4;
171
171
  break;
172
172
  }
173
173
  return _context3.abrupt("return", this.SignMetamask({
174
174
  message: message,
175
175
  address: this.UserAddress()
176
176
  }));
177
- case 16:
177
+ case 4:
178
178
  throw Error("ElvWalletClient: Unable to sign");
179
- case 17:
180
- _context3.next = 21;
179
+ case 5:
180
+ _context3.next = 7;
181
181
  break;
182
- case 19:
182
+ case 6:
183
183
  if (inBrowser) {
184
- _context3.next = 21;
184
+ _context3.next = 7;
185
185
  break;
186
186
  }
187
187
  throw Error("ElvWalletClient: Unable to sign");
188
- case 21:
188
+ case 7:
189
189
  parameters = {
190
190
  action: "personal-sign",
191
191
  message: message,
@@ -195,18 +195,18 @@ var ElvWalletClient = /*#__PURE__*/function () {
195
195
  url.hash = UrlJoin("/action", "sign", Utils.B58(JSON.stringify(parameters)));
196
196
  url.searchParams.set("origin", window.location.origin);
197
197
  if (!(!embedded && window.location.origin === url.origin)) {
198
- _context3.next = 27;
198
+ _context3.next = 8;
199
199
  break;
200
200
  }
201
201
  throw Error("ElvWalletClient: Unable to sign");
202
- case 27:
203
- _context3.next = 29;
204
- return new Promise( /*#__PURE__*/function () {
205
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve, reject) {
206
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
202
+ case 8:
203
+ _context3.next = 9;
204
+ return new Promise(/*#__PURE__*/function () {
205
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve, reject) {
206
+ return _regeneratorRuntime.wrap(function (_context2) {
207
207
  while (1) switch (_context2.prev = _context2.next) {
208
208
  case 0:
209
- _context2.next = 2;
209
+ _context2.next = 1;
210
210
  return ActionPopup({
211
211
  mode: "tab",
212
212
  url: url.toString(),
@@ -214,16 +214,16 @@ var ElvWalletClient = /*#__PURE__*/function () {
214
214
  return reject("User cancelled sign");
215
215
  },
216
216
  onMessage: function () {
217
- var _onMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event, Close) {
218
- return _regeneratorRuntime.wrap(function _callee$(_context) {
217
+ var _onMessage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(event, Close) {
218
+ return _regeneratorRuntime.wrap(function (_context) {
219
219
  while (1) switch (_context.prev = _context.next) {
220
220
  case 0:
221
221
  if (!(!event || !event.data || event.data.type !== "FlowResponse")) {
222
- _context.next = 2;
222
+ _context.next = 1;
223
223
  break;
224
224
  }
225
225
  return _context.abrupt("return");
226
- case 2:
226
+ case 1:
227
227
  try {
228
228
  resolve(event.data.response);
229
229
  } catch (error) {
@@ -231,7 +231,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
231
231
  } finally {
232
232
  Close();
233
233
  }
234
- case 3:
234
+ case 2:
235
235
  case "end":
236
236
  return _context.stop();
237
237
  }
@@ -243,7 +243,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
243
243
  return onMessage;
244
244
  }()
245
245
  });
246
- case 2:
246
+ case 1:
247
247
  case "end":
248
248
  return _context2.stop();
249
249
  }
@@ -253,9 +253,9 @@ var ElvWalletClient = /*#__PURE__*/function () {
253
253
  return _ref3.apply(this, arguments);
254
254
  };
255
255
  }());
256
- case 29:
256
+ case 9:
257
257
  return _context3.abrupt("return", _context3.sent);
258
- case 30:
258
+ case 10:
259
259
  case "end":
260
260
  return _context3.stop();
261
261
  }
@@ -265,13 +265,13 @@ 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 () {
272
- var _LogInURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
273
- var _ref4$mode, mode, provider, marketplaceParams, clearLogin, loginUrl;
274
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
272
+ var _LogInURL = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
273
+ var _ref4$mode, mode, provider, marketplaceParams, clearLogin, loginUrl, _t, _t2;
274
+ return _regeneratorRuntime.wrap(function (_context4) {
275
275
  while (1) switch (_context4.prev = _context4.next) {
276
276
  case 0:
277
277
  _ref4$mode = _ref4.mode, mode = _ref4$mode === void 0 ? "login" : _ref4$mode, provider = _ref4.provider, marketplaceParams = _ref4.marketplaceParams, clearLogin = _ref4.clearLogin;
@@ -288,29 +288,29 @@ var ElvWalletClient = /*#__PURE__*/function () {
288
288
  loginUrl.searchParams.set("mode", mode);
289
289
  }
290
290
  if (!marketplaceParams) {
291
- _context4.next = 15;
291
+ _context4.next = 2;
292
292
  break;
293
293
  }
294
- _context4.t0 = loginUrl.searchParams;
295
- _context4.next = 11;
294
+ _t = loginUrl.searchParams;
295
+ _context4.next = 1;
296
296
  return this.MarketplaceInfo({
297
297
  marketplaceParams: marketplaceParams
298
298
  });
299
- case 11:
300
- _context4.t1 = _context4.sent.marketplaceHash;
301
- _context4.t0.set.call(_context4.t0, "mid", _context4.t1);
302
- _context4.next = 16;
299
+ case 1:
300
+ _t2 = _context4.sent.marketplaceHash;
301
+ _t.set.call(_t, "mid", _t2);
302
+ _context4.next = 3;
303
303
  break;
304
- case 15:
304
+ case 2:
305
305
  if ((this.selectedMarketplaceInfo || {}).marketplaceHash) {
306
306
  loginUrl.searchParams.set("mid", this.selectedMarketplaceInfo.marketplaceHash);
307
307
  }
308
- case 16:
308
+ case 3:
309
309
  if (clearLogin) {
310
310
  loginUrl.searchParams.set("clear", "");
311
311
  }
312
312
  return _context4.abrupt("return", loginUrl);
313
- case 18:
313
+ case 4:
314
314
  case "end":
315
315
  return _context4.stop();
316
316
  }
@@ -344,43 +344,43 @@ var ElvWalletClient = /*#__PURE__*/function () {
344
344
  */
345
345
  }, {
346
346
  key: "LogIn",
347
- value: function () {
348
- var _LogIn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref5) {
347
+ value: (function () {
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;
351
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
351
+ return _regeneratorRuntime.wrap(function (_context7) {
352
352
  while (1) switch (_context7.prev = _context7.next) {
353
353
  case 0:
354
354
  _ref5$method = _ref5.method, method = _ref5$method === void 0 ? "redirect" : _ref5$method, provider = _ref5.provider, _ref5$mode = _ref5.mode, mode = _ref5$mode === void 0 ? "login" : _ref5$mode, callbackUrl = _ref5.callbackUrl, marketplaceParams = _ref5.marketplaceParams, _ref5$clearLogin = _ref5.clearLogin, clearLogin = _ref5$clearLogin === void 0 ? false : _ref5$clearLogin, callback = _ref5.callback;
355
- _context7.next = 3;
355
+ _context7.next = 1;
356
356
  return this.LogInURL({
357
357
  mode: mode,
358
358
  provider: provider,
359
359
  marketplaceParams: marketplaceParams,
360
360
  clearLogin: clearLogin
361
361
  });
362
- case 3:
362
+ case 1:
363
363
  loginUrl = _context7.sent;
364
364
  if (!(method === "redirect")) {
365
- _context7.next = 11;
365
+ _context7.next = 2;
366
366
  break;
367
367
  }
368
368
  loginUrl.searchParams.set("response", "redirect");
369
369
  loginUrl.searchParams.set("source", "origin");
370
370
  loginUrl.searchParams.set("redirect", callbackUrl);
371
371
  window.location = loginUrl;
372
- _context7.next = 15;
372
+ _context7.next = 3;
373
373
  break;
374
- case 11:
374
+ case 2:
375
375
  loginUrl.searchParams.set("response", "message");
376
376
  loginUrl.searchParams.set("source", "parent");
377
- _context7.next = 15;
378
- return new Promise( /*#__PURE__*/function () {
379
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(resolve, reject) {
380
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
377
+ _context7.next = 3;
378
+ return new Promise(/*#__PURE__*/function () {
379
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(resolve, reject) {
380
+ return _regeneratorRuntime.wrap(function (_context6) {
381
381
  while (1) switch (_context6.prev = _context6.next) {
382
382
  case 0:
383
- _context6.next = 2;
383
+ _context6.next = 1;
384
384
  return ActionPopup({
385
385
  mode: "tab",
386
386
  url: loginUrl.toString(),
@@ -388,56 +388,57 @@ var ElvWalletClient = /*#__PURE__*/function () {
388
388
  return reject("User cancelled login");
389
389
  },
390
390
  onMessage: function () {
391
- var _onMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(event, Close) {
392
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
391
+ var _onMessage2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(event, Close) {
392
+ var _t3;
393
+ return _regeneratorRuntime.wrap(function (_context5) {
393
394
  while (1) switch (_context5.prev = _context5.next) {
394
395
  case 0:
395
396
  if (!(!event || !event.data || event.data.type !== "LoginResponse")) {
396
- _context5.next = 2;
397
+ _context5.next = 1;
397
398
  break;
398
399
  }
399
400
  return _context5.abrupt("return");
400
- case 2:
401
- _context5.prev = 2;
401
+ case 1:
402
+ _context5.prev = 1;
402
403
  if (!callback) {
403
- _context5.next = 8;
404
+ _context5.next = 3;
404
405
  break;
405
406
  }
406
- _context5.next = 6;
407
+ _context5.next = 2;
407
408
  return callback(event.data.params);
408
- case 6:
409
- _context5.next = 10;
409
+ case 2:
410
+ _context5.next = 4;
410
411
  break;
411
- case 8:
412
- _context5.next = 10;
412
+ case 3:
413
+ _context5.next = 4;
413
414
  return _this.Authenticate({
414
415
  token: event.data.params.clientSigningToken || event.data.params.clientAuthToken
415
416
  });
416
- case 10:
417
+ case 4:
417
418
  resolve();
418
- _context5.next = 16;
419
+ _context5.next = 6;
419
420
  break;
420
- case 13:
421
- _context5.prev = 13;
422
- _context5.t0 = _context5["catch"](2);
423
- reject(_context5.t0);
424
- case 16:
425
- _context5.prev = 16;
421
+ case 5:
422
+ _context5.prev = 5;
423
+ _t3 = _context5["catch"](1);
424
+ reject(_t3);
425
+ case 6:
426
+ _context5.prev = 6;
426
427
  Close();
427
- return _context5.finish(16);
428
- case 19:
428
+ return _context5.finish(6);
429
+ case 7:
429
430
  case "end":
430
431
  return _context5.stop();
431
432
  }
432
- }, _callee5, null, [[2, 13, 16, 19]]);
433
+ }, _callee5, null, [[1, 5, 6, 7]]);
433
434
  }));
434
- function onMessage(_x10, _x11) {
435
+ function onMessage(_x0, _x1) {
435
436
  return _onMessage2.apply(this, arguments);
436
437
  }
437
438
  return onMessage;
438
439
  }()
439
440
  });
440
- case 2:
441
+ case 1:
441
442
  case "end":
442
443
  return _context6.stop();
443
444
  }
@@ -447,7 +448,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
447
448
  return _ref6.apply(this, arguments);
448
449
  };
449
450
  }());
450
- case 15:
451
+ case 3:
451
452
  case "end":
452
453
  return _context7.stop();
453
454
  }
@@ -463,30 +464,32 @@ var ElvWalletClient = /*#__PURE__*/function () {
463
464
  *
464
465
  * @methodGroup Login
465
466
  */
467
+ )
466
468
  }, {
467
469
  key: "LogOut",
468
- value: function () {
469
- var _LogOut = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
470
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
470
+ value: (function () {
471
+ var _LogOut = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
472
+ var _t4;
473
+ return _regeneratorRuntime.wrap(function (_context8) {
471
474
  while (1) switch (_context8.prev = _context8.next) {
472
475
  case 0:
473
- if (!(this.__authorization && (this.__authorization.nonce || this.__authorization.installId))) {
474
- _context8.next = 9;
476
+ if (!(this.__authorization && this.__authorization.nonce)) {
477
+ _context8.next = 4;
475
478
  break;
476
479
  }
477
480
  _context8.prev = 1;
478
- _context8.next = 4;
481
+ _context8.next = 2;
479
482
  return this.client.signer.ReleaseCSAT({
480
483
  accessToken: this.AuthToken()
481
484
  });
482
- case 4:
483
- _context8.next = 9;
485
+ case 2:
486
+ _context8.next = 4;
484
487
  break;
485
- case 6:
486
- _context8.prev = 6;
487
- _context8.t0 = _context8["catch"](1);
488
- this.Log("Failed to release token", true, _context8.t0);
489
- case 9:
488
+ case 3:
489
+ _context8.prev = 3;
490
+ _t4 = _context8["catch"](1);
491
+ this.Log("Failed to release token", true, _t4);
492
+ case 4:
490
493
  this.__authorization = {};
491
494
  this.loggedIn = false;
492
495
  this.cachedMarketplaces = {};
@@ -498,37 +501,37 @@ var ElvWalletClient = /*#__PURE__*/function () {
498
501
  // eslint-disable-next-line no-empty
499
502
  } catch (error) {}
500
503
  }
501
- case 13:
504
+ case 5:
502
505
  case "end":
503
506
  return _context8.stop();
504
507
  }
505
- }, _callee8, this, [[1, 6]]);
508
+ }, _callee8, this, [[1, 3]]);
506
509
  }));
507
510
  function LogOut() {
508
511
  return _LogOut.apply(this, arguments);
509
512
  }
510
513
  return LogOut;
511
- }()
514
+ }())
512
515
  }, {
513
516
  key: "TokenStatus",
514
517
  value: function () {
515
- var _TokenStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
516
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
518
+ var _TokenStatus = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
519
+ return _regeneratorRuntime.wrap(function (_context9) {
517
520
  while (1) switch (_context9.prev = _context9.next) {
518
521
  case 0:
519
- if (!(!this.__authorization || !(this.__authorization.nonce || this.__authorization.installId))) {
520
- _context9.next = 2;
522
+ if (!(!this.__authorization || !this.__authorization.nonce)) {
523
+ _context9.next = 1;
521
524
  break;
522
525
  }
523
526
  return _context9.abrupt("return", true);
524
- case 2:
525
- _context9.next = 4;
527
+ case 1:
528
+ _context9.next = 2;
526
529
  return this.client.signer.CSATStatus({
527
530
  accessToken: this.AuthToken()
528
531
  });
529
- case 4:
532
+ case 2:
530
533
  return _context9.abrupt("return", _context9.sent);
531
- case 5:
534
+ case 3:
532
535
  case "end":
533
536
  return _context9.stop();
534
537
  }
@@ -548,49 +551,49 @@ var ElvWalletClient = /*#__PURE__*/function () {
548
551
  */
549
552
  }, {
550
553
  key: "Authenticate",
551
- value: function () {
552
- var _Authenticate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref7) {
553
- var token, decodedToken;
554
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
555
- while (1) switch (_context10.prev = _context10.next) {
554
+ value: (function () {
555
+ var _Authenticate = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(_ref7) {
556
+ var token, decodedToken, _t5;
557
+ return _regeneratorRuntime.wrap(function (_context0) {
558
+ while (1) switch (_context0.prev = _context0.next) {
556
559
  case 0:
557
560
  token = _ref7.token;
558
- _context10.prev = 1;
561
+ _context0.prev = 1;
559
562
  decodedToken = JSON.parse(this.utils.FromB58ToStr(token)) || {};
560
- _context10.next = 8;
563
+ _context0.next = 3;
561
564
  break;
562
- case 5:
563
- _context10.prev = 5;
564
- _context10.t0 = _context10["catch"](1);
565
+ case 2:
566
+ _context0.prev = 2;
567
+ _t5 = _context0["catch"](1);
565
568
  throw new Error("Invalid authorization token " + token);
566
- case 8:
569
+ case 3:
567
570
  if (!(!decodedToken.expiresAt || Date.now() > decodedToken.expiresAt)) {
568
- _context10.next = 10;
571
+ _context0.next = 4;
569
572
  break;
570
573
  }
571
574
  throw Error("ElvWalletClient: Provided authorization token has expired");
572
- case 10:
575
+ case 4:
573
576
  if (!decodedToken.clusterToken) {
574
- _context10.next = 13;
577
+ _context0.next = 5;
575
578
  break;
576
579
  }
577
- _context10.next = 13;
580
+ _context0.next = 5;
578
581
  return this.client.SetRemoteSigner({
579
582
  authToken: decodedToken.clusterToken,
580
583
  signerURIs: decodedToken.signerURIs
581
584
  });
582
- case 13:
585
+ case 5:
583
586
  this.client.SetStaticToken({
584
587
  token: decodedToken.fabricToken
585
588
  });
586
- return _context10.abrupt("return", this.SetAuthorization(_objectSpread({}, decodedToken)));
587
- case 15:
589
+ return _context0.abrupt("return", this.SetAuthorization(_objectSpread({}, decodedToken)));
590
+ case 6:
588
591
  case "end":
589
- return _context10.stop();
592
+ return _context0.stop();
590
593
  }
591
- }, _callee10, this, [[1, 5]]);
594
+ }, _callee0, this, [[1, 2]]);
592
595
  }));
593
- function Authenticate(_x12) {
596
+ function Authenticate(_x10) {
594
597
  return _Authenticate.apply(this, arguments);
595
598
  }
596
599
  return Authenticate;
@@ -615,25 +618,26 @@ var ElvWalletClient = /*#__PURE__*/function () {
615
618
  * - 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
616
619
  * shared with third parties.
617
620
  */
621
+ )
618
622
  }, {
619
623
  key: "AuthenticateOAuth",
620
- value: function () {
621
- var _AuthenticateOAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref8) {
622
- var idToken, tenantId, email, signerURIs, _ref8$shareEmail, shareEmail, _ref8$extraData, extraData, nonce, installId, appName, _ref8$createRemoteTok, createRemoteToken, _ref8$force, force, _ref8$tokenDuration, tokenDuration, fabricToken, refreshToken, expiresAt, tokenResponse, address, decodedToken;
623
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
624
- while (1) switch (_context11.prev = _context11.next) {
624
+ value: (function () {
625
+ var _AuthenticateOAuth = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee1(_ref8) {
626
+ 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, _t6;
627
+ return _regeneratorRuntime.wrap(function (_context1) {
628
+ while (1) switch (_context1.prev = _context1.next) {
625
629
  case 0:
626
- 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, installId = _ref8.installId, appName = _ref8.appName, _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;
630
+ 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
631
  if (!(!tenantId && this.selectedMarketplaceInfo)) {
628
- _context11.next = 5;
632
+ _context1.next = 2;
629
633
  break;
630
634
  }
631
- _context11.next = 4;
635
+ _context1.next = 1;
632
636
  return this.AvailableMarketplaces();
633
- case 4:
637
+ case 1:
634
638
  tenantId = this.selectedMarketplaceInfo.tenantId;
635
- case 5:
636
- _context11.next = 7;
639
+ case 2:
640
+ _context1.next = 3;
637
641
  return this.client.SetRemoteSigner({
638
642
  idToken: idToken,
639
643
  tenantId: tenantId,
@@ -643,33 +647,29 @@ var ElvWalletClient = /*#__PURE__*/function () {
643
647
  }),
644
648
  unsignedPublicAuth: true
645
649
  });
646
- case 7:
650
+ case 3:
647
651
  if (!(createRemoteToken && this.client.signer.remoteSigner)) {
648
- _context11.next = 18;
652
+ _context1.next = 5;
649
653
  break;
650
654
  }
651
655
  expiresAt = Date.now() + tokenDuration * 60 * 60 * 1000;
652
- _context11.next = 11;
656
+ _context1.next = 4;
653
657
  return this.client.signer.RetrieveCSAT({
654
658
  email: email,
655
659
  nonce: nonce,
656
- installId: installId,
657
- appName: appName,
658
660
  tenantId: tenantId,
659
661
  force: force,
660
662
  duration: tokenDuration
661
663
  });
662
- case 11:
663
- tokenResponse = _context11.sent;
664
+ case 4:
665
+ tokenResponse = _context1.sent;
664
666
  fabricToken = tokenResponse.token;
665
- nonce = tokenResponse.nonce || nonce;
666
- installId = tokenResponse.installId || installId;
667
- refreshToken = tokenResponse.refresh_token;
668
- _context11.next = 22;
667
+ nonce = tokenResponse.nonce;
668
+ _context1.next = 7;
669
669
  break;
670
- case 18:
670
+ case 5:
671
671
  expiresAt = Date.now() + tokenDuration * 60 * 60 * 1000;
672
- _context11.next = 21;
672
+ _context1.next = 6;
673
673
  return this.client.CreateFabricToken({
674
674
  duration: parseInt(tokenDuration * 60 * 60 * 1000),
675
675
  context: email ? {
@@ -678,31 +678,30 @@ var ElvWalletClient = /*#__PURE__*/function () {
678
678
  }
679
679
  } : {}
680
680
  });
681
- case 21:
682
- fabricToken = _context11.sent;
683
- case 22:
681
+ case 6:
682
+ fabricToken = _context1.sent;
683
+ case 7:
684
684
  address = this.client.utils.FormatAddress(this.client.CurrentAccountAddress());
685
685
  if (email) {
686
- _context11.next = 32;
686
+ _context1.next = 10;
687
687
  break;
688
688
  }
689
- _context11.prev = 24;
689
+ _context1.prev = 8;
690
690
  decodedToken = JSON.parse(this.utils.FromB64URL(idToken.split(".")[1]));
691
691
  email = decodedToken.email;
692
- _context11.next = 32;
692
+ _context1.next = 10;
693
693
  break;
694
- case 29:
695
- _context11.prev = 29;
696
- _context11.t0 = _context11["catch"](24);
694
+ case 9:
695
+ _context1.prev = 9;
696
+ _t6 = _context1["catch"](8);
697
697
  throw Error("Failed to decode ID token");
698
- case 32:
698
+ case 10:
699
699
  this.client.SetStaticToken({
700
700
  token: fabricToken
701
701
  });
702
- return _context11.abrupt("return", {
702
+ return _context1.abrupt("return", {
703
703
  authToken: this.SetAuthorization({
704
704
  fabricToken: fabricToken,
705
- refreshToken: refreshToken,
706
705
  tenantId: tenantId,
707
706
  address: address,
708
707
  email: email,
@@ -711,13 +710,11 @@ var ElvWalletClient = /*#__PURE__*/function () {
711
710
  walletType: "Custodial",
712
711
  walletName: "Eluvio",
713
712
  register: true,
714
- nonce: nonce,
715
- installId: installId
713
+ nonce: nonce
716
714
  }),
717
715
  signingToken: this.SetAuthorization({
718
716
  clusterToken: this.client.signer.authToken,
719
717
  fabricToken: fabricToken,
720
- refreshToken: refreshToken,
721
718
  tenantId: tenantId,
722
719
  address: address,
723
720
  email: email,
@@ -725,17 +722,16 @@ var ElvWalletClient = /*#__PURE__*/function () {
725
722
  signerURIs: signerURIs,
726
723
  walletType: "Custodial",
727
724
  walletName: "Eluvio",
728
- nonce: nonce,
729
- installId: installId
725
+ nonce: nonce
730
726
  })
731
727
  });
732
- case 34:
728
+ case 11:
733
729
  case "end":
734
- return _context11.stop();
730
+ return _context1.stop();
735
731
  }
736
- }, _callee11, this, [[24, 29]]);
732
+ }, _callee1, this, [[8, 9]]);
737
733
  }));
738
- function AuthenticateOAuth(_x13) {
734
+ function AuthenticateOAuth(_x11) {
739
735
  return _AuthenticateOAuth.apply(this, arguments);
740
736
  }
741
737
  return AuthenticateOAuth;
@@ -753,14 +749,15 @@ var ElvWalletClient = /*#__PURE__*/function () {
753
749
  * @returns {Promise<string>} - Returns an authorization token that can be used to initialize the client using <a href="#Authenticate">Authenticate</a>.
754
750
  * Save this token to avoid having to reauthenticate. This token expires after 24 hours.
755
751
  */
752
+ )
756
753
  }, {
757
754
  key: "AuthenticateExternalWallet",
758
- value: function () {
759
- var _AuthenticateExternalWallet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref9) {
755
+ value: (function () {
756
+ var _AuthenticateExternalWallet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref9) {
760
757
  var _this2 = this;
761
758
  var address, _ref9$tokenDuration, tokenDuration, _ref9$walletName, walletName, Sign, expiresAt, fabricToken;
762
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
763
- while (1) switch (_context13.prev = _context13.next) {
759
+ return _regeneratorRuntime.wrap(function (_context11) {
760
+ while (1) switch (_context11.prev = _context11.next) {
764
761
  case 0:
765
762
  address = _ref9.address, _ref9$tokenDuration = _ref9.tokenDuration, tokenDuration = _ref9$tokenDuration === void 0 ? 24 : _ref9$tokenDuration, _ref9$walletName = _ref9.walletName, walletName = _ref9$walletName === void 0 ? "Metamask" : _ref9$walletName, Sign = _ref9.Sign;
766
763
  if (!address) {
@@ -769,36 +766,36 @@ var ElvWalletClient = /*#__PURE__*/function () {
769
766
  address = this.utils.FormatAddress(address);
770
767
  if (!Sign) {
771
768
  Sign = /*#__PURE__*/function () {
772
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(message) {
773
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
774
- while (1) switch (_context12.prev = _context12.next) {
769
+ var _ref0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(message) {
770
+ return _regeneratorRuntime.wrap(function (_context10) {
771
+ while (1) switch (_context10.prev = _context10.next) {
775
772
  case 0:
776
- return _context12.abrupt("return", _this2.SignMetamask({
773
+ return _context10.abrupt("return", _this2.SignMetamask({
777
774
  message: message,
778
775
  address: address
779
776
  }));
780
777
  case 1:
781
778
  case "end":
782
- return _context12.stop();
779
+ return _context10.stop();
783
780
  }
784
- }, _callee12);
781
+ }, _callee10);
785
782
  }));
786
- return function Sign(_x15) {
787
- return _ref10.apply(this, arguments);
783
+ return function Sign(_x13) {
784
+ return _ref0.apply(this, arguments);
788
785
  };
789
786
  }();
790
787
  }
791
788
  expiresAt = Date.now() + tokenDuration * 60 * 60 * 1000;
792
- _context13.next = 7;
789
+ _context11.next = 1;
793
790
  return this.client.CreateFabricToken({
794
791
  address: address,
795
792
  duration: tokenDuration * 60 * 60 * 1000,
796
793
  Sign: Sign,
797
794
  addEthereumPrefix: false
798
795
  });
799
- case 7:
800
- fabricToken = _context13.sent;
801
- return _context13.abrupt("return", this.SetAuthorization({
796
+ case 1:
797
+ fabricToken = _context11.sent;
798
+ return _context11.abrupt("return", this.SetAuthorization({
802
799
  fabricToken: fabricToken,
803
800
  address: address,
804
801
  expiresAt: expiresAt,
@@ -806,13 +803,13 @@ var ElvWalletClient = /*#__PURE__*/function () {
806
803
  walletName: walletName,
807
804
  register: true
808
805
  }));
809
- case 9:
806
+ case 2:
810
807
  case "end":
811
- return _context13.stop();
808
+ return _context11.stop();
812
809
  }
813
- }, _callee13, this);
810
+ }, _callee11, this);
814
811
  }));
815
- function AuthenticateExternalWallet(_x14) {
812
+ function AuthenticateExternalWallet(_x12) {
816
813
  return _AuthenticateExternalWallet.apply(this, arguments);
817
814
  }
818
815
  return AuthenticateExternalWallet;
@@ -824,6 +821,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
824
821
  *
825
822
  * @returns {string} - The client auth token
826
823
  */
824
+ )
827
825
  }, {
828
826
  key: "ClientAuthToken",
829
827
  value: function ClientAuthToken() {
@@ -842,34 +840,30 @@ var ElvWalletClient = /*#__PURE__*/function () {
842
840
  }
843
841
  }, {
844
842
  key: "SetAuthorization",
845
- value: function SetAuthorization(_ref11) {
843
+ value: function SetAuthorization(_ref1) {
846
844
  var _this3 = this;
847
- var clusterToken = _ref11.clusterToken,
848
- fabricToken = _ref11.fabricToken,
849
- refreshToken = _ref11.refreshToken,
850
- tenantId = _ref11.tenantId,
851
- address = _ref11.address,
852
- email = _ref11.email,
853
- expiresAt = _ref11.expiresAt,
854
- signerURIs = _ref11.signerURIs,
855
- walletType = _ref11.walletType,
856
- walletName = _ref11.walletName,
857
- nonce = _ref11.nonce,
858
- installId = _ref11.installId,
859
- _ref11$register = _ref11.register,
860
- register = _ref11$register === void 0 ? false : _ref11$register;
845
+ var clusterToken = _ref1.clusterToken,
846
+ fabricToken = _ref1.fabricToken,
847
+ tenantId = _ref1.tenantId,
848
+ address = _ref1.address,
849
+ email = _ref1.email,
850
+ expiresAt = _ref1.expiresAt,
851
+ signerURIs = _ref1.signerURIs,
852
+ walletType = _ref1.walletType,
853
+ walletName = _ref1.walletName,
854
+ nonce = _ref1.nonce,
855
+ _ref1$register = _ref1.register,
856
+ register = _ref1$register === void 0 ? false : _ref1$register;
861
857
  address = this.client.utils.FormatAddress(address);
862
858
  this.__authorization = {
863
859
  fabricToken: fabricToken,
864
- refreshToken: refreshToken,
865
860
  tenantId: tenantId,
866
861
  address: address,
867
862
  email: email,
868
863
  expiresAt: expiresAt,
869
864
  walletType: walletType,
870
865
  walletName: walletName,
871
- nonce: nonce,
872
- installId: installId
866
+ nonce: nonce
873
867
  };
874
868
  if (clusterToken) {
875
869
  this.__authorization.clusterToken = clusterToken;
@@ -902,58 +896,58 @@ var ElvWalletClient = /*#__PURE__*/function () {
902
896
  }, {
903
897
  key: "SignMetamask",
904
898
  value: function () {
905
- var _SignMetamask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref12) {
899
+ var _SignMetamask = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref10) {
906
900
  var message, address, accounts;
907
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
908
- while (1) switch (_context14.prev = _context14.next) {
901
+ return _regeneratorRuntime.wrap(function (_context12) {
902
+ while (1) switch (_context12.prev = _context12.next) {
909
903
  case 0:
910
- message = _ref12.message, address = _ref12.address;
904
+ message = _ref10.message, address = _ref10.address;
911
905
  if (!(!inBrowser || !window.ethereum)) {
912
- _context14.next = 3;
906
+ _context12.next = 1;
913
907
  break;
914
908
  }
915
909
  throw Error("ElvWalletClient: Unable to initialize - Metamask not available");
916
- case 3:
910
+ case 1:
917
911
  address = address || this.UserAddress();
918
- _context14.next = 6;
912
+ _context12.next = 2;
919
913
  return window.ethereum.request({
920
914
  method: "eth_requestAccounts"
921
915
  });
922
- case 6:
923
- accounts = _context14.sent;
916
+ case 2:
917
+ accounts = _context12.sent;
924
918
  if (!(address && !Utils.EqualAddress(accounts[0], address))) {
925
- _context14.next = 9;
919
+ _context12.next = 3;
926
920
  break;
927
921
  }
928
922
  throw Error("ElvWalletClient: Incorrect MetaMask account selected. Expected ".concat(address, ", got ").concat(accounts[0]));
929
- case 9:
930
- _context14.next = 11;
923
+ case 3:
924
+ _context12.next = 4;
931
925
  return window.ethereum.request({
932
926
  method: "personal_sign",
933
927
  params: [message, address, ""]
934
928
  });
935
- case 11:
936
- return _context14.abrupt("return", _context14.sent);
937
- case 12:
929
+ case 4:
930
+ return _context12.abrupt("return", _context12.sent);
931
+ case 5:
938
932
  case "end":
939
- return _context14.stop();
933
+ return _context12.stop();
940
934
  }
941
- }, _callee14, this);
935
+ }, _callee12, this);
942
936
  }));
943
- function SignMetamask(_x16) {
937
+ function SignMetamask(_x14) {
944
938
  return _SignMetamask.apply(this, arguments);
945
939
  }
946
940
  return SignMetamask;
947
941
  }()
948
942
  }, {
949
943
  key: "FlowURL",
950
- value: function FlowURL(_ref13) {
951
- var _ref13$type = _ref13.type,
952
- type = _ref13$type === void 0 ? "flow" : _ref13$type,
953
- flow = _ref13.flow,
954
- marketplaceId = _ref13.marketplaceId,
955
- _ref13$parameters = _ref13.parameters,
956
- parameters = _ref13$parameters === void 0 ? {} : _ref13$parameters;
944
+ value: function FlowURL(_ref11) {
945
+ var _ref11$type = _ref11.type,
946
+ type = _ref11$type === void 0 ? "flow" : _ref11$type,
947
+ flow = _ref11.flow,
948
+ marketplaceId = _ref11.marketplaceId,
949
+ _ref11$parameters = _ref11.parameters,
950
+ parameters = _ref11$parameters === void 0 ? {} : _ref11$parameters;
957
951
  var url = new URL(this.appUrl);
958
952
  if (marketplaceId) {
959
953
  url.pathname = UrlJoin("/", type, flow, "marketplace", marketplaceId, Utils.B58(JSON.stringify(parameters)));
@@ -966,29 +960,29 @@ var ElvWalletClient = /*#__PURE__*/function () {
966
960
  }, {
967
961
  key: "GenerateCodeAuth",
968
962
  value: function () {
969
- var _GenerateCodeAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
970
- var _ref14,
963
+ var _GenerateCodeAuth = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
964
+ var _ref12,
971
965
  url,
972
966
  response,
973
- _args15 = arguments;
974
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
975
- while (1) switch (_context15.prev = _context15.next) {
967
+ _args13 = arguments;
968
+ return _regeneratorRuntime.wrap(function (_context13) {
969
+ while (1) switch (_context13.prev = _context13.next) {
976
970
  case 0:
977
- _ref14 = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {}, url = _ref14.url;
971
+ _ref12 = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {}, url = _ref12.url;
978
972
  if (url) {
979
- _context15.next = 7;
973
+ _context13.next = 2;
980
974
  break;
981
975
  }
982
- _context15.next = 4;
976
+ _context13.next = 1;
983
977
  return this.LogInURL({
984
978
  mode: "login"
985
979
  });
986
- case 4:
987
- url = _context15.sent;
980
+ case 1:
981
+ url = _context13.sent;
988
982
  url.searchParams.set("response", "code");
989
983
  url.searchParams.set("source", "code");
990
- case 7:
991
- _context15.next = 9;
984
+ case 2:
985
+ _context13.next = 3;
992
986
  return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
993
987
  path: UrlJoin("as", "wlt", "login", "redirect", "metamask"),
994
988
  method: "POST",
@@ -997,17 +991,17 @@ var ElvWalletClient = /*#__PURE__*/function () {
997
991
  dest: url.toString()
998
992
  }
999
993
  }));
1000
- case 9:
1001
- response = _context15.sent;
994
+ case 3:
995
+ response = _context13.sent;
1002
996
  response.code = response.id;
1003
997
  response.url = response.url.startsWith("https://") ? response.url : "https://".concat(response.url);
1004
998
  response.metamask_url = response.metamask_url.startsWith("https://") ? response.metamask_url : "https://".concat(response.metamask_url);
1005
- return _context15.abrupt("return", response);
1006
- case 14:
999
+ return _context13.abrupt("return", response);
1000
+ case 4:
1007
1001
  case "end":
1008
- return _context15.stop();
1002
+ return _context13.stop();
1009
1003
  }
1010
- }, _callee15, this);
1004
+ }, _callee13, this);
1011
1005
  }));
1012
1006
  function GenerateCodeAuth() {
1013
1007
  return _GenerateCodeAuth.apply(this, arguments);
@@ -1017,13 +1011,13 @@ var ElvWalletClient = /*#__PURE__*/function () {
1017
1011
  }, {
1018
1012
  key: "SetCodeAuth",
1019
1013
  value: function () {
1020
- var _SetCodeAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(_ref15) {
1014
+ var _SetCodeAuth = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref13) {
1021
1015
  var code, address, type, authToken, expiresAt, additionalPayload;
1022
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
1023
- while (1) switch (_context16.prev = _context16.next) {
1016
+ return _regeneratorRuntime.wrap(function (_context14) {
1017
+ while (1) switch (_context14.prev = _context14.next) {
1024
1018
  case 0:
1025
- code = _ref15.code, address = _ref15.address, type = _ref15.type, authToken = _ref15.authToken, expiresAt = _ref15.expiresAt, additionalPayload = _objectWithoutProperties(_ref15, _excluded);
1026
- _context16.next = 3;
1019
+ code = _ref13.code, address = _ref13.address, type = _ref13.type, authToken = _ref13.authToken, expiresAt = _ref13.expiresAt, additionalPayload = _objectWithoutProperties(_ref13, _excluded);
1020
+ _context14.next = 1;
1027
1021
  return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
1028
1022
  path: UrlJoin("as", "wlt", "login", "session", code),
1029
1023
  method: "POST",
@@ -1043,13 +1037,13 @@ var ElvWalletClient = /*#__PURE__*/function () {
1043
1037
  }, additionalPayload))
1044
1038
  }
1045
1039
  }));
1046
- case 3:
1040
+ case 1:
1047
1041
  case "end":
1048
- return _context16.stop();
1042
+ return _context14.stop();
1049
1043
  }
1050
- }, _callee16, this);
1044
+ }, _callee14, this);
1051
1045
  }));
1052
- function SetCodeAuth(_x17) {
1046
+ function SetCodeAuth(_x15) {
1053
1047
  return _SetCodeAuth.apply(this, arguments);
1054
1048
  }
1055
1049
  return SetCodeAuth;
@@ -1057,37 +1051,37 @@ var ElvWalletClient = /*#__PURE__*/function () {
1057
1051
  }, {
1058
1052
  key: "GetCodeAuth",
1059
1053
  value: function () {
1060
- var _GetCodeAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref16) {
1061
- var code, passcode;
1062
- return _regeneratorRuntime.wrap(function _callee17$(_context17) {
1063
- while (1) switch (_context17.prev = _context17.next) {
1054
+ var _GetCodeAuth = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref14) {
1055
+ var code, passcode, _t7;
1056
+ return _regeneratorRuntime.wrap(function (_context15) {
1057
+ while (1) switch (_context15.prev = _context15.next) {
1064
1058
  case 0:
1065
- code = _ref16.code, passcode = _ref16.passcode;
1066
- _context17.prev = 1;
1067
- _context17.next = 4;
1059
+ code = _ref14.code, passcode = _ref14.passcode;
1060
+ _context15.prev = 1;
1061
+ _context15.next = 2;
1068
1062
  return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
1069
1063
  path: UrlJoin("as", "wlt", "login", "redirect", "metamask", code, passcode),
1070
1064
  method: "GET"
1071
1065
  }));
1072
- case 4:
1073
- return _context17.abrupt("return", _context17.sent);
1074
- case 7:
1075
- _context17.prev = 7;
1076
- _context17.t0 = _context17["catch"](1);
1077
- if (!(_context17.t0 && _context17.t0.status === 404)) {
1078
- _context17.next = 11;
1066
+ case 2:
1067
+ return _context15.abrupt("return", _context15.sent);
1068
+ case 3:
1069
+ _context15.prev = 3;
1070
+ _t7 = _context15["catch"](1);
1071
+ if (!(_t7 && _t7.status === 404)) {
1072
+ _context15.next = 4;
1079
1073
  break;
1080
1074
  }
1081
- return _context17.abrupt("return", undefined);
1082
- case 11:
1083
- throw _context17.t0;
1084
- case 12:
1075
+ return _context15.abrupt("return", undefined);
1076
+ case 4:
1077
+ throw _t7;
1078
+ case 5:
1085
1079
  case "end":
1086
- return _context17.stop();
1080
+ return _context15.stop();
1087
1081
  }
1088
- }, _callee17, this, [[1, 7]]);
1082
+ }, _callee15, this, [[1, 3]]);
1089
1083
  }));
1090
- function GetCodeAuth(_x18) {
1084
+ function GetCodeAuth(_x16) {
1091
1085
  return _GetCodeAuth.apply(this, arguments);
1092
1086
  }
1093
1087
  return GetCodeAuth;
@@ -1095,13 +1089,13 @@ var ElvWalletClient = /*#__PURE__*/function () {
1095
1089
  }, {
1096
1090
  key: "TopLevelInfo",
1097
1091
  value: function () {
1098
- var _TopLevelInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
1092
+ var _TopLevelInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
1099
1093
  var forceReload,
1100
- _args18 = arguments;
1101
- return _regeneratorRuntime.wrap(function _callee18$(_context18) {
1102
- while (1) switch (_context18.prev = _context18.next) {
1094
+ _args16 = arguments;
1095
+ return _regeneratorRuntime.wrap(function (_context16) {
1096
+ while (1) switch (_context16.prev = _context16.next) {
1103
1097
  case 0:
1104
- forceReload = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : false;
1098
+ forceReload = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : false;
1105
1099
  if (!this.topLevelInfoPromise || forceReload) {
1106
1100
  this.topLevelInfoPromise = this.client.utils.ResponseToJson(this.client.MakeAuthServiceRequest({
1107
1101
  path: "/as/mw/toplevel",
@@ -1110,15 +1104,15 @@ var ElvWalletClient = /*#__PURE__*/function () {
1110
1104
  }
1111
1105
  }));
1112
1106
  }
1113
- _context18.next = 4;
1107
+ _context16.next = 1;
1114
1108
  return this.topLevelInfoPromise;
1115
- case 4:
1116
- return _context18.abrupt("return", _context18.sent);
1117
- case 5:
1109
+ case 1:
1110
+ return _context16.abrupt("return", _context16.sent);
1111
+ case 2:
1118
1112
  case "end":
1119
- return _context18.stop();
1113
+ return _context16.stop();
1120
1114
  }
1121
- }, _callee18, this);
1115
+ }, _callee16, this);
1122
1116
  }));
1123
1117
  function TopLevelInfo() {
1124
1118
  return _TopLevelInfo.apply(this, arguments);
@@ -1128,25 +1122,25 @@ var ElvWalletClient = /*#__PURE__*/function () {
1128
1122
  }, {
1129
1123
  key: "LoadAvailableMarketplaces",
1130
1124
  value: function () {
1131
- var _LoadAvailableMarketplaces = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
1125
+ var _LoadAvailableMarketplaces = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
1132
1126
  var _this4 = this;
1133
1127
  var forceReload,
1134
- _args20 = arguments;
1135
- return _regeneratorRuntime.wrap(function _callee20$(_context20) {
1136
- while (1) switch (_context20.prev = _context20.next) {
1128
+ _args18 = arguments;
1129
+ return _regeneratorRuntime.wrap(function (_context18) {
1130
+ while (1) switch (_context18.prev = _context18.next) {
1137
1131
  case 0:
1138
- forceReload = _args20.length > 0 && _args20[0] !== undefined ? _args20[0] : false;
1132
+ forceReload = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : false;
1139
1133
  if (!this.availableMarketplacesPromise || forceReload) {
1140
- this.availableMarketplacesPromise = new Promise( /*#__PURE__*/function () {
1141
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(resolve) {
1134
+ this.availableMarketplacesPromise = new Promise(/*#__PURE__*/function () {
1135
+ var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17(resolve) {
1142
1136
  var topLevelInfo, marketplaces, availableMarketplaces, availableMarketplacesById;
1143
- return _regeneratorRuntime.wrap(function _callee19$(_context19) {
1144
- while (1) switch (_context19.prev = _context19.next) {
1137
+ return _regeneratorRuntime.wrap(function (_context17) {
1138
+ while (1) switch (_context17.prev = _context17.next) {
1145
1139
  case 0:
1146
- _context19.next = 2;
1140
+ _context17.next = 1;
1147
1141
  return _this4.TopLevelInfo();
1148
- case 2:
1149
- topLevelInfo = _context19.sent;
1142
+ case 1:
1143
+ topLevelInfo = _context17.sent;
1150
1144
  marketplaces = topLevelInfo.marketplaces;
1151
1145
  availableMarketplaces = _objectSpread({}, _this4.availableMarketplaces || {});
1152
1146
  availableMarketplacesById = _objectSpread({}, _this4.availableMarketplacesById || {});
@@ -1168,24 +1162,24 @@ var ElvWalletClient = /*#__PURE__*/function () {
1168
1162
  _this4.availableMarketplaces = availableMarketplaces;
1169
1163
  _this4.availableMarketplacesById = availableMarketplacesById;
1170
1164
  resolve();
1171
- case 10:
1165
+ case 2:
1172
1166
  case "end":
1173
- return _context19.stop();
1167
+ return _context17.stop();
1174
1168
  }
1175
- }, _callee19);
1169
+ }, _callee17);
1176
1170
  }));
1177
- return function (_x19) {
1178
- return _ref17.apply(this, arguments);
1171
+ return function (_x17) {
1172
+ return _ref15.apply(this, arguments);
1179
1173
  };
1180
1174
  }());
1181
1175
  }
1182
- _context20.next = 4;
1176
+ _context18.next = 1;
1183
1177
  return this.availableMarketplacesPromise;
1184
- case 4:
1178
+ case 1:
1185
1179
  case "end":
1186
- return _context20.stop();
1180
+ return _context18.stop();
1187
1181
  }
1188
- }, _callee20, this);
1182
+ }, _callee18, this);
1189
1183
  }));
1190
1184
  function LoadAvailableMarketplaces() {
1191
1185
  return _LoadAvailableMarketplaces.apply(this, arguments);
@@ -1195,25 +1189,25 @@ var ElvWalletClient = /*#__PURE__*/function () {
1195
1189
  }, {
1196
1190
  key: "LatestMarketplaceHash",
1197
1191
  value: function () {
1198
- var _LatestMarketplaceHash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(_ref18) {
1192
+ var _LatestMarketplaceHash = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref16) {
1199
1193
  var marketplaceParams, marketplaceInfo, marketplaceLink;
1200
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
1201
- while (1) switch (_context21.prev = _context21.next) {
1194
+ return _regeneratorRuntime.wrap(function (_context19) {
1195
+ while (1) switch (_context19.prev = _context19.next) {
1202
1196
  case 0:
1203
- marketplaceParams = _ref18.marketplaceParams;
1204
- _context21.next = 3;
1197
+ marketplaceParams = _ref16.marketplaceParams;
1198
+ _context19.next = 1;
1205
1199
  return this.MarketplaceInfo({
1206
1200
  marketplaceParams: marketplaceParams
1207
1201
  });
1208
- case 3:
1209
- marketplaceInfo = _context21.sent;
1202
+ case 1:
1203
+ marketplaceInfo = _context19.sent;
1210
1204
  if (!(this.previewMarketplaceId && Utils.EqualHash(this.previewMarketplaceId, marketplaceInfo.marketplaceId))) {
1211
- _context21.next = 6;
1205
+ _context19.next = 2;
1212
1206
  break;
1213
1207
  }
1214
- return _context21.abrupt("return", this.previewMarketplaceHash);
1215
- case 6:
1216
- _context21.next = 8;
1208
+ return _context19.abrupt("return", this.previewMarketplaceHash);
1209
+ case 2:
1210
+ _context19.next = 3;
1217
1211
  return this.client.ContentObjectMetadata({
1218
1212
  libraryId: this.mainSiteLibraryId,
1219
1213
  objectId: this.mainSiteId,
@@ -1221,16 +1215,16 @@ var ElvWalletClient = /*#__PURE__*/function () {
1221
1215
  resolveLinks: false,
1222
1216
  noAuth: true
1223
1217
  });
1224
- case 8:
1225
- marketplaceLink = _context21.sent;
1226
- return _context21.abrupt("return", LinkTargetHash(marketplaceLink));
1227
- case 10:
1218
+ case 3:
1219
+ marketplaceLink = _context19.sent;
1220
+ return _context19.abrupt("return", LinkTargetHash(marketplaceLink));
1221
+ case 4:
1228
1222
  case "end":
1229
- return _context21.stop();
1223
+ return _context19.stop();
1230
1224
  }
1231
- }, _callee21, this);
1225
+ }, _callee19, this);
1232
1226
  }));
1233
- function LatestMarketplaceHash(_x20) {
1227
+ function LatestMarketplaceHash(_x18) {
1234
1228
  return _LatestMarketplaceHash.apply(this, arguments);
1235
1229
  }
1236
1230
  return LatestMarketplaceHash;
@@ -1238,37 +1232,37 @@ var ElvWalletClient = /*#__PURE__*/function () {
1238
1232
  }, {
1239
1233
  key: "LoadMarketplace",
1240
1234
  value: function () {
1241
- var _LoadMarketplace = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(marketplaceParams) {
1235
+ var _LoadMarketplace = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee21(marketplaceParams) {
1242
1236
  var _this5 = this;
1243
- var marketplaceInfo, marketplaceId, marketplaceHash, marketplace;
1244
- return _regeneratorRuntime.wrap(function _callee23$(_context23) {
1245
- while (1) switch (_context23.prev = _context23.next) {
1237
+ var marketplaceInfo, marketplaceId, marketplaceHash, marketplace, _t9;
1238
+ return _regeneratorRuntime.wrap(function (_context21) {
1239
+ while (1) switch (_context21.prev = _context21.next) {
1246
1240
  case 0:
1247
- _context23.next = 2;
1241
+ _context21.next = 1;
1248
1242
  return this.LoadAvailableMarketplaces();
1249
- case 2:
1243
+ case 1:
1250
1244
  marketplaceInfo = this.MarketplaceInfo({
1251
1245
  marketplaceParams: marketplaceParams
1252
1246
  });
1253
1247
  marketplaceId = marketplaceInfo.marketplaceId;
1254
- _context23.next = 6;
1248
+ _context21.next = 2;
1255
1249
  return this.LatestMarketplaceHash({
1256
1250
  marketplaceParams: marketplaceParams
1257
1251
  });
1258
- case 6:
1259
- marketplaceHash = _context23.sent;
1252
+ case 2:
1253
+ marketplaceHash = _context21.sent;
1260
1254
  if (this.cachedMarketplaces[marketplaceId] && this.cachedMarketplaces[marketplaceId].versionHash !== marketplaceHash) {
1261
1255
  delete this.cachedMarketplaces[marketplaceId];
1262
1256
  }
1263
1257
  if (this.cachedMarketplaces[marketplaceId]) {
1264
- _context23.next = 36;
1258
+ _context21.next = 11;
1265
1259
  break;
1266
1260
  }
1267
1261
  if (!(this.previewMarketplaceId && Utils.EqualHash(marketplaceId, this.previewMarketplaceId))) {
1268
- _context23.next = 15;
1262
+ _context21.next = 4;
1269
1263
  break;
1270
1264
  }
1271
- _context23.next = 12;
1265
+ _context21.next = 3;
1272
1266
  return this.client.ContentObjectMetadata({
1273
1267
  versionHash: this.previewMarketplaceHash,
1274
1268
  metadataSubtree: "/public/asset_metadata/info",
@@ -1280,12 +1274,12 @@ var ElvWalletClient = /*#__PURE__*/function () {
1280
1274
  produceLinkUrls: true,
1281
1275
  authorizationToken: this.publicStaticToken
1282
1276
  });
1283
- case 12:
1284
- marketplace = _context23.sent;
1285
- _context23.next = 18;
1277
+ case 3:
1278
+ marketplace = _context21.sent;
1279
+ _context21.next = 6;
1286
1280
  break;
1287
- case 15:
1288
- _context23.next = 17;
1281
+ case 4:
1282
+ _context21.next = 5;
1289
1283
  return this.client.ContentObjectMetadata({
1290
1284
  libraryId: this.mainSiteLibraryId,
1291
1285
  objectId: this.mainSiteId,
@@ -1298,14 +1292,14 @@ var ElvWalletClient = /*#__PURE__*/function () {
1298
1292
  produceLinkUrls: true,
1299
1293
  authorizationToken: this.publicStaticToken
1300
1294
  });
1301
- case 17:
1302
- marketplace = _context23.sent;
1303
- case 18:
1295
+ case 5:
1296
+ marketplace = _context21.sent;
1297
+ case 6:
1304
1298
  if (!marketplace.branding.use_tenant_styling) {
1305
- _context23.next = 25;
1299
+ _context21.next = 9;
1306
1300
  break;
1307
1301
  }
1308
- _context23.next = 21;
1302
+ _context21.next = 7;
1309
1303
  return this.client.ContentObjectMetadata({
1310
1304
  libraryId: this.mainSiteLibraryId,
1311
1305
  objectId: this.mainSiteId,
@@ -1313,68 +1307,68 @@ var ElvWalletClient = /*#__PURE__*/function () {
1313
1307
  authorizationToken: this.publicStaticToken,
1314
1308
  produceLinkUrls: true
1315
1309
  });
1316
- case 21:
1317
- _context23.t0 = _context23.sent;
1318
- if (_context23.t0) {
1319
- _context23.next = 24;
1310
+ case 7:
1311
+ _t9 = _context21.sent;
1312
+ if (_t9) {
1313
+ _context21.next = 8;
1320
1314
  break;
1321
1315
  }
1322
- _context23.t0 = {};
1323
- case 24:
1324
- marketplace.tenantBranding = _context23.t0;
1325
- case 25:
1326
- _context23.next = 27;
1327
- return Promise.all(marketplace.items.map( /*#__PURE__*/function () {
1328
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(item, index) {
1329
- var authorizationToken;
1330
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
1331
- while (1) switch (_context22.prev = _context22.next) {
1316
+ _t9 = {};
1317
+ case 8:
1318
+ marketplace.tenantBranding = _t9;
1319
+ case 9:
1320
+ _context21.next = 10;
1321
+ return Promise.all(marketplace.items.map(/*#__PURE__*/function () {
1322
+ var _ref17 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee20(item, index) {
1323
+ var authorizationToken, _t8;
1324
+ return _regeneratorRuntime.wrap(function (_context20) {
1325
+ while (1) switch (_context20.prev = _context20.next) {
1332
1326
  case 0:
1333
1327
  if (!item.requires_permissions) {
1334
- _context22.next = 14;
1328
+ _context20.next = 5;
1335
1329
  break;
1336
1330
  }
1337
1331
  if (_this5.loggedIn) {
1338
- _context22.next = 5;
1332
+ _context20.next = 2;
1339
1333
  break;
1340
1334
  }
1341
- _context22.next = 4;
1335
+ _context20.next = 1;
1342
1336
  return _this5.client.CreateFabricToken({});
1343
- case 4:
1344
- authorizationToken = _context22.sent;
1345
- case 5:
1346
- _context22.prev = 5;
1347
- _context22.next = 8;
1337
+ case 1:
1338
+ authorizationToken = _context20.sent;
1339
+ case 2:
1340
+ _context20.prev = 2;
1341
+ _context20.next = 3;
1348
1342
  return _this5.client.ContentObjectMetadata({
1349
1343
  versionHash: LinkTargetHash(item.nft_template),
1350
1344
  metadataSubtree: "permissioned",
1351
1345
  authorizationToken: authorizationToken
1352
1346
  });
1353
- case 8:
1347
+ case 3:
1354
1348
  item.authorized = true;
1355
- _context22.next = 14;
1349
+ _context20.next = 5;
1356
1350
  break;
1357
- case 11:
1358
- _context22.prev = 11;
1359
- _context22.t0 = _context22["catch"](5);
1351
+ case 4:
1352
+ _context20.prev = 4;
1353
+ _t8 = _context20["catch"](2);
1360
1354
  item.authorized = false;
1361
- case 14:
1355
+ case 5:
1362
1356
  item.nftTemplateMetadata = (item.nft_template || {}).nft || {};
1363
1357
  item.nftTemplateHash = ((item.nft_template || {})["."] || {}).source;
1364
1358
  item.itemIndex = index;
1365
- return _context22.abrupt("return", item);
1366
- case 18:
1359
+ return _context20.abrupt("return", item);
1360
+ case 6:
1367
1361
  case "end":
1368
- return _context22.stop();
1362
+ return _context20.stop();
1369
1363
  }
1370
- }, _callee22, null, [[5, 11]]);
1364
+ }, _callee20, null, [[2, 4]]);
1371
1365
  }));
1372
- return function (_x22, _x23) {
1373
- return _ref19.apply(this, arguments);
1366
+ return function (_x20, _x21) {
1367
+ return _ref17.apply(this, arguments);
1374
1368
  };
1375
1369
  }()));
1376
- case 27:
1377
- marketplace.items = _context23.sent;
1370
+ case 10:
1371
+ marketplace.items = _context21.sent;
1378
1372
  marketplace.collections = (marketplace.collections || []).map(function (collection, collectionIndex) {
1379
1373
  return _objectSpread(_objectSpread({}, collection), {}, {
1380
1374
  collectionIndex: collectionIndex
@@ -1409,15 +1403,15 @@ var ElvWalletClient = /*#__PURE__*/function () {
1409
1403
  } catch (error) {}
1410
1404
  });
1411
1405
  this.cachedMarketplaces[marketplaceId] = marketplace;
1412
- case 36:
1413
- return _context23.abrupt("return", this.cachedMarketplaces[marketplaceId]);
1414
- case 37:
1406
+ case 11:
1407
+ return _context21.abrupt("return", this.cachedMarketplaces[marketplaceId]);
1408
+ case 12:
1415
1409
  case "end":
1416
- return _context23.stop();
1410
+ return _context21.stop();
1417
1411
  }
1418
- }, _callee23, this);
1412
+ }, _callee21, this);
1419
1413
  }));
1420
- function LoadMarketplace(_x21) {
1414
+ function LoadMarketplace(_x19) {
1421
1415
  return _LoadMarketplace.apply(this, arguments);
1422
1416
  }
1423
1417
  return LoadMarketplace;
@@ -1425,14 +1419,14 @@ var ElvWalletClient = /*#__PURE__*/function () {
1425
1419
  }, {
1426
1420
  key: "FilteredQuery",
1427
1421
  value: function () {
1428
- var _FilteredQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
1422
+ var _FilteredQuery = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
1429
1423
  var _this6 = this;
1430
- var _ref20,
1431
- _ref20$mode,
1424
+ var _ref18,
1425
+ _ref18$mode,
1432
1426
  mode,
1433
- _ref20$sortBy,
1427
+ _ref18$sortBy,
1434
1428
  sortBy,
1435
- _ref20$sortDesc,
1429
+ _ref18$sortDesc,
1436
1430
  sortDesc,
1437
1431
  filter,
1438
1432
  editionFilters,
@@ -1448,15 +1442,15 @@ var ElvWalletClient = /*#__PURE__*/function () {
1448
1442
  capLimit,
1449
1443
  userAddress,
1450
1444
  sellerAddress,
1451
- _ref20$lastNDays,
1445
+ _ref18$lastNDays,
1452
1446
  lastNDays,
1453
1447
  startTime,
1454
1448
  endTime,
1455
- _ref20$includeCheckou,
1449
+ _ref18$includeCheckou,
1456
1450
  includeCheckoutLocked,
1457
- _ref20$start,
1451
+ _ref18$start,
1458
1452
  start,
1459
- _ref20$limit,
1453
+ _ref18$limit,
1460
1454
  limit,
1461
1455
  params,
1462
1456
  marketplaceInfo,
@@ -1464,15 +1458,20 @@ var ElvWalletClient = /*#__PURE__*/function () {
1464
1458
  filters,
1465
1459
  headers,
1466
1460
  path,
1467
- _ref22,
1461
+ _ref20,
1468
1462
  contents,
1469
1463
  paging,
1470
1464
  modesToFormat,
1471
- _args24 = arguments;
1472
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
1473
- while (1) switch (_context24.prev = _context24.next) {
1465
+ _args22 = arguments,
1466
+ _t0,
1467
+ _t1,
1468
+ _t10,
1469
+ _t11,
1470
+ _t12;
1471
+ return _regeneratorRuntime.wrap(function (_context22) {
1472
+ while (1) switch (_context22.prev = _context22.next) {
1474
1473
  case 0:
1475
- _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;
1474
+ _ref18 = _args22.length > 0 && _args22[0] !== undefined ? _args22[0] : {}, _ref18$mode = _ref18.mode, mode = _ref18$mode === void 0 ? "listings" : _ref18$mode, _ref18$sortBy = _ref18.sortBy, sortBy = _ref18$sortBy === void 0 ? "created" : _ref18$sortBy, _ref18$sortDesc = _ref18.sortDesc, sortDesc = _ref18$sortDesc === void 0 ? false : _ref18$sortDesc, filter = _ref18.filter, editionFilters = _ref18.editionFilters, attributeFilters = _ref18.attributeFilters, contractAddress = _ref18.contractAddress, tokenId = _ref18.tokenId, currency = _ref18.currency, marketplaceParams = _ref18.marketplaceParams, tenantId = _ref18.tenantId, collectionIndexes = _ref18.collectionIndexes, priceRange = _ref18.priceRange, tokenIdRange = _ref18.tokenIdRange, capLimit = _ref18.capLimit, userAddress = _ref18.userAddress, sellerAddress = _ref18.sellerAddress, _ref18$lastNDays = _ref18.lastNDays, lastNDays = _ref18$lastNDays === void 0 ? -1 : _ref18$lastNDays, startTime = _ref18.startTime, endTime = _ref18.endTime, _ref18$includeCheckou = _ref18.includeCheckoutLocked, includeCheckoutLocked = _ref18$includeCheckou === void 0 ? false : _ref18$includeCheckou, _ref18$start = _ref18.start, start = _ref18$start === void 0 ? 0 : _ref18$start, _ref18$limit = _ref18.limit, limit = _ref18$limit === void 0 ? 50 : _ref18$limit;
1476
1475
  collectionIndexes = (collectionIndexes || []).map(function (i) {
1477
1476
  return parseInt(i);
1478
1477
  });
@@ -1491,27 +1490,27 @@ var ElvWalletClient = /*#__PURE__*/function () {
1491
1490
  params.checkout = true;
1492
1491
  }
1493
1492
  if (!marketplaceParams) {
1494
- _context24.next = 14;
1493
+ _context22.next = 3;
1495
1494
  break;
1496
1495
  }
1497
- _context24.next = 9;
1496
+ _context22.next = 1;
1498
1497
  return this.MarketplaceInfo({
1499
1498
  marketplaceParams: marketplaceParams
1500
1499
  });
1501
- case 9:
1502
- marketplaceInfo = _context24.sent;
1500
+ case 1:
1501
+ marketplaceInfo = _context22.sent;
1503
1502
  if (!(collectionIndexes.length > 0)) {
1504
- _context24.next = 14;
1503
+ _context22.next = 3;
1505
1504
  break;
1506
1505
  }
1507
- _context24.next = 13;
1506
+ _context22.next = 2;
1508
1507
  return this.Marketplace({
1509
1508
  marketplaceParams: marketplaceParams
1510
1509
  });
1511
- case 13:
1512
- marketplace = _context24.sent;
1513
- case 14:
1514
- _context24.prev = 14;
1510
+ case 2:
1511
+ marketplace = _context22.sent;
1512
+ case 3:
1513
+ _context22.prev = 3;
1515
1514
  filters = [];
1516
1515
  if (sellerAddress) {
1517
1516
  filters.push("seller:eq:".concat(this.client.utils.FormatAddress(sellerAddress)));
@@ -1571,9 +1570,9 @@ var ElvWalletClient = /*#__PURE__*/function () {
1571
1570
  });
1572
1571
  }
1573
1572
  if (attributeFilters) {
1574
- attributeFilters.map(function (_ref21) {
1575
- var name = _ref21.name,
1576
- value = _ref21.value;
1573
+ attributeFilters.map(function (_ref19) {
1574
+ var name = _ref19.name,
1575
+ value = _ref19.value;
1577
1576
  if (!name || !value) {
1578
1577
  return;
1579
1578
  }
@@ -1612,84 +1611,84 @@ var ElvWalletClient = /*#__PURE__*/function () {
1612
1611
  if (capLimit) {
1613
1612
  filters.push("info/cap:le:".concat(parseInt(capLimit)));
1614
1613
  }
1615
- _context24.t0 = mode;
1616
- _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;
1614
+ _t0 = mode;
1615
+ _context22.next = _t0 === "owned" ? 4 : _t0 === "owned-full-meta" ? 5 : _t0 === "listings" ? 6 : _t0 === "transfers" ? 7 : _t0 === "sales" ? 8 : _t0 === "listing-stats" ? 9 : _t0 === "sales-stats" ? 10 : _t0 === "leaderboard" ? 11 : 12;
1617
1616
  break;
1618
- case 29:
1617
+ case 4:
1619
1618
  path = UrlJoin("as", "wlt", userAddress || this.UserAddress());
1620
- return _context24.abrupt("break", 51);
1621
- case 31:
1619
+ return _context22.abrupt("continue", 12);
1620
+ case 5:
1622
1621
  path = UrlJoin("as", "apigw", "nfts");
1623
1622
  headers = {
1624
1623
  Authorization: "Bearer ".concat(this.AuthToken())
1625
1624
  };
1626
- return _context24.abrupt("break", 51);
1627
- case 34:
1625
+ return _context22.abrupt("continue", 12);
1626
+ case 6:
1628
1627
  path = UrlJoin("as", "mkt", "f");
1629
- return _context24.abrupt("break", 51);
1630
- case 36:
1628
+ return _context22.abrupt("continue", 12);
1629
+ case 7:
1631
1630
  path = UrlJoin("as", "mkt", "hst", "f");
1632
1631
  filters.push("action:eq:TRANSFERRED");
1633
1632
  filters.push("action:eq:SOLD");
1634
- return _context24.abrupt("break", 51);
1635
- case 40:
1633
+ return _context22.abrupt("continue", 12);
1634
+ case 8:
1636
1635
  path = UrlJoin("as", "mkt", "hst", "f");
1637
1636
  filters.push("action:eq:SOLD");
1638
1637
  filters.push("seller:co:0x");
1639
- return _context24.abrupt("break", 51);
1640
- case 44:
1638
+ return _context22.abrupt("continue", 12);
1639
+ case 9:
1641
1640
  path = UrlJoin("as", "mkt", "stats", "listed");
1642
- return _context24.abrupt("break", 51);
1643
- case 46:
1641
+ return _context22.abrupt("continue", 12);
1642
+ case 10:
1644
1643
  path = UrlJoin("as", "mkt", "stats", "sold");
1645
1644
  filters.push("seller:co:0x");
1646
- return _context24.abrupt("break", 51);
1647
- case 49:
1645
+ return _context22.abrupt("continue", 12);
1646
+ case 11:
1648
1647
  path = UrlJoin("as", "wlt", "leaders");
1649
- return _context24.abrupt("break", 51);
1650
- case 51:
1648
+ return _context22.abrupt("continue", 12);
1649
+ case 12:
1651
1650
  if (filters.length > 0) {
1652
1651
  params.filter = filters;
1653
1652
  }
1654
1653
  if (!mode.includes("stats")) {
1655
- _context24.next = 56;
1654
+ _context22.next = 14;
1656
1655
  break;
1657
1656
  }
1658
- _context24.next = 55;
1657
+ _context22.next = 13;
1659
1658
  return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
1660
1659
  path: path,
1661
1660
  method: "GET",
1662
1661
  queryParams: params,
1663
1662
  headers: headers
1664
1663
  }));
1665
- case 55:
1666
- return _context24.abrupt("return", _context24.sent);
1667
- case 56:
1668
- _context24.t2 = Utils;
1669
- _context24.next = 59;
1664
+ case 13:
1665
+ return _context22.abrupt("return", _context22.sent);
1666
+ case 14:
1667
+ _t10 = Utils;
1668
+ _context22.next = 15;
1670
1669
  return this.client.authClient.MakeAuthServiceRequest({
1671
1670
  path: path,
1672
1671
  method: "GET",
1673
1672
  queryParams: params,
1674
1673
  headers: headers
1675
1674
  });
1676
- case 59:
1677
- _context24.t3 = _context24.sent;
1678
- _context24.next = 62;
1679
- return _context24.t2.ResponseToJson.call(_context24.t2, _context24.t3);
1680
- case 62:
1681
- _context24.t1 = _context24.sent;
1682
- if (_context24.t1) {
1683
- _context24.next = 65;
1675
+ case 15:
1676
+ _t11 = _context22.sent;
1677
+ _context22.next = 16;
1678
+ return _t10.ResponseToJson.call(_t10, _t11);
1679
+ case 16:
1680
+ _t1 = _context22.sent;
1681
+ if (_t1) {
1682
+ _context22.next = 17;
1684
1683
  break;
1685
1684
  }
1686
- _context24.t1 = [];
1687
- case 65:
1688
- _ref22 = _context24.t1;
1689
- contents = _ref22.contents;
1690
- paging = _ref22.paging;
1685
+ _t1 = [];
1686
+ case 17:
1687
+ _ref20 = _t1;
1688
+ contents = _ref20.contents;
1689
+ paging = _ref20.paging;
1691
1690
  modesToFormat = ["owned", "listings", "owned-full-meta"];
1692
- return _context24.abrupt("return", {
1691
+ return _context22.abrupt("return", {
1693
1692
  paging: {
1694
1693
  start: params.start,
1695
1694
  limit: params.limit,
@@ -1700,14 +1699,14 @@ var ElvWalletClient = /*#__PURE__*/function () {
1700
1699
  return modesToFormat.includes(mode) ? FormatNFT(_this6, item) : item;
1701
1700
  })
1702
1701
  });
1703
- case 72:
1704
- _context24.prev = 72;
1705
- _context24.t4 = _context24["catch"](14);
1706
- if (!(_context24.t4.status && _context24.t4.status.toString() === "404")) {
1707
- _context24.next = 76;
1702
+ case 18:
1703
+ _context22.prev = 18;
1704
+ _t12 = _context22["catch"](3);
1705
+ if (!(_t12.status && _t12.status.toString() === "404")) {
1706
+ _context22.next = 19;
1708
1707
  break;
1709
1708
  }
1710
- return _context24.abrupt("return", {
1709
+ return _context22.abrupt("return", {
1711
1710
  paging: {
1712
1711
  start: params.start,
1713
1712
  limit: params.limit,
@@ -1716,13 +1715,13 @@ var ElvWalletClient = /*#__PURE__*/function () {
1716
1715
  },
1717
1716
  results: []
1718
1717
  });
1719
- case 76:
1720
- throw _context24.t4;
1721
- case 77:
1718
+ case 19:
1719
+ throw _t12;
1720
+ case 20:
1722
1721
  case "end":
1723
- return _context24.stop();
1722
+ return _context22.stop();
1724
1723
  }
1725
- }, _callee24, this, [[14, 72]]);
1724
+ }, _callee22, this, [[3, 18]]);
1726
1725
  }));
1727
1726
  function FilteredQuery() {
1728
1727
  return _FilteredQuery.apply(this, arguments);
@@ -1732,26 +1731,26 @@ var ElvWalletClient = /*#__PURE__*/function () {
1732
1731
  }, {
1733
1732
  key: "MintingStatus",
1734
1733
  value: function () {
1735
- var _MintingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref23) {
1736
- var marketplaceParams, tenantId, marketplaceInfo, response;
1737
- return _regeneratorRuntime.wrap(function _callee25$(_context25) {
1738
- while (1) switch (_context25.prev = _context25.next) {
1734
+ var _MintingStatus = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23(_ref21) {
1735
+ var marketplaceParams, tenantId, marketplaceInfo, response, _t13;
1736
+ return _regeneratorRuntime.wrap(function (_context23) {
1737
+ while (1) switch (_context23.prev = _context23.next) {
1739
1738
  case 0:
1740
- marketplaceParams = _ref23.marketplaceParams, tenantId = _ref23.tenantId;
1739
+ marketplaceParams = _ref21.marketplaceParams, tenantId = _ref21.tenantId;
1741
1740
  if (tenantId) {
1742
- _context25.next = 6;
1741
+ _context23.next = 2;
1743
1742
  break;
1744
1743
  }
1745
- _context25.next = 4;
1744
+ _context23.next = 1;
1746
1745
  return this.MarketplaceInfo({
1747
1746
  marketplaceParams: marketplaceParams || this.selectedMarketplaceInfo
1748
1747
  });
1749
- case 4:
1750
- marketplaceInfo = _context25.sent;
1748
+ case 1:
1749
+ marketplaceInfo = _context23.sent;
1751
1750
  tenantId = marketplaceInfo.tenantId;
1752
- case 6:
1753
- _context25.prev = 6;
1754
- _context25.next = 9;
1751
+ case 2:
1752
+ _context23.prev = 2;
1753
+ _context23.next = 3;
1755
1754
  return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
1756
1755
  path: UrlJoin("as", "wlt", "status", "act", tenantId),
1757
1756
  method: "GET",
@@ -1759,9 +1758,9 @@ var ElvWalletClient = /*#__PURE__*/function () {
1759
1758
  Authorization: "Bearer ".concat(this.AuthToken())
1760
1759
  }
1761
1760
  }));
1762
- case 9:
1763
- response = _context25.sent;
1764
- return _context25.abrupt("return", response.map(function (status) {
1761
+ case 3:
1762
+ response = _context23.sent;
1763
+ return _context23.abrupt("return", response.map(function (status) {
1765
1764
  var _status$op$split = status.op.split(":"),
1766
1765
  _status$op$split2 = _slicedToArray(_status$op$split, 3),
1767
1766
  op = _status$op$split2[0],
@@ -1823,18 +1822,18 @@ var ElvWalletClient = /*#__PURE__*/function () {
1823
1822
  }).sort(function (a, b) {
1824
1823
  return a.ts < b.ts ? 1 : -1;
1825
1824
  }));
1826
- case 13:
1827
- _context25.prev = 13;
1828
- _context25.t0 = _context25["catch"](6);
1829
- this.Log("Failed to retrieve minting status", true, _context25.t0);
1830
- return _context25.abrupt("return", []);
1831
- case 17:
1825
+ case 4:
1826
+ _context23.prev = 4;
1827
+ _t13 = _context23["catch"](2);
1828
+ this.Log("Failed to retrieve minting status", true, _t13);
1829
+ return _context23.abrupt("return", []);
1830
+ case 5:
1832
1831
  case "end":
1833
- return _context25.stop();
1832
+ return _context23.stop();
1834
1833
  }
1835
- }, _callee25, this, [[6, 13]]);
1834
+ }, _callee23, this, [[2, 4]]);
1836
1835
  }));
1837
- function MintingStatus(_x24) {
1836
+ function MintingStatus(_x22) {
1838
1837
  return _MintingStatus.apply(this, arguments);
1839
1838
  }
1840
1839
  return MintingStatus;
@@ -1842,17 +1841,17 @@ var ElvWalletClient = /*#__PURE__*/function () {
1842
1841
  }, {
1843
1842
  key: "DeployTenant",
1844
1843
  value: function () {
1845
- var _DeployTenant = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(_ref24) {
1846
- var tenantId, _ref24$tenantSlug, tenantSlug, tenantHash, _ref24$environment, environment, tenantLink, deployedTenantHash, body, token;
1847
- return _regeneratorRuntime.wrap(function _callee26$(_context26) {
1848
- while (1) switch (_context26.prev = _context26.next) {
1844
+ var _DeployTenant = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee24(_ref22) {
1845
+ var tenantId, _ref22$tenantSlug, tenantSlug, tenantHash, _ref22$environment, environment, tenantLink, deployedTenantHash, body, token;
1846
+ return _regeneratorRuntime.wrap(function (_context24) {
1847
+ while (1) switch (_context24.prev = _context24.next) {
1849
1848
  case 0:
1850
- 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;
1849
+ tenantId = _ref22.tenantId, _ref22$tenantSlug = _ref22.tenantSlug, tenantSlug = _ref22$tenantSlug === void 0 ? "" : _ref22$tenantSlug, tenantHash = _ref22.tenantHash, _ref22$environment = _ref22.environment, environment = _ref22$environment === void 0 ? "production" : _ref22$environment;
1851
1850
  if (tenantHash) {
1852
- _context26.next = 11;
1851
+ _context24.next = 4;
1853
1852
  break;
1854
1853
  }
1855
- _context26.next = 4;
1854
+ _context24.next = 1;
1856
1855
  return this.client.ContentObjectMetadata({
1857
1856
  libraryId: this.mainSiteLibraryId,
1858
1857
  objectId: this.mainSiteId,
@@ -1863,32 +1862,32 @@ var ElvWalletClient = /*#__PURE__*/function () {
1863
1862
  resolveIgnoreErrors: true,
1864
1863
  select: ["."]
1865
1864
  });
1866
- case 4:
1867
- tenantLink = _context26.sent;
1865
+ case 1:
1866
+ tenantLink = _context24.sent;
1868
1867
  if (tenantLink) {
1869
- _context26.next = 7;
1868
+ _context24.next = 2;
1870
1869
  break;
1871
1870
  }
1872
1871
  throw Error("Eluvio Wallet Client: Invalid or missing tenancy: ".concat(tenantSlug));
1873
- case 7:
1872
+ case 2:
1874
1873
  deployedTenantHash = tenantLink["."].source;
1875
- _context26.next = 10;
1874
+ _context24.next = 3;
1876
1875
  return this.client.LatestVersionHash({
1877
1876
  versionHash: deployedTenantHash
1878
1877
  });
1879
- case 10:
1880
- tenantHash = _context26.sent;
1881
- case 11:
1878
+ case 3:
1879
+ tenantHash = _context24.sent;
1880
+ case 4:
1882
1881
  body = {
1883
1882
  content_hash: tenantHash,
1884
1883
  env: environment,
1885
1884
  ts: Date.now()
1886
1885
  };
1887
- _context26.next = 14;
1886
+ _context24.next = 5;
1888
1887
  return this.client.Sign(JSON.stringify(body));
1889
- case 14:
1890
- token = _context26.sent;
1891
- _context26.next = 17;
1888
+ case 5:
1889
+ token = _context24.sent;
1890
+ _context24.next = 6;
1892
1891
  return this.client.authClient.MakeAuthServiceRequest({
1893
1892
  path: UrlJoin("as", "tnt", "config", tenantId, "metadata"),
1894
1893
  method: "POST",
@@ -1897,13 +1896,13 @@ var ElvWalletClient = /*#__PURE__*/function () {
1897
1896
  Authorization: "Bearer ".concat(token)
1898
1897
  }
1899
1898
  });
1900
- case 17:
1899
+ case 6:
1901
1900
  case "end":
1902
- return _context26.stop();
1901
+ return _context24.stop();
1903
1902
  }
1904
- }, _callee26, this);
1903
+ }, _callee24, this);
1905
1904
  }));
1906
- function DeployTenant(_x25) {
1905
+ function DeployTenant(_x23) {
1907
1906
  return _DeployTenant.apply(this, arguments);
1908
1907
  }
1909
1908
  return DeployTenant;
@@ -1911,20 +1910,20 @@ var ElvWalletClient = /*#__PURE__*/function () {
1911
1910
  }, {
1912
1911
  key: "PurgeUrl",
1913
1912
  value: function () {
1914
- var _PurgeUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(_ref25) {
1913
+ var _PurgeUrl = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref23) {
1915
1914
  var tenantId, url, body, token;
1916
- return _regeneratorRuntime.wrap(function _callee27$(_context27) {
1917
- while (1) switch (_context27.prev = _context27.next) {
1915
+ return _regeneratorRuntime.wrap(function (_context25) {
1916
+ while (1) switch (_context25.prev = _context25.next) {
1918
1917
  case 0:
1919
- tenantId = _ref25.tenantId, url = _ref25.url;
1918
+ tenantId = _ref23.tenantId, url = _ref23.url;
1920
1919
  body = {
1921
1920
  url: url
1922
1921
  };
1923
- _context27.next = 4;
1922
+ _context25.next = 1;
1924
1923
  return this.client.CreateFabricToken({});
1925
- case 4:
1926
- token = _context27.sent;
1927
- _context27.next = 7;
1924
+ case 1:
1925
+ token = _context25.sent;
1926
+ _context25.next = 2;
1928
1927
  return this.client.authClient.MakeAuthServiceRequest({
1929
1928
  path: UrlJoin("as", "tnt", tenantId, "purge"),
1930
1929
  method: "POST",
@@ -1933,13 +1932,13 @@ var ElvWalletClient = /*#__PURE__*/function () {
1933
1932
  Authorization: "Bearer ".concat(token)
1934
1933
  }
1935
1934
  });
1936
- case 7:
1935
+ case 2:
1937
1936
  case "end":
1938
- return _context27.stop();
1937
+ return _context25.stop();
1939
1938
  }
1940
- }, _callee27, this);
1939
+ }, _callee25, this);
1941
1940
  }));
1942
- function PurgeUrl(_x26) {
1941
+ function PurgeUrl(_x24) {
1943
1942
  return _PurgeUrl.apply(this, arguments);
1944
1943
  }
1945
1944
  return PurgeUrl;
@@ -1979,50 +1978,50 @@ var ElvWalletClient = /*#__PURE__*/function () {
1979
1978
  */
1980
1979
  }, {
1981
1980
  key: "Initialize",
1982
- value: function () {
1983
- var _Initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(_ref26) {
1984
- 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;
1985
- return _regeneratorRuntime.wrap(function _callee28$(_context28) {
1986
- while (1) switch (_context28.prev = _context28.next) {
1981
+ value: (function () {
1982
+ var _Initialize = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee26(_ref24) {
1983
+ 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, _t14;
1984
+ return _regeneratorRuntime.wrap(function (_context26) {
1985
+ while (1) switch (_context26.prev = _context26.next) {
1987
1986
  case 0:
1988
- 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;
1989
- _ref27 = marketplaceParams || {}, tenantSlug = _ref27.tenantSlug, marketplaceSlug = _ref27.marketplaceSlug, marketplaceId = _ref27.marketplaceId, marketplaceHash = _ref27.marketplaceHash;
1987
+ 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;
1988
+ _ref25 = marketplaceParams || {}, tenantSlug = _ref25.tenantSlug, marketplaceSlug = _ref25.marketplaceSlug, marketplaceId = _ref25.marketplaceId, marketplaceHash = _ref25.marketplaceHash;
1990
1989
  if (Configuration[network]) {
1991
- _context28.next = 6;
1990
+ _context26.next = 1;
1992
1991
  break;
1993
1992
  }
1994
1993
  throw Error("ElvWalletClient: Invalid network ".concat(network));
1995
- case 6:
1994
+ case 1:
1996
1995
  if (Configuration[network][mode]) {
1997
- _context28.next = 8;
1996
+ _context26.next = 2;
1998
1997
  break;
1999
1998
  }
2000
1999
  throw Error("ElvWalletClient: Invalid mode ".concat(mode));
2001
- case 8:
2000
+ case 2:
2002
2001
  if (client) {
2003
- _context28.next = 12;
2002
+ _context26.next = 4;
2004
2003
  break;
2005
2004
  }
2006
- _context28.next = 11;
2005
+ _context26.next = 3;
2007
2006
  return ElvClient.FromNetworkName({
2008
2007
  networkName: network,
2009
2008
  assumeV3: true
2010
2009
  });
2011
- case 11:
2012
- client = _context28.sent;
2013
- case 12:
2010
+ case 3:
2011
+ client = _context26.sent;
2012
+ case 4:
2014
2013
  previewMarketplaceHash = previewMarketplaceId;
2015
2014
  if (!(previewMarketplaceHash && !previewMarketplaceHash.startsWith("hq__"))) {
2016
- _context28.next = 17;
2015
+ _context26.next = 6;
2017
2016
  break;
2018
2017
  }
2019
- _context28.next = 16;
2018
+ _context26.next = 5;
2020
2019
  return client.LatestVersionHash({
2021
2020
  objectId: previewMarketplaceId
2022
2021
  });
2023
- case 16:
2024
- previewMarketplaceHash = _context28.sent;
2025
- case 17:
2022
+ case 5:
2023
+ previewMarketplaceHash = _context26.sent;
2024
+ case 6:
2026
2025
  walletClient = new ElvWalletClient({
2027
2026
  appId: appId,
2028
2027
  client: client,
@@ -2039,63 +2038,62 @@ var ElvWalletClient = /*#__PURE__*/function () {
2039
2038
  storeAuthToken: storeAuthToken
2040
2039
  });
2041
2040
  if (!(inBrowser && window.location && window.location.href)) {
2042
- _context28.next = 37;
2041
+ _context26.next = 12;
2043
2042
  break;
2044
2043
  }
2045
2044
  url = new URL(window.location.href);
2046
2045
  if (!url.searchParams.get("elvToken")) {
2047
- _context28.next = 27;
2046
+ _context26.next = 8;
2048
2047
  break;
2049
2048
  }
2050
- _context28.next = 23;
2049
+ _context26.next = 7;
2051
2050
  return walletClient.Authenticate({
2052
2051
  token: url.searchParams.get("elvToken")
2053
2052
  });
2054
- case 23:
2053
+ case 7:
2055
2054
  url.searchParams["delete"]("elvToken");
2056
2055
  window.history.replaceState("", "", url);
2057
- _context28.next = 37;
2056
+ _context26.next = 12;
2058
2057
  break;
2059
- case 27:
2058
+ case 8:
2060
2059
  if (!(storeAuthToken && localStorageAvailable)) {
2061
- _context28.next = 37;
2060
+ _context26.next = 12;
2062
2061
  break;
2063
2062
  }
2064
- _context28.prev = 28;
2063
+ _context26.prev = 9;
2065
2064
  // Load saved auth token
2066
2065
  savedToken = localStorage.getItem("__elv-token-".concat(network));
2067
2066
  if (!savedToken) {
2068
- _context28.next = 33;
2067
+ _context26.next = 10;
2069
2068
  break;
2070
2069
  }
2071
- _context28.next = 33;
2070
+ _context26.next = 10;
2072
2071
  return walletClient.Authenticate({
2073
2072
  token: savedToken
2074
2073
  });
2075
- case 33:
2076
- _context28.next = 37;
2074
+ case 10:
2075
+ _context26.next = 12;
2077
2076
  break;
2078
- case 35:
2079
- _context28.prev = 35;
2080
- _context28.t0 = _context28["catch"](28);
2081
- case 37:
2077
+ case 11:
2078
+ _context26.prev = 11;
2079
+ _t14 = _context26["catch"](9);
2080
+ case 12:
2082
2081
  if (!skipMarketplaceLoad) {
2083
2082
  walletClient.LoadAvailableMarketplaces();
2084
2083
  }
2085
- return _context28.abrupt("return", walletClient);
2086
- case 39:
2084
+ return _context26.abrupt("return", walletClient);
2085
+ case 13:
2087
2086
  case "end":
2088
- return _context28.stop();
2087
+ return _context26.stop();
2089
2088
  }
2090
- }, _callee28, null, [[28, 35]]);
2089
+ }, _callee26, null, [[9, 11]]);
2091
2090
  }));
2092
- function Initialize(_x27) {
2091
+ function Initialize(_x25) {
2093
2092
  return _Initialize.apply(this, arguments);
2094
2093
  }
2095
2094
  return Initialize;
2096
- }()
2095
+ }())
2097
2096
  }]);
2098
- return ElvWalletClient;
2099
2097
  }();
2100
2098
  Object.assign(ElvWalletClient.prototype, require("./ClientMethods"));
2101
2099
  Object.assign(ElvWalletClient.prototype, require("./Profile"));