@eluvio/elv-client-js 4.2.10 → 4.2.12

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