@eluvio/elv-client-js 4.0.5 → 4.0.7

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 (43) hide show
  1. package/dist/ElvClient-min.js +12 -11
  2. package/dist/ElvClient-node-min.js +12 -11
  3. package/dist/ElvFrameClient-min.js +12 -11
  4. package/dist/ElvPermissionsClient-min.js +10 -9
  5. package/dist/ElvWalletClient-min.js +12 -11
  6. package/dist/ElvWalletClient-node-min.js +11 -10
  7. package/dist/src/AuthorizationClient.js +1556 -2077
  8. package/dist/src/ContentObjectVerification.js +134 -185
  9. package/dist/src/Crypto.js +225 -322
  10. package/dist/src/ElvClient.js +823 -1117
  11. package/dist/src/ElvWallet.js +64 -106
  12. package/dist/src/EthClient.js +719 -974
  13. package/dist/src/FrameClient.js +222 -318
  14. package/dist/src/HttpClient.js +112 -154
  15. package/dist/src/Id.js +1 -6
  16. package/dist/src/LogMessage.js +4 -8
  17. package/dist/src/PermissionsClient.js +973 -1271
  18. package/dist/src/RemoteSigner.js +161 -232
  19. package/dist/src/UserProfileClient.js +781 -1038
  20. package/dist/src/Utils.js +160 -302
  21. package/dist/src/Validation.js +2 -17
  22. package/dist/src/client/ABRPublishing.js +772 -942
  23. package/dist/src/client/AccessGroups.js +849 -1095
  24. package/dist/src/client/ContentAccess.js +3263 -4132
  25. package/dist/src/client/ContentManagement.js +1811 -2283
  26. package/dist/src/client/Contracts.js +468 -614
  27. package/dist/src/client/Files.js +1505 -1845
  28. package/dist/src/client/NFT.js +94 -116
  29. package/dist/src/client/NTP.js +326 -425
  30. package/dist/src/index.js +2 -5
  31. package/dist/src/walletClient/ClientMethods.js +1348 -1735
  32. package/dist/src/walletClient/Configuration.js +4 -2
  33. package/dist/src/walletClient/Notifications.js +98 -127
  34. package/dist/src/walletClient/Profile.js +184 -246
  35. package/dist/src/walletClient/Utils.js +76 -122
  36. package/dist/src/walletClient/index.js +1168 -1493
  37. package/package.json +2 -2
  38. package/src/Crypto.js +1 -1
  39. package/src/ElvClient.js +1 -3
  40. package/src/Utils.js +1 -1
  41. package/testScripts/Test.js +0 -1
  42. package/utilities/NFTIngest.js +527 -0
  43. package/utilities/lib/concerns/LocalFile.js +2 -1
@@ -1,21 +1,15 @@
1
1
  var _defineProperty = require("@babel/runtime/helpers/defineProperty");
2
-
3
2
  var _regeneratorRuntime = require("@babel/runtime/regenerator");
4
-
5
3
  var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
6
-
7
4
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
-
9
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
-
11
6
  var Utils = require("../Utils");
12
-
13
7
  var UrlJoin = require("url-join");
14
-
15
8
  var _require = require("./Utils"),
16
- FormatNFTDetails = _require.FormatNFTDetails,
17
- FormatNFTMetadata = _require.FormatNFTMetadata,
18
- FormatNFT = _require.FormatNFT;
9
+ FormatNFTDetails = _require.FormatNFTDetails,
10
+ FormatNFTMetadata = _require.FormatNFTMetadata,
11
+ FormatNFT = _require.FormatNFT;
12
+
19
13
  /**
20
14
  * Methods
21
15
  *
@@ -33,13 +27,10 @@ var _require = require("./Utils"),
33
27
  *
34
28
  * @returns {Object} - User info
35
29
  */
36
-
37
-
38
30
  exports.UserInfo = function () {
39
31
  if (!this.loggedIn) {
40
32
  return;
41
33
  }
42
-
43
34
  return {
44
35
  name: this.__authorization.email || this.UserAddress(),
45
36
  address: this.UserAddress(),
@@ -48,6 +39,7 @@ exports.UserInfo = function () {
48
39
  walletName: this.__authorization.walletName
49
40
  };
50
41
  };
42
+
51
43
  /**
52
44
  * <b><i>Requires login</i></b>
53
45
  *
@@ -57,15 +49,13 @@ exports.UserInfo = function () {
57
49
  *
58
50
  * @returns {string} - The address of the current user
59
51
  */
60
-
61
-
62
52
  exports.UserAddress = function () {
63
53
  if (!this.loggedIn) {
64
54
  return;
65
55
  }
66
-
67
56
  return this.client.utils.DecodeSignedToken(this.AuthToken()).payload.adr;
68
57
  };
58
+
69
59
  /**
70
60
  * <b><i>Requires login</i></b>
71
61
  *
@@ -81,132 +71,115 @@ exports.UserAddress = function () {
81
71
  * <li>- usedBalance - <i>(Only included if user has set up Solana link with the Phantom wallet)</i> Available USDC balance of the user's Solana wallet</li>
82
72
  * </ul>
83
73
  */
84
-
85
-
86
74
  exports.UserWalletBalance = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
87
75
  var checkOnboard,
88
- _yield$this$client$ut,
89
- balance,
90
- usage_hold,
91
- payout_hold,
92
- locked_offer_balance,
93
- stripe_id,
94
- stripe_payouts_enabled,
95
- userStripeId,
96
- userStripeEnabled,
97
- totalWalletBalance,
98
- lockedWalletBalance,
99
- availableWalletBalance,
100
- pendingWalletBalance,
101
- withdrawableWalletBalance,
102
- rootUrl,
103
- balances,
104
- _args = arguments;
105
-
76
+ _yield$this$client$ut,
77
+ balance,
78
+ usage_hold,
79
+ payout_hold,
80
+ locked_offer_balance,
81
+ stripe_id,
82
+ stripe_payouts_enabled,
83
+ userStripeId,
84
+ userStripeEnabled,
85
+ totalWalletBalance,
86
+ lockedWalletBalance,
87
+ availableWalletBalance,
88
+ pendingWalletBalance,
89
+ withdrawableWalletBalance,
90
+ rootUrl,
91
+ balances,
92
+ _args = arguments;
106
93
  return _regeneratorRuntime.wrap(function _callee$(_context) {
107
- while (1) {
108
- switch (_context.prev = _context.next) {
109
- case 0:
110
- checkOnboard = _args.length > 0 && _args[0] !== undefined ? _args[0] : false;
111
-
112
- if (this.loggedIn) {
113
- _context.next = 3;
114
- break;
115
- }
116
-
117
- return _context.abrupt("return");
118
-
119
- case 3:
120
- _context.t0 = this.client.utils;
121
- _context.next = 6;
122
- return this.client.authClient.MakeAuthServiceRequest({
123
- path: UrlJoin("as", "wlt", "mkt", "bal"),
124
- method: "GET",
125
- headers: {
126
- Authorization: "Bearer ".concat(this.AuthToken())
127
- }
128
- });
129
-
130
- case 6:
131
- _context.t1 = _context.sent;
132
- _context.next = 9;
133
- return _context.t0.ResponseToJson.call(_context.t0, _context.t1);
134
-
135
- case 9:
136
- _yield$this$client$ut = _context.sent;
137
- balance = _yield$this$client$ut.balance;
138
- usage_hold = _yield$this$client$ut.usage_hold;
139
- payout_hold = _yield$this$client$ut.payout_hold;
140
- locked_offer_balance = _yield$this$client$ut.locked_offer_balance;
141
- stripe_id = _yield$this$client$ut.stripe_id;
142
- stripe_payouts_enabled = _yield$this$client$ut.stripe_payouts_enabled;
143
- userStripeId = stripe_id;
144
- userStripeEnabled = stripe_payouts_enabled;
145
- totalWalletBalance = parseFloat(balance || 0);
146
- lockedWalletBalance = parseFloat(locked_offer_balance || 0);
147
- availableWalletBalance = Math.max(0, totalWalletBalance - parseFloat(usage_hold || 0) - lockedWalletBalance);
148
- pendingWalletBalance = Math.max(0, totalWalletBalance - availableWalletBalance);
149
- withdrawableWalletBalance = Math.max(0, totalWalletBalance - parseFloat(Math.max(payout_hold, lockedWalletBalance) || 0));
150
-
151
- if (!(checkOnboard && stripe_id && !stripe_payouts_enabled)) {
152
- _context.next = 30;
153
- break;
94
+ while (1) switch (_context.prev = _context.next) {
95
+ case 0:
96
+ checkOnboard = _args.length > 0 && _args[0] !== undefined ? _args[0] : false;
97
+ if (this.loggedIn) {
98
+ _context.next = 3;
99
+ break;
100
+ }
101
+ return _context.abrupt("return");
102
+ case 3:
103
+ _context.t0 = this.client.utils;
104
+ _context.next = 6;
105
+ return this.client.authClient.MakeAuthServiceRequest({
106
+ path: UrlJoin("as", "wlt", "mkt", "bal"),
107
+ method: "GET",
108
+ headers: {
109
+ Authorization: "Bearer ".concat(this.AuthToken())
154
110
  }
155
-
156
- // Refresh stripe enabled flag
157
- rootUrl = new URL(UrlJoin(window.location.origin, window.location.pathname)).toString();
158
- _context.next = 27;
159
- return this.client.authClient.MakeAuthServiceRequest({
160
- path: UrlJoin("as", "wlt", "onb", "stripe"),
161
- method: "POST",
162
- body: {
163
- country: "US",
164
- mode: this.mode,
165
- refresh_url: rootUrl.toString(),
166
- return_url: rootUrl.toString()
167
- },
168
- headers: {
169
- Authorization: "Bearer ".concat(this.AuthToken())
170
- }
171
- });
172
-
173
- case 27:
174
- _context.next = 29;
175
- return this.UserWalletBalance(false);
176
-
177
- case 29:
178
- return _context.abrupt("return", _context.sent);
179
-
180
- case 30:
181
- balances = {
182
- totalWalletBalance: totalWalletBalance,
183
- availableWalletBalance: availableWalletBalance,
184
- lockedWalletBalance: lockedWalletBalance,
185
- pendingWalletBalance: pendingWalletBalance,
186
- withdrawableWalletBalance: withdrawableWalletBalance
187
- };
188
-
189
- if (userStripeEnabled) {
190
- balances.userStripeId = userStripeId;
191
- balances.userStripeEnabled = userStripeEnabled;
192
- } // TODO: integrate
193
-
194
- /*
195
- if(cryptoStore.usdcConnected) {
196
- balances.usdcBalance = cryptoStore.phantomUSDCBalance;
111
+ });
112
+ case 6:
113
+ _context.t1 = _context.sent;
114
+ _context.next = 9;
115
+ return _context.t0.ResponseToJson.call(_context.t0, _context.t1);
116
+ case 9:
117
+ _yield$this$client$ut = _context.sent;
118
+ balance = _yield$this$client$ut.balance;
119
+ usage_hold = _yield$this$client$ut.usage_hold;
120
+ payout_hold = _yield$this$client$ut.payout_hold;
121
+ locked_offer_balance = _yield$this$client$ut.locked_offer_balance;
122
+ stripe_id = _yield$this$client$ut.stripe_id;
123
+ stripe_payouts_enabled = _yield$this$client$ut.stripe_payouts_enabled;
124
+ userStripeId = stripe_id;
125
+ userStripeEnabled = stripe_payouts_enabled;
126
+ totalWalletBalance = parseFloat(balance || 0);
127
+ lockedWalletBalance = parseFloat(locked_offer_balance || 0);
128
+ availableWalletBalance = Math.max(0, totalWalletBalance - parseFloat(usage_hold || 0) - lockedWalletBalance);
129
+ pendingWalletBalance = Math.max(0, totalWalletBalance - availableWalletBalance);
130
+ withdrawableWalletBalance = Math.max(0, totalWalletBalance - parseFloat(Math.max(payout_hold, lockedWalletBalance) || 0));
131
+ if (!(checkOnboard && stripe_id && !stripe_payouts_enabled)) {
132
+ _context.next = 30;
133
+ break;
134
+ }
135
+ // Refresh stripe enabled flag
136
+ rootUrl = new URL(UrlJoin(window.location.origin, window.location.pathname)).toString();
137
+ _context.next = 27;
138
+ return this.client.authClient.MakeAuthServiceRequest({
139
+ path: UrlJoin("as", "wlt", "onb", "stripe"),
140
+ method: "POST",
141
+ body: {
142
+ country: "US",
143
+ mode: this.mode,
144
+ refresh_url: rootUrl.toString(),
145
+ return_url: rootUrl.toString()
146
+ },
147
+ headers: {
148
+ Authorization: "Bearer ".concat(this.AuthToken())
197
149
  }
198
- */
199
-
200
-
201
- return _context.abrupt("return", balances);
150
+ });
151
+ case 27:
152
+ _context.next = 29;
153
+ return this.UserWalletBalance(false);
154
+ case 29:
155
+ return _context.abrupt("return", _context.sent);
156
+ case 30:
157
+ balances = {
158
+ totalWalletBalance: totalWalletBalance,
159
+ availableWalletBalance: availableWalletBalance,
160
+ lockedWalletBalance: lockedWalletBalance,
161
+ pendingWalletBalance: pendingWalletBalance,
162
+ withdrawableWalletBalance: withdrawableWalletBalance
163
+ };
164
+ if (userStripeEnabled) {
165
+ balances.userStripeId = userStripeId;
166
+ balances.userStripeEnabled = userStripeEnabled;
167
+ }
202
168
 
203
- case 33:
204
- case "end":
205
- return _context.stop();
206
- }
169
+ // TODO: integrate
170
+ /*
171
+ if(cryptoStore.usdcConnected) {
172
+ balances.usdcBalance = cryptoStore.phantomUSDCBalance;
173
+ }
174
+ */
175
+ return _context.abrupt("return", balances);
176
+ case 33:
177
+ case "end":
178
+ return _context.stop();
207
179
  }
208
180
  }, _callee, this);
209
181
  }));
182
+
210
183
  /**
211
184
  * Retrieve all valid names for filtering user items. Full item names are required for filtering results by name.
212
185
  *
@@ -219,69 +192,57 @@ exports.UserWalletBalance = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regene
219
192
  *
220
193
  * @returns {Promise<Array<String>>} - A list of item names
221
194
  */
222
-
223
195
  exports.UserItemNames = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
224
196
  var _ref3,
225
- marketplaceParams,
226
- userAddress,
227
- filters,
228
- _args2 = arguments;
229
-
197
+ marketplaceParams,
198
+ userAddress,
199
+ filters,
200
+ _args2 = arguments;
230
201
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
231
- while (1) {
232
- switch (_context2.prev = _context2.next) {
233
- case 0:
234
- _ref3 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, marketplaceParams = _ref3.marketplaceParams, userAddress = _ref3.userAddress;
235
- filters = [];
236
-
237
- if (!marketplaceParams) {
238
- _context2.next = 10;
239
- break;
240
- }
241
-
242
- _context2.t0 = filters;
243
- _context2.t1 = "tenant:eq:";
244
- _context2.next = 7;
245
- return this.MarketplaceInfo({
246
- marketplaceParams: marketplaceParams
247
- });
248
-
249
- case 7:
250
- _context2.t2 = _context2.sent.tenantId;
251
- _context2.t3 = _context2.t1.concat.call(_context2.t1, _context2.t2);
252
-
253
- _context2.t0.push.call(_context2.t0, _context2.t3);
254
-
255
- case 10:
256
- if (userAddress) {
257
- filters.push("wlt:eq:".concat(Utils.FormatAddress(userAddress)));
202
+ while (1) switch (_context2.prev = _context2.next) {
203
+ case 0:
204
+ _ref3 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, marketplaceParams = _ref3.marketplaceParams, userAddress = _ref3.userAddress;
205
+ filters = [];
206
+ if (!marketplaceParams) {
207
+ _context2.next = 10;
208
+ break;
209
+ }
210
+ _context2.t0 = filters;
211
+ _context2.t1 = "tenant:eq:";
212
+ _context2.next = 7;
213
+ return this.MarketplaceInfo({
214
+ marketplaceParams: marketplaceParams
215
+ });
216
+ case 7:
217
+ _context2.t2 = _context2.sent.tenantId;
218
+ _context2.t3 = _context2.t1.concat.call(_context2.t1, _context2.t2);
219
+ _context2.t0.push.call(_context2.t0, _context2.t3);
220
+ case 10:
221
+ if (userAddress) {
222
+ filters.push("wlt:eq:".concat(Utils.FormatAddress(userAddress)));
223
+ }
224
+ _context2.t4 = Utils;
225
+ _context2.next = 14;
226
+ return this.client.authClient.MakeAuthServiceRequest({
227
+ path: UrlJoin("as", "wlt", "names"),
228
+ method: "GET",
229
+ queryParams: {
230
+ filter: filters
258
231
  }
259
-
260
- _context2.t4 = Utils;
261
- _context2.next = 14;
262
- return this.client.authClient.MakeAuthServiceRequest({
263
- path: UrlJoin("as", "wlt", "names"),
264
- method: "GET",
265
- queryParams: {
266
- filter: filters
267
- }
268
- });
269
-
270
- case 14:
271
- _context2.t5 = _context2.sent;
272
- _context2.next = 17;
273
- return _context2.t4.ResponseToJson.call(_context2.t4, _context2.t5);
274
-
275
- case 17:
276
- return _context2.abrupt("return", _context2.sent);
277
-
278
- case 18:
279
- case "end":
280
- return _context2.stop();
281
- }
232
+ });
233
+ case 14:
234
+ _context2.t5 = _context2.sent;
235
+ _context2.next = 17;
236
+ return _context2.t4.ResponseToJson.call(_context2.t4, _context2.t5);
237
+ case 17:
238
+ return _context2.abrupt("return", _context2.sent);
239
+ case 18:
240
+ case "end":
241
+ return _context2.stop();
282
242
  }
283
243
  }, _callee2, this);
284
244
  }));
245
+
285
246
  /**
286
247
  * Retrieve all valid edition names for filtering the specified item. Full edition names are required for filtering results by edition.
287
248
  *
@@ -293,45 +254,39 @@ exports.UserItemNames = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerato
293
254
  *
294
255
  * @returns {Promise<Array<String>>} - A list of item editions
295
256
  */
