@eluvio/elv-client-js 4.0.4 → 4.0.6

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