@eluvio/elv-client-js 4.0.11 → 4.0.13

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