296
-
297
257
  exports.UserItemEditionNames = /*#__PURE__*/function () {
298
258
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
299
259
  var displayName;
300
260
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
301
- while (1) {
302
- switch (_context3.prev = _context3.next) {
303
- case 0:
304
- displayName = _ref4.displayName;
305
- _context3.t0 = Utils;
306
- _context3.next = 4;
307
- return this.client.authClient.MakeAuthServiceRequest({
308
- path: UrlJoin("as", "wlt", "editions"),
309
- method: "GET",
310
- queryParams: {
311
- filter: "meta/display_name:eq:".concat(displayName)
312
- }
313
- });
314
-
315
- case 4:
316
- _context3.t1 = _context3.sent;
317
- _context3.next = 7;
318
- return _context3.t0.ResponseToJson.call(_context3.t0, _context3.t1);
319
-
320
- case 7:
321
- return _context3.abrupt("return", _context3.sent);
322
-
323
- case 8:
324
- case "end":
325
- return _context3.stop();
326
- }
261
+ while (1) switch (_context3.prev = _context3.next) {
262
+ case 0:
263
+ displayName = _ref4.displayName;
264
+ _context3.t0 = Utils;
265
+ _context3.next = 4;
266
+ return this.client.authClient.MakeAuthServiceRequest({
267
+ path: UrlJoin("as", "wlt", "editions"),
268
+ method: "GET",
269
+ queryParams: {
270
+ filter: "meta/display_name:eq:".concat(displayName)
271
+ }
272
+ });
273
+ case 4:
274
+ _context3.t1 = _context3.sent;
275
+ _context3.next = 7;
276
+ return _context3.t0.ResponseToJson.call(_context3.t0, _context3.t1);
277
+ case 7:
278
+ return _context3.abrupt("return", _context3.sent);
279
+ case 8:
280
+ case "end":
281
+ return _context3.stop();
327
282
  }
328
283
  }, _callee3, this);
329
284
  }));
330
-
331
285
  return function (_x) {
332
286
  return _ref5.apply(this, arguments);
333
287
  };
334
288
  }();
289
+
335
290
  /**
336
291
  * Retrieve all valid attribute names and values. Full attribute names and values are required for filtering results by attribute.
337
292
  *
@@ -345,87 +300,73 @@ exports.UserItemEditionNames = /*#__PURE__*/function () {
345
300
  *
346
301
  * @returns {Promise<Array<String>>} - A list of item names
347
302
  */
348
-
349
-
350
303
  exports.UserItemAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
351
304
  var _ref7,
352
- marketplaceParams,
353
- displayName,
354
- userAddress,
355
- filters,
356
- attributes,
357
- _args4 = arguments;
358
-
305
+ marketplaceParams,
306
+ displayName,
307
+ userAddress,
308
+ filters,
309
+ attributes,
310
+ _args4 = arguments;
359
311
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
360
- while (1) {
361
- switch (_context4.prev = _context4.next) {
362
- case 0:
363
- _ref7 = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, marketplaceParams = _ref7.marketplaceParams, displayName = _ref7.displayName, userAddress = _ref7.userAddress;
364
- filters = [];
365
-
366
- if (!marketplaceParams) {
367
- _context4.next = 10;
368
- break;
369
- }
370
-
371
- _context4.t0 = filters;
372
- _context4.t1 = "tenant:eq:";
373
- _context4.next = 7;
374
- return this.MarketplaceInfo({
375
- marketplaceParams: marketplaceParams
376
- });
377
-
378
- case 7:
379
- _context4.t2 = _context4.sent.tenantId;
380
- _context4.t3 = _context4.t1.concat.call(_context4.t1, _context4.t2);
381
-
382
- _context4.t0.push.call(_context4.t0, _context4.t3);
383
-
384
- case 10:
385
- if (userAddress) {
386
- filters.push("wlt:eq:".concat(Utils.FormatAddress(userAddress)));
387
- }
388
-
389
- if (displayName) {
390
- filters.push("meta/display_name:eq:".concat(displayName));
312
+ while (1) switch (_context4.prev = _context4.next) {
313
+ case 0:
314
+ _ref7 = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, marketplaceParams = _ref7.marketplaceParams, displayName = _ref7.displayName, userAddress = _ref7.userAddress;
315
+ filters = [];
316
+ if (!marketplaceParams) {
317
+ _context4.next = 10;
318
+ break;
319
+ }
320
+ _context4.t0 = filters;
321
+ _context4.t1 = "tenant:eq:";
322
+ _context4.next = 7;
323
+ return this.MarketplaceInfo({
324
+ marketplaceParams: marketplaceParams
325
+ });
326
+ case 7:
327
+ _context4.t2 = _context4.sent.tenantId;
328
+ _context4.t3 = _context4.t1.concat.call(_context4.t1, _context4.t2);
329
+ _context4.t0.push.call(_context4.t0, _context4.t3);
330
+ case 10:
331
+ if (userAddress) {
332
+ filters.push("wlt:eq:".concat(Utils.FormatAddress(userAddress)));
333
+ }
334
+ if (displayName) {
335
+ filters.push("meta/display_name:eq:".concat(displayName));
336
+ }
337
+ _context4.t4 = Utils;
338
+ _context4.next = 15;
339
+ return this.client.authClient.MakeAuthServiceRequest({
340
+ path: UrlJoin("as", "wlt", "attributes"),
341
+ method: "GET",
342
+ queryParams: {
343
+ filter: filters
391
344
  }
392
-
393
- _context4.t4 = Utils;
394
- _context4.next = 15;
395
- return this.client.authClient.MakeAuthServiceRequest({
396
- path: UrlJoin("as", "wlt", "attributes"),
397
- method: "GET",
398
- queryParams: {
399
- filter: filters
400
- }
401
- });
402
-
403
- case 15:
404
- _context4.t5 = _context4.sent;
405
- _context4.next = 18;
406
- return _context4.t4.ResponseToJson.call(_context4.t4, _context4.t5);
407
-
408
- case 18:
409
- attributes = _context4.sent;
410
- return _context4.abrupt("return", attributes.map(function (_ref8) {
411
- var trait_type = _ref8.trait_type,
412
- values = _ref8.values;
413
- return {
414
- name: trait_type,
415
- values: values
416
- };
417
- }).filter(function (_ref9) {
418
- var name = _ref9.name;
419
- return !["Content Fabric Hash", "Total Minted Supply", "Creator"].includes(name);
420
- }));
421
-
422
- case 20:
423
- case "end":
424
- return _context4.stop();
425
- }
345
+ });
346
+ case 15:
347
+ _context4.t5 = _context4.sent;
348
+ _context4.next = 18;
349
+ return _context4.t4.ResponseToJson.call(_context4.t4, _context4.t5);
350
+ case 18:
351
+ attributes = _context4.sent;
352
+ return _context4.abrupt("return", attributes.map(function (_ref8) {
353
+ var trait_type = _ref8.trait_type,
354
+ values = _ref8.values;
355
+ return {
356
+ name: trait_type,
357
+ values: values
358
+ };
359
+ }).filter(function (_ref9) {
360
+ var name = _ref9.name;
361
+ return !["Content Fabric Hash", "Total Minted Supply", "Creator"].includes(name);
362
+ }));
363
+ case 20:
364
+ case "end":
365
+ return _context4.stop();
426
366
  }
427
367
  }, _callee4, this);
428
368
  }));
369
+
429
370
  /**
430
371
  * <b><i>Requires login</i></b>
431
372
  *
@@ -446,30 +387,26 @@ exports.UserItemAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regen
446
387
  *
447
388
  * @returns {Promise<Object>} - Results of the query and pagination info
448
389
  */
449
-
450
390
  exports.UserItems = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
451
391
  var _ref11,
452
- _ref11$sortBy,
453
- sortBy,
454
- _args5 = arguments;
455
-
392
+ _ref11$sortBy,
393
+ sortBy,
394
+ _args5 = arguments;
456
395
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
457
- while (1) {
458
- switch (_context5.prev = _context5.next) {
459
- case 0:
460
- _ref11 = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}, _ref11$sortBy = _ref11.sortBy, sortBy = _ref11$sortBy === void 0 ? "default" : _ref11$sortBy;
461
- return _context5.abrupt("return", this.FilteredQuery(_objectSpread({
462
- mode: "owned",
463
- sortBy: sortBy
464
- }, _args5[0] || {})));
465
-
466
- case 2:
467
- case "end":
468
- return _context5.stop();
469
- }
396
+ while (1) switch (_context5.prev = _context5.next) {
397
+ case 0:
398
+ _ref11 = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}, _ref11$sortBy = _ref11.sortBy, sortBy = _ref11$sortBy === void 0 ? "default" : _ref11$sortBy;
399
+ return _context5.abrupt("return", this.FilteredQuery(_objectSpread({
400
+ mode: "owned",
401
+ sortBy: sortBy
402
+ }, _args5[0] || {})));
403
+ case 2:
404
+ case "end":
405
+ return _context5.stop();
470
406
  }
471
407
  }, _callee5, this);
472
408
  }));
409
+
473
410
  /**
474
411
  * Return all listings for the current user. Not paginated.
475
412
  *
@@ -484,48 +421,43 @@ exports.UserItems = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
484
421
  *
485
422
  * @returns {Promise<Array<Object>>} - List of current user's listings
486
423
  */
487
-
488
424
  exports.UserListings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
489
425
  var _ref13,
490
- userAddress,
491
- _ref13$sortBy,
492
- sortBy,
493
- _ref13$sortDesc,
494
- sortDesc,
495
- contractAddress,
496
- tokenId,
497
- marketplaceParams,
498
- _args6 = arguments;
499
-
426
+ userAddress,
427
+ _ref13$sortBy,
428
+ sortBy,
429
+ _ref13$sortDesc,
430
+ sortDesc,
431
+ contractAddress,
432
+ tokenId,
433
+ marketplaceParams,
434
+ _args6 = arguments;
500
435
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
501
- while (1) {
502
- switch (_context6.prev = _context6.next) {
503
- case 0:
504
- _ref13 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, userAddress = _ref13.userAddress, _ref13$sortBy = _ref13.sortBy, sortBy = _ref13$sortBy === void 0 ? "created" : _ref13$sortBy, _ref13$sortDesc = _ref13.sortDesc, sortDesc = _ref13$sortDesc === void 0 ? false : _ref13$sortDesc, contractAddress = _ref13.contractAddress, tokenId = _ref13.tokenId, marketplaceParams = _ref13.marketplaceParams;
505
- _context6.next = 3;
506
- return this.FilteredQuery({
507
- mode: "listings",
508
- start: 0,
509
- limit: 10000,
510
- sortBy: sortBy,
511
- sortDesc: sortDesc,
512
- sellerAddress: userAddress || this.UserAddress(),
513
- marketplaceParams: marketplaceParams,
514
- contractAddress: contractAddress,
515
- tokenId: tokenId,
516
- includeCheckoutLocked: true
517
- });
518
-
519
- case 3:
520
- return _context6.abrupt("return", _context6.sent.results);
521
-
522
- case 4:
523
- case "end":
524
- return _context6.stop();
525
- }
436
+ while (1) switch (_context6.prev = _context6.next) {
437
+ case 0:
438
+ _ref13 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, userAddress = _ref13.userAddress, _ref13$sortBy = _ref13.sortBy, sortBy = _ref13$sortBy === void 0 ? "created" : _ref13$sortBy, _ref13$sortDesc = _ref13.sortDesc, sortDesc = _ref13$sortDesc === void 0 ? false : _ref13$sortDesc, contractAddress = _ref13.contractAddress, tokenId = _ref13.tokenId, marketplaceParams = _ref13.marketplaceParams;
439
+ _context6.next = 3;
440
+ return this.FilteredQuery({
441
+ mode: "listings",
442
+ start: 0,
443
+ limit: 10000,
444
+ sortBy: sortBy,
445
+ sortDesc: sortDesc,
446
+ sellerAddress: userAddress || this.UserAddress(),
447
+ marketplaceParams: marketplaceParams,
448
+ contractAddress: contractAddress,
449
+ tokenId: tokenId,
450
+ includeCheckoutLocked: true
451
+ });
452
+ case 3:
453
+ return _context6.abrupt("return", _context6.sent.results);
454
+ case 4:
455
+ case "end":
456
+ return _context6.stop();
526
457
  }
527
458
  }, _callee6, this);
528
459
  }));
460
+
529
461
  /**
530
462
  * Return all sales for the current user. Not paginated.
531
463
  *
@@ -541,47 +473,42 @@ exports.UserListings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
541
473
  *
542
474
  * @returns {Promise<Array<Object>>} - List of current user's sales
543
475
  */
544
-
545
476
  exports.UserSales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
546
477
  var _ref15,
547
- userAddress,
548
- _ref15$sortBy,
549
- sortBy,
550
- _ref15$sortDesc,
551
- sortDesc,
552
- contractAddress,
553
- tokenId,
554
- marketplaceParams,
555
- _args7 = arguments;
556
-
478
+ userAddress,
479
+ _ref15$sortBy,
480
+ sortBy,
481
+ _ref15$sortDesc,
482
+ sortDesc,
483
+ contractAddress,
484
+ tokenId,
485
+ marketplaceParams,
486
+ _args7 = arguments;
557
487
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
558
- while (1) {
559
- switch (_context7.prev = _context7.next) {
560
- case 0:
561
- _ref15 = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}, userAddress = _ref15.userAddress, _ref15$sortBy = _ref15.sortBy, sortBy = _ref15$sortBy === void 0 ? "created" : _ref15$sortBy, _ref15$sortDesc = _ref15.sortDesc, sortDesc = _ref15$sortDesc === void 0 ? false : _ref15$sortDesc, contractAddress = _ref15.contractAddress, tokenId = _ref15.tokenId, marketplaceParams = _ref15.marketplaceParams;
562
- _context7.next = 3;
563
- return this.FilteredQuery({
564
- mode: "sales",
565
- start: 0,
566
- limit: 10000,
567
- sortBy: sortBy,
568
- sortDesc: sortDesc,
569
- sellerAddress: userAddress || this.UserAddress(),
570
- marketplaceParams: marketplaceParams,
571
- contractAddress: contractAddress,
572
- tokenId: tokenId
573
- });
574
-
575
- case 3:
576
- return _context7.abrupt("return", _context7.sent.results);
577
-
578
- case 4:
579
- case "end":
580
- return _context7.stop();
581
- }
488
+ while (1) switch (_context7.prev = _context7.next) {
489
+ case 0:
490
+ _ref15 = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}, userAddress = _ref15.userAddress, _ref15$sortBy = _ref15.sortBy, sortBy = _ref15$sortBy === void 0 ? "created" : _ref15$sortBy, _ref15$sortDesc = _ref15.sortDesc, sortDesc = _ref15$sortDesc === void 0 ? false : _ref15$sortDesc, contractAddress = _ref15.contractAddress, tokenId = _ref15.tokenId, marketplaceParams = _ref15.marketplaceParams;
491
+ _context7.next = 3;
492
+ return this.FilteredQuery({
493
+ mode: "sales",
494
+ start: 0,
495
+ limit: 10000,
496
+ sortBy: sortBy,
497
+ sortDesc: sortDesc,
498
+ sellerAddress: userAddress || this.UserAddress(),
499
+ marketplaceParams: marketplaceParams,
500
+ contractAddress: contractAddress,
501
+ tokenId: tokenId
502
+ });
503
+ case 3:
504
+ return _context7.abrupt("return", _context7.sent.results);
505
+ case 4:
506
+ case "end":
507
+ return _context7.stop();
582
508
  }
583
509
  }, _callee7, this);
584
510
  }));
511
+
585
512
  /**
586
513
  * Return all transfers and sales for the current user. Not paginated.
587
514
  *
@@ -597,47 +524,42 @@ exports.UserSales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
597
524
  *
598
525
  * @returns {Promise<Array<Object>>} - List of current user's sales
599
526
  */
600
-
601
527
  exports.UserTransfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
602
528
  var _ref17,
603
- userAddress,
604
- _ref17$sortBy,
605
- sortBy,
606
- _ref17$sortDesc,
607
- sortDesc,
608
- contractAddress,
609
- tokenId,
610
- marketplaceParams,
611
- _args8 = arguments;
612
-
529
+ userAddress,
530
+ _ref17$sortBy,
531
+ sortBy,
532
+ _ref17$sortDesc,
533
+ sortDesc,
534
+ contractAddress,
535
+ tokenId,
536
+ marketplaceParams,
537
+ _args8 = arguments;
613
538
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
614
- while (1) {
615
- switch (_context8.prev = _context8.next) {
616
- case 0:
617
- _ref17 = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {}, userAddress = _ref17.userAddress, _ref17$sortBy = _ref17.sortBy, sortBy = _ref17$sortBy === void 0 ? "created" : _ref17$sortBy, _ref17$sortDesc = _ref17.sortDesc, sortDesc = _ref17$sortDesc === void 0 ? false : _ref17$sortDesc, contractAddress = _ref17.contractAddress, tokenId = _ref17.tokenId, marketplaceParams = _ref17.marketplaceParams;
618
- _context8.next = 3;
619
- return this.FilteredQuery({
620
- mode: "transfers",
621
- start: 0,
622
- limit: 10000,
623
- sortBy: sortBy,
624
- sortDesc: sortDesc,
625
- sellerAddress: userAddress || this.UserAddress(),
626
- marketplaceParams: marketplaceParams,
627
- contractAddress: contractAddress,
628
- tokenId: tokenId
629
- });
630
-
631
- case 3:
632
- return _context8.abrupt("return", _context8.sent.results);
633
-
634
- case 4:
635
- case "end":
636
- return _context8.stop();
637
- }
539
+ while (1) switch (_context8.prev = _context8.next) {
540
+ case 0:
541
+ _ref17 = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {}, userAddress = _ref17.userAddress, _ref17$sortBy = _ref17.sortBy, sortBy = _ref17$sortBy === void 0 ? "created" : _ref17$sortBy, _ref17$sortDesc = _ref17.sortDesc, sortDesc = _ref17$sortDesc === void 0 ? false : _ref17$sortDesc, contractAddress = _ref17.contractAddress, tokenId = _ref17.tokenId, marketplaceParams = _ref17.marketplaceParams;
542
+ _context8.next = 3;
543
+ return this.FilteredQuery({
544
+ mode: "transfers",
545
+ start: 0,
546
+ limit: 10000,
547
+ sortBy: sortBy,
548
+ sortDesc: sortDesc,
549
+ sellerAddress: userAddress || this.UserAddress(),
550
+ marketplaceParams: marketplaceParams,
551
+ contractAddress: contractAddress,
552
+ tokenId: tokenId
553
+ });
554
+ case 3:
555
+ return _context8.abrupt("return", _context8.sent.results);
556
+ case 4:
557
+ case "end":
558
+ return _context8.stop();
638
559
  }
639
560
  }, _callee8, this);
640
561
  }));
562
+
641
563
  /* TENANT */
642
564
 
643
565
  /**
@@ -652,53 +574,44 @@ exports.UserTransfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerato
652
574
  *
653
575
  * @returns {Promise<Object>} - The tenant configuration
654
576
  */
655
-
656
577
  exports.TenantConfiguration = /*#__PURE__*/function () {
657
578
  var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref18) {
658
579
  var tenantId, contractAddress;
659
580
  return _regeneratorRuntime.wrap(function _callee9$(_context9) {
660
- while (1) {
661
- switch (_context9.prev = _context9.next) {
662
- case 0:
663
- tenantId = _ref18.tenantId, contractAddress = _ref18.contractAddress;
664
- _context9.prev = 1;
665
- contractAddress = contractAddress ? Utils.FormatAddress(contractAddress) : undefined;
666
-
667
- if (this.tenantConfigs[contractAddress || tenantId]) {
668
- _context9.next = 7;
669
- break;
670
- }
671
-
672
- _context9.next = 6;
673
- return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
674
- path: contractAddress ? UrlJoin("as", "config", "nft", contractAddress) : UrlJoin("as", "config", "tnt", tenantId),
675
- method: "GET"
676
- }));
677
-
678
- case 6:
679
- this.tenantConfigs[contractAddress || tenantId] = _context9.sent;
680
-
681
- case 7:
682
- return _context9.abrupt("return", this.tenantConfigs[contractAddress || tenantId]);
683
-
684
- case 10:
685
- _context9.prev = 10;
686
- _context9.t0 = _context9["catch"](1);
687
- this.Log("Failed to load tenant configuration", true, _context9.t0);
688
- return _context9.abrupt("return", {});
689
-
690
- case 14:
691
- case "end":
692
- return _context9.stop();
693
- }
581
+ while (1) switch (_context9.prev = _context9.next) {
582
+ case 0:
583
+ tenantId = _ref18.tenantId, contractAddress = _ref18.contractAddress;
584
+ _context9.prev = 1;
585
+ contractAddress = contractAddress ? Utils.FormatAddress(contractAddress) : undefined;
586
+ if (this.tenantConfigs[contractAddress || tenantId]) {
587
+ _context9.next = 7;
588
+ break;
589
+ }
590
+ _context9.next = 6;
591
+ return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
592
+ path: contractAddress ? UrlJoin("as", "config", "nft", contractAddress) : UrlJoin("as", "config", "tnt", tenantId),
593
+ method: "GET"
594
+ }));
595
+ case 6:
596
+ this.tenantConfigs[contractAddress || tenantId] = _context9.sent;
597
+ case 7:
598
+ return _context9.abrupt("return", this.tenantConfigs[contractAddress || tenantId]);
599
+ case 10:
600
+ _context9.prev = 10;
601
+ _context9.t0 = _context9["catch"](1);
602
+ this.Log("Failed to load tenant configuration", true, _context9.t0);
603
+ return _context9.abrupt("return", {});
604
+ case 14:
605
+ case "end":
606
+ return _context9.stop();
694
607
  }
695
608
  }, _callee9, this, [[1, 10]]);
696
609
  }));
697
-
698
610
  return function (_x2) {
699
611
  return _ref19.apply(this, arguments);
700
612
  };
701
613
  }();
614
+
702
615
  /**
703
616
  * Retrieve the current exchange rate for the specified currency to USD
704
617
  *
@@ -706,46 +619,37 @@ exports.TenantConfiguration = /*#__PURE__*/function () {
706
619
  * @namedParams
707
620
  * @param {string} currency - The currency for which to retrieve the USD exchange rate
708
621
  */
709
-
710
-
711
622
  exports.ExchangeRate = /*#__PURE__*/function () {
712
623
  var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref20) {
713
624
  var currency;
714
625
  return _regeneratorRuntime.wrap(function _callee10$(_context10) {
715
- while (1) {
716
- switch (_context10.prev = _context10.next) {
717
- case 0:
718
- currency = _ref20.currency;
719
-
720
- if (currency) {
721
- _context10.next = 3;
722
- break;
723
- }
724
-
725
- throw Error("Eluvio Wallet Client: Invalid or missing currency in ExchangeRate");
726
-
727
- case 3:
728
- _context10.next = 5;
729
- return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
730
- path: UrlJoin("as", "xr", "ebanx", currency),
731
- method: "GET"
732
- }));
733
-
734
- case 5:
735
- return _context10.abrupt("return", _context10.sent);
736
-
737
- case 6:
738
- case "end":
739
- return _context10.stop();
740
- }
626
+ while (1) switch (_context10.prev = _context10.next) {
627
+ case 0:
628
+ currency = _ref20.currency;
629
+ if (currency) {
630
+ _context10.next = 3;
631
+ break;
632
+ }
633
+ throw Error("Eluvio Wallet Client: Invalid or missing currency in ExchangeRate");
634
+ case 3:
635
+ _context10.next = 5;
636
+ return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
637
+ path: UrlJoin("as", "xr", "ebanx", currency),
638
+ method: "GET"
639
+ }));
640
+ case 5:
641
+ return _context10.abrupt("return", _context10.sent);
642
+ case 6:
643
+ case "end":
644
+ return _context10.stop();
741
645
  }
742
646
  }, _callee10, this);
743
647
  }));
744
-
745
648
  return function (_x3) {
746
649
  return _ref21.apply(this, arguments);
747
650
  };
748
651
  }();
652
+
749
653
  /* MARKETPLACE */
750
654
 
751
655
  /**
@@ -759,63 +663,52 @@ exports.ExchangeRate = /*#__PURE__*/function () {
759
663
  *
760
664
  * @returns {Promise<Object>} - Stock info for items in the marketplace
761
665
  */
762
-
763
-
764
666
  exports.MarketplaceStock = /*#__PURE__*/function () {
765
667
  var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref22) {
766
668
  var marketplaceParams, tenantId, marketplaceInfo;
767
669
  return _regeneratorRuntime.wrap(function _callee11$(_context11) {
768
- while (1) {
769
- switch (_context11.prev = _context11.next) {
770
- case 0:
771
- marketplaceParams = _ref22.marketplaceParams, tenantId = _ref22.tenantId;
772
-
773
- if (!tenantId) {
774
- marketplaceInfo = this.MarketplaceInfo({
775
- marketplaceParams: marketplaceParams
776
- });
777
- tenantId = marketplaceInfo.tenantId;
778
- }
779
-
780
- if (!this.loggedIn) {
781
- _context11.next = 6;
782
- break;
670
+ while (1) switch (_context11.prev = _context11.next) {
671
+ case 0:
672
+ marketplaceParams = _ref22.marketplaceParams, tenantId = _ref22.tenantId;
673
+ if (!tenantId) {
674
+ marketplaceInfo = this.MarketplaceInfo({
675
+ marketplaceParams: marketplaceParams
676
+ });
677
+ tenantId = marketplaceInfo.tenantId;
678
+ }
679
+ if (!this.loggedIn) {
680
+ _context11.next = 6;
681
+ break;
682
+ }
683
+ _context11.next = 5;
684
+ return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
685
+ path: UrlJoin("as", "wlt", "nft", "info", tenantId),
686
+ method: "GET",
687
+ headers: {
688
+ Authorization: "Bearer ".concat(this.AuthToken())
783
689
  }
784
-
785
- _context11.next = 5;
786
- return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
787
- path: UrlJoin("as", "wlt", "nft", "info", tenantId),
788
- method: "GET",
789
- headers: {
790
- Authorization: "Bearer ".concat(this.AuthToken())
791
- }
792
- }));
793
-
794
- case 5:
795
- return _context11.abrupt("return", _context11.sent);
796
-
797
- case 6:
798
- _context11.next = 8;
799
- return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
800
- path: UrlJoin("as", "nft", "stock", tenantId),
801
- method: "GET"
802
- }));
803
-
804
- case 8:
805
- return _context11.abrupt("return", _context11.sent);
806
-
807
- case 9:
808
- case "end":
809
- return _context11.stop();
810
- }
690
+ }));
691
+ case 5:
692
+ return _context11.abrupt("return", _context11.sent);
693
+ case 6:
694
+ _context11.next = 8;
695
+ return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
696
+ path: UrlJoin("as", "nft", "stock", tenantId),
697
+ method: "GET"
698
+ }));
699
+ case 8:
700
+ return _context11.abrupt("return", _context11.sent);
701
+ case 9:
702
+ case "end":
703
+ return _context11.stop();
811
704
  }
812
705
  }, _callee11, this);
813
706
  }));
814
-
815
707
  return function (_x4) {
816
708
  return _ref23.apply(this, arguments);
817
709
  };
818
710
  }();
711
+
819
712
  /**
820
713
  * Retrieve basic information about a specific available marketplace with the specified tenant/marketplace slug, ID, or hash.
821
714
  *
@@ -829,32 +722,26 @@ exports.MarketplaceStock = /*#__PURE__*/function () {
829
722
  *
830
723
  * @returns {Promise<Object>} - Info about the marketplace
831
724
  */
832
-
833
-
834
725
  exports.MarketplaceInfo = function (_ref24) {
835
726
  var marketplaceParams = _ref24.marketplaceParams;
836
-
837
727
  var _ref25 = marketplaceParams || {},
838
- tenantSlug = _ref25.tenantSlug,
839
- marketplaceSlug = _ref25.marketplaceSlug,
840
- marketplaceId = _ref25.marketplaceId,
841
- marketplaceHash = _ref25.marketplaceHash;
842
-
728
+ tenantSlug = _ref25.tenantSlug,
729
+ marketplaceSlug = _ref25.marketplaceSlug,
730
+ marketplaceId = _ref25.marketplaceId,
731
+ marketplaceHash = _ref25.marketplaceHash;
843
732
  var marketplaceInfo;
844
-
845
733
  if (tenantSlug && marketplaceSlug) {
846
734
  marketplaceInfo = (this.availableMarketplaces[tenantSlug] || {})[marketplaceSlug];
847
735
  } else {
848
736
  marketplaceId = marketplaceHash ? this.client.utils.DecodeVersionHash(marketplaceHash).objectId : marketplaceId;
849
737
  marketplaceInfo = this.availableMarketplacesById[marketplaceId];
850
738
  }
851
-
852
739
  if (!marketplaceInfo) {
853
740
  throw Error("Eluvio Wallet Client: Unable to find marketplace with parameters ".concat(JSON.stringify(arguments)));
854
741
  }
855
-
856
742
  return marketplaceInfo;
857
743
  };
744
+
858
745
  /**
859
746
  * Retrieve custom CSS for the specified marketplace
860
747
  *
@@ -864,52 +751,43 @@ exports.MarketplaceInfo = function (_ref24) {
864
751
  *
865
752
  * @returns {Promise<string>} - The CSS of the marketplace
866
753
  */
867
-
868
-
869
754
  exports.MarketplaceCSS = /*#__PURE__*/function () {
870
755
  var _ref27 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref26) {
871
756
  var marketplaceParams, marketplaceInfo, marketplaceHash;
872
757
  return _regeneratorRuntime.wrap(function _callee12$(_context12) {
873
- while (1) {
874
- switch (_context12.prev = _context12.next) {
875
- case 0:
876
- marketplaceParams = _ref26.marketplaceParams;
877
- marketplaceInfo = this.MarketplaceInfo({
878
- marketplaceParams: marketplaceParams
879
- });
880
- marketplaceHash = marketplaceInfo.marketplaceHash;
881
-
882
- if (this.cachedCSS[marketplaceHash]) {
883
- _context12.next = 7;
884
- break;
885
- }
886
-
887
- _context12.next = 6;
888
- return this.client.ContentObjectMetadata({
889
- versionHash: marketplaceHash,
890
- metadataSubtree: "public/asset_metadata/info/branding/custom_css",
891
- authorizationToken: this.publicStaticToken,
892
- noAuth: true
893
- });
894
-
895
- case 6:
896
- this.cachedCSS[marketplaceHash] = _context12.sent;
897
-
898
- case 7:
899
- return _context12.abrupt("return", this.cachedCSS[marketplaceHash] || "");
900
-
901
- case 8:
902
- case "end":
903
- return _context12.stop();
904
- }
758
+ while (1) switch (_context12.prev = _context12.next) {
759
+ case 0:
760
+ marketplaceParams = _ref26.marketplaceParams;
761
+ marketplaceInfo = this.MarketplaceInfo({
762
+ marketplaceParams: marketplaceParams
763
+ });
764
+ marketplaceHash = marketplaceInfo.marketplaceHash;
765
+ if (this.cachedCSS[marketplaceHash]) {
766
+ _context12.next = 7;
767
+ break;
768
+ }
769
+ _context12.next = 6;
770
+ return this.client.ContentObjectMetadata({
771
+ versionHash: marketplaceHash,
772
+ metadataSubtree: "public/asset_metadata/info/branding/custom_css",
773
+ authorizationToken: this.publicStaticToken,
774
+ noAuth: true
775
+ });
776
+ case 6:
777
+ this.cachedCSS[marketplaceHash] = _context12.sent;
778
+ case 7:
779
+ return _context12.abrupt("return", this.cachedCSS[marketplaceHash] || "");
780
+ case 8:
781
+ case "end":
782
+ return _context12.stop();
905
783
  }
906
784
  }, _callee12, this);
907
785
  }));
908
-
909
786
  return function (_x5) {
910
787
  return _ref27.apply(this, arguments);
911
788
  };
912
789
  }();
790
+
913
791
  /**
914
792
  * Retrieve info about all available marketplaces
915
793
  *
@@ -920,39 +798,31 @@ exports.MarketplaceCSS = /*#__PURE__*/function () {
920
798
  *
921
799
  * @returns {Promise<Object>} - Info about available marketplaces
922
800
  */
923
-
924
-
925
801
  exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
926
802
  var _ref29,
927
- organizeById,
928
- _ref29$forceReload,
929
- forceReload,
930
- _args13 = arguments;
931
-
803
+ organizeById,
804
+ _ref29$forceReload,
805
+ forceReload,
806
+ _args13 = arguments;
932
807
  return _regeneratorRuntime.wrap(function _callee13$(_context13) {
933
- while (1) {
934
- switch (_context13.prev = _context13.next) {
935
- case 0:
936
- _ref29 = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {}, organizeById = _ref29.organizeById, _ref29$forceReload = _ref29.forceReload, forceReload = _ref29$forceReload === void 0 ? false : _ref29$forceReload;
937
-
938
- if (!forceReload) {
939
- _context13.next = 4;
940
- break;
941
- }
942
-
808
+ while (1) switch (_context13.prev = _context13.next) {
809
+ case 0:
810
+ _ref29 = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {}, organizeById = _ref29.organizeById, _ref29$forceReload = _ref29.forceReload, forceReload = _ref29$forceReload === void 0 ? false : _ref29$forceReload;
811
+ if (!forceReload) {
943
812
  _context13.next = 4;
944
- return this.LoadAvailableMarketplaces(true);
945
-
946
- case 4:
947
- return _context13.abrupt("return", _objectSpread({}, organizeById ? this.availableMarketplacesById : this.availableMarketplaces));
948
-
949
- case 5:
950
- case "end":
951
- return _context13.stop();
952
- }
813
+ break;
814
+ }
815
+ _context13.next = 4;
816
+ return this.LoadAvailableMarketplaces(true);
817
+ case 4:
818
+ return _context13.abrupt("return", _objectSpread({}, organizeById ? this.availableMarketplacesById : this.availableMarketplaces));
819
+ case 5:
820
+ case "end":
821
+ return _context13.stop();
953
822
  }
954
823
  }, _callee13, this);
955
824
  }));
825
+
956
826
  /**
957
827
  * Retrieve full information about the specified marketplace
958
828
  *
@@ -964,29 +834,25 @@ exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_re
964
834
  *
965
835
  * @returns {Promise<Object>} - The full information for the marketplace
966
836
  */
967
-
968
837
  exports.Marketplace = /*#__PURE__*/function () {
969
838
  var _ref31 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref30) {
970
839
  var marketplaceParams;
971
840
  return _regeneratorRuntime.wrap(function _callee14$(_context14) {
972
- while (1) {
973
- switch (_context14.prev = _context14.next) {
974
- case 0:
975
- marketplaceParams = _ref30.marketplaceParams;
976
- return _context14.abrupt("return", this.LoadMarketplace(marketplaceParams));
977
-
978
- case 2:
979
- case "end":
980
- return _context14.stop();
981
- }
841
+ while (1) switch (_context14.prev = _context14.next) {
842
+ case 0:
843
+ marketplaceParams = _ref30.marketplaceParams;
844
+ return _context14.abrupt("return", this.LoadMarketplace(marketplaceParams));
845
+ case 2:
846
+ case "end":
847
+ return _context14.stop();
982
848
  }
983
849
  }, _callee14, this);
984
850
  }));
985
-
986
851
  return function (_x6) {
987
852
  return _ref31.apply(this, arguments);
988
853
  };
989
854
  }();
855
+
990
856
  /* NFTS */
991
857
 
992
858
  /**
@@ -998,37 +864,31 @@ exports.Marketplace = /*#__PURE__*/function () {
998
864
  *
999
865
  * @returns {Promise<Object>} - Information about the specified contract
1000
866
  */
1001
-
1002
-
1003
867
  exports.NFTContractStats = /*#__PURE__*/function () {
1004
868
  var _ref33 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref32) {
1005
869
  var contractAddress;
1006
870
  return _regeneratorRuntime.wrap(function _callee15$(_context15) {
1007
- while (1) {
1008
- switch (_context15.prev = _context15.next) {
1009
- case 0:
1010
- contractAddress = _ref32.contractAddress;
1011
- _context15.next = 3;
1012
- return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
1013
- path: UrlJoin("as", "nft", "info", contractAddress),
1014
- method: "GET"
1015
- }));
1016
-
1017
- case 3:
1018
- return _context15.abrupt("return", _context15.sent);
1019
-
1020
- case 4:
1021
- case "end":
1022
- return _context15.stop();
1023
- }
871
+ while (1) switch (_context15.prev = _context15.next) {
872
+ case 0:
873
+ contractAddress = _ref32.contractAddress;
874
+ _context15.next = 3;
875
+ return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
876
+ path: UrlJoin("as", "nft", "info", contractAddress),
877
+ method: "GET"
878
+ }));
879
+ case 3:
880
+ return _context15.abrupt("return", _context15.sent);
881
+ case 4:
882
+ case "end":
883
+ return _context15.stop();
1024
884
  }
1025
885
  }, _callee15, this);
1026
886
  }));
1027
-
1028
887
  return function (_x7) {
1029
888
  return _ref33.apply(this, arguments);
1030
889
  };
1031
890
  }();
891
+
1032
892
  /**
1033
893
  * Load full info for the specified NFT
1034
894
  *
@@ -1037,72 +897,61 @@ exports.NFTContractStats = /*#__PURE__*/function () {
1037
897
  * @param {string} contractAddress - The contract address of the NFT
1038
898
  * @param {string} tokenId - The token ID of the NFT
1039
899
  */
1040
-
1041
-
1042
900
  exports.NFT = /*#__PURE__*/function () {
1043
901
  var _ref35 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(_ref34) {
1044
902
  var tokenId, contractAddress, nft;
1045
903
  return _regeneratorRuntime.wrap(function _callee16$(_context16) {
1046
- while (1) {
1047
- switch (_context16.prev = _context16.next) {
1048
- case 0:
1049
- tokenId = _ref34.tokenId, contractAddress = _ref34.contractAddress;
1050
- _context16.t0 = FormatNFTDetails;
1051
- _context16.next = 4;
1052
- return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
1053
- path: UrlJoin("as", "nft", "info", contractAddress, tokenId),
1054
- method: "GET"
1055
- }));
1056
-
1057
- case 4:
1058
- _context16.t1 = _context16.sent;
1059
- nft = (0, _context16.t0)(_context16.t1);
1060
- _context16.t2 = _objectSpread;
1061
- _context16.t3 = _objectSpread;
1062
- _context16.t4 = {};
1063
- _context16.next = 11;
1064
- return this.client.ContentObjectMetadata({
1065
- versionHash: nft.details.VersionHash,
1066
- metadataSubtree: "public/asset_metadata/nft",
1067
- produceLinkUrls: true
1068
- });
1069
-
1070
- case 11:
1071
- _context16.t5 = _context16.sent;
1072
-
1073
- if (_context16.t5) {
1074
- _context16.next = 14;
1075
- break;
1076
- }
1077
-
1078
- _context16.t5 = {};
1079
-
1080
- case 14:
1081
- _context16.t6 = _context16.t5;
1082
- _context16.t7 = (0, _context16.t3)(_context16.t4, _context16.t6);
1083
- _context16.t8 = nft.metadata || {};
1084
- nft.metadata = (0, _context16.t2)(_context16.t7, _context16.t8);
1085
- _context16.next = 20;
1086
- return this.TenantConfiguration({
1087
- contractAddress: contractAddress
1088
- });
1089
-
1090
- case 20:
1091
- nft.config = _context16.sent;
1092
- return _context16.abrupt("return", FormatNFTMetadata(this, nft));
1093
-
1094
- case 22:
1095
- case "end":
1096
- return _context16.stop();
1097
- }
904
+ while (1) switch (_context16.prev = _context16.next) {
905
+ case 0:
906
+ tokenId = _ref34.tokenId, contractAddress = _ref34.contractAddress;
907
+ _context16.t0 = FormatNFTDetails;
908
+ _context16.next = 4;
909
+ return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
910
+ path: UrlJoin("as", "nft", "info", contractAddress, tokenId),
911
+ method: "GET"
912
+ }));
913
+ case 4:
914
+ _context16.t1 = _context16.sent;
915
+ nft = (0, _context16.t0)(_context16.t1);
916
+ _context16.t2 = _objectSpread;
917
+ _context16.t3 = _objectSpread;
918
+ _context16.t4 = {};
919
+ _context16.next = 11;
920
+ return this.client.ContentObjectMetadata({
921
+ versionHash: nft.details.VersionHash,
922
+ metadataSubtree: "public/asset_metadata/nft",
923
+ produceLinkUrls: true
924
+ });
925
+ case 11:
926
+ _context16.t5 = _context16.sent;
927
+ if (_context16.t5) {
928
+ _context16.next = 14;
929
+ break;
930
+ }
931
+ _context16.t5 = {};
932
+ case 14:
933
+ _context16.t6 = _context16.t5;
934
+ _context16.t7 = (0, _context16.t3)(_context16.t4, _context16.t6);
935
+ _context16.t8 = nft.metadata || {};
936
+ nft.metadata = (0, _context16.t2)(_context16.t7, _context16.t8);
937
+ _context16.next = 20;
938
+ return this.TenantConfiguration({
939
+ contractAddress: contractAddress
940
+ });
941
+ case 20:
942
+ nft.config = _context16.sent;
943
+ return _context16.abrupt("return", FormatNFTMetadata(this, nft));
944
+ case 22:
945
+ case "end":
946
+ return _context16.stop();
1098
947
  }
1099
948
  }, _callee16, this);
1100
949
  }));
1101
-
1102
950
  return function (_x8) {
1103
951
  return _ref35.apply(this, arguments);
1104
952
  };
1105
953
  }();
954
+
1106
955
  /**
1107
956
  * <b><i>Requires login</i></b>
1108
957
  *
@@ -1114,54 +963,45 @@ exports.NFT = /*#__PURE__*/function () {
1114
963
  * @param {string} tokenId - The token ID of the NFT
1115
964
  * @param {string} targetAddress - The address to which to transfer the NFT
1116
965
  */
1117
-
1118
-
1119
966
  exports.TransferNFT = /*#__PURE__*/function () {
1120
967
  var _ref37 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref36) {
1121
968
  var contractAddress, tokenId, targetAddress;
1122
969
  return _regeneratorRuntime.wrap(function _callee17$(_context17) {
1123
- while (1) {
1124
- switch (_context17.prev = _context17.next) {
1125
- case 0:
1126
- contractAddress = _ref36.contractAddress, tokenId = _ref36.tokenId, targetAddress = _ref36.targetAddress;
1127
-
1128
- if (!(!targetAddress || !Utils.ValidAddress(targetAddress))) {
1129
- _context17.next = 3;
1130
- break;
970
+ while (1) switch (_context17.prev = _context17.next) {
971
+ case 0:
972
+ contractAddress = _ref36.contractAddress, tokenId = _ref36.tokenId, targetAddress = _ref36.targetAddress;
973
+ if (!(!targetAddress || !Utils.ValidAddress(targetAddress))) {
974
+ _context17.next = 3;
975
+ break;
976
+ }
977
+ throw Error("Eluvio Wallet Client: Invalid or missing target address in UserTransferNFT");
978
+ case 3:
979
+ _context17.next = 5;
980
+ return this.client.authClient.MakeAuthServiceRequest({
981
+ path: UrlJoin("as", "wlt", "mkt", "xfer"),
982
+ method: "POST",
983
+ body: {
984
+ contract: Utils.FormatAddress(contractAddress),
985
+ token: tokenId,
986
+ to_addr: Utils.FormatAddress(targetAddress)
987
+ },
988
+ headers: {
989
+ Authorization: "Bearer ".concat(this.AuthToken())
1131
990
  }
1132
-
1133
- throw Error("Eluvio Wallet Client: Invalid or missing target address in UserTransferNFT");
1134
-
1135
- case 3:
1136
- _context17.next = 5;
1137
- return this.client.authClient.MakeAuthServiceRequest({
1138
- path: UrlJoin("as", "wlt", "mkt", "xfer"),
1139
- method: "POST",
1140
- body: {
1141
- contract: Utils.FormatAddress(contractAddress),
1142
- token: tokenId,
1143
- to_addr: Utils.FormatAddress(targetAddress)
1144
- },
1145
- headers: {
1146
- Authorization: "Bearer ".concat(this.AuthToken())
1147
- }
1148
- });
1149
-
1150
- case 5:
1151
- return _context17.abrupt("return", _context17.sent);
1152
-
1153
- case 6:
1154
- case "end":
1155
- return _context17.stop();
1156
- }
991
+ });
992
+ case 5:
993
+ return _context17.abrupt("return", _context17.sent);
994
+ case 6:
995
+ case "end":
996
+ return _context17.stop();
1157
997
  }
1158
998
  }, _callee17, this);
1159
999
  }));
1160
-
1161
1000
  return function (_x9) {
1162
1001
  return _ref37.apply(this, arguments);
1163
1002
  };
1164
1003
  }();
1004
+
1165
1005
  /** LISTINGS */
1166
1006
 
1167
1007
  /**
@@ -1173,58 +1013,47 @@ exports.TransferNFT = /*#__PURE__*/function () {
1173
1013
  *
1174
1014
  * @returns {Promise<Object>} - The status of the listing
1175
1015
  */
1176
-
1177
-
1178
1016
  exports.ListingStatus = /*#__PURE__*/function () {
1179
1017
  var _ref39 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(_ref38) {
1180
1018
  var listingId;
1181
1019
  return _regeneratorRuntime.wrap(function _callee18$(_context18) {
1182
- while (1) {
1183
- switch (_context18.prev = _context18.next) {
1184
- case 0:
1185
- listingId = _ref38.listingId;
1186
- _context18.prev = 1;
1187
- _context18.t0 = Utils;
1188
- _context18.next = 5;
1189
- return this.client.authClient.MakeAuthServiceRequest({
1190
- path: UrlJoin("as", "mkt", "status", listingId),
1191
- method: "GET"
1192
- });
1193
-
1194
- case 5:
1195
- _context18.t1 = _context18.sent;
1196
- _context18.next = 8;
1197
- return _context18.t0.ResponseToJson.call(_context18.t0, _context18.t1);
1198
-
1199
- case 8:
1200
- return _context18.abrupt("return", _context18.sent);
1201
-
1202
- case 11:
1203
- _context18.prev = 11;
1204
- _context18.t2 = _context18["catch"](1);
1205
-
1206
- if (!(_context18.t2.status === 404)) {
1207
- _context18.next = 15;
1208
- break;
1209
- }
1210
-
1211
- return _context18.abrupt("return");
1212
-
1213
- case 15:
1214
- throw _context18.t2;
1215
-
1216
- case 16:
1217
- case "end":
1218
- return _context18.stop();
1219
- }
1020
+ while (1) switch (_context18.prev = _context18.next) {
1021
+ case 0:
1022
+ listingId = _ref38.listingId;
1023
+ _context18.prev = 1;
1024
+ _context18.t0 = Utils;
1025
+ _context18.next = 5;
1026
+ return this.client.authClient.MakeAuthServiceRequest({
1027
+ path: UrlJoin("as", "mkt", "status", listingId),
1028
+ method: "GET"
1029
+ });
1030
+ case 5:
1031
+ _context18.t1 = _context18.sent;
1032
+ _context18.next = 8;
1033
+ return _context18.t0.ResponseToJson.call(_context18.t0, _context18.t1);
1034
+ case 8:
1035
+ return _context18.abrupt("return", _context18.sent);
1036
+ case 11:
1037
+ _context18.prev = 11;
1038
+ _context18.t2 = _context18["catch"](1);
1039
+ if (!(_context18.t2.status === 404)) {
1040
+ _context18.next = 15;
1041
+ break;
1042
+ }
1043
+ return _context18.abrupt("return");
1044
+ case 15:
1045
+ throw _context18.t2;
1046
+ case 16:
1047
+ case "end":
1048
+ return _context18.stop();
1220
1049
  }
1221
1050
  }, _callee18, this, [[1, 11]]);
1222
1051
  }));
1223
-
1224
1052
  return function (_x10) {
1225
1053
  return _ref39.apply(this, arguments);
1226
1054
  };
1227
1055
  }();
1056
+
1228
1057
  /**
1229
1058
  * Retrieve a specific listing
1230
1059
  *
@@ -1236,46 +1065,39 @@ exports.ListingStatus = /*#__PURE__*/function () {
1236
1065
  *
1237
1066
  * @returns {Promise<Object>} - The listing
1238
1067
  */
1239
-
1240
-
1241
1068
  exports.Listing = /*#__PURE__*/function () {
1242
1069
  var _ref41 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref40) {
1243
1070
  var listingId;
1244
1071
  return _regeneratorRuntime.wrap(function _callee19$(_context19) {
1245
- while (1) {
1246
- switch (_context19.prev = _context19.next) {
1247
- case 0:
1248
- listingId = _ref40.listingId;
1249
- _context19.t0 = FormatNFT;
1250
- _context19.t1 = this;
1251
- _context19.t2 = Utils;
1252
- _context19.next = 6;
1253
- return this.client.authClient.MakeAuthServiceRequest({
1254
- path: UrlJoin("as", "mkt", "l", listingId),
1255
- method: "GET"
1256
- });
1257
-
1258
- case 6:
1259
- _context19.t3 = _context19.sent;
1260
- _context19.next = 9;
1261
- return _context19.t2.ResponseToJson.call(_context19.t2, _context19.t3);
1262
-
1263
- case 9:
1264
- _context19.t4 = _context19.sent;
1265
- return _context19.abrupt("return", (0, _context19.t0)(_context19.t1, _context19.t4));
1266
-
1267
- case 11:
1268
- case "end":
1269
- return _context19.stop();
1270
- }
1072
+ while (1) switch (_context19.prev = _context19.next) {
1073
+ case 0:
1074
+ listingId = _ref40.listingId;
1075
+ _context19.t0 = FormatNFT;
1076
+ _context19.t1 = this;
1077
+ _context19.t2 = Utils;
1078
+ _context19.next = 6;
1079
+ return this.client.authClient.MakeAuthServiceRequest({
1080
+ path: UrlJoin("as", "mkt", "l", listingId),
1081
+ method: "GET"
1082
+ });
1083
+ case 6:
1084
+ _context19.t3 = _context19.sent;
1085
+ _context19.next = 9;
1086
+ return _context19.t2.ResponseToJson.call(_context19.t2, _context19.t3);
1087
+ case 9:
1088
+ _context19.t4 = _context19.sent;
1089
+ return _context19.abrupt("return", (0, _context19.t0)(_context19.t1, _context19.t4));
1090
+ case 11:
1091
+ case "end":
1092
+ return _context19.stop();
1271
1093
  }
1272
1094
  }, _callee19, this);
1273
1095
  }));
1274
-
1275
1096
  return function (_x11) {
1276
1097
  return _ref41.apply(this, arguments);
1277
1098
  };
1278
1099
  }();
1100
+
1279
1101
  /**
1280
1102
  * Retrieve listings matching the specified parameters.
1281
1103
  *
@@ -1309,25 +1131,21 @@ exports.Listing = /*#__PURE__*/function () {
1309
1131
  *
1310
1132
  * @returns {Promise<Object>} - Results of the query and pagination info
1311
1133
  */
1312
-
1313
-
1314
1134
  exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
1315
1135
  var _args20 = arguments;
1316
1136
  return _regeneratorRuntime.wrap(function _callee20$(_context20) {
1317
- while (1) {
1318
- switch (_context20.prev = _context20.next) {
1319
- case 0:
1320
- return _context20.abrupt("return", this.FilteredQuery(_objectSpread({
1321
- mode: "listings"
1322
- }, _args20[0] || {})));
1323
-
1324
- case 1:
1325
- case "end":
1326
- return _context20.stop();
1327
- }
1137
+ while (1) switch (_context20.prev = _context20.next) {
1138
+ case 0:
1139
+ return _context20.abrupt("return", this.FilteredQuery(_objectSpread({
1140
+ mode: "listings"
1141
+ }, _args20[0] || {})));
1142
+ case 1:
1143
+ case "end":
1144
+ return _context20.stop();
1328
1145
  }
1329
1146
  }, _callee20, this);
1330
1147
  }));
1148
+
1331
1149
  /**
1332
1150
  * Retrieve stats for listings matching the specified parameters.
1333
1151
  *
@@ -1360,24 +1178,21 @@ exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRunt
1360
1178
  *
1361
1179
  * @returns {Promise<Object>} - Statistics about listings. All prices in USD.
1362
1180
  */
1363
-
1364
1181
  exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
1365
1182
  var _args21 = arguments;
1366
1183
  return _regeneratorRuntime.wrap(function _callee21$(_context21) {
1367
- while (1) {
1368
- switch (_context21.prev = _context21.next) {
1369
- case 0:
1370
- return _context21.abrupt("return", this.FilteredQuery(_objectSpread({
1371
- mode: "listing-stats"
1372
- }, _args21[0] || {})));
1373
-
1374
- case 1:
1375
- case "end":
1376
- return _context21.stop();
1377
- }
1184
+ while (1) switch (_context21.prev = _context21.next) {
1185
+ case 0:
1186
+ return _context21.abrupt("return", this.FilteredQuery(_objectSpread({
1187
+ mode: "listing-stats"
1188
+ }, _args21[0] || {})));
1189
+ case 1:
1190
+ case "end":
1191
+ return _context21.stop();
1378
1192
  }
1379
1193
  }, _callee21, this);
1380
1194
  }));
1195
+
1381
1196
  /**
1382
1197
  * Retrieve sales matching the specified parameters.
1383
1198
  *
@@ -1409,24 +1224,21 @@ exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
1409
1224
  *
1410
1225
  * @returns {Promise<Object>} - Results of the query and pagination info
1411
1226
  */
1412
-
1413
1227
  exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
1414
1228
  var _args22 = arguments;
1415
1229
  return _regeneratorRuntime.wrap(function _callee22$(_context22) {
1416
- while (1) {
1417
- switch (_context22.prev = _context22.next) {
1418
- case 0:
1419
- return _context22.abrupt("return", this.FilteredQuery(_objectSpread({
1420
- mode: "sales"
1421
- }, _args22[0] || {})));
1422
-
1423
- case 1:
1424
- case "end":
1425
- return _context22.stop();
1426
- }
1230
+ while (1) switch (_context22.prev = _context22.next) {
1231
+ case 0:
1232
+ return _context22.abrupt("return", this.FilteredQuery(_objectSpread({
1233
+ mode: "sales"
1234
+ }, _args22[0] || {})));
1235
+ case 1:
1236
+ case "end":
1237
+ return _context22.stop();
1427
1238
  }
1428
1239
  }, _callee22, this);
1429
1240
  }));
1241
+
1430
1242
  /**
1431
1243
  * Retrieve sales and transfers matching the specified parameters.
1432
1244
  *
@@ -1458,24 +1270,21 @@ exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
1458
1270
  *
1459
1271
  * @returns {Promise<Object>} - Results of the query and pagination info
1460
1272
  */
1461
-
1462
1273
  exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
1463
1274
  var _args23 = arguments;
1464
1275
  return _regeneratorRuntime.wrap(function _callee23$(_context23) {
1465
- while (1) {
1466
- switch (_context23.prev = _context23.next) {
1467
- case 0:
1468
- return _context23.abrupt("return", this.FilteredQuery(_objectSpread({
1469
- mode: "transfers"
1470
- }, _args23[0] || {})));
1471
-
1472
- case 1:
1473
- case "end":
1474
- return _context23.stop();
1475
- }
1276
+ while (1) switch (_context23.prev = _context23.next) {
1277
+ case 0:
1278
+ return _context23.abrupt("return", this.FilteredQuery(_objectSpread({
1279
+ mode: "transfers"
1280
+ }, _args23[0] || {})));
1281
+ case 1:
1282
+ case "end":
1283
+ return _context23.stop();
1476
1284
  }
1477
1285
  }, _callee23, this);
1478
1286
  }));
1287
+
1479
1288
  /**
1480
1289
  * Retrieve stats for listings matching the specified parameters.
1481
1290
  *
@@ -1507,24 +1316,21 @@ exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
1507
1316
  *
1508
1317
  * @returns {Promise<Object>} - Statistics about sales. All prices in USD.
1509
1318
  */
1510
-
1511
1319
  exports.SalesStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
1512
1320
  var _args24 = arguments;
1513
1321
  return _regeneratorRuntime.wrap(function _callee24$(_context24) {
1514
- while (1) {
1515
- switch (_context24.prev = _context24.next) {
1516
- case 0:
1517
- return _context24.abrupt("return", this.FilteredQuery(_objectSpread({
1518
- mode: "sales-stats"
1519
- }, _args24[0] || {})));
1520
-
1521
- case 1:
1522
- case "end":
1523
- return _context24.stop();
1524
- }
1322
+ while (1) switch (_context24.prev = _context24.next) {
1323
+ case 0:
1324
+ return _context24.abrupt("return", this.FilteredQuery(_objectSpread({
1325
+ mode: "sales-stats"
1326
+ }, _args24[0] || {})));
1327
+ case 1:
1328
+ case "end":
1329
+ return _context24.stop();
1525
1330
  }
1526
1331
  }, _callee24, this);
1527
1332
  }));
1333
+
1528
1334
  /**
1529
1335
  * Get the leaderboard rankings for the specified marketplace. If user address is specified, will return the ranking for the specified user (if present)
1530
1336
  *
@@ -1537,88 +1343,72 @@ exports.SalesStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRu
1537
1343
  *
1538
1344
  * @returns {Promise<Array|Object>} - Returns a list of leaderboard rankings or, if userAddress is specified, ranking for that user.
1539
1345
  */
1540
-
1541
1346
  exports.Leaderboard = /*#__PURE__*/function () {
1542
1347
  var _ref48 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref47) {
1543
1348
  var userAddress,
1544
- marketplaceParams,
1545
- params,
1546
- _args25 = arguments;
1349
+ marketplaceParams,
1350
+ params,
1351
+ _args25 = arguments;
1547
1352
  return _regeneratorRuntime.wrap(function _callee25$(_context25) {
1548
- while (1) {
1549
- switch (_context25.prev = _context25.next) {
1550
- case 0:
1551
- userAddress = _ref47.userAddress, marketplaceParams = _ref47.marketplaceParams;
1552
-
1553
- if (!userAddress) {
1554
- _context25.next = 20;
1555
- break;
1556
- }
1557
-
1558
- params = {
1559
- addr: Utils.FormatAddress(userAddress)
1560
- };
1561
-
1562
- if (!marketplaceParams) {
1563
- _context25.next = 10;
1564
- break;
1565
- }
1566
-
1567
- _context25.t0 = "tenant:eq:";
1568
- _context25.next = 7;
1569
- return this.MarketplaceInfo({
1570
- marketplaceParams: marketplaceParams
1571
- });
1572
-
1573
- case 7:
1574
- _context25.t1 = _context25.sent.tenantId;
1575
- _context25.t2 = _context25.t0.concat.call(_context25.t0, _context25.t1);
1576
- params.filter = [_context25.t2];
1577
-
1578
- case 10:
1579
- _context25.t4 = Utils;
1580
- _context25.next = 13;
1581
- return this.client.authClient.MakeAuthServiceRequest({
1582
- path: UrlJoin("as", "wlt", "ranks"),
1583
- method: "GET",
1584
- queryParams: params
1585
- });
1586
-
1587
- case 13:
1588
- _context25.t5 = _context25.sent;
1589
- _context25.next = 16;
1590
- return _context25.t4.ResponseToJson.call(_context25.t4, _context25.t5);
1591
-
1592
- case 16:
1593
- _context25.t3 = _context25.sent;
1594
-
1595
- if (_context25.t3) {
1596
- _context25.next = 19;
1597
- break;
1598
- }
1599
-
1600
- _context25.t3 = [];
1601
-
1602
- case 19:
1603
- return _context25.abrupt("return", _context25.t3[0]);
1604
-
1605
- case 20:
1606
- return _context25.abrupt("return", this.FilteredQuery(_objectSpread({
1607
- mode: "leaderboard"
1608
- }, _args25[0] || {})));
1609
-
1610
- case 21:
1611
- case "end":
1612
- return _context25.stop();
1613
- }
1353
+ while (1) switch (_context25.prev = _context25.next) {
1354
+ case 0:
1355
+ userAddress = _ref47.userAddress, marketplaceParams = _ref47.marketplaceParams;
1356
+ if (!userAddress) {
1357
+ _context25.next = 20;
1358
+ break;
1359
+ }
1360
+ params = {
1361
+ addr: Utils.FormatAddress(userAddress)
1362
+ };
1363
+ if (!marketplaceParams) {
1364
+ _context25.next = 10;
1365
+ break;
1366
+ }
1367
+ _context25.t0 = "tenant:eq:";
1368
+ _context25.next = 7;
1369
+ return this.MarketplaceInfo({
1370
+ marketplaceParams: marketplaceParams
1371
+ });
1372
+ case 7:
1373
+ _context25.t1 = _context25.sent.tenantId;
1374
+ _context25.t2 = _context25.t0.concat.call(_context25.t0, _context25.t1);
1375
+ params.filter = [_context25.t2];
1376
+ case 10:
1377
+ _context25.t4 = Utils;
1378
+ _context25.next = 13;
1379
+ return this.client.authClient.MakeAuthServiceRequest({
1380
+ path: UrlJoin("as", "wlt", "ranks"),
1381
+ method: "GET",
1382
+ queryParams: params
1383
+ });
1384
+ case 13:
1385
+ _context25.t5 = _context25.sent;
1386
+ _context25.next = 16;
1387
+ return _context25.t4.ResponseToJson.call(_context25.t4, _context25.t5);
1388
+ case 16:
1389
+ _context25.t3 = _context25.sent;
1390
+ if (_context25.t3) {
1391
+ _context25.next = 19;
1392
+ break;
1393
+ }
1394
+ _context25.t3 = [];
1395
+ case 19:
1396
+ return _context25.abrupt("return", _context25.t3[0]);
1397
+ case 20:
1398
+ return _context25.abrupt("return", this.FilteredQuery(_objectSpread({
1399
+ mode: "leaderboard"
1400
+ }, _args25[0] || {})));
1401
+ case 21:
1402
+ case "end":
1403
+ return _context25.stop();
1614
1404
  }
1615
1405
  }, _callee25, this);
1616
1406
  }));
1617
-
1618
1407
  return function (_x12) {
1619
1408
  return _ref48.apply(this, arguments);
1620
1409
  };
1621
1410
  }();
1411
+
1622
1412
  /**
1623
1413
  * <b><i>Requires login</i></b>
1624
1414
  *
@@ -1633,81 +1423,69 @@ exports.Leaderboard = /*#__PURE__*/function () {
1633
1423
  *
1634
1424
  * @returns {Promise<string>} - The listing ID of the created listing
1635
1425
  */
1636
-
1637
-
1638
1426
  exports.CreateListing = /*#__PURE__*/function () {
1639
1427
  var _ref50 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(_ref49) {
1640
1428
  var contractAddress, tokenId, price, listingId;
1641
1429
  return _regeneratorRuntime.wrap(function _callee26$(_context26) {
1642
- while (1) {
1643
- switch (_context26.prev = _context26.next) {
1644
- case 0:
1645
- contractAddress = _ref49.contractAddress, tokenId = _ref49.tokenId, price = _ref49.price, listingId = _ref49.listingId;
1646
- contractAddress = Utils.FormatAddress(contractAddress);
1647
-
1648
- if (!listingId) {
1649
- _context26.next = 12;
1650
- break;
1430
+ while (1) switch (_context26.prev = _context26.next) {
1431
+ case 0:
1432
+ contractAddress = _ref49.contractAddress, tokenId = _ref49.tokenId, price = _ref49.price, listingId = _ref49.listingId;
1433
+ contractAddress = Utils.FormatAddress(contractAddress);
1434
+ if (!listingId) {
1435
+ _context26.next = 12;
1436
+ break;
1437
+ }
1438
+ _context26.t0 = Utils;
1439
+ _context26.next = 6;
1440
+ return this.client.authClient.MakeAuthServiceRequest({
1441
+ path: UrlJoin("as", "wlt", "mkt"),
1442
+ method: "PUT",
1443
+ body: {
1444
+ id: listingId,
1445
+ price: parseFloat(price)
1446
+ },
1447
+ headers: {
1448
+ Authorization: "Bearer ".concat(this.AuthToken())
1651
1449
  }
1652
-
1653
- _context26.t0 = Utils;
1654
- _context26.next = 6;
1655
- return this.client.authClient.MakeAuthServiceRequest({
1656
- path: UrlJoin("as", "wlt", "mkt"),
1657
- method: "PUT",
1658
- body: {
1659
- id: listingId,
1660
- price: parseFloat(price)
1661
- },
1662
- headers: {
1663
- Authorization: "Bearer ".concat(this.AuthToken())
1664
- }
1665
- });
1666
-
1667
- case 6:
1668
- _context26.t1 = _context26.sent;
1669
- _context26.next = 9;
1670
- return _context26.t0.ResponseToFormat.call(_context26.t0, "text", _context26.t1);
1671
-
1672
- case 9:
1673
- return _context26.abrupt("return", _context26.sent);
1674
-
1675
- case 12:
1676
- _context26.t2 = Utils;
1677
- _context26.next = 15;
1678
- return this.client.authClient.MakeAuthServiceRequest({
1679
- path: UrlJoin("as", "wlt", "mkt"),
1680
- method: "POST",
1681
- body: {
1682
- contract: contractAddress,
1683
- token: tokenId,
1684
- price: parseFloat(price)
1685
- },
1686
- headers: {
1687
- Authorization: "Bearer ".concat(this.AuthToken())
1688
- }
1689
- });
1690
-
1691
- case 15:
1692
- _context26.t3 = _context26.sent;
1693
- _context26.next = 18;
1694
- return _context26.t2.ResponseToJson.call(_context26.t2, _context26.t3);
1695
-
1696
- case 18:
1697
- return _context26.abrupt("return", _context26.sent);
1698
-
1699
- case 19:
1700
- case "end":
1701
- return _context26.stop();
1702
- }
1450
+ });
1451
+ case 6:
1452
+ _context26.t1 = _context26.sent;
1453
+ _context26.next = 9;
1454
+ return _context26.t0.ResponseToFormat.call(_context26.t0, "text", _context26.t1);
1455
+ case 9:
1456
+ return _context26.abrupt("return", _context26.sent);
1457
+ case 12:
1458
+ _context26.t2 = Utils;
1459
+ _context26.next = 15;
1460
+ return this.client.authClient.MakeAuthServiceRequest({
1461
+ path: UrlJoin("as", "wlt", "mkt"),
1462
+ method: "POST",
1463
+ body: {
1464
+ contract: contractAddress,
1465
+ token: tokenId,
1466
+ price: parseFloat(price)
1467
+ },
1468
+ headers: {
1469
+ Authorization: "Bearer ".concat(this.AuthToken())
1470
+ }
1471
+ });
1472
+ case 15:
1473
+ _context26.t3 = _context26.sent;
1474
+ _context26.next = 18;
1475
+ return _context26.t2.ResponseToJson.call(_context26.t2, _context26.t3);
1476
+ case 18:
1477
+ return _context26.abrupt("return", _context26.sent);
1478
+ case 19:
1479
+ case "end":
1480
+ return _context26.stop();
1703
1481
  }
1704
1482
  }, _callee26, this);
1705
1483
  }));
1706
-
1707
1484
  return function (_x13) {
1708
1485
  return _ref50.apply(this, arguments);
1709
1486
  };
1710
1487
  }();
1488
+
1711
1489
  /**
1712
1490
  * <b><i>Requires login</i></b>
1713
1491
  *
@@ -1717,37 +1495,32 @@ exports.CreateListing = /*#__PURE__*/function () {
1717
1495
  * @namedParams
1718
1496
  * @param {string} listingId - The ID of the listing to remove
1719
1497
  */
1720
-
1721
-
1722
1498
  exports.RemoveListing = /*#__PURE__*/function () {
1723
1499
  var _ref52 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(_ref51) {
1724
1500
  var listingId;
1725
1501
  return _regeneratorRuntime.wrap(function _callee27$(_context27) {
1726
- while (1) {
1727
- switch (_context27.prev = _context27.next) {
1728
- case 0:
1729
- listingId = _ref51.listingId;
1730
- _context27.next = 3;
1731
- return this.client.authClient.MakeAuthServiceRequest({
1732
- path: UrlJoin("as", "wlt", "mkt", listingId),
1733
- method: "DELETE",
1734
- headers: {
1735
- Authorization: "Bearer ".concat(this.AuthToken())
1736
- }
1737
- });
1738
-
1739
- case 3:
1740
- case "end":
1741
- return _context27.stop();
1742
- }
1502
+ while (1) switch (_context27.prev = _context27.next) {
1503
+ case 0:
1504
+ listingId = _ref51.listingId;
1505
+ _context27.next = 3;
1506
+ return this.client.authClient.MakeAuthServiceRequest({
1507
+ path: UrlJoin("as", "wlt", "mkt", listingId),
1508
+ method: "DELETE",
1509
+ headers: {
1510
+ Authorization: "Bearer ".concat(this.AuthToken())
1511
+ }
1512
+ });
1513
+ case 3:
1514
+ case "end":
1515
+ return _context27.stop();
1743
1516
  }
1744
1517
  }, _callee27, this);
1745
1518
  }));
1746
-
1747
1519
  return function (_x14) {
1748
1520
  return _ref52.apply(this, arguments);
1749
1521
  };
1750
1522
  }();
1523
+
1751
1524
  /**
1752
1525
  * Retrieve all valid names for filtering listing sales names. Full item names are required for filtering sales results by name.
1753
1526
  *
@@ -1759,61 +1532,50 @@ exports.RemoveListing = /*#__PURE__*/function () {
1759
1532
  *
1760
1533
  * @returns {Promise<Array<String>>} - A list of item names
1761
1534
  */
1762
-
1763
-
1764
1535
  exports.SalesNames = /*#__PURE__*/function () {
1765
1536
  var _ref54 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(_ref53) {
1766
1537
  var marketplaceParams, tenantId;
1767
1538
  return _regeneratorRuntime.wrap(function _callee28$(_context28) {
1768
- while (1) {
1769
- switch (_context28.prev = _context28.next) {
1770
- case 0:
1771
- marketplaceParams = _ref53.marketplaceParams;
1772
-
1773
- if (!marketplaceParams) {
1774
- _context28.next = 5;
1775
- break;
1776
- }
1777
-
1778
- _context28.next = 4;
1779
- return this.MarketplaceInfo({
1780
- marketplaceParams: marketplaceParams
1781
- });
1782
-
1783
- case 4:
1784
- tenantId = _context28.sent.tenantId;
1785
-
1786
- case 5:
1787
- _context28.t0 = Utils;
1788
- _context28.next = 8;
1789
- return this.client.authClient.MakeAuthServiceRequest({
1790
- path: UrlJoin("as", "mkt", "names", "hst"),
1791
- method: "GET",
1792
- queryParams: tenantId ? {
1793
- filter: "tenant:eq:".concat(tenantId)
1794
- } : {}
1795
- });
1796
-
1797
- case 8:
1798
- _context28.t1 = _context28.sent;
1799
- _context28.next = 11;
1800
- return _context28.t0.ResponseToJson.call(_context28.t0, _context28.t1);
1801
-
1802
- case 11:
1803
- return _context28.abrupt("return", _context28.sent);
1804
-
1805
- case 12:
1806
- case "end":
1807
- return _context28.stop();
1808
- }
1539
+ while (1) switch (_context28.prev = _context28.next) {
1540
+ case 0:
1541
+ marketplaceParams = _ref53.marketplaceParams;
1542
+ if (!marketplaceParams) {
1543
+ _context28.next = 5;
1544
+ break;
1545
+ }
1546
+ _context28.next = 4;
1547
+ return this.MarketplaceInfo({
1548
+ marketplaceParams: marketplaceParams
1549
+ });
1550
+ case 4:
1551
+ tenantId = _context28.sent.tenantId;
1552
+ case 5:
1553
+ _context28.t0 = Utils;
1554
+ _context28.next = 8;
1555
+ return this.client.authClient.MakeAuthServiceRequest({
1556
+ path: UrlJoin("as", "mkt", "names", "hst"),
1557
+ method: "GET",
1558
+ queryParams: tenantId ? {
1559
+ filter: "tenant:eq:".concat(tenantId)
1560
+ } : {}
1561
+ });
1562
+ case 8:
1563
+ _context28.t1 = _context28.sent;
1564
+ _context28.next = 11;
1565
+ return _context28.t0.ResponseToJson.call(_context28.t0, _context28.t1);
1566
+ case 11:
1567
+ return _context28.abrupt("return", _context28.sent);
1568
+ case 12:
1569
+ case "end":
1570
+ return _context28.stop();
1809
1571
  }
1810
1572
  }, _callee28, this);
1811
1573
  }));
1812
-
1813
1574
  return function (_x15) {
1814
1575
  return _ref54.apply(this, arguments);
1815
1576
  };
1816
1577
  }();
1578
+
1817
1579
  /**
1818
1580
  * Retrieve all valid names for filtering listings. Full item names are required for filtering listing results by name.
1819
1581
  *
@@ -1825,61 +1587,50 @@ exports.SalesNames = /*#__PURE__*/function () {
1825
1587
  *
1826
1588
  * @returns {Promise<Array<String>>} - A list of item names
1827
1589
  */
1828
-
1829
-
1830
1590
  exports.ListingNames = /*#__PURE__*/function () {
1831
1591
  var _ref56 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(_ref55) {
1832
1592
  var marketplaceParams, tenantId;
1833
1593
  return _regeneratorRuntime.wrap(function _callee29$(_context29) {
1834
- while (1) {
1835
- switch (_context29.prev = _context29.next) {
1836
- case 0:
1837
- marketplaceParams = _ref55.marketplaceParams;
1838
-
1839
- if (!marketplaceParams) {
1840
- _context29.next = 5;
1841
- break;
1842
- }
1843
-
1844
- _context29.next = 4;
1845
- return this.MarketplaceInfo({
1846
- marketplaceParams: marketplaceParams
1847
- });
1848
-
1849
- case 4:
1850
- tenantId = _context29.sent.tenantId;
1851
-
1852
- case 5:
1853
- _context29.t0 = Utils;
1854
- _context29.next = 8;
1855
- return this.client.authClient.MakeAuthServiceRequest({
1856
- path: UrlJoin("as", "mkt", "names"),
1857
- method: "GET",
1858
- queryParams: tenantId ? {
1859
- filter: "tenant:eq:".concat(tenantId)
1860
- } : {}
1861
- });
1862
-
1863
- case 8:
1864
- _context29.t1 = _context29.sent;
1865
- _context29.next = 11;
1866
- return _context29.t0.ResponseToJson.call(_context29.t0, _context29.t1);
1867
-
1868
- case 11:
1869
- return _context29.abrupt("return", _context29.sent);
1870
-
1871
- case 12:
1872
- case "end":
1873
- return _context29.stop();
1874
- }
1594
+ while (1) switch (_context29.prev = _context29.next) {
1595
+ case 0:
1596
+ marketplaceParams = _ref55.marketplaceParams;
1597
+ if (!marketplaceParams) {
1598
+ _context29.next = 5;
1599
+ break;
1600
+ }
1601
+ _context29.next = 4;
1602
+ return this.MarketplaceInfo({
1603
+ marketplaceParams: marketplaceParams
1604
+ });
1605
+ case 4:
1606
+ tenantId = _context29.sent.tenantId;
1607
+ case 5:
1608
+ _context29.t0 = Utils;
1609
+ _context29.next = 8;
1610
+ return this.client.authClient.MakeAuthServiceRequest({
1611
+ path: UrlJoin("as", "mkt", "names"),
1612
+ method: "GET",
1613
+ queryParams: tenantId ? {
1614
+ filter: "tenant:eq:".concat(tenantId)
1615
+ } : {}
1616
+ });
1617
+ case 8:
1618
+ _context29.t1 = _context29.sent;
1619
+ _context29.next = 11;
1620
+ return _context29.t0.ResponseToJson.call(_context29.t0, _context29.t1);
1621
+ case 11:
1622
+ return _context29.abrupt("return", _context29.sent);
1623
+ case 12:
1624
+ case "end":
1625
+ return _context29.stop();
1875
1626
  }
1876
1627
  }, _callee29, this);
1877
1628
  }));
1878
-
1879
1629
  return function (_x16) {
1880
1630
  return _ref56.apply(this, arguments);
1881
1631
  };
1882
1632
  }();
1633
+
1883
1634
  /**
1884
1635
  * Retrieve all valid edition names of the specified item. Full item edition names are required for filtering listing results by edition.
1885
1636
  *
@@ -1889,46 +1640,39 @@ exports.ListingNames = /*#__PURE__*/function () {
1889
1640
  *
1890
1641
  * @returns {Promise<Array<String>>} - A list of item editions
1891
1642
  */
1892
-
1893
-
1894
1643
  exports.ListingEditionNames = /*#__PURE__*/function () {
1895
1644
  var _ref58 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(_ref57) {
1896
1645
  var displayName;
1897
1646
  return _regeneratorRuntime.wrap(function _callee30$(_context30) {
1898
- while (1) {
1899
- switch (_context30.prev = _context30.next) {
1900
- case 0:
1901
- displayName = _ref57.displayName;
1902
- _context30.t0 = Utils;
1903
- _context30.next = 4;
1904
- return this.client.authClient.MakeAuthServiceRequest({
1905
- path: UrlJoin("as", "mkt", "editions"),
1906
- queryParams: {
1907
- filter: "nft/display_name:eq:".concat(displayName)
1908
- },
1909
- method: "GET"
1910
- });
1911
-
1912
- case 4:
1913
- _context30.t1 = _context30.sent;
1914
- _context30.next = 7;
1915
- return _context30.t0.ResponseToJson.call(_context30.t0, _context30.t1);
1916
-
1917
- case 7:
1918
- return _context30.abrupt("return", _context30.sent);
1919
-
1920
- case 8:
1921
- case "end":
1922
- return _context30.stop();
1923
- }
1647
+ while (1) switch (_context30.prev = _context30.next) {
1648
+ case 0:
1649
+ displayName = _ref57.displayName;
1650
+ _context30.t0 = Utils;
1651
+ _context30.next = 4;
1652
+ return this.client.authClient.MakeAuthServiceRequest({
1653
+ path: UrlJoin("as", "mkt", "editions"),
1654
+ queryParams: {
1655
+ filter: "nft/display_name:eq:".concat(displayName)
1656
+ },
1657
+ method: "GET"
1658
+ });
1659
+ case 4:
1660
+ _context30.t1 = _context30.sent;
1661
+ _context30.next = 7;
1662
+ return _context30.t0.ResponseToJson.call(_context30.t0, _context30.t1);
1663
+ case 7:
1664
+ return _context30.abrupt("return", _context30.sent);
1665
+ case 8:
1666
+ case "end":
1667
+ return _context30.stop();
1924
1668
  }
1925
1669
  }, _callee30, this);
1926
1670
  }));
1927
-
1928
1671
  return function (_x17) {
1929
1672
  return _ref58.apply(this, arguments);
1930
1673
  };
1931
1674
  }();
1675
+
1932
1676
  /**
1933
1677
  * Retrieve names of all valid attributes for listed items. Full attribute names and values are required for filtering listing results by attributes.
1934
1678
  *
@@ -1941,82 +1685,69 @@ exports.ListingEditionNames = /*#__PURE__*/function () {
1941
1685
  *
1942
1686
  * @returns {Promise<Array<String>>} - A list of valid attributes
1943
1687
  */
1944
-
1945
-
1946
1688
  exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
1947
1689
  var _ref60,
1948
- marketplaceParams,
1949
- displayName,
1950
- filters,
1951
- attributes,
1952
- _args31 = arguments;
1953
-
1690
+ marketplaceParams,
1691
+ displayName,
1692
+ filters,
1693
+ attributes,
1694
+ _args31 = arguments;
1954
1695
  return _regeneratorRuntime.wrap(function _callee31$(_context31) {
1955
- while (1) {
1956
- switch (_context31.prev = _context31.next) {
1957
- case 0:
1958
- _ref60 = _args31.length > 0 && _args31[0] !== undefined ? _args31[0] : {}, marketplaceParams = _ref60.marketplaceParams, displayName = _ref60.displayName;
1959
- filters = [];
1960
-
1961
- if (!marketplaceParams) {
1962
- _context31.next = 10;
1963
- break;
1964
- }
1965
-
1966
- _context31.t0 = filters;
1967
- _context31.t1 = "tenant:eq:";
1968
- _context31.next = 7;
1969
- return this.MarketplaceInfo({
1970
- marketplaceParams: marketplaceParams
1971
- });
1972
-
1973
- case 7:
1974
- _context31.t2 = _context31.sent.tenantId;
1975
- _context31.t3 = _context31.t1.concat.call(_context31.t1, _context31.t2);
1976
-
1977
- _context31.t0.push.call(_context31.t0, _context31.t3);
1978
-
1979
- case 10:
1980
- if (displayName) {
1981
- filters.push("nft/display_name:eq:".concat(displayName));
1696
+ while (1) switch (_context31.prev = _context31.next) {
1697
+ case 0:
1698
+ _ref60 = _args31.length > 0 && _args31[0] !== undefined ? _args31[0] : {}, marketplaceParams = _ref60.marketplaceParams, displayName = _ref60.displayName;
1699
+ filters = [];
1700
+ if (!marketplaceParams) {
1701
+ _context31.next = 10;
1702
+ break;
1703
+ }
1704
+ _context31.t0 = filters;
1705
+ _context31.t1 = "tenant:eq:";
1706
+ _context31.next = 7;
1707
+ return this.MarketplaceInfo({
1708
+ marketplaceParams: marketplaceParams
1709
+ });
1710
+ case 7:
1711
+ _context31.t2 = _context31.sent.tenantId;
1712
+ _context31.t3 = _context31.t1.concat.call(_context31.t1, _context31.t2);
1713
+ _context31.t0.push.call(_context31.t0, _context31.t3);
1714
+ case 10:
1715
+ if (displayName) {
1716
+ filters.push("nft/display_name:eq:".concat(displayName));
1717
+ }
1718
+ _context31.t4 = Utils;
1719
+ _context31.next = 14;
1720
+ return this.client.authClient.MakeAuthServiceRequest({
1721
+ path: UrlJoin("as", "mkt", "attributes"),
1722
+ method: "GET",
1723
+ queryParams: {
1724
+ filter: filters
1982
1725
  }
1983
-
1984
- _context31.t4 = Utils;
1985
- _context31.next = 14;
1986
- return this.client.authClient.MakeAuthServiceRequest({
1987
- path: UrlJoin("as", "mkt", "attributes"),
1988
- method: "GET",
1989
- queryParams: {
1990
- filter: filters
1991
- }
1992
- });
1993
-
1994
- case 14:
1995
- _context31.t5 = _context31.sent;
1996
- _context31.next = 17;
1997
- return _context31.t4.ResponseToJson.call(_context31.t4, _context31.t5);
1998
-
1999
- case 17:
2000
- attributes = _context31.sent;
2001
- return _context31.abrupt("return", attributes.map(function (_ref61) {
2002
- var trait_type = _ref61.trait_type,
2003
- values = _ref61.values;
2004
- return {
2005
- name: trait_type,
2006
- values: values
2007
- };
2008
- }).filter(function (_ref62) {
2009
- var name = _ref62.name;
2010
- return !["Content Fabric Hash", "Total Minted Supply", "Creator"].includes(name);
2011
- }));
2012
-
2013
- case 19:
2014
- case "end":
2015
- return _context31.stop();
2016
- }
1726
+ });
1727
+ case 14:
1728
+ _context31.t5 = _context31.sent;
1729
+ _context31.next = 17;
1730
+ return _context31.t4.ResponseToJson.call(_context31.t4, _context31.t5);
1731
+ case 17:
1732
+ attributes = _context31.sent;
1733
+ return _context31.abrupt("return", attributes.map(function (_ref61) {
1734
+ var trait_type = _ref61.trait_type,
1735
+ values = _ref61.values;
1736
+ return {
1737
+ name: trait_type,
1738
+ values: values
1739
+ };
1740
+ }).filter(function (_ref62) {
1741
+ var name = _ref62.name;
1742
+ return !["Content Fabric Hash", "Total Minted Supply", "Creator"].includes(name);
1743
+ }));
1744
+ case 19:
1745
+ case "end":
1746
+ return _context31.stop();
2017
1747
  }
2018
1748
  }, _callee31, this);
2019
1749
  }));
1750
+
2020
1751
  /* PURCHASE / CLAIM */
2021
1752
 
2022
1753
  /**
@@ -2030,49 +1761,44 @@ exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regene
2030
1761
  * @param {string} sku - The SKU of the item to claim
2031
1762
  * @param {string=} email - Email address of the user. If specified, this will bind the user to the tenant of the specified marketplace
2032
1763
  */
2033
-
2034
1764
  exports.ClaimItem = /*#__PURE__*/function () {
2035
1765
  var _ref64 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(_ref63) {
2036
1766
  var marketplaceParams, sku, email, marketplaceInfo;
2037
1767
  return _regeneratorRuntime.wrap(function _callee32$(_context32) {
2038
- while (1) {
2039
- switch (_context32.prev = _context32.next) {
2040
- case 0:
2041
- marketplaceParams = _ref63.marketplaceParams, sku = _ref63.sku, email = _ref63.email;
2042
- _context32.next = 3;
2043
- return this.MarketplaceInfo({
2044
- marketplaceParams: marketplaceParams
2045
- });
2046
-
2047
- case 3:
2048
- marketplaceInfo = _context32.sent;
2049
- _context32.next = 6;
2050
- return this.client.authClient.MakeAuthServiceRequest({
2051
- method: "POST",
2052
- path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
2053
- body: {
2054
- op: "nft-claim",
2055
- sid: marketplaceInfo.marketplaceId,
2056
- sku: sku,
2057
- email: email
2058
- },
2059
- headers: {
2060
- Authorization: "Bearer ".concat(this.AuthToken())
2061
- }
2062
- });
2063
-
2064
- case 6:
2065
- case "end":
2066
- return _context32.stop();
2067
- }
1768
+ while (1) switch (_context32.prev = _context32.next) {
1769
+ case 0:
1770
+ marketplaceParams = _ref63.marketplaceParams, sku = _ref63.sku, email = _ref63.email;
1771
+ _context32.next = 3;
1772
+ return this.MarketplaceInfo({
1773
+ marketplaceParams: marketplaceParams
1774
+ });
1775
+ case 3:
1776
+ marketplaceInfo = _context32.sent;
1777
+ _context32.next = 6;
1778
+ return this.client.authClient.MakeAuthServiceRequest({
1779
+ method: "POST",
1780
+ path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
1781
+ body: {
1782
+ op: "nft-claim",
1783
+ sid: marketplaceInfo.marketplaceId,
1784
+ sku: sku,
1785
+ email: email
1786
+ },
1787
+ headers: {
1788
+ Authorization: "Bearer ".concat(this.AuthToken())
1789
+ }
1790
+ });
1791
+ case 6:
1792
+ case "end":
1793
+ return _context32.stop();
2068
1794
  }
2069
1795
  }, _callee32, this);
2070
1796
  }));
2071
-
2072
1797
  return function (_x18) {
2073
1798
  return _ref64.apply(this, arguments);
2074
1799
  };
2075
1800
  }();
1801
+
2076
1802
  /* MINTING STATUS */
2077
1803
 
2078
1804
  /**
@@ -2085,66 +1811,55 @@ exports.ClaimItem = /*#__PURE__*/function () {
2085
1811
  *
2086
1812
  * @returns {Promise<Object>} - The status of the purchase
2087
1813
  */
2088
-
2089
-
2090
1814
  exports.ListingPurchaseStatus = /*#__PURE__*/function () {
2091
1815
  var _ref66 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(_ref65) {
2092
1816
  var listingId, confirmationId, listingStatus, statuses;
2093
1817
  return _regeneratorRuntime.wrap(function _callee33$(_context33) {
2094
- while (1) {
2095
- switch (_context33.prev = _context33.next) {
2096
- case 0:
2097
- listingId = _ref65.listingId, confirmationId = _ref65.confirmationId;
2098
- _context33.prev = 1;
2099
- _context33.next = 4;
2100
- return this.ListingStatus({
2101
- listingId: listingId
2102
- });
2103
-
2104
- case 4:
2105
- listingStatus = _context33.sent;
2106
-
2107
- if (listingStatus) {
2108
- _context33.next = 7;
2109
- break;
2110
- }
2111
-
2112
- throw Error("Unable to find info for listing " + listingId);
2113
-
2114
- case 7:
2115
- _context33.next = 9;
2116
- return this.MintingStatus({
2117
- tenantId: listingStatus.tenant
2118
- });
2119
-
2120
- case 9:
2121
- statuses = _context33.sent;
2122
- return _context33.abrupt("return", statuses.find(function (status) {
2123
- return status.op === "nft-transfer" && status.extra && status.extra[0] === confirmationId;
2124
- }) || {
2125
- status: "none"
2126
- });
2127
-
2128
- case 13:
2129
- _context33.prev = 13;
2130
- _context33.t0 = _context33["catch"](1);
2131
- this.Log(_context33.t0, true);
2132
- return _context33.abrupt("return", {
2133
- status: "unknown"
2134
- });
2135
-
2136
- case 17:
2137
- case "end":
2138
- return _context33.stop();
2139
- }
1818
+ while (1) switch (_context33.prev = _context33.next) {
1819
+ case 0:
1820
+ listingId = _ref65.listingId, confirmationId = _ref65.confirmationId;
1821
+ _context33.prev = 1;
1822
+ _context33.next = 4;
1823
+ return this.ListingStatus({
1824
+ listingId: listingId
1825
+ });
1826
+ case 4:
1827
+ listingStatus = _context33.sent;
1828
+ if (listingStatus) {
1829
+ _context33.next = 7;
1830
+ break;
1831
+ }
1832
+ throw Error("Unable to find info for listing " + listingId);
1833
+ case 7:
1834
+ _context33.next = 9;
1835
+ return this.MintingStatus({
1836
+ tenantId: listingStatus.tenant
1837
+ });
1838
+ case 9:
1839
+ statuses = _context33.sent;
1840
+ return _context33.abrupt("return", statuses.find(function (status) {
1841
+ return status.op === "nft-transfer" && status.extra && status.extra[0] === confirmationId;
1842
+ }) || {
1843
+ status: "none"
1844
+ });
1845
+ case 13:
1846
+ _context33.prev = 13;
1847
+ _context33.t0 = _context33["catch"](1);
1848
+ this.Log(_context33.t0, true);
1849
+ return _context33.abrupt("return", {
1850
+ status: "unknown"
1851
+ });
1852
+ case 17:
1853
+ case "end":
1854
+ return _context33.stop();
2140
1855
  }
2141
1856
  }, _callee33, this, [[1, 13]]);
2142
1857
  }));
2143
-
2144
1858
  return function (_x19) {
2145
1859
  return _ref66.apply(this, arguments);
2146
1860
  };
2147
1861
  }();
1862
+
2148
1863
  /**
2149
1864
  * Return status of the specified marketplace purchase
2150
1865
  *
@@ -2155,57 +1870,49 @@ exports.ListingPurchaseStatus = /*#__PURE__*/function () {
2155
1870
  *
2156
1871
  * @returns {Promise<Object>} - The minting status of the purchaseed item(s)
2157
1872
  */
2158
-
2159
-
2160
1873
  exports.PurchaseStatus = /*#__PURE__*/function () {
2161
1874
  var _ref68 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(_ref67) {
2162
1875
  var marketplaceParams, confirmationId, marketplaceInfo, statuses;
2163
1876
  return _regeneratorRuntime.wrap(function _callee34$(_context34) {
2164
- while (1) {
2165
- switch (_context34.prev = _context34.next) {
2166
- case 0:
2167
- marketplaceParams = _ref67.marketplaceParams, confirmationId = _ref67.confirmationId;
2168
- _context34.prev = 1;
2169
- _context34.next = 4;
2170
- return this.MarketplaceInfo({
2171
- marketplaceParams: marketplaceParams
2172
- });
2173
-
2174
- case 4:
2175
- marketplaceInfo = _context34.sent;
2176
- _context34.next = 7;
2177
- return this.MintingStatus({
2178
- tenantId: marketplaceInfo.tenant_id
2179
- });
2180
-
2181
- case 7:
2182
- statuses = _context34.sent;
2183
- return _context34.abrupt("return", statuses.find(function (status) {
2184
- return status.op === "nft-buy" && status.confirmationId === confirmationId;
2185
- }) || {
2186
- status: "none"
2187
- });
2188
-
2189
- case 11:
2190
- _context34.prev = 11;
2191
- _context34.t0 = _context34["catch"](1);
2192
- this.Log(_context34.t0, true);
2193
- return _context34.abrupt("return", {
2194
- status: "unknown"
2195
- });
2196
-
2197
- case 15:
2198
- case "end":
2199
- return _context34.stop();
2200
- }
1877
+ while (1) switch (_context34.prev = _context34.next) {
1878
+ case 0:
1879
+ marketplaceParams = _ref67.marketplaceParams, confirmationId = _ref67.confirmationId;
1880
+ _context34.prev = 1;
1881
+ _context34.next = 4;
1882
+ return this.MarketplaceInfo({
1883
+ marketplaceParams: marketplaceParams
1884
+ });
1885
+ case 4:
1886
+ marketplaceInfo = _context34.sent;
1887
+ _context34.next = 7;
1888
+ return this.MintingStatus({
1889
+ tenantId: marketplaceInfo.tenant_id
1890
+ });
1891
+ case 7:
1892
+ statuses = _context34.sent;
1893
+ return _context34.abrupt("return", statuses.find(function (status) {
1894
+ return status.op === "nft-buy" && status.confirmationId === confirmationId;
1895
+ }) || {
1896
+ status: "none"
1897
+ });
1898
+ case 11:
1899
+ _context34.prev = 11;
1900
+ _context34.t0 = _context34["catch"](1);
1901
+ this.Log(_context34.t0, true);
1902
+ return _context34.abrupt("return", {
1903
+ status: "unknown"
1904
+ });
1905
+ case 15:
1906
+ case "end":
1907
+ return _context34.stop();
2201
1908
  }
2202
1909
  }, _callee34, this, [[1, 11]]);
2203
1910
  }));
2204
-
2205
1911
  return function (_x20) {
2206
1912
  return _ref68.apply(this, arguments);
2207
1913
  };
2208
1914
  }();
1915
+
2209
1916
  /**
2210
1917
  * Return status of the specified item claim
2211
1918
  *
@@ -2216,57 +1923,49 @@ exports.PurchaseStatus = /*#__PURE__*/function () {
2216
1923
  *
2217
1924
  * @returns {Promise<Object>} - The minting status of the claim
2218
1925
  */
2219
-
2220
-
2221
1926
  exports.ClaimStatus = /*#__PURE__*/function () {
2222
1927
  var _ref70 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(_ref69) {
2223
1928
  var marketplaceParams, sku, marketplaceInfo, statuses;
2224
1929
  return _regeneratorRuntime.wrap(function _callee35$(_context35) {
2225
- while (1) {
2226
- switch (_context35.prev = _context35.next) {
2227
- case 0:
2228
- marketplaceParams = _ref69.marketplaceParams, sku = _ref69.sku;
2229
- _context35.prev = 1;
2230
- _context35.next = 4;
2231
- return this.MarketplaceInfo({
2232
- marketplaceParams: marketplaceParams
2233
- });
2234
-
2235
- case 4:
2236
- marketplaceInfo = _context35.sent;
2237
- _context35.next = 7;
2238
- return this.MintingStatus({
2239
- tenantId: marketplaceInfo.tenantId
2240
- });
2241
-
2242
- case 7:
2243
- statuses = _context35.sent;
2244
- return _context35.abrupt("return", statuses.find(function (status) {
2245
- return status.op === "nft-claim" && status.marketplaceId === marketplaceInfo.marketplaceId && status.confirmationId === sku;
2246
- }) || {
2247
- status: "none"
2248
- });
2249
-
2250
- case 11:
2251
- _context35.prev = 11;
2252
- _context35.t0 = _context35["catch"](1);
2253
- this.Log(_context35.t0, true);
2254
- return _context35.abrupt("return", {
2255
- status: "unknown"
2256
- });
2257
-
2258
- case 15:
2259
- case "end":
2260
- return _context35.stop();
2261
- }
1930
+ while (1) switch (_context35.prev = _context35.next) {
1931
+ case 0:
1932
+ marketplaceParams = _ref69.marketplaceParams, sku = _ref69.sku;
1933
+ _context35.prev = 1;
1934
+ _context35.next = 4;
1935
+ return this.MarketplaceInfo({
1936
+ marketplaceParams: marketplaceParams
1937
+ });
1938
+ case 4:
1939
+ marketplaceInfo = _context35.sent;
1940
+ _context35.next = 7;
1941
+ return this.MintingStatus({
1942
+ tenantId: marketplaceInfo.tenantId
1943
+ });
1944
+ case 7:
1945
+ statuses = _context35.sent;
1946
+ return _context35.abrupt("return", statuses.find(function (status) {
1947
+ return status.op === "nft-claim" && status.marketplaceId === marketplaceInfo.marketplaceId && status.confirmationId === sku;
1948
+ }) || {
1949
+ status: "none"
1950
+ });
1951
+ case 11:
1952
+ _context35.prev = 11;
1953
+ _context35.t0 = _context35["catch"](1);
1954
+ this.Log(_context35.t0, true);
1955
+ return _context35.abrupt("return", {
1956
+ status: "unknown"
1957
+ });
1958
+ case 15:
1959
+ case "end":
1960
+ return _context35.stop();
2262
1961
  }
2263
1962
  }, _callee35, this, [[1, 11]]);
2264
1963
  }));
2265
-
2266
1964
  return function (_x21) {
2267
1965
  return _ref70.apply(this, arguments);
2268
1966
  };
2269
1967
  }();
1968
+
2270
1969
  /**
2271
1970
  * Return status of the specified pack opening
2272
1971
  *
@@ -2277,57 +1976,49 @@ exports.ClaimStatus = /*#__PURE__*/function () {
2277
1976
  *
2278
1977
  * @returns {Promise<Object>} - The status of the pack opening
2279
1978
  */
2280
-
2281
-
2282
1979
  exports.PackOpenStatus = /*#__PURE__*/function () {
2283
1980
  var _ref72 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(_ref71) {
2284
1981
  var contractAddress, tokenId, tenantConfig, statuses;
2285
1982
  return _regeneratorRuntime.wrap(function _callee36$(_context36) {
2286
- while (1) {
2287
- switch (_context36.prev = _context36.next) {
2288
- case 0:
2289
- contractAddress = _ref71.contractAddress, tokenId = _ref71.tokenId;
2290
- _context36.prev = 1;
2291
- _context36.next = 4;
2292
- return this.TenantConfiguration({
2293
- contractAddress: contractAddress
2294
- });
2295
-
2296
- case 4:
2297
- tenantConfig = _context36.sent;
2298
- _context36.next = 7;
2299
- return this.MintingStatus({
2300
- tenantId: tenantConfig.tenant
2301
- });
2302
-
2303
- case 7:
2304
- statuses = _context36.sent;
2305
- return _context36.abrupt("return", statuses.find(function (status) {
2306
- return status.op === "nft-open" && Utils.EqualAddress(contractAddress, status.address) && status.tokenId === tokenId;
2307
- }) || {
2308
- status: "none"
2309
- });
2310
-
2311
- case 11:
2312
- _context36.prev = 11;
2313
- _context36.t0 = _context36["catch"](1);
2314
- this.Log(_context36.t0, true);
2315
- return _context36.abrupt("return", {
2316
- status: "unknown"
2317
- });
2318
-
2319
- case 15:
2320
- case "end":
2321
- return _context36.stop();
2322
- }
1983
+ while (1) switch (_context36.prev = _context36.next) {
1984
+ case 0:
1985
+ contractAddress = _ref71.contractAddress, tokenId = _ref71.tokenId;
1986
+ _context36.prev = 1;
1987
+ _context36.next = 4;
1988
+ return this.TenantConfiguration({
1989
+ contractAddress: contractAddress
1990
+ });
1991
+ case 4:
1992
+ tenantConfig = _context36.sent;
1993
+ _context36.next = 7;
1994
+ return this.MintingStatus({
1995
+ tenantId: tenantConfig.tenant
1996
+ });
1997
+ case 7:
1998
+ statuses = _context36.sent;
1999
+ return _context36.abrupt("return", statuses.find(function (status) {
2000
+ return status.op === "nft-open" && Utils.EqualAddress(contractAddress, status.address) && status.tokenId === tokenId;
2001
+ }) || {
2002
+ status: "none"
2003
+ });
2004
+ case 11:
2005
+ _context36.prev = 11;
2006
+ _context36.t0 = _context36["catch"](1);
2007
+ this.Log(_context36.t0, true);
2008
+ return _context36.abrupt("return", {
2009
+ status: "unknown"
2010
+ });
2011
+ case 15:
2012
+ case "end":
2013
+ return _context36.stop();
2323
2014
  }
2324
2015
  }, _callee36, this, [[1, 11]]);
2325
2016
  }));
2326
-
2327
2017
  return function (_x22) {
2328
2018
  return _ref72.apply(this, arguments);
2329
2019
  };
2330
2020
  }();
2021
+
2331
2022
  /**
2332
2023
  * Return status of the specified collection redemption
2333
2024
  *
@@ -2338,453 +2029,375 @@ exports.PackOpenStatus = /*#__PURE__*/function () {
2338
2029
  *
2339
2030
  * @returns {Promise<Object>} - The status of the collection redemption
2340
2031
  */
2341
-
2342
-
2343
2032
  exports.CollectionRedemptionStatus = /*#__PURE__*/function () {
2344
2033
  var _ref74 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(_ref73) {
2345
2034
  var marketplaceParams, confirmationId, statuses;
2346
2035
  return _regeneratorRuntime.wrap(function _callee37$(_context37) {
2347
- while (1) {
2348
- switch (_context37.prev = _context37.next) {
2349
- case 0:
2350
- marketplaceParams = _ref73.marketplaceParams, confirmationId = _ref73.confirmationId;
2351
- _context37.prev = 1;
2352
- _context37.next = 4;
2353
- return this.MintingStatus({
2354
- marketplaceParams: marketplaceParams
2355
- });
2356
-
2357
- case 4:
2358
- statuses = _context37.sent;
2359
- return _context37.abrupt("return", statuses.find(function (status) {
2360
- return status.op === "nft-redeem" && status.confirmationId === confirmationId;
2361
- }) || {
2362
- status: "none"
2363
- });
2364
-
2365
- case 8:
2366
- _context37.prev = 8;
2367
- _context37.t0 = _context37["catch"](1);
2368
- this.Log(_context37.t0, true);
2369
- return _context37.abrupt("return", {
2370
- status: "unknown"
2371
- });
2372
-
2373
- case 12:
2374
- case "end":
2375
- return _context37.stop();
2376
- }
2036
+ while (1) switch (_context37.prev = _context37.next) {
2037
+ case 0:
2038
+ marketplaceParams = _ref73.marketplaceParams, confirmationId = _ref73.confirmationId;
2039
+ _context37.prev = 1;
2040
+ _context37.next = 4;
2041
+ return this.MintingStatus({
2042
+ marketplaceParams: marketplaceParams
2043
+ });
2044
+ case 4:
2045
+ statuses = _context37.sent;
2046
+ return _context37.abrupt("return", statuses.find(function (status) {
2047
+ return status.op === "nft-redeem" && status.confirmationId === confirmationId;
2048
+ }) || {
2049
+ status: "none"
2050
+ });
2051
+ case 8:
2052
+ _context37.prev = 8;
2053
+ _context37.t0 = _context37["catch"](1);
2054
+ this.Log(_context37.t0, true);
2055
+ return _context37.abrupt("return", {
2056
+ status: "unknown"
2057
+ });
2058
+ case 12:
2059
+ case "end":
2060
+ return _context37.stop();
2377
2061
  }
2378
2062
  }, _callee37, this, [[1, 8]]);
2379
2063
  }));
2380
-
2381
2064
  return function (_x23) {
2382
2065
  return _ref74.apply(this, arguments);
2383
2066
  };
2384
2067
  }();
2385
- /* EVENTS */
2386
2068
 
2069
+ /* EVENTS */
2387
2070
 
2388
2071
  exports.LoadDrop = /*#__PURE__*/function () {
2389
2072
  var _ref76 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(_ref75) {
2390
2073
  var _this = this;
2391
-
2392
2074
  var tenantSlug, eventSlug, dropId, mainSiteHash, event, eventId;
2393
2075
  return _regeneratorRuntime.wrap(function _callee38$(_context38) {
2394
- while (1) {
2395
- switch (_context38.prev = _context38.next) {
2396
- case 0:
2397
- tenantSlug = _ref75.tenantSlug, eventSlug = _ref75.eventSlug, dropId = _ref75.dropId;
2398
-
2399
- if (!this.drops) {
2400
- this.drops = {};
2401
- }
2402
-
2403
- if (!this.drops[tenantSlug]) {
2404
- this.drops[tenantSlug] = {};
2405
- }
2406
-
2407
- if (!this.drops[tenantSlug][eventSlug]) {
2408
- this.drops[tenantSlug][eventSlug] = {};
2409
- }
2410
-
2411
- if (this.drops[tenantSlug][eventSlug][dropId]) {
2412
- _context38.next = 16;
2413
- break;
2414
- }
2415
-
2416
- _context38.next = 7;
2417
- return this.client.LatestVersionHash({
2418
- objectId: this.mainSiteId
2419
- });
2420
-
2421
- case 7:
2422
- mainSiteHash = _context38.sent;
2423
- _context38.next = 10;
2424
- return this.client.ContentObjectMetadata({
2425
- versionHash: mainSiteHash,
2426
- metadataSubtree: UrlJoin("public", "asset_metadata", "tenants", tenantSlug, "sites", eventSlug, "info"),
2427
- resolveLinks: true,
2428
- linkDepthLimit: 2,
2429
- resolveIncludeSource: true,
2430
- produceLinkUrls: true,
2431
- select: [".", "drops"],
2432
- noAuth: true
2433
- });
2434
-
2435
- case 10:
2436
- _context38.t0 = _context38.sent;
2437
-
2438
- if (_context38.t0) {
2439
- _context38.next = 13;
2440
- break;
2441
- }
2442
-
2443
- _context38.t0 = [];
2444
-
2445
- case 13:
2446
- event = _context38.t0;
2447
- eventId = Utils.DecodeVersionHash(event["."].source).objectId;
2448
- event.drops.forEach(function (drop) {
2449
- drop = _objectSpread(_objectSpread({}, drop), {}, {
2450
- eventId: eventId
2451
- });
2452
- _this.drops[tenantSlug][eventSlug][drop.uuid] = drop;
2453
- _this.drops[drop.uuid] = drop;
2076
+ while (1) switch (_context38.prev = _context38.next) {
2077
+ case 0:
2078
+ tenantSlug = _ref75.tenantSlug, eventSlug = _ref75.eventSlug, dropId = _ref75.dropId;
2079
+ if (!this.drops) {
2080
+ this.drops = {};
2081
+ }
2082
+ if (!this.drops[tenantSlug]) {
2083
+ this.drops[tenantSlug] = {};
2084
+ }
2085
+ if (!this.drops[tenantSlug][eventSlug]) {
2086
+ this.drops[tenantSlug][eventSlug] = {};
2087
+ }
2088
+ if (this.drops[tenantSlug][eventSlug][dropId]) {
2089
+ _context38.next = 16;
2090
+ break;
2091
+ }
2092
+ _context38.next = 7;
2093
+ return this.client.LatestVersionHash({
2094
+ objectId: this.mainSiteId
2095
+ });
2096
+ case 7:
2097
+ mainSiteHash = _context38.sent;
2098
+ _context38.next = 10;
2099
+ return this.client.ContentObjectMetadata({
2100
+ versionHash: mainSiteHash,
2101
+ metadataSubtree: UrlJoin("public", "asset_metadata", "tenants", tenantSlug, "sites", eventSlug, "info"),
2102
+ resolveLinks: true,
2103
+ linkDepthLimit: 2,
2104
+ resolveIncludeSource: true,
2105
+ produceLinkUrls: true,
2106
+ select: [".", "drops"],
2107
+ noAuth: true
2108
+ });
2109
+ case 10:
2110
+ _context38.t0 = _context38.sent;
2111
+ if (_context38.t0) {
2112
+ _context38.next = 13;
2113
+ break;
2114
+ }
2115
+ _context38.t0 = [];
2116
+ case 13:
2117
+ event = _context38.t0;
2118
+ eventId = Utils.DecodeVersionHash(event["."].source).objectId;
2119
+ event.drops.forEach(function (drop) {
2120
+ drop = _objectSpread(_objectSpread({}, drop), {}, {
2121
+ eventId: eventId
2454
2122
  });
2455
-
2456
- case 16:
2457
- return _context38.abrupt("return", this.drops[dropId]);
2458
-
2459
- case 17:
2460
- case "end":
2461
- return _context38.stop();
2462
- }
2123
+ _this.drops[tenantSlug][eventSlug][drop.uuid] = drop;
2124
+ _this.drops[drop.uuid] = drop;
2125
+ });
2126
+ case 16:
2127
+ return _context38.abrupt("return", this.drops[dropId]);
2128
+ case 17:
2129
+ case "end":
2130
+ return _context38.stop();
2463
2131
  }
2464
2132
  }, _callee38, this);
2465
2133
  }));
2466
-
2467
2134
  return function (_x24) {
2468
2135
  return _ref76.apply(this, arguments);
2469
2136
  };
2470
2137
  }();
2471
-
2472
2138
  exports.SubmitDropVote = /*#__PURE__*/function () {
2473
2139
  var _ref78 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(_ref77) {
2474
2140
  var marketplaceParams, eventId, dropId, sku, marketplaceInfo;
2475
2141
  return _regeneratorRuntime.wrap(function _callee39$(_context39) {
2476
- while (1) {
2477
- switch (_context39.prev = _context39.next) {
2478
- case 0:
2479
- marketplaceParams = _ref77.marketplaceParams, eventId = _ref77.eventId, dropId = _ref77.dropId, sku = _ref77.sku;
2480
- _context39.next = 3;
2481
- return this.MarketplaceInfo({
2482
- marketplaceParams: marketplaceParams
2483
- });
2484
-
2485
- case 3:
2486
- marketplaceInfo = _context39.sent;
2487
- _context39.next = 6;
2488
- return this.client.authClient.MakeAuthServiceRequest({
2489
- path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
2490
- method: "POST",
2491
- body: {
2492
- op: "vote-drop",
2493
- evt: eventId,
2494
- id: dropId,
2495
- itm: sku
2496
- },
2497
- headers: {
2498
- Authorization: "Bearer ".concat(this.AuthToken())
2499
- }
2500
- });
2501
-
2502
- case 6:
2503
- case "end":
2504
- return _context39.stop();
2505
- }
2142
+ while (1) switch (_context39.prev = _context39.next) {
2143
+ case 0:
2144
+ marketplaceParams = _ref77.marketplaceParams, eventId = _ref77.eventId, dropId = _ref77.dropId, sku = _ref77.sku;
2145
+ _context39.next = 3;
2146
+ return this.MarketplaceInfo({
2147
+ marketplaceParams: marketplaceParams
2148
+ });
2149
+ case 3:
2150
+ marketplaceInfo = _context39.sent;
2151
+ _context39.next = 6;
2152
+ return this.client.authClient.MakeAuthServiceRequest({
2153
+ path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
2154
+ method: "POST",
2155
+ body: {
2156
+ op: "vote-drop",
2157
+ evt: eventId,
2158
+ id: dropId,
2159
+ itm: sku
2160
+ },
2161
+ headers: {
2162
+ Authorization: "Bearer ".concat(this.AuthToken())
2163
+ }
2164
+ });
2165
+ case 6:
2166
+ case "end":
2167
+ return _context39.stop();
2506
2168
  }
2507
2169
  }, _callee39, this);
2508
2170
  }));
2509
-
2510
2171
  return function (_x25) {
2511
2172
  return _ref78.apply(this, arguments);
2512
2173
  };
2513
2174
  }();
2514
-
2515
2175
  exports.DropStatus = /*#__PURE__*/function () {
2516
2176
  var _ref80 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(_ref79) {
2517
2177
  var marketplace, eventId, dropId, response;
2518
2178
  return _regeneratorRuntime.wrap(function _callee40$(_context40) {
2519
- while (1) {
2520
- switch (_context40.prev = _context40.next) {
2521
- case 0:
2522
- marketplace = _ref79.marketplace, eventId = _ref79.eventId, dropId = _ref79.dropId;
2523
- _context40.prev = 1;
2524
- _context40.next = 4;
2525
- return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
2526
- path: UrlJoin("as", "wlt", "act", marketplace.tenant_id, eventId, dropId),
2527
- method: "GET",
2528
- headers: {
2529
- Authorization: "Bearer ".concat(this.AuthToken())
2530
- }
2531
- }));
2532
-
2533
- case 4:
2534
- response = _context40.sent;
2535
- return _context40.abrupt("return", response.sort(function (a, b) {
2536
- return a.ts > b.ts ? 1 : -1;
2537
- })[0] || {
2538
- status: "none"
2539
- });
2540
-
2541
- case 8:
2542
- _context40.prev = 8;
2543
- _context40.t0 = _context40["catch"](1);
2544
- this.Log(_context40.t0, true);
2545
- return _context40.abrupt("return", "");
2546
-
2547
- case 12:
2548
- case "end":
2549
- return _context40.stop();
2550
- }
2179
+ while (1) switch (_context40.prev = _context40.next) {
2180
+ case 0:
2181
+ marketplace = _ref79.marketplace, eventId = _ref79.eventId, dropId = _ref79.dropId;
2182
+ _context40.prev = 1;
2183
+ _context40.next = 4;
2184
+ return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
2185
+ path: UrlJoin("as", "wlt", "act", marketplace.tenant_id, eventId, dropId),
2186
+ method: "GET",
2187
+ headers: {
2188
+ Authorization: "Bearer ".concat(this.AuthToken())
2189
+ }
2190
+ }));
2191
+ case 4:
2192
+ response = _context40.sent;
2193
+ return _context40.abrupt("return", response.sort(function (a, b) {
2194
+ return a.ts > b.ts ? 1 : -1;
2195
+ })[0] || {
2196
+ status: "none"
2197
+ });
2198
+ case 8:
2199
+ _context40.prev = 8;
2200
+ _context40.t0 = _context40["catch"](1);
2201
+ this.Log(_context40.t0, true);
2202
+ return _context40.abrupt("return", "");
2203
+ case 12:
2204
+ case "end":
2205
+ return _context40.stop();
2551
2206
  }
2552
2207
  }, _callee40, this, [[1, 8]]);
2553
2208
  }));
2554
-
2555
2209
  return function (_x26) {
2556
2210
  return _ref80.apply(this, arguments);
2557
2211
  };
2558
2212
  }();
2213
+
2559
2214
  /* OFFERS */
2560
2215
  // TODO: Document
2561
2216
 
2562
-
2563
2217
  exports.MarketplaceOffers = /*#__PURE__*/function () {
2564
2218
  var _ref82 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(_ref81) {
2565
2219
  var contractAddress, tokenId, buyerAddress, sellerAddress, statuses, _ref81$start, start, _ref81$limit, limit, path, queryParams, offers;
2566
-
2567
2220
  return _regeneratorRuntime.wrap(function _callee41$(_context41) {
2568
- while (1) {
2569
- switch (_context41.prev = _context41.next) {
2570
- case 0:
2571
- contractAddress = _ref81.contractAddress, tokenId = _ref81.tokenId, buyerAddress = _ref81.buyerAddress, sellerAddress = _ref81.sellerAddress, statuses = _ref81.statuses, _ref81$start = _ref81.start, start = _ref81$start === void 0 ? 0 : _ref81$start, _ref81$limit = _ref81.limit, limit = _ref81$limit === void 0 ? 10 : _ref81$limit;
2572
- path = UrlJoin("as", "mkt", "offers", "ls");
2573
-
2574
- if (buyerAddress) {
2575
- path = UrlJoin(path, "b", Utils.FormatAddress(buyerAddress));
2576
- } else if (sellerAddress) {
2577
- path = UrlJoin(path, "s", Utils.FormatAddress(sellerAddress));
2578
- }
2579
-
2580
- if (contractAddress) {
2581
- path = UrlJoin(path, "c", Utils.FormatAddress(contractAddress));
2582
-
2583
- if (tokenId) {
2584
- path = UrlJoin(path, "t", tokenId);
2585
- }
2586
- }
2587
-
2588
- queryParams = {
2589
- start: start,
2590
- limit: limit
2591
- };
2592
-
2593
- if (statuses && statuses.length > 0) {
2594
- queryParams.include = statuses.join(",");
2221
+ while (1) switch (_context41.prev = _context41.next) {
2222
+ case 0:
2223
+ contractAddress = _ref81.contractAddress, tokenId = _ref81.tokenId, buyerAddress = _ref81.buyerAddress, sellerAddress = _ref81.sellerAddress, statuses = _ref81.statuses, _ref81$start = _ref81.start, start = _ref81$start === void 0 ? 0 : _ref81$start, _ref81$limit = _ref81.limit, limit = _ref81$limit === void 0 ? 10 : _ref81$limit;
2224
+ path = UrlJoin("as", "mkt", "offers", "ls");
2225
+ if (buyerAddress) {
2226
+ path = UrlJoin(path, "b", Utils.FormatAddress(buyerAddress));
2227
+ } else if (sellerAddress) {
2228
+ path = UrlJoin(path, "s", Utils.FormatAddress(sellerAddress));
2229
+ }
2230
+ if (contractAddress) {
2231
+ path = UrlJoin(path, "c", Utils.FormatAddress(contractAddress));
2232
+ if (tokenId) {
2233
+ path = UrlJoin(path, "t", tokenId);
2595
2234
  }
2596
-
2597
- _context41.next = 8;
2598
- return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
2599
- path: path,
2600
- method: "GET",
2601
- queryParams: queryParams
2602
- }));
2603
-
2604
- case 8:
2605
- offers = _context41.sent;
2606
- return _context41.abrupt("return", offers.map(function (offer) {
2607
- return _objectSpread(_objectSpread({}, offer), {}, {
2608
- created: offer.created * 1000,
2609
- updated: offer.updated * 1000,
2610
- expiration: offer.expiration * 1000
2611
- });
2612
- }));
2613
-
2614
- case 10:
2615
- case "end":
2616
- return _context41.stop();
2617
- }
2235
+ }
2236
+ queryParams = {
2237
+ start: start,
2238
+ limit: limit
2239
+ };
2240
+ if (statuses && statuses.length > 0) {
2241
+ queryParams.include = statuses.join(",");
2242
+ }
2243
+ _context41.next = 8;
2244
+ return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
2245
+ path: path,
2246
+ method: "GET",
2247
+ queryParams: queryParams
2248
+ }));
2249
+ case 8:
2250
+ offers = _context41.sent;
2251
+ return _context41.abrupt("return", offers.map(function (offer) {
2252
+ return _objectSpread(_objectSpread({}, offer), {}, {
2253
+ created: offer.created * 1000,
2254
+ updated: offer.updated * 1000,
2255
+ expiration: offer.expiration * 1000
2256
+ });
2257
+ }));
2258
+ case 10:
2259
+ case "end":
2260
+ return _context41.stop();
2618
2261
  }
2619
2262
  }, _callee41, this);
2620
2263
  }));
2621
-
2622
2264
  return function (_x27) {
2623
2265
  return _ref82.apply(this, arguments);
2624
2266
  };
2625
2267
  }();
2626
-
2627
2268
  exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
2628
2269
  var _ref84 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(_ref83) {
2629
2270
  var contractAddress, tokenId, offerId, price, expiresAt, response;
2630
2271
  return _regeneratorRuntime.wrap(function _callee42$(_context42) {
2631
- while (1) {
2632
- switch (_context42.prev = _context42.next) {
2633
- case 0:
2634
- contractAddress = _ref83.contractAddress, tokenId = _ref83.tokenId, offerId = _ref83.offerId, price = _ref83.price, expiresAt = _ref83.expiresAt;
2635
-
2636
- if (!offerId) {
2637
- _context42.next = 7;
2638
- break;
2639
- }
2640
-
2641
- _context42.next = 4;
2642
- return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
2643
- path: UrlJoin("as", "wlt", "mkt", "offers", offerId),
2644
- method: "PUT",
2645
- body: {
2646
- price: price,
2647
- expiration: Math.floor(expiresAt / 1000)
2648
- },
2649
- headers: {
2650
- Authorization: "Bearer ".concat(this.AuthToken())
2651
- }
2652
- }));
2653
-
2654
- case 4:
2655
- response = _context42.sent;
2656
- _context42.next = 10;
2272
+ while (1) switch (_context42.prev = _context42.next) {
2273
+ case 0:
2274
+ contractAddress = _ref83.contractAddress, tokenId = _ref83.tokenId, offerId = _ref83.offerId, price = _ref83.price, expiresAt = _ref83.expiresAt;
2275
+ if (!offerId) {
2276
+ _context42.next = 7;
2657
2277
  break;
2658
-
2659
- case 7:
2660
- _context42.next = 9;
2661
- return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
2662
- path: UrlJoin("as", "wlt", "mkt", "offers", contractAddress, tokenId),
2663
- method: "POST",
2664
- body: {
2665
- contract: contractAddress,
2666
- token: tokenId,
2667
- price: price,
2668
- expiration: Math.floor(expiresAt / 1000)
2669
- },
2670
- headers: {
2671
- Authorization: "Bearer ".concat(this.AuthToken())
2672
- }
2673
- }));
2674
-
2675
- case 9:
2676
- response = _context42.sent;
2677
-
2678
- case 10:
2679
- return _context42.abrupt("return", response.offer_id);
2680
-
2681
- case 11:
2682
- case "end":
2683
- return _context42.stop();
2684
- }
2278
+ }
2279
+ _context42.next = 4;
2280
+ return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
2281
+ path: UrlJoin("as", "wlt", "mkt", "offers", offerId),
2282
+ method: "PUT",
2283
+ body: {
2284
+ price: price,
2285
+ expiration: Math.floor(expiresAt / 1000)
2286
+ },
2287
+ headers: {
2288
+ Authorization: "Bearer ".concat(this.AuthToken())
2289
+ }
2290
+ }));
2291
+ case 4:
2292
+ response = _context42.sent;
2293
+ _context42.next = 10;
2294
+ break;
2295
+ case 7:
2296
+ _context42.next = 9;
2297
+ return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
2298
+ path: UrlJoin("as", "wlt", "mkt", "offers", contractAddress, tokenId),
2299
+ method: "POST",
2300
+ body: {
2301
+ contract: contractAddress,
2302
+ token: tokenId,
2303
+ price: price,
2304
+ expiration: Math.floor(expiresAt / 1000)
2305
+ },
2306
+ headers: {
2307
+ Authorization: "Bearer ".concat(this.AuthToken())
2308
+ }
2309
+ }));
2310
+ case 9:
2311
+ response = _context42.sent;
2312
+ case 10:
2313
+ return _context42.abrupt("return", response.offer_id);
2314
+ case 11:
2315
+ case "end":
2316
+ return _context42.stop();
2685
2317
  }
2686
2318
  }, _callee42, this);
2687
2319
  }));
2688
-
2689
2320
  return function (_x28) {
2690
2321
  return _ref84.apply(this, arguments);
2691
2322
  };
2692
2323
  }();
2693
-
2694
2324
  exports.RemoveMarketplaceOffer = /*#__PURE__*/function () {
2695
2325
  var _ref86 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(_ref85) {
2696
2326
  var offerId;
2697
2327
  return _regeneratorRuntime.wrap(function _callee43$(_context43) {
2698
- while (1) {
2699
- switch (_context43.prev = _context43.next) {
2700
- case 0:
2701
- offerId = _ref85.offerId;
2702
- _context43.next = 3;
2703
- return this.client.authClient.MakeAuthServiceRequest({
2704
- path: UrlJoin("as", "wlt", "mkt", "offers", offerId),
2705
- method: "DELETE",
2706
- headers: {
2707
- Authorization: "Bearer ".concat(this.AuthToken())
2708
- }
2709
- });
2710
-
2711
- case 3:
2712
- return _context43.abrupt("return", _context43.sent);
2713
-
2714
- case 4:
2715
- case "end":
2716
- return _context43.stop();
2717
- }
2328
+ while (1) switch (_context43.prev = _context43.next) {
2329
+ case 0:
2330
+ offerId = _ref85.offerId;
2331
+ _context43.next = 3;
2332
+ return this.client.authClient.MakeAuthServiceRequest({
2333
+ path: UrlJoin("as", "wlt", "mkt", "offers", offerId),
2334
+ method: "DELETE",
2335
+ headers: {
2336
+ Authorization: "Bearer ".concat(this.AuthToken())
2337
+ }
2338
+ });
2339
+ case 3:
2340
+ return _context43.abrupt("return", _context43.sent);
2341
+ case 4:
2342
+ case "end":
2343
+ return _context43.stop();
2718
2344
  }
2719
2345
  }, _callee43, this);
2720
2346
  }));
2721
-
2722
2347
  return function (_x29) {
2723
2348
  return _ref86.apply(this, arguments);
2724
2349
  };
2725
2350
  }();
2726
-
2727
2351
  exports.AcceptMarketplaceOffer = /*#__PURE__*/function () {
2728
2352
  var _ref88 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(_ref87) {
2729
2353
  var offerId;
2730
2354
  return _regeneratorRuntime.wrap(function _callee44$(_context44) {
2731
- while (1) {
2732
- switch (_context44.prev = _context44.next) {
2733
- case 0:
2734
- offerId = _ref87.offerId;
2735
- _context44.next = 3;
2736
- return this.client.authClient.MakeAuthServiceRequest({
2737
- path: UrlJoin("as", "wlt", "mkt", "offers", "accept", offerId),
2738
- method: "PUT",
2739
- headers: {
2740
- Authorization: "Bearer ".concat(this.AuthToken())
2741
- }
2742
- });
2743
-
2744
- case 3:
2745
- return _context44.abrupt("return", _context44.sent);
2746
-
2747
- case 4:
2748
- case "end":
2749
- return _context44.stop();
2750
- }
2355
+ while (1) switch (_context44.prev = _context44.next) {
2356
+ case 0:
2357
+ offerId = _ref87.offerId;
2358
+ _context44.next = 3;
2359
+ return this.client.authClient.MakeAuthServiceRequest({
2360
+ path: UrlJoin("as", "wlt", "mkt", "offers", "accept", offerId),
2361
+ method: "PUT",
2362
+ headers: {
2363
+ Authorization: "Bearer ".concat(this.AuthToken())
2364
+ }
2365
+ });
2366
+ case 3:
2367
+ return _context44.abrupt("return", _context44.sent);
2368
+ case 4:
2369
+ case "end":
2370
+ return _context44.stop();
2751
2371
  }
2752
2372
  }, _callee44, this);
2753
2373
  }));
2754
-
2755
2374
  return function (_x30) {
2756
2375
  return _ref88.apply(this, arguments);
2757
2376
  };
2758
2377
  }();
2759
-
2760
2378
  exports.RejectMarketplaceOffer = /*#__PURE__*/function () {
2761
2379
  var _ref90 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(_ref89) {
2762
2380
  var offerId;
2763
2381
  return _regeneratorRuntime.wrap(function _callee45$(_context45) {
2764
- while (1) {
2765
- switch (_context45.prev = _context45.next) {
2766
- case 0:
2767
- offerId = _ref89.offerId;
2768
- _context45.next = 3;
2769
- return this.client.authClient.MakeAuthServiceRequest({
2770
- path: UrlJoin("as", "wlt", "mkt", "offers", "decline", offerId),
2771
- method: "PUT",
2772
- headers: {
2773
- Authorization: "Bearer ".concat(this.AuthToken())
2774
- }
2775
- });
2776
-
2777
- case 3:
2778
- return _context45.abrupt("return", _context45.sent);
2779
-
2780
- case 4:
2781
- case "end":
2782
- return _context45.stop();
2783
- }
2382
+ while (1) switch (_context45.prev = _context45.next) {
2383
+ case 0:
2384
+ offerId = _ref89.offerId;
2385
+ _context45.next = 3;
2386
+ return this.client.authClient.MakeAuthServiceRequest({
2387
+ path: UrlJoin("as", "wlt", "mkt", "offers", "decline", offerId),
2388
+ method: "PUT",
2389
+ headers: {
2390
+ Authorization: "Bearer ".concat(this.AuthToken())
2391
+ }
2392
+ });
2393
+ case 3:
2394
+ return _context45.abrupt("return", _context45.sent);
2395
+ case 4:
2396
+ case "end":
2397
+ return _context45.stop();
2784
2398
  }
2785
2399
  }, _callee45, this);
2786
2400
  }));
2787
-
2788
2401
  return function (_x31) {
2789
2402
  return _ref90.apply(this, arguments);
2790
2403
  };