@eluvio/elv-client-js 3.2.2 → 3.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ElvClient-min.js +15 -11
- package/dist/ElvClient-node-min.js +17 -13
- package/dist/ElvFrameClient-min.js +12 -8
- package/dist/ElvPermissionsClient-min.js +13 -9
- package/dist/ElvWalletClient-min.js +58 -0
- package/dist/ElvWalletClient-node-min.js +78 -0
- package/dist/src/AuthorizationClient.js +2248 -1990
- package/dist/src/ContentObjectVerification.js +164 -173
- package/dist/src/Crypto.js +376 -324
- package/dist/src/ElvClient.js +1182 -1019
- package/dist/src/ElvWallet.js +119 -95
- package/dist/src/EthClient.js +1040 -896
- package/dist/src/FrameClient.js +331 -300
- package/dist/src/HttpClient.js +153 -147
- package/dist/src/Id.js +1 -3
- package/dist/src/PermissionsClient.js +1294 -1168
- package/dist/src/RemoteSigner.js +263 -211
- package/dist/src/UserProfileClient.js +1164 -1023
- package/dist/src/Utils.js +209 -181
- package/dist/src/client/ABRPublishing.js +895 -858
- package/dist/src/client/AccessGroups.js +1102 -959
- package/dist/src/client/ContentAccess.js +3724 -3431
- package/dist/src/client/ContentManagement.js +2252 -2068
- package/dist/src/client/Contracts.js +647 -563
- package/dist/src/client/Files.js +1886 -1757
- package/dist/src/client/NFT.js +126 -112
- package/dist/src/client/NTP.js +478 -422
- package/dist/src/walletClient/ClientMethods.js +1029 -879
- package/dist/src/walletClient/Utils.js +84 -70
- package/dist/src/walletClient/index.js +1203 -1087
- package/package.json +4 -2
- package/src/Utils.js +0 -1
- package/src/walletClient/ClientMethods.js +34 -2
- package/src/walletClient/index.js +3 -3
- package/utilities/ProductionMasterCreate.js +2 -2
|
@@ -2,9 +2,11 @@ var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
|
2
2
|
|
|
3
3
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
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
|
+
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; }
|
|
8
10
|
|
|
9
11
|
var Utils = require("../Utils");
|
|
10
12
|
|
|
@@ -80,9 +82,9 @@ exports.UserAddress = function () {
|
|
|
80
82
|
*/
|
|
81
83
|
|
|
82
84
|
|
|
83
|
-
exports.UserWalletBalance = function _callee() {
|
|
85
|
+
exports.UserWalletBalance = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
84
86
|
var checkOnboard,
|
|
85
|
-
|
|
87
|
+
_yield$this$client$ut,
|
|
86
88
|
balance,
|
|
87
89
|
usage_hold,
|
|
88
90
|
payout_hold,
|
|
@@ -98,7 +100,7 @@ exports.UserWalletBalance = function _callee() {
|
|
|
98
100
|
balances,
|
|
99
101
|
_args = arguments;
|
|
100
102
|
|
|
101
|
-
return _regeneratorRuntime.
|
|
103
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
102
104
|
while (1) {
|
|
103
105
|
switch (_context.prev = _context.next) {
|
|
104
106
|
case 0:
|
|
@@ -112,46 +114,44 @@ exports.UserWalletBalance = function _callee() {
|
|
|
112
114
|
return _context.abrupt("return");
|
|
113
115
|
|
|
114
116
|
case 3:
|
|
115
|
-
_context.t0 =
|
|
116
|
-
_context.
|
|
117
|
-
|
|
118
|
-
return _regeneratorRuntime.awrap(this.client.authClient.MakeAuthServiceRequest({
|
|
117
|
+
_context.t0 = this.client.utils;
|
|
118
|
+
_context.next = 6;
|
|
119
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
119
120
|
path: UrlJoin("as", "wlt", "mkt", "bal"),
|
|
120
121
|
method: "GET",
|
|
121
122
|
headers: {
|
|
122
123
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
123
124
|
}
|
|
124
|
-
})
|
|
125
|
+
});
|
|
125
126
|
|
|
126
|
-
case
|
|
127
|
-
_context.
|
|
128
|
-
_context.
|
|
129
|
-
_context.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
stripe_payouts_enabled = _ref.stripe_payouts_enabled;
|
|
127
|
+
case 6:
|
|
128
|
+
_context.t1 = _context.sent;
|
|
129
|
+
_context.next = 9;
|
|
130
|
+
return _context.t0.ResponseToJson.call(_context.t0, _context.t1);
|
|
131
|
+
|
|
132
|
+
case 9:
|
|
133
|
+
_yield$this$client$ut = _context.sent;
|
|
134
|
+
balance = _yield$this$client$ut.balance;
|
|
135
|
+
usage_hold = _yield$this$client$ut.usage_hold;
|
|
136
|
+
payout_hold = _yield$this$client$ut.payout_hold;
|
|
137
|
+
stripe_id = _yield$this$client$ut.stripe_id;
|
|
138
|
+
stripe_payouts_enabled = _yield$this$client$ut.stripe_payouts_enabled;
|
|
139
139
|
userStripeId = stripe_id;
|
|
140
140
|
userStripeEnabled = stripe_payouts_enabled;
|
|
141
141
|
totalWalletBalance = parseFloat(balance || 0);
|
|
142
|
-
availableWalletBalance = Math.max(0,
|
|
143
|
-
pendingWalletBalance = Math.max(0,
|
|
144
|
-
withdrawableWalletBalance = Math.max(0,
|
|
142
|
+
availableWalletBalance = Math.max(0, totalWalletBalance - parseFloat(usage_hold || 0));
|
|
143
|
+
pendingWalletBalance = Math.max(0, totalWalletBalance - availableWalletBalance);
|
|
144
|
+
withdrawableWalletBalance = Math.max(0, totalWalletBalance - parseFloat(payout_hold || 0));
|
|
145
145
|
|
|
146
146
|
if (!(checkOnboard && stripe_id && !stripe_payouts_enabled)) {
|
|
147
|
-
_context.next =
|
|
147
|
+
_context.next = 28;
|
|
148
148
|
break;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
// Refresh stripe enabled flag
|
|
152
152
|
rootUrl = new URL(UrlJoin(window.location.origin, window.location.pathname)).toString();
|
|
153
|
-
_context.next =
|
|
154
|
-
return
|
|
153
|
+
_context.next = 25;
|
|
154
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
155
155
|
path: UrlJoin("as", "wlt", "onb", "stripe"),
|
|
156
156
|
method: "POST",
|
|
157
157
|
body: {
|
|
@@ -163,16 +163,16 @@ exports.UserWalletBalance = function _callee() {
|
|
|
163
163
|
headers: {
|
|
164
164
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
165
165
|
}
|
|
166
|
-
})
|
|
166
|
+
});
|
|
167
167
|
|
|
168
|
-
case
|
|
169
|
-
_context.next =
|
|
170
|
-
return
|
|
168
|
+
case 25:
|
|
169
|
+
_context.next = 27;
|
|
170
|
+
return this.UserWalletBalance(false);
|
|
171
171
|
|
|
172
|
-
case
|
|
172
|
+
case 27:
|
|
173
173
|
return _context.abrupt("return", _context.sent);
|
|
174
174
|
|
|
175
|
-
case
|
|
175
|
+
case 28:
|
|
176
176
|
balances = {
|
|
177
177
|
totalWalletBalance: totalWalletBalance,
|
|
178
178
|
availableWalletBalance: availableWalletBalance,
|
|
@@ -194,13 +194,13 @@ exports.UserWalletBalance = function _callee() {
|
|
|
194
194
|
|
|
195
195
|
return _context.abrupt("return", balances);
|
|
196
196
|
|
|
197
|
-
case
|
|
197
|
+
case 31:
|
|
198
198
|
case "end":
|
|
199
199
|
return _context.stop();
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
},
|
|
203
|
-
};
|
|
202
|
+
}, _callee, this);
|
|
203
|
+
}));
|
|
204
204
|
/**
|
|
205
205
|
* <b><i>Requires login</i></b>
|
|
206
206
|
*
|
|
@@ -213,12 +213,11 @@ exports.UserWalletBalance = function _callee() {
|
|
|
213
213
|
* @returns {Promise<Object>} - Basic info about all owned items.
|
|
214
214
|
*/
|
|
215
215
|
|
|
216
|
-
|
|
217
|
-
exports.UserItemInfo = function _callee2() {
|
|
216
|
+
exports.UserItemInfo = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
218
217
|
var _this = this;
|
|
219
218
|
|
|
220
219
|
var accountId, nftInfo;
|
|
221
|
-
return _regeneratorRuntime.
|
|
220
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
222
221
|
while (1) {
|
|
223
222
|
switch (_context2.prev = _context2.next) {
|
|
224
223
|
case 0:
|
|
@@ -232,10 +231,10 @@ exports.UserItemInfo = function _callee2() {
|
|
|
232
231
|
case 2:
|
|
233
232
|
accountId = "iusr".concat(Utils.AddressToHash(this.UserAddress()));
|
|
234
233
|
_context2.next = 5;
|
|
235
|
-
return
|
|
234
|
+
return this.client.ethClient.MakeProviderCall({
|
|
236
235
|
methodName: "send",
|
|
237
236
|
args: ["elv_getAccountProfile", [this.client.contentSpaceId, accountId]]
|
|
238
|
-
})
|
|
237
|
+
});
|
|
239
238
|
|
|
240
239
|
case 5:
|
|
241
240
|
this.profileData = _context2.sent;
|
|
@@ -265,7 +264,7 @@ exports.UserItemInfo = function _callee2() {
|
|
|
265
264
|
|
|
266
265
|
var contractAddress = Utils.FormatAddress(details.ContractAddr);
|
|
267
266
|
var key = "".concat(contractAddress, "-").concat(details.TokenIdStr);
|
|
268
|
-
nftInfo[key] = _objectSpread({}, details, {
|
|
267
|
+
nftInfo[key] = _objectSpread(_objectSpread({}, details), {}, {
|
|
269
268
|
ContractAddr: Utils.FormatAddress(details.ContractAddr),
|
|
270
269
|
ContractId: "ictr".concat(Utils.AddressToHash(details.ContractAddr)),
|
|
271
270
|
VersionHash: versionHash
|
|
@@ -280,8 +279,8 @@ exports.UserItemInfo = function _callee2() {
|
|
|
280
279
|
return _context2.stop();
|
|
281
280
|
}
|
|
282
281
|
}
|
|
283
|
-
},
|
|
284
|
-
};
|
|
282
|
+
}, _callee2, this);
|
|
283
|
+
}));
|
|
285
284
|
/**
|
|
286
285
|
* <b><i>Requires login</i></b>
|
|
287
286
|
*
|
|
@@ -302,10 +301,9 @@ exports.UserItemInfo = function _callee2() {
|
|
|
302
301
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
303
302
|
*/
|
|
304
303
|
|
|
305
|
-
|
|
306
|
-
exports.UserItems = function _callee3() {
|
|
304
|
+
exports.UserItems = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
307
305
|
var _args3 = arguments;
|
|
308
|
-
return _regeneratorRuntime.
|
|
306
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
309
307
|
while (1) {
|
|
310
308
|
switch (_context3.prev = _context3.next) {
|
|
311
309
|
case 0:
|
|
@@ -318,8 +316,8 @@ exports.UserItems = function _callee3() {
|
|
|
318
316
|
return _context3.stop();
|
|
319
317
|
}
|
|
320
318
|
}
|
|
321
|
-
},
|
|
322
|
-
};
|
|
319
|
+
}, _callee3, this);
|
|
320
|
+
}));
|
|
323
321
|
/**
|
|
324
322
|
* Return all listings for the current user. Not paginated.
|
|
325
323
|
*
|
|
@@ -334,25 +332,24 @@ exports.UserItems = function _callee3() {
|
|
|
334
332
|
* @returns {Promise<Array<Object>>} - List of current user's listings
|
|
335
333
|
*/
|
|
336
334
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
_ref2$sortBy,
|
|
335
|
+
exports.UserListings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
336
|
+
var _ref5,
|
|
337
|
+
_ref5$sortBy,
|
|
341
338
|
sortBy,
|
|
342
|
-
|
|
339
|
+
_ref5$sortDesc,
|
|
343
340
|
sortDesc,
|
|
344
341
|
contractAddress,
|
|
345
342
|
tokenId,
|
|
346
343
|
marketplaceParams,
|
|
347
344
|
_args4 = arguments;
|
|
348
345
|
|
|
349
|
-
return _regeneratorRuntime.
|
|
346
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
350
347
|
while (1) {
|
|
351
348
|
switch (_context4.prev = _context4.next) {
|
|
352
349
|
case 0:
|
|
353
|
-
|
|
350
|
+
_ref5 = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, _ref5$sortBy = _ref5.sortBy, sortBy = _ref5$sortBy === void 0 ? "created" : _ref5$sortBy, _ref5$sortDesc = _ref5.sortDesc, sortDesc = _ref5$sortDesc === void 0 ? false : _ref5$sortDesc, contractAddress = _ref5.contractAddress, tokenId = _ref5.tokenId, marketplaceParams = _ref5.marketplaceParams;
|
|
354
351
|
_context4.next = 3;
|
|
355
|
-
return
|
|
352
|
+
return this.FilteredQuery({
|
|
356
353
|
mode: "listings",
|
|
357
354
|
start: 0,
|
|
358
355
|
limit: 10000,
|
|
@@ -362,7 +359,7 @@ exports.UserListings = function _callee4() {
|
|
|
362
359
|
marketplaceParams: marketplaceParams,
|
|
363
360
|
contractAddress: contractAddress,
|
|
364
361
|
tokenId: tokenId
|
|
365
|
-
})
|
|
362
|
+
});
|
|
366
363
|
|
|
367
364
|
case 3:
|
|
368
365
|
return _context4.abrupt("return", _context4.sent.results);
|
|
@@ -372,8 +369,8 @@ exports.UserListings = function _callee4() {
|
|
|
372
369
|
return _context4.stop();
|
|
373
370
|
}
|
|
374
371
|
}
|
|
375
|
-
},
|
|
376
|
-
};
|
|
372
|
+
}, _callee4, this);
|
|
373
|
+
}));
|
|
377
374
|
/**
|
|
378
375
|
* Return all sales for the current user. Not paginated.
|
|
379
376
|
*
|
|
@@ -389,25 +386,24 @@ exports.UserListings = function _callee4() {
|
|
|
389
386
|
* @returns {Promise<Array<Object>>} - List of current user's sales
|
|
390
387
|
*/
|
|
391
388
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
_ref3$sortBy,
|
|
389
|
+
exports.UserSales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
390
|
+
var _ref7,
|
|
391
|
+
_ref7$sortBy,
|
|
396
392
|
sortBy,
|
|
397
|
-
|
|
393
|
+
_ref7$sortDesc,
|
|
398
394
|
sortDesc,
|
|
399
395
|
contractAddress,
|
|
400
396
|
tokenId,
|
|
401
397
|
marketplaceParams,
|
|
402
398
|
_args5 = arguments;
|
|
403
399
|
|
|
404
|
-
return _regeneratorRuntime.
|
|
400
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
405
401
|
while (1) {
|
|
406
402
|
switch (_context5.prev = _context5.next) {
|
|
407
403
|
case 0:
|
|
408
|
-
|
|
404
|
+
_ref7 = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}, _ref7$sortBy = _ref7.sortBy, sortBy = _ref7$sortBy === void 0 ? "created" : _ref7$sortBy, _ref7$sortDesc = _ref7.sortDesc, sortDesc = _ref7$sortDesc === void 0 ? false : _ref7$sortDesc, contractAddress = _ref7.contractAddress, tokenId = _ref7.tokenId, marketplaceParams = _ref7.marketplaceParams;
|
|
409
405
|
_context5.next = 3;
|
|
410
|
-
return
|
|
406
|
+
return this.FilteredQuery({
|
|
411
407
|
mode: "sales",
|
|
412
408
|
start: 0,
|
|
413
409
|
limit: 10000,
|
|
@@ -417,7 +413,7 @@ exports.UserSales = function _callee5() {
|
|
|
417
413
|
marketplaceParams: marketplaceParams,
|
|
418
414
|
contractAddress: contractAddress,
|
|
419
415
|
tokenId: tokenId
|
|
420
|
-
})
|
|
416
|
+
});
|
|
421
417
|
|
|
422
418
|
case 3:
|
|
423
419
|
return _context5.abrupt("return", _context5.sent.results);
|
|
@@ -427,8 +423,8 @@ exports.UserSales = function _callee5() {
|
|
|
427
423
|
return _context5.stop();
|
|
428
424
|
}
|
|
429
425
|
}
|
|
430
|
-
},
|
|
431
|
-
};
|
|
426
|
+
}, _callee5, this);
|
|
427
|
+
}));
|
|
432
428
|
/* TENANT */
|
|
433
429
|
|
|
434
430
|
/**
|
|
@@ -444,38 +440,43 @@ exports.UserSales = function _callee5() {
|
|
|
444
440
|
* @returns {Promise<{Object}>} - The tenant configuration
|
|
445
441
|
*/
|
|
446
442
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
443
|
+
exports.TenantConfiguration = /*#__PURE__*/function () {
|
|
444
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref8) {
|
|
445
|
+
var tenantId, contractAddress;
|
|
446
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
447
|
+
while (1) {
|
|
448
|
+
switch (_context6.prev = _context6.next) {
|
|
449
|
+
case 0:
|
|
450
|
+
tenantId = _ref8.tenantId, contractAddress = _ref8.contractAddress;
|
|
451
|
+
_context6.prev = 1;
|
|
452
|
+
_context6.next = 4;
|
|
453
|
+
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
454
|
+
path: contractAddress ? UrlJoin("as", "config", "nft", contractAddress) : UrlJoin("as", "config", "tnt", tenantId),
|
|
455
|
+
method: "GET"
|
|
456
|
+
}));
|
|
457
|
+
|
|
458
|
+
case 4:
|
|
459
|
+
return _context6.abrupt("return", _context6.sent);
|
|
460
|
+
|
|
461
|
+
case 7:
|
|
462
|
+
_context6.prev = 7;
|
|
463
|
+
_context6.t0 = _context6["catch"](1);
|
|
464
|
+
this.Log("Failed to load tenant configuration", true);
|
|
465
|
+
this.Log(_context6.t0, true);
|
|
466
|
+
return _context6.abrupt("return", {});
|
|
467
|
+
|
|
468
|
+
case 12:
|
|
469
|
+
case "end":
|
|
470
|
+
return _context6.stop();
|
|
471
|
+
}
|
|
475
472
|
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
|
|
473
|
+
}, _callee6, this, [[1, 7]]);
|
|
474
|
+
}));
|
|
475
|
+
|
|
476
|
+
return function (_x) {
|
|
477
|
+
return _ref9.apply(this, arguments);
|
|
478
|
+
};
|
|
479
|
+
}();
|
|
479
480
|
/* MARKETPLACE */
|
|
480
481
|
|
|
481
482
|
/**
|
|
@@ -491,55 +492,61 @@ exports.TenantConfiguration = function _callee6(_ref4) {
|
|
|
491
492
|
*/
|
|
492
493
|
|
|
493
494
|
|
|
494
|
-
exports.MarketplaceStock = function
|
|
495
|
-
var
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
495
|
+
exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
496
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref10) {
|
|
497
|
+
var marketplaceParams, tenantId, marketplaceInfo;
|
|
498
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
499
|
+
while (1) {
|
|
500
|
+
switch (_context7.prev = _context7.next) {
|
|
501
|
+
case 0:
|
|
502
|
+
marketplaceParams = _ref10.marketplaceParams, tenantId = _ref10.tenantId;
|
|
501
503
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
if (!this.loggedIn) {
|
|
510
|
-
_context7.next = 6;
|
|
511
|
-
break;
|
|
512
|
-
}
|
|
504
|
+
if (!tenantId) {
|
|
505
|
+
marketplaceInfo = this.MarketplaceInfo({
|
|
506
|
+
marketplaceParams: marketplaceParams
|
|
507
|
+
});
|
|
508
|
+
tenantId = marketplaceInfo.tenantId;
|
|
509
|
+
}
|
|
513
510
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
method: "GET",
|
|
518
|
-
headers: {
|
|
519
|
-
Authorization: "Bearer ".concat(this.AuthToken())
|
|
511
|
+
if (!this.loggedIn) {
|
|
512
|
+
_context7.next = 6;
|
|
513
|
+
break;
|
|
520
514
|
}
|
|
521
|
-
})));
|
|
522
515
|
|
|
523
|
-
|
|
524
|
-
|
|
516
|
+
_context7.next = 5;
|
|
517
|
+
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
518
|
+
path: UrlJoin("as", "wlt", "nft", "info", tenantId),
|
|
519
|
+
method: "GET",
|
|
520
|
+
headers: {
|
|
521
|
+
Authorization: "Bearer ".concat(this.AuthToken())
|
|
522
|
+
}
|
|
523
|
+
}));
|
|
525
524
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
return _regeneratorRuntime.awrap(Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
529
|
-
path: UrlJoin("as", "nft", "stock", tenantId),
|
|
530
|
-
method: "GET"
|
|
531
|
-
})));
|
|
525
|
+
case 5:
|
|
526
|
+
return _context7.abrupt("return", _context7.sent);
|
|
532
527
|
|
|
533
|
-
|
|
534
|
-
|
|
528
|
+
case 6:
|
|
529
|
+
_context7.next = 8;
|
|
530
|
+
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
531
|
+
path: UrlJoin("as", "nft", "stock", tenantId),
|
|
532
|
+
method: "GET"
|
|
533
|
+
}));
|
|
535
534
|
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
535
|
+
case 8:
|
|
536
|
+
return _context7.abrupt("return", _context7.sent);
|
|
537
|
+
|
|
538
|
+
case 9:
|
|
539
|
+
case "end":
|
|
540
|
+
return _context7.stop();
|
|
541
|
+
}
|
|
539
542
|
}
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
+
}, _callee7, this);
|
|
544
|
+
}));
|
|
545
|
+
|
|
546
|
+
return function (_x2) {
|
|
547
|
+
return _ref11.apply(this, arguments);
|
|
548
|
+
};
|
|
549
|
+
}();
|
|
543
550
|
/**
|
|
544
551
|
* Retrieve basic information about a specific available marketplace with the specified tenant/marketplace slug, ID, or hash.
|
|
545
552
|
*
|
|
@@ -555,21 +562,22 @@ exports.MarketplaceStock = function _callee7(_ref5) {
|
|
|
555
562
|
*/
|
|
556
563
|
|
|
557
564
|
|
|
558
|
-
exports.MarketplaceInfo = function (
|
|
559
|
-
var marketplaceParams =
|
|
565
|
+
exports.MarketplaceInfo = function (_ref12) {
|
|
566
|
+
var marketplaceParams = _ref12.marketplaceParams;
|
|
560
567
|
|
|
561
|
-
var
|
|
562
|
-
tenantSlug =
|
|
563
|
-
marketplaceSlug =
|
|
564
|
-
marketplaceId =
|
|
565
|
-
marketplaceHash =
|
|
568
|
+
var _ref13 = marketplaceParams || {},
|
|
569
|
+
tenantSlug = _ref13.tenantSlug,
|
|
570
|
+
marketplaceSlug = _ref13.marketplaceSlug,
|
|
571
|
+
marketplaceId = _ref13.marketplaceId,
|
|
572
|
+
marketplaceHash = _ref13.marketplaceHash;
|
|
566
573
|
|
|
567
574
|
var marketplaceInfo;
|
|
568
575
|
|
|
569
576
|
if (tenantSlug && marketplaceSlug) {
|
|
570
577
|
marketplaceInfo = (this.availableMarketplaces[tenantSlug] || {})[marketplaceSlug];
|
|
571
578
|
} else {
|
|
572
|
-
|
|
579
|
+
marketplaceId = marketplaceHash ? this.client.utils.DecodeVersionHash(marketplaceHash).objectId : marketplaceId;
|
|
580
|
+
marketplaceInfo = this.availableMarketplacesById[marketplaceId];
|
|
573
581
|
}
|
|
574
582
|
|
|
575
583
|
if (!marketplaceInfo) {
|
|
@@ -589,44 +597,50 @@ exports.MarketplaceInfo = function (_ref6) {
|
|
|
589
597
|
*/
|
|
590
598
|
|
|
591
599
|
|
|
592
|
-
exports.MarketplaceCSS = function
|
|
593
|
-
var
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
600
|
+
exports.MarketplaceCSS = /*#__PURE__*/function () {
|
|
601
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref14) {
|
|
602
|
+
var marketplaceParams, marketplaceInfo, marketplaceHash;
|
|
603
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
604
|
+
while (1) {
|
|
605
|
+
switch (_context8.prev = _context8.next) {
|
|
606
|
+
case 0:
|
|
607
|
+
marketplaceParams = _ref14.marketplaceParams;
|
|
608
|
+
marketplaceInfo = this.MarketplaceInfo({
|
|
609
|
+
marketplaceParams: marketplaceParams
|
|
610
|
+
});
|
|
611
|
+
marketplaceHash = marketplaceInfo.marketplaceHash;
|
|
603
612
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
613
|
+
if (this.cachedCSS[marketplaceHash]) {
|
|
614
|
+
_context8.next = 7;
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
608
617
|
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
618
|
+
_context8.next = 6;
|
|
619
|
+
return this.client.ContentObjectMetadata({
|
|
620
|
+
versionHash: marketplaceHash,
|
|
621
|
+
metadataSubtree: "public/asset_metadata/info/branding/custom_css",
|
|
622
|
+
authorizationToken: this.publicStaticToken,
|
|
623
|
+
noAuth: true
|
|
624
|
+
});
|
|
616
625
|
|
|
617
|
-
|
|
618
|
-
|
|
626
|
+
case 6:
|
|
627
|
+
this.cachedCSS[marketplaceHash] = _context8.sent;
|
|
619
628
|
|
|
620
|
-
|
|
621
|
-
|
|
629
|
+
case 7:
|
|
630
|
+
return _context8.abrupt("return", this.cachedCSS[marketplaceHash] || "");
|
|
622
631
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
632
|
+
case 8:
|
|
633
|
+
case "end":
|
|
634
|
+
return _context8.stop();
|
|
635
|
+
}
|
|
626
636
|
}
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
|
|
637
|
+
}, _callee8, this);
|
|
638
|
+
}));
|
|
639
|
+
|
|
640
|
+
return function (_x3) {
|
|
641
|
+
return _ref15.apply(this, arguments);
|
|
642
|
+
};
|
|
643
|
+
}();
|
|
630
644
|
/**
|
|
631
645
|
* Retrieve info about all available marketplaces
|
|
632
646
|
*
|
|
@@ -639,18 +653,18 @@ exports.MarketplaceCSS = function _callee8(_ref8) {
|
|
|
639
653
|
*/
|
|
640
654
|
|
|
641
655
|
|
|
642
|
-
exports.AvailableMarketplaces = function _callee9() {
|
|
643
|
-
var
|
|
656
|
+
exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
657
|
+
var _ref17,
|
|
644
658
|
organizeById,
|
|
645
|
-
|
|
659
|
+
_ref17$forceReload,
|
|
646
660
|
forceReload,
|
|
647
661
|
_args9 = arguments;
|
|
648
662
|
|
|
649
|
-
return _regeneratorRuntime.
|
|
663
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
650
664
|
while (1) {
|
|
651
665
|
switch (_context9.prev = _context9.next) {
|
|
652
666
|
case 0:
|
|
653
|
-
|
|
667
|
+
_ref17 = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {}, organizeById = _ref17.organizeById, _ref17$forceReload = _ref17.forceReload, forceReload = _ref17$forceReload === void 0 ? false : _ref17$forceReload;
|
|
654
668
|
|
|
655
669
|
if (!forceReload) {
|
|
656
670
|
_context9.next = 4;
|
|
@@ -658,7 +672,7 @@ exports.AvailableMarketplaces = function _callee9() {
|
|
|
658
672
|
}
|
|
659
673
|
|
|
660
674
|
_context9.next = 4;
|
|
661
|
-
return
|
|
675
|
+
return this.LoadAvailableMarketplaces(true);
|
|
662
676
|
|
|
663
677
|
case 4:
|
|
664
678
|
return _context9.abrupt("return", _objectSpread({}, organizeById ? this.availableMarketplacesById : this.availableMarketplaces));
|
|
@@ -668,8 +682,8 @@ exports.AvailableMarketplaces = function _callee9() {
|
|
|
668
682
|
return _context9.stop();
|
|
669
683
|
}
|
|
670
684
|
}
|
|
671
|
-
},
|
|
672
|
-
};
|
|
685
|
+
}, _callee9, this);
|
|
686
|
+
}));
|
|
673
687
|
/**
|
|
674
688
|
* Retrieve full information about the specified marketplace
|
|
675
689
|
*
|
|
@@ -682,23 +696,28 @@ exports.AvailableMarketplaces = function _callee9() {
|
|
|
682
696
|
* @returns {Promise<Object>} - The full information for the marketplace
|
|
683
697
|
*/
|
|
684
698
|
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
699
|
+
exports.Marketplace = /*#__PURE__*/function () {
|
|
700
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref18) {
|
|
701
|
+
var marketplaceParams;
|
|
702
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
703
|
+
while (1) {
|
|
704
|
+
switch (_context10.prev = _context10.next) {
|
|
705
|
+
case 0:
|
|
706
|
+
marketplaceParams = _ref18.marketplaceParams;
|
|
707
|
+
return _context10.abrupt("return", this.LoadMarketplace(marketplaceParams));
|
|
708
|
+
|
|
709
|
+
case 2:
|
|
710
|
+
case "end":
|
|
711
|
+
return _context10.stop();
|
|
712
|
+
}
|
|
698
713
|
}
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
|
|
714
|
+
}, _callee10, this);
|
|
715
|
+
}));
|
|
716
|
+
|
|
717
|
+
return function (_x4) {
|
|
718
|
+
return _ref19.apply(this, arguments);
|
|
719
|
+
};
|
|
720
|
+
}();
|
|
702
721
|
/* NFTS */
|
|
703
722
|
|
|
704
723
|
/**
|
|
@@ -711,63 +730,129 @@ exports.Marketplace = function _callee10(_ref10) {
|
|
|
711
730
|
*/
|
|
712
731
|
|
|
713
732
|
|
|
714
|
-
exports.NFT = function
|
|
715
|
-
var
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
733
|
+
exports.NFT = /*#__PURE__*/function () {
|
|
734
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref20) {
|
|
735
|
+
var tokenId, contractAddress, nft;
|
|
736
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
737
|
+
while (1) {
|
|
738
|
+
switch (_context11.prev = _context11.next) {
|
|
739
|
+
case 0:
|
|
740
|
+
tokenId = _ref20.tokenId, contractAddress = _ref20.contractAddress;
|
|
741
|
+
_context11.t0 = FormatNFTDetails;
|
|
742
|
+
_context11.next = 4;
|
|
743
|
+
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
744
|
+
path: UrlJoin("as", "nft", "info", contractAddress, tokenId),
|
|
745
|
+
method: "GET"
|
|
746
|
+
}));
|
|
747
|
+
|
|
748
|
+
case 4:
|
|
749
|
+
_context11.t1 = _context11.sent;
|
|
750
|
+
nft = (0, _context11.t0)(_context11.t1);
|
|
751
|
+
_context11.t2 = _objectSpread;
|
|
752
|
+
_context11.t3 = _objectSpread;
|
|
753
|
+
_context11.t4 = {};
|
|
754
|
+
_context11.next = 11;
|
|
755
|
+
return this.client.ContentObjectMetadata({
|
|
756
|
+
versionHash: nft.details.VersionHash,
|
|
757
|
+
metadataSubtree: "public/asset_metadata/nft",
|
|
758
|
+
produceLinkUrls: true
|
|
759
|
+
});
|
|
727
760
|
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
nft = (0, _context11.t0)(_context11.t1);
|
|
731
|
-
_context11.t2 = _objectSpread;
|
|
732
|
-
_context11.t3 = {};
|
|
733
|
-
_context11.next = 10;
|
|
734
|
-
return _regeneratorRuntime.awrap(this.client.ContentObjectMetadata({
|
|
735
|
-
versionHash: nft.details.VersionHash,
|
|
736
|
-
metadataSubtree: "public/asset_metadata/nft",
|
|
737
|
-
produceLinkUrls: true
|
|
738
|
-
}));
|
|
761
|
+
case 11:
|
|
762
|
+
_context11.t5 = _context11.sent;
|
|
739
763
|
|
|
740
|
-
|
|
741
|
-
|
|
764
|
+
if (_context11.t5) {
|
|
765
|
+
_context11.next = 14;
|
|
766
|
+
break;
|
|
767
|
+
}
|
|
742
768
|
|
|
743
|
-
|
|
744
|
-
_context11.next = 13;
|
|
745
|
-
break;
|
|
746
|
-
}
|
|
769
|
+
_context11.t5 = {};
|
|
747
770
|
|
|
748
|
-
|
|
771
|
+
case 14:
|
|
772
|
+
_context11.t6 = _context11.t5;
|
|
773
|
+
_context11.t7 = (0, _context11.t3)(_context11.t4, _context11.t6);
|
|
774
|
+
_context11.t8 = nft.metadata || {};
|
|
775
|
+
nft.metadata = (0, _context11.t2)(_context11.t7, _context11.t8);
|
|
776
|
+
_context11.next = 20;
|
|
777
|
+
return this.TenantConfiguration({
|
|
778
|
+
contractAddress: contractAddress
|
|
779
|
+
});
|
|
749
780
|
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
_context11.t7 = nft.metadata || {};
|
|
754
|
-
nft.metadata = (0, _context11.t2)(_context11.t3, _context11.t5, _context11.t6, _context11.t7);
|
|
755
|
-
_context11.next = 19;
|
|
756
|
-
return _regeneratorRuntime.awrap(this.TenantConfiguration({
|
|
757
|
-
contractAddress: contractAddress
|
|
758
|
-
}));
|
|
781
|
+
case 20:
|
|
782
|
+
nft.config = _context11.sent;
|
|
783
|
+
return _context11.abrupt("return", FormatNFTMetadata(nft));
|
|
759
784
|
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
785
|
+
case 22:
|
|
786
|
+
case "end":
|
|
787
|
+
return _context11.stop();
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
}, _callee11, this);
|
|
791
|
+
}));
|
|
763
792
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
793
|
+
return function (_x5) {
|
|
794
|
+
return _ref21.apply(this, arguments);
|
|
795
|
+
};
|
|
796
|
+
}();
|
|
797
|
+
/**
|
|
798
|
+
* <b><i>Requires login</i></b>
|
|
799
|
+
*
|
|
800
|
+
* Transfer the specified NFT owned by the current user to the specified address
|
|
801
|
+
*
|
|
802
|
+
* @methodGroup NFT
|
|
803
|
+
* @namedParams
|
|
804
|
+
* @param {string} contractAddress - The contract address of the NFT
|
|
805
|
+
* @param {string} tokenId - The token ID of the NFT
|
|
806
|
+
* @param {string} targetAddress - The address to which to transfer the NFT
|
|
807
|
+
*/
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
exports.TransferNFT = /*#__PURE__*/function () {
|
|
811
|
+
var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref22) {
|
|
812
|
+
var contractAddress, tokenId, targetAddress;
|
|
813
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
814
|
+
while (1) {
|
|
815
|
+
switch (_context12.prev = _context12.next) {
|
|
816
|
+
case 0:
|
|
817
|
+
contractAddress = _ref22.contractAddress, tokenId = _ref22.tokenId, targetAddress = _ref22.targetAddress;
|
|
818
|
+
|
|
819
|
+
if (!(!targetAddress || !Utils.ValidAddress(targetAddress))) {
|
|
820
|
+
_context12.next = 3;
|
|
821
|
+
break;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
throw Error("Eluvio Wallet Client: Invalid or missing target address in UserTransferNFT");
|
|
825
|
+
|
|
826
|
+
case 3:
|
|
827
|
+
_context12.next = 5;
|
|
828
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
829
|
+
path: UrlJoin("as", "wlt", "mkt", "xfer"),
|
|
830
|
+
method: "POST",
|
|
831
|
+
body: {
|
|
832
|
+
contract: Utils.FormatAddress(contractAddress),
|
|
833
|
+
token: tokenId,
|
|
834
|
+
to_addr: Utils.FormatAddress(targetAddress)
|
|
835
|
+
},
|
|
836
|
+
headers: {
|
|
837
|
+
Authorization: "Bearer ".concat(this.AuthToken())
|
|
838
|
+
}
|
|
839
|
+
});
|
|
840
|
+
|
|
841
|
+
case 5:
|
|
842
|
+
return _context12.abrupt("return", _context12.sent);
|
|
843
|
+
|
|
844
|
+
case 6:
|
|
845
|
+
case "end":
|
|
846
|
+
return _context12.stop();
|
|
847
|
+
}
|
|
767
848
|
}
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
|
|
849
|
+
}, _callee12, this);
|
|
850
|
+
}));
|
|
851
|
+
|
|
852
|
+
return function (_x6) {
|
|
853
|
+
return _ref23.apply(this, arguments);
|
|
854
|
+
};
|
|
855
|
+
}();
|
|
771
856
|
/** LISTINGS */
|
|
772
857
|
|
|
773
858
|
/**
|
|
@@ -781,52 +866,56 @@ exports.NFT = function _callee11(_ref11) {
|
|
|
781
866
|
*/
|
|
782
867
|
|
|
783
868
|
|
|
784
|
-
exports.ListingStatus = function
|
|
785
|
-
var
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
869
|
+
exports.ListingStatus = /*#__PURE__*/function () {
|
|
870
|
+
var _ref25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref24) {
|
|
871
|
+
var listingId;
|
|
872
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
873
|
+
while (1) {
|
|
874
|
+
switch (_context13.prev = _context13.next) {
|
|
875
|
+
case 0:
|
|
876
|
+
listingId = _ref24.listingId;
|
|
877
|
+
_context13.prev = 1;
|
|
878
|
+
_context13.t0 = Utils;
|
|
879
|
+
_context13.next = 5;
|
|
880
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
881
|
+
path: UrlJoin("as", "mkt", "status", listingId),
|
|
882
|
+
method: "GET"
|
|
883
|
+
});
|
|
799
884
|
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
return _context12.t0.awrap.call(_context12.t0, _context12.t3);
|
|
885
|
+
case 5:
|
|
886
|
+
_context13.t1 = _context13.sent;
|
|
887
|
+
_context13.next = 8;
|
|
888
|
+
return _context13.t0.ResponseToJson.call(_context13.t0, _context13.t1);
|
|
805
889
|
|
|
806
|
-
|
|
807
|
-
|
|
890
|
+
case 8:
|
|
891
|
+
return _context13.abrupt("return", _context13.sent);
|
|
808
892
|
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
893
|
+
case 11:
|
|
894
|
+
_context13.prev = 11;
|
|
895
|
+
_context13.t2 = _context13["catch"](1);
|
|
812
896
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
897
|
+
if (!(_context13.t2.status === 404)) {
|
|
898
|
+
_context13.next = 15;
|
|
899
|
+
break;
|
|
900
|
+
}
|
|
817
901
|
|
|
818
|
-
|
|
902
|
+
return _context13.abrupt("return");
|
|
819
903
|
|
|
820
|
-
|
|
821
|
-
|
|
904
|
+
case 15:
|
|
905
|
+
throw _context13.t2;
|
|
822
906
|
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
907
|
+
case 16:
|
|
908
|
+
case "end":
|
|
909
|
+
return _context13.stop();
|
|
910
|
+
}
|
|
826
911
|
}
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
|
|
912
|
+
}, _callee13, this, [[1, 11]]);
|
|
913
|
+
}));
|
|
914
|
+
|
|
915
|
+
return function (_x7) {
|
|
916
|
+
return _ref25.apply(this, arguments);
|
|
917
|
+
};
|
|
918
|
+
}();
|
|
830
919
|
/**
|
|
831
920
|
* Retrieve a specific listing
|
|
832
921
|
*
|
|
@@ -840,39 +929,43 @@ exports.ListingStatus = function _callee12(_ref12) {
|
|
|
840
929
|
*/
|
|
841
930
|
|
|
842
931
|
|
|
843
|
-
exports.Listing = function
|
|
844
|
-
var
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
932
|
+
exports.Listing = /*#__PURE__*/function () {
|
|
933
|
+
var _ref27 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref26) {
|
|
934
|
+
var listingId;
|
|
935
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
936
|
+
while (1) {
|
|
937
|
+
switch (_context14.prev = _context14.next) {
|
|
938
|
+
case 0:
|
|
939
|
+
listingId = _ref26.listingId;
|
|
940
|
+
_context14.t0 = FormatNFT;
|
|
941
|
+
_context14.t1 = Utils;
|
|
942
|
+
_context14.next = 5;
|
|
943
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
944
|
+
path: UrlJoin("as", "mkt", "l", listingId),
|
|
945
|
+
method: "GET"
|
|
946
|
+
});
|
|
858
947
|
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
return _context13.t1.awrap.call(_context13.t1, _context13.t4);
|
|
948
|
+
case 5:
|
|
949
|
+
_context14.t2 = _context14.sent;
|
|
950
|
+
_context14.next = 8;
|
|
951
|
+
return _context14.t1.ResponseToJson.call(_context14.t1, _context14.t2);
|
|
864
952
|
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
953
|
+
case 8:
|
|
954
|
+
_context14.t3 = _context14.sent;
|
|
955
|
+
return _context14.abrupt("return", (0, _context14.t0)(_context14.t3));
|
|
868
956
|
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
957
|
+
case 10:
|
|
958
|
+
case "end":
|
|
959
|
+
return _context14.stop();
|
|
960
|
+
}
|
|
872
961
|
}
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
|
|
962
|
+
}, _callee14, this);
|
|
963
|
+
}));
|
|
964
|
+
|
|
965
|
+
return function (_x8) {
|
|
966
|
+
return _ref27.apply(this, arguments);
|
|
967
|
+
};
|
|
968
|
+
}();
|
|
876
969
|
/**
|
|
877
970
|
* Retrieve listings matching the specified parameters.
|
|
878
971
|
*
|
|
@@ -906,23 +999,23 @@ exports.Listing = function _callee13(_ref13) {
|
|
|
906
999
|
*/
|
|
907
1000
|
|
|
908
1001
|
|
|
909
|
-
exports.Listings = function
|
|
910
|
-
var
|
|
911
|
-
return _regeneratorRuntime.
|
|
1002
|
+
exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
|
|
1003
|
+
var _args15 = arguments;
|
|
1004
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
912
1005
|
while (1) {
|
|
913
|
-
switch (
|
|
1006
|
+
switch (_context15.prev = _context15.next) {
|
|
914
1007
|
case 0:
|
|
915
|
-
return
|
|
1008
|
+
return _context15.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
916
1009
|
mode: "listings"
|
|
917
|
-
},
|
|
1010
|
+
}, _args15[0] || {})));
|
|
918
1011
|
|
|
919
1012
|
case 1:
|
|
920
1013
|
case "end":
|
|
921
|
-
return
|
|
1014
|
+
return _context15.stop();
|
|
922
1015
|
}
|
|
923
1016
|
}
|
|
924
|
-
},
|
|
925
|
-
};
|
|
1017
|
+
}, _callee15, this);
|
|
1018
|
+
}));
|
|
926
1019
|
/**
|
|
927
1020
|
* Retrieve stats for listings matching the specified parameters.
|
|
928
1021
|
*
|
|
@@ -955,24 +1048,23 @@ exports.Listings = function _callee14() {
|
|
|
955
1048
|
* @returns {Promise<Object>} - Statistics about listings. All prices in USD.
|
|
956
1049
|
*/
|
|
957
1050
|
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
return _regeneratorRuntime.async(function _callee15$(_context15) {
|
|
1051
|
+
exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
|
|
1052
|
+
var _args16 = arguments;
|
|
1053
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
962
1054
|
while (1) {
|
|
963
|
-
switch (
|
|
1055
|
+
switch (_context16.prev = _context16.next) {
|
|
964
1056
|
case 0:
|
|
965
|
-
return
|
|
1057
|
+
return _context16.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
966
1058
|
mode: "listing-stats"
|
|
967
|
-
},
|
|
1059
|
+
}, _args16[0] || {})));
|
|
968
1060
|
|
|
969
1061
|
case 1:
|
|
970
1062
|
case "end":
|
|
971
|
-
return
|
|
1063
|
+
return _context16.stop();
|
|
972
1064
|
}
|
|
973
1065
|
}
|
|
974
|
-
},
|
|
975
|
-
};
|
|
1066
|
+
}, _callee16, this);
|
|
1067
|
+
}));
|
|
976
1068
|
/**
|
|
977
1069
|
* Retrieve sales matching the specified parameters.
|
|
978
1070
|
*
|
|
@@ -1005,24 +1097,23 @@ exports.ListingStats = function _callee15() {
|
|
|
1005
1097
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
1006
1098
|
*/
|
|
1007
1099
|
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
return _regeneratorRuntime.async(function _callee16$(_context16) {
|
|
1100
|
+
exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
|
|
1101
|
+
var _args17 = arguments;
|
|
1102
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
1012
1103
|
while (1) {
|
|
1013
|
-
switch (
|
|
1104
|
+
switch (_context17.prev = _context17.next) {
|
|
1014
1105
|
case 0:
|
|
1015
|
-
return
|
|
1106
|
+
return _context17.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1016
1107
|
mode: "sales"
|
|
1017
|
-
},
|
|
1108
|
+
}, _args17[0] || {})));
|
|
1018
1109
|
|
|
1019
1110
|
case 1:
|
|
1020
1111
|
case "end":
|
|
1021
|
-
return
|
|
1112
|
+
return _context17.stop();
|
|
1022
1113
|
}
|
|
1023
1114
|
}
|
|
1024
|
-
},
|
|
1025
|
-
};
|
|
1115
|
+
}, _callee17, this);
|
|
1116
|
+
}));
|
|
1026
1117
|
/**
|
|
1027
1118
|
* Retrieve stats for listings matching the specified parameters.
|
|
1028
1119
|
*
|
|
@@ -1055,24 +1146,23 @@ exports.Sales = function _callee16() {
|
|
|
1055
1146
|
* @returns {Promise<Object>} - Statistics about sales. All prices in USD.
|
|
1056
1147
|
*/
|
|
1057
1148
|
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
return _regeneratorRuntime.async(function _callee17$(_context17) {
|
|
1149
|
+
exports.SalesStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
|
|
1150
|
+
var _args18 = arguments;
|
|
1151
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
1062
1152
|
while (1) {
|
|
1063
|
-
switch (
|
|
1153
|
+
switch (_context18.prev = _context18.next) {
|
|
1064
1154
|
case 0:
|
|
1065
|
-
return
|
|
1155
|
+
return _context18.abrupt("return", this.FilteredQuery(_objectSpread({
|
|
1066
1156
|
mode: "sales-stats"
|
|
1067
|
-
},
|
|
1157
|
+
}, _args18[0] || {})));
|
|
1068
1158
|
|
|
1069
1159
|
case 1:
|
|
1070
1160
|
case "end":
|
|
1071
|
-
return
|
|
1161
|
+
return _context18.stop();
|
|
1072
1162
|
}
|
|
1073
1163
|
}
|
|
1074
|
-
},
|
|
1075
|
-
};
|
|
1164
|
+
}, _callee18, this);
|
|
1165
|
+
}));
|
|
1076
1166
|
/**
|
|
1077
1167
|
* <b><i>Requires login</i></b>
|
|
1078
1168
|
*
|
|
@@ -1088,78 +1178,79 @@ exports.SalesStats = function _callee17() {
|
|
|
1088
1178
|
* @returns {Promise<string>} - The listing ID of the created listing
|
|
1089
1179
|
*/
|
|
1090
1180
|
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
_context18.t0 = _regeneratorRuntime;
|
|
1107
|
-
_context18.t1 = Utils;
|
|
1108
|
-
_context18.next = 7;
|
|
1109
|
-
return _regeneratorRuntime.awrap(this.client.authClient.MakeAuthServiceRequest({
|
|
1110
|
-
path: UrlJoin("as", "wlt", "mkt"),
|
|
1111
|
-
method: "PUT",
|
|
1112
|
-
body: {
|
|
1113
|
-
id: listingId,
|
|
1114
|
-
price: parseFloat(price)
|
|
1115
|
-
},
|
|
1116
|
-
headers: {
|
|
1117
|
-
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1181
|
+
exports.CreateListing = /*#__PURE__*/function () {
|
|
1182
|
+
var _ref33 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref32) {
|
|
1183
|
+
var contractAddress, tokenId, price, listingId;
|
|
1184
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
1185
|
+
while (1) {
|
|
1186
|
+
switch (_context19.prev = _context19.next) {
|
|
1187
|
+
case 0:
|
|
1188
|
+
contractAddress = _ref32.contractAddress, tokenId = _ref32.tokenId, price = _ref32.price, listingId = _ref32.listingId;
|
|
1189
|
+
contractAddress = Utils.FormatAddress(contractAddress);
|
|
1190
|
+
|
|
1191
|
+
if (!listingId) {
|
|
1192
|
+
_context19.next = 12;
|
|
1193
|
+
break;
|
|
1118
1194
|
}
|
|
1119
|
-
}));
|
|
1120
|
-
|
|
1121
|
-
case 7:
|
|
1122
|
-
_context18.t2 = _context18.sent;
|
|
1123
|
-
_context18.t3 = _context18.t1.ResponseToFormat.call(_context18.t1, "text", _context18.t2);
|
|
1124
|
-
_context18.next = 11;
|
|
1125
|
-
return _context18.t0.awrap.call(_context18.t0, _context18.t3);
|
|
1126
1195
|
|
|
1127
|
-
|
|
1128
|
-
|
|
1196
|
+
_context19.t0 = Utils;
|
|
1197
|
+
_context19.next = 6;
|
|
1198
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
1199
|
+
path: UrlJoin("as", "wlt", "mkt"),
|
|
1200
|
+
method: "PUT",
|
|
1201
|
+
body: {
|
|
1202
|
+
id: listingId,
|
|
1203
|
+
price: parseFloat(price)
|
|
1204
|
+
},
|
|
1205
|
+
headers: {
|
|
1206
|
+
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1207
|
+
}
|
|
1208
|
+
});
|
|
1129
1209
|
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1210
|
+
case 6:
|
|
1211
|
+
_context19.t1 = _context19.sent;
|
|
1212
|
+
_context19.next = 9;
|
|
1213
|
+
return _context19.t0.ResponseToFormat.call(_context19.t0, "text", _context19.t1);
|
|
1214
|
+
|
|
1215
|
+
case 9:
|
|
1216
|
+
return _context19.abrupt("return", _context19.sent);
|
|
1217
|
+
|
|
1218
|
+
case 12:
|
|
1219
|
+
_context19.t2 = Utils;
|
|
1220
|
+
_context19.next = 15;
|
|
1221
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
1222
|
+
path: UrlJoin("as", "wlt", "mkt"),
|
|
1223
|
+
method: "POST",
|
|
1224
|
+
body: {
|
|
1225
|
+
contract: contractAddress,
|
|
1226
|
+
token: tokenId,
|
|
1227
|
+
price: parseFloat(price)
|
|
1228
|
+
},
|
|
1229
|
+
headers: {
|
|
1230
|
+
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1231
|
+
}
|
|
1232
|
+
});
|
|
1146
1233
|
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
return _context18.t4.awrap.call(_context18.t4, _context18.t7);
|
|
1234
|
+
case 15:
|
|
1235
|
+
_context19.t3 = _context19.sent;
|
|
1236
|
+
_context19.next = 18;
|
|
1237
|
+
return _context19.t2.ResponseToJson.call(_context19.t2, _context19.t3);
|
|
1152
1238
|
|
|
1153
|
-
|
|
1154
|
-
|
|
1239
|
+
case 18:
|
|
1240
|
+
return _context19.abrupt("return", _context19.sent);
|
|
1155
1241
|
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1242
|
+
case 19:
|
|
1243
|
+
case "end":
|
|
1244
|
+
return _context19.stop();
|
|
1245
|
+
}
|
|
1159
1246
|
}
|
|
1160
|
-
}
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1247
|
+
}, _callee19, this);
|
|
1248
|
+
}));
|
|
1249
|
+
|
|
1250
|
+
return function (_x9) {
|
|
1251
|
+
return _ref33.apply(this, arguments);
|
|
1252
|
+
};
|
|
1253
|
+
}();
|
|
1163
1254
|
/**
|
|
1164
1255
|
* <b><i>Requires login</i></b>
|
|
1165
1256
|
*
|
|
@@ -1171,29 +1262,35 @@ exports.CreateListing = function _callee18(_ref14) {
|
|
|
1171
1262
|
*/
|
|
1172
1263
|
|
|
1173
1264
|
|
|
1174
|
-
exports.RemoveListing = function
|
|
1175
|
-
var
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1265
|
+
exports.RemoveListing = /*#__PURE__*/function () {
|
|
1266
|
+
var _ref35 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(_ref34) {
|
|
1267
|
+
var listingId;
|
|
1268
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
1269
|
+
while (1) {
|
|
1270
|
+
switch (_context20.prev = _context20.next) {
|
|
1271
|
+
case 0:
|
|
1272
|
+
listingId = _ref34.listingId;
|
|
1273
|
+
_context20.next = 3;
|
|
1274
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
1275
|
+
path: UrlJoin("as", "wlt", "mkt", listingId),
|
|
1276
|
+
method: "DELETE",
|
|
1277
|
+
headers: {
|
|
1278
|
+
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1279
|
+
}
|
|
1280
|
+
});
|
|
1189
1281
|
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1282
|
+
case 3:
|
|
1283
|
+
case "end":
|
|
1284
|
+
return _context20.stop();
|
|
1285
|
+
}
|
|
1193
1286
|
}
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1287
|
+
}, _callee20, this);
|
|
1288
|
+
}));
|
|
1289
|
+
|
|
1290
|
+
return function (_x10) {
|
|
1291
|
+
return _ref35.apply(this, arguments);
|
|
1292
|
+
};
|
|
1293
|
+
}();
|
|
1197
1294
|
/**
|
|
1198
1295
|
* Retrieve all valid names for filtering listings. Full item names are required for filtering listing results by name.
|
|
1199
1296
|
*
|
|
@@ -1207,55 +1304,59 @@ exports.RemoveListing = function _callee19(_ref15) {
|
|
|
1207
1304
|
*/
|
|
1208
1305
|
|
|
1209
1306
|
|
|
1210
|
-
exports.ListingNames = function
|
|
1211
|
-
var
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
if (!marketplaceParams) {
|
|
1219
|
-
_context20.next = 5;
|
|
1220
|
-
break;
|
|
1221
|
-
}
|
|
1307
|
+
exports.ListingNames = /*#__PURE__*/function () {
|
|
1308
|
+
var _ref37 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(_ref36) {
|
|
1309
|
+
var marketplaceParams, tenantId;
|
|
1310
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
1311
|
+
while (1) {
|
|
1312
|
+
switch (_context21.prev = _context21.next) {
|
|
1313
|
+
case 0:
|
|
1314
|
+
marketplaceParams = _ref36.marketplaceParams;
|
|
1222
1315
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1316
|
+
if (!marketplaceParams) {
|
|
1317
|
+
_context21.next = 5;
|
|
1318
|
+
break;
|
|
1319
|
+
}
|
|
1227
1320
|
|
|
1228
|
-
|
|
1229
|
-
|
|
1321
|
+
_context21.next = 4;
|
|
1322
|
+
return this.MarketplaceInfo({
|
|
1323
|
+
marketplaceParams: marketplaceParams
|
|
1324
|
+
});
|
|
1230
1325
|
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1326
|
+
case 4:
|
|
1327
|
+
tenantId = _context21.sent.tenantId;
|
|
1328
|
+
|
|
1329
|
+
case 5:
|
|
1330
|
+
_context21.t0 = Utils;
|
|
1331
|
+
_context21.next = 8;
|
|
1332
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
1333
|
+
path: UrlJoin("as", "mkt", "names"),
|
|
1334
|
+
method: "GET",
|
|
1335
|
+
queryParams: tenantId ? {
|
|
1336
|
+
filter: "tenant:eq:".concat(tenantId)
|
|
1337
|
+
} : {}
|
|
1338
|
+
});
|
|
1242
1339
|
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
return _context20.t0.awrap.call(_context20.t0, _context20.t3);
|
|
1340
|
+
case 8:
|
|
1341
|
+
_context21.t1 = _context21.sent;
|
|
1342
|
+
_context21.next = 11;
|
|
1343
|
+
return _context21.t0.ResponseToJson.call(_context21.t0, _context21.t1);
|
|
1248
1344
|
|
|
1249
|
-
|
|
1250
|
-
|
|
1345
|
+
case 11:
|
|
1346
|
+
return _context21.abrupt("return", _context21.sent);
|
|
1251
1347
|
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1348
|
+
case 12:
|
|
1349
|
+
case "end":
|
|
1350
|
+
return _context21.stop();
|
|
1351
|
+
}
|
|
1255
1352
|
}
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1353
|
+
}, _callee21, this);
|
|
1354
|
+
}));
|
|
1355
|
+
|
|
1356
|
+
return function (_x11) {
|
|
1357
|
+
return _ref37.apply(this, arguments);
|
|
1358
|
+
};
|
|
1359
|
+
}();
|
|
1259
1360
|
/**
|
|
1260
1361
|
* Retrieve all valid edition names of the specified item. Full item edition names are required for filtering listing results by edition.
|
|
1261
1362
|
*
|
|
@@ -1267,40 +1368,44 @@ exports.ListingNames = function _callee20(_ref16) {
|
|
|
1267
1368
|
*/
|
|
1268
1369
|
|
|
1269
1370
|
|
|
1270
|
-
exports.ListingEditionNames = function
|
|
1271
|
-
var
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1371
|
+
exports.ListingEditionNames = /*#__PURE__*/function () {
|
|
1372
|
+
var _ref39 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(_ref38) {
|
|
1373
|
+
var displayName;
|
|
1374
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
1375
|
+
while (1) {
|
|
1376
|
+
switch (_context22.prev = _context22.next) {
|
|
1377
|
+
case 0:
|
|
1378
|
+
displayName = _ref38.displayName;
|
|
1379
|
+
_context22.t0 = Utils;
|
|
1380
|
+
_context22.next = 4;
|
|
1381
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
1382
|
+
path: UrlJoin("as", "mkt", "editions"),
|
|
1383
|
+
queryParams: {
|
|
1384
|
+
filter: "nft/display_name:eq:".concat(displayName)
|
|
1385
|
+
},
|
|
1386
|
+
method: "GET"
|
|
1387
|
+
});
|
|
1287
1388
|
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
return _context21.t0.awrap.call(_context21.t0, _context21.t3);
|
|
1389
|
+
case 4:
|
|
1390
|
+
_context22.t1 = _context22.sent;
|
|
1391
|
+
_context22.next = 7;
|
|
1392
|
+
return _context22.t0.ResponseToJson.call(_context22.t0, _context22.t1);
|
|
1293
1393
|
|
|
1294
|
-
|
|
1295
|
-
|
|
1394
|
+
case 7:
|
|
1395
|
+
return _context22.abrupt("return", _context22.sent);
|
|
1296
1396
|
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1397
|
+
case 8:
|
|
1398
|
+
case "end":
|
|
1399
|
+
return _context22.stop();
|
|
1400
|
+
}
|
|
1300
1401
|
}
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1402
|
+
}, _callee22, this);
|
|
1403
|
+
}));
|
|
1404
|
+
|
|
1405
|
+
return function (_x12) {
|
|
1406
|
+
return _ref39.apply(this, arguments);
|
|
1407
|
+
};
|
|
1408
|
+
}();
|
|
1304
1409
|
/**
|
|
1305
1410
|
* Retrieve names of all valid attributes for listed tiems. Full attribute names and values are required for filtering listing results by attributes.
|
|
1306
1411
|
*
|
|
@@ -1315,82 +1420,80 @@ exports.ListingEditionNames = function _callee21(_ref17) {
|
|
|
1315
1420
|
*/
|
|
1316
1421
|
|
|
1317
1422
|
|
|
1318
|
-
exports.ListingAttributes = function
|
|
1319
|
-
var
|
|
1423
|
+
exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
|
|
1424
|
+
var _ref41,
|
|
1320
1425
|
marketplaceParams,
|
|
1321
1426
|
displayName,
|
|
1322
1427
|
filters,
|
|
1323
1428
|
attributes,
|
|
1324
|
-
|
|
1429
|
+
_args23 = arguments;
|
|
1325
1430
|
|
|
1326
|
-
return _regeneratorRuntime.
|
|
1431
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
1327
1432
|
while (1) {
|
|
1328
|
-
switch (
|
|
1433
|
+
switch (_context23.prev = _context23.next) {
|
|
1329
1434
|
case 0:
|
|
1330
|
-
|
|
1435
|
+
_ref41 = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {}, marketplaceParams = _ref41.marketplaceParams, displayName = _ref41.displayName;
|
|
1331
1436
|
filters = [];
|
|
1332
1437
|
|
|
1333
1438
|
if (!marketplaceParams) {
|
|
1334
|
-
|
|
1439
|
+
_context23.next = 10;
|
|
1335
1440
|
break;
|
|
1336
1441
|
}
|
|
1337
1442
|
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
return
|
|
1443
|
+
_context23.t0 = filters;
|
|
1444
|
+
_context23.t1 = "tenant:eq:";
|
|
1445
|
+
_context23.next = 7;
|
|
1446
|
+
return this.MarketplaceInfo({
|
|
1342
1447
|
marketplaceParams: marketplaceParams
|
|
1343
|
-
})
|
|
1448
|
+
});
|
|
1344
1449
|
|
|
1345
1450
|
case 7:
|
|
1346
|
-
|
|
1347
|
-
|
|
1451
|
+
_context23.t2 = _context23.sent.tenantId;
|
|
1452
|
+
_context23.t3 = _context23.t1.concat.call(_context23.t1, _context23.t2);
|
|
1348
1453
|
|
|
1349
|
-
|
|
1454
|
+
_context23.t0.push.call(_context23.t0, _context23.t3);
|
|
1350
1455
|
|
|
1351
1456
|
case 10:
|
|
1352
1457
|
if (displayName) {
|
|
1353
1458
|
filters.push("nft/display_name:eq:".concat(displayName));
|
|
1354
1459
|
}
|
|
1355
1460
|
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
return _regeneratorRuntime.awrap(this.client.authClient.MakeAuthServiceRequest({
|
|
1461
|
+
_context23.t4 = Utils;
|
|
1462
|
+
_context23.next = 14;
|
|
1463
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
1360
1464
|
path: UrlJoin("as", "mkt", "attributes"),
|
|
1361
1465
|
method: "GET",
|
|
1362
1466
|
queryParams: {
|
|
1363
1467
|
filter: filters
|
|
1364
1468
|
}
|
|
1365
|
-
})
|
|
1469
|
+
});
|
|
1366
1470
|
|
|
1367
|
-
case
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
return _context22.t4.awrap.call(_context22.t4, _context22.t7);
|
|
1471
|
+
case 14:
|
|
1472
|
+
_context23.t5 = _context23.sent;
|
|
1473
|
+
_context23.next = 17;
|
|
1474
|
+
return _context23.t4.ResponseToJson.call(_context23.t4, _context23.t5);
|
|
1372
1475
|
|
|
1373
|
-
case
|
|
1374
|
-
attributes =
|
|
1375
|
-
return
|
|
1376
|
-
var trait_type =
|
|
1377
|
-
values =
|
|
1476
|
+
case 17:
|
|
1477
|
+
attributes = _context23.sent;
|
|
1478
|
+
return _context23.abrupt("return", attributes.map(function (_ref42) {
|
|
1479
|
+
var trait_type = _ref42.trait_type,
|
|
1480
|
+
values = _ref42.values;
|
|
1378
1481
|
return {
|
|
1379
1482
|
name: trait_type,
|
|
1380
1483
|
values: values
|
|
1381
1484
|
};
|
|
1382
|
-
}).filter(function (
|
|
1383
|
-
var name =
|
|
1485
|
+
}).filter(function (_ref43) {
|
|
1486
|
+
var name = _ref43.name;
|
|
1384
1487
|
return !["Content Fabric Hash", "Total Minted Supply", "Creator"].includes(name);
|
|
1385
1488
|
}));
|
|
1386
1489
|
|
|
1387
|
-
case
|
|
1490
|
+
case 19:
|
|
1388
1491
|
case "end":
|
|
1389
|
-
return
|
|
1492
|
+
return _context23.stop();
|
|
1390
1493
|
}
|
|
1391
1494
|
}
|
|
1392
|
-
},
|
|
1393
|
-
};
|
|
1495
|
+
}, _callee23, this);
|
|
1496
|
+
}));
|
|
1394
1497
|
/* MINTING STATUS */
|
|
1395
1498
|
|
|
1396
1499
|
/**
|
|
@@ -1404,59 +1507,64 @@ exports.ListingAttributes = function _callee22() {
|
|
|
1404
1507
|
* @returns {Promise<Object>} - The status of the purchase
|
|
1405
1508
|
*/
|
|
1406
1509
|
|
|
1510
|
+
exports.ListingPurchaseStatus = /*#__PURE__*/function () {
|
|
1511
|
+
var _ref45 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(_ref44) {
|
|
1512
|
+
var listingId, confirmationId, listingStatus, statuses;
|
|
1513
|
+
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
1514
|
+
while (1) {
|
|
1515
|
+
switch (_context24.prev = _context24.next) {
|
|
1516
|
+
case 0:
|
|
1517
|
+
listingId = _ref44.listingId, confirmationId = _ref44.confirmationId;
|
|
1518
|
+
_context24.prev = 1;
|
|
1519
|
+
_context24.next = 4;
|
|
1520
|
+
return this.ListingStatus({
|
|
1521
|
+
listingId: listingId
|
|
1522
|
+
});
|
|
1407
1523
|
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
return _regeneratorRuntime.async(function _callee23$(_context23) {
|
|
1411
|
-
while (1) {
|
|
1412
|
-
switch (_context23.prev = _context23.next) {
|
|
1413
|
-
case 0:
|
|
1414
|
-
listingId = _ref21.listingId, confirmationId = _ref21.confirmationId;
|
|
1415
|
-
_context23.prev = 1;
|
|
1416
|
-
_context23.next = 4;
|
|
1417
|
-
return _regeneratorRuntime.awrap(this.ListingStatus({
|
|
1418
|
-
listingId: listingId
|
|
1419
|
-
}));
|
|
1420
|
-
|
|
1421
|
-
case 4:
|
|
1422
|
-
listingStatus = _context23.sent;
|
|
1524
|
+
case 4:
|
|
1525
|
+
listingStatus = _context24.sent;
|
|
1423
1526
|
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1527
|
+
if (listingStatus) {
|
|
1528
|
+
_context24.next = 7;
|
|
1529
|
+
break;
|
|
1530
|
+
}
|
|
1428
1531
|
|
|
1429
|
-
|
|
1532
|
+
throw Error("Unable to find info for listing " + listingId);
|
|
1430
1533
|
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1534
|
+
case 7:
|
|
1535
|
+
_context24.next = 9;
|
|
1536
|
+
return this.MintingStatus({
|
|
1537
|
+
tenantId: listingStatus.tenant
|
|
1538
|
+
});
|
|
1436
1539
|
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1540
|
+
case 9:
|
|
1541
|
+
statuses = _context24.sent;
|
|
1542
|
+
return _context24.abrupt("return", statuses.find(function (status) {
|
|
1543
|
+
return status.op === "nft-transfer" && status.extra && status.extra[0] === confirmationId;
|
|
1544
|
+
}) || {
|
|
1545
|
+
status: "none"
|
|
1546
|
+
});
|
|
1444
1547
|
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1548
|
+
case 13:
|
|
1549
|
+
_context24.prev = 13;
|
|
1550
|
+
_context24.t0 = _context24["catch"](1);
|
|
1551
|
+
this.Log(_context24.t0, true);
|
|
1552
|
+
return _context24.abrupt("return", {
|
|
1553
|
+
status: "unknown"
|
|
1554
|
+
});
|
|
1452
1555
|
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1556
|
+
case 17:
|
|
1557
|
+
case "end":
|
|
1558
|
+
return _context24.stop();
|
|
1559
|
+
}
|
|
1456
1560
|
}
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1561
|
+
}, _callee24, this, [[1, 13]]);
|
|
1562
|
+
}));
|
|
1563
|
+
|
|
1564
|
+
return function (_x13) {
|
|
1565
|
+
return _ref45.apply(this, arguments);
|
|
1566
|
+
};
|
|
1567
|
+
}();
|
|
1460
1568
|
/**
|
|
1461
1569
|
* Return status of the specified marketplace purchase
|
|
1462
1570
|
*
|
|
@@ -1469,49 +1577,55 @@ exports.ListingPurchaseStatus = function _callee23(_ref21) {
|
|
|
1469
1577
|
*/
|
|
1470
1578
|
|
|
1471
1579
|
|
|
1472
|
-
exports.PurchaseStatus = function
|
|
1473
|
-
var
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1580
|
+
exports.PurchaseStatus = /*#__PURE__*/function () {
|
|
1581
|
+
var _ref47 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref46) {
|
|
1582
|
+
var marketplaceParams, confirmationId, marketplaceInfo, statuses;
|
|
1583
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
1584
|
+
while (1) {
|
|
1585
|
+
switch (_context25.prev = _context25.next) {
|
|
1586
|
+
case 0:
|
|
1587
|
+
marketplaceParams = _ref46.marketplaceParams, confirmationId = _ref46.confirmationId;
|
|
1588
|
+
_context25.prev = 1;
|
|
1589
|
+
_context25.next = 4;
|
|
1590
|
+
return this.MarketplaceInfo({
|
|
1591
|
+
marketplaceParams: marketplaceParams
|
|
1592
|
+
});
|
|
1484
1593
|
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1594
|
+
case 4:
|
|
1595
|
+
marketplaceInfo = _context25.sent;
|
|
1596
|
+
_context25.next = 7;
|
|
1597
|
+
return this.MintingStatus({
|
|
1598
|
+
tenantId: marketplaceInfo.tenant_id
|
|
1599
|
+
});
|
|
1491
1600
|
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1601
|
+
case 7:
|
|
1602
|
+
statuses = _context25.sent;
|
|
1603
|
+
return _context25.abrupt("return", statuses.find(function (status) {
|
|
1604
|
+
return status.op === "nft-buy" && status.confirmationId === confirmationId;
|
|
1605
|
+
}) || {
|
|
1606
|
+
status: "none"
|
|
1607
|
+
});
|
|
1499
1608
|
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1609
|
+
case 11:
|
|
1610
|
+
_context25.prev = 11;
|
|
1611
|
+
_context25.t0 = _context25["catch"](1);
|
|
1612
|
+
this.Log(_context25.t0, true);
|
|
1613
|
+
return _context25.abrupt("return", {
|
|
1614
|
+
status: "unknown"
|
|
1615
|
+
});
|
|
1507
1616
|
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1617
|
+
case 15:
|
|
1618
|
+
case "end":
|
|
1619
|
+
return _context25.stop();
|
|
1620
|
+
}
|
|
1511
1621
|
}
|
|
1512
|
-
}
|
|
1513
|
-
}
|
|
1514
|
-
|
|
1622
|
+
}, _callee25, this, [[1, 11]]);
|
|
1623
|
+
}));
|
|
1624
|
+
|
|
1625
|
+
return function (_x14) {
|
|
1626
|
+
return _ref47.apply(this, arguments);
|
|
1627
|
+
};
|
|
1628
|
+
}();
|
|
1515
1629
|
/**
|
|
1516
1630
|
* Return status of the specified item claim
|
|
1517
1631
|
*
|
|
@@ -1524,49 +1638,55 @@ exports.PurchaseStatus = function _callee24(_ref22) {
|
|
|
1524
1638
|
*/
|
|
1525
1639
|
|
|
1526
1640
|
|
|
1527
|
-
exports.ClaimStatus = function
|
|
1528
|
-
var
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1641
|
+
exports.ClaimStatus = /*#__PURE__*/function () {
|
|
1642
|
+
var _ref49 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(_ref48) {
|
|
1643
|
+
var marketplaceParams, sku, marketplaceInfo, statuses;
|
|
1644
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
1645
|
+
while (1) {
|
|
1646
|
+
switch (_context26.prev = _context26.next) {
|
|
1647
|
+
case 0:
|
|
1648
|
+
marketplaceParams = _ref48.marketplaceParams, sku = _ref48.sku;
|
|
1649
|
+
_context26.prev = 1;
|
|
1650
|
+
_context26.next = 4;
|
|
1651
|
+
return this.MarketplaceInfo({
|
|
1652
|
+
marketplaceParams: marketplaceParams
|
|
1653
|
+
});
|
|
1539
1654
|
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1655
|
+
case 4:
|
|
1656
|
+
marketplaceInfo = _context26.sent;
|
|
1657
|
+
_context26.next = 7;
|
|
1658
|
+
return this.MintingStatus({
|
|
1659
|
+
tenantId: marketplaceInfo.tenantId
|
|
1660
|
+
});
|
|
1546
1661
|
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1662
|
+
case 7:
|
|
1663
|
+
statuses = _context26.sent;
|
|
1664
|
+
return _context26.abrupt("return", statuses.find(function (status) {
|
|
1665
|
+
return status.op === "nft-claim" && status.marketplaceId === marketplaceInfo.marketplaceId && status.confirmationId === sku;
|
|
1666
|
+
}) || {
|
|
1667
|
+
status: "none"
|
|
1668
|
+
});
|
|
1554
1669
|
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1670
|
+
case 11:
|
|
1671
|
+
_context26.prev = 11;
|
|
1672
|
+
_context26.t0 = _context26["catch"](1);
|
|
1673
|
+
this.Log(_context26.t0, true);
|
|
1674
|
+
return _context26.abrupt("return", {
|
|
1675
|
+
status: "unknown"
|
|
1676
|
+
});
|
|
1562
1677
|
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1678
|
+
case 15:
|
|
1679
|
+
case "end":
|
|
1680
|
+
return _context26.stop();
|
|
1681
|
+
}
|
|
1566
1682
|
}
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
|
|
1683
|
+
}, _callee26, this, [[1, 11]]);
|
|
1684
|
+
}));
|
|
1685
|
+
|
|
1686
|
+
return function (_x15) {
|
|
1687
|
+
return _ref49.apply(this, arguments);
|
|
1688
|
+
};
|
|
1689
|
+
}();
|
|
1570
1690
|
/**
|
|
1571
1691
|
* Return status of the specified pack opening
|
|
1572
1692
|
*
|
|
@@ -1579,49 +1699,55 @@ exports.ClaimStatus = function _callee25(_ref23) {
|
|
|
1579
1699
|
*/
|
|
1580
1700
|
|
|
1581
1701
|
|
|
1582
|
-
exports.PackOpenStatus = function
|
|
1583
|
-
var
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1702
|
+
exports.PackOpenStatus = /*#__PURE__*/function () {
|
|
1703
|
+
var _ref51 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(_ref50) {
|
|
1704
|
+
var contractAddress, tokenId, tenantConfig, statuses;
|
|
1705
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
1706
|
+
while (1) {
|
|
1707
|
+
switch (_context27.prev = _context27.next) {
|
|
1708
|
+
case 0:
|
|
1709
|
+
contractAddress = _ref50.contractAddress, tokenId = _ref50.tokenId;
|
|
1710
|
+
_context27.prev = 1;
|
|
1711
|
+
_context27.next = 4;
|
|
1712
|
+
return this.TenantConfiguration({
|
|
1713
|
+
contractAddress: contractAddress
|
|
1714
|
+
});
|
|
1594
1715
|
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1716
|
+
case 4:
|
|
1717
|
+
tenantConfig = _context27.sent;
|
|
1718
|
+
_context27.next = 7;
|
|
1719
|
+
return this.MintingStatus({
|
|
1720
|
+
tenantId: tenantConfig.tenant
|
|
1721
|
+
});
|
|
1601
1722
|
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1723
|
+
case 7:
|
|
1724
|
+
statuses = _context27.sent;
|
|
1725
|
+
return _context27.abrupt("return", statuses.find(function (status) {
|
|
1726
|
+
return status.op === "nft-open" && Utils.EqualAddress(contractAddress, status.address) && status.tokenId === tokenId;
|
|
1727
|
+
}) || {
|
|
1728
|
+
status: "none"
|
|
1729
|
+
});
|
|
1609
1730
|
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1731
|
+
case 11:
|
|
1732
|
+
_context27.prev = 11;
|
|
1733
|
+
_context27.t0 = _context27["catch"](1);
|
|
1734
|
+
this.Log(_context27.t0, true);
|
|
1735
|
+
return _context27.abrupt("return", {
|
|
1736
|
+
status: "unknown"
|
|
1737
|
+
});
|
|
1617
1738
|
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1739
|
+
case 15:
|
|
1740
|
+
case "end":
|
|
1741
|
+
return _context27.stop();
|
|
1742
|
+
}
|
|
1621
1743
|
}
|
|
1622
|
-
}
|
|
1623
|
-
}
|
|
1624
|
-
|
|
1744
|
+
}, _callee27, this, [[1, 11]]);
|
|
1745
|
+
}));
|
|
1746
|
+
|
|
1747
|
+
return function (_x16) {
|
|
1748
|
+
return _ref51.apply(this, arguments);
|
|
1749
|
+
};
|
|
1750
|
+
}();
|
|
1625
1751
|
/**
|
|
1626
1752
|
* Return status of the specified collection redemption
|
|
1627
1753
|
*
|
|
@@ -1634,195 +1760,219 @@ exports.PackOpenStatus = function _callee26(_ref24) {
|
|
|
1634
1760
|
*/
|
|
1635
1761
|
|
|
1636
1762
|
|
|
1637
|
-
exports.CollectionRedemptionStatus = function
|
|
1638
|
-
var
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1763
|
+
exports.CollectionRedemptionStatus = /*#__PURE__*/function () {
|
|
1764
|
+
var _ref53 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(_ref52) {
|
|
1765
|
+
var marketplaceParams, confirmationId, statuses;
|
|
1766
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
1767
|
+
while (1) {
|
|
1768
|
+
switch (_context28.prev = _context28.next) {
|
|
1769
|
+
case 0:
|
|
1770
|
+
marketplaceParams = _ref52.marketplaceParams, confirmationId = _ref52.confirmationId;
|
|
1771
|
+
_context28.prev = 1;
|
|
1772
|
+
_context28.next = 4;
|
|
1773
|
+
return this.MintingStatus({
|
|
1774
|
+
marketplaceParams: marketplaceParams
|
|
1775
|
+
});
|
|
1649
1776
|
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1777
|
+
case 4:
|
|
1778
|
+
statuses = _context28.sent;
|
|
1779
|
+
return _context28.abrupt("return", statuses.find(function (status) {
|
|
1780
|
+
return status.op === "nft-redeem" && status.confirmationId === confirmationId;
|
|
1781
|
+
}) || {
|
|
1782
|
+
status: "none"
|
|
1783
|
+
});
|
|
1657
1784
|
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1785
|
+
case 8:
|
|
1786
|
+
_context28.prev = 8;
|
|
1787
|
+
_context28.t0 = _context28["catch"](1);
|
|
1788
|
+
this.Log(_context28.t0, true);
|
|
1789
|
+
return _context28.abrupt("return", {
|
|
1790
|
+
status: "unknown"
|
|
1791
|
+
});
|
|
1665
1792
|
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1793
|
+
case 12:
|
|
1794
|
+
case "end":
|
|
1795
|
+
return _context28.stop();
|
|
1796
|
+
}
|
|
1669
1797
|
}
|
|
1670
|
-
}
|
|
1671
|
-
}
|
|
1672
|
-
|
|
1798
|
+
}, _callee28, this, [[1, 8]]);
|
|
1799
|
+
}));
|
|
1800
|
+
|
|
1801
|
+
return function (_x17) {
|
|
1802
|
+
return _ref53.apply(this, arguments);
|
|
1803
|
+
};
|
|
1804
|
+
}();
|
|
1673
1805
|
/* EVENTS */
|
|
1674
1806
|
|
|
1675
1807
|
|
|
1676
|
-
exports.LoadDrop = function
|
|
1677
|
-
var
|
|
1808
|
+
exports.LoadDrop = /*#__PURE__*/function () {
|
|
1809
|
+
var _ref55 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(_ref54) {
|
|
1810
|
+
var _this2 = this;
|
|
1678
1811
|
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1812
|
+
var tenantSlug, eventSlug, dropId, mainSiteHash, event, eventId;
|
|
1813
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
1814
|
+
while (1) {
|
|
1815
|
+
switch (_context29.prev = _context29.next) {
|
|
1816
|
+
case 0:
|
|
1817
|
+
tenantSlug = _ref54.tenantSlug, eventSlug = _ref54.eventSlug, dropId = _ref54.dropId;
|
|
1685
1818
|
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1819
|
+
if (!this.drops) {
|
|
1820
|
+
this.drops = {};
|
|
1821
|
+
}
|
|
1689
1822
|
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1823
|
+
if (!this.drops[tenantSlug]) {
|
|
1824
|
+
this.drops[tenantSlug] = {};
|
|
1825
|
+
}
|
|
1693
1826
|
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1827
|
+
if (!this.drops[tenantSlug][eventSlug]) {
|
|
1828
|
+
this.drops[tenantSlug][eventSlug] = {};
|
|
1829
|
+
}
|
|
1697
1830
|
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1831
|
+
if (this.drops[tenantSlug][eventSlug][dropId]) {
|
|
1832
|
+
_context29.next = 16;
|
|
1833
|
+
break;
|
|
1834
|
+
}
|
|
1702
1835
|
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1836
|
+
_context29.next = 7;
|
|
1837
|
+
return this.client.LatestVersionHash({
|
|
1838
|
+
objectId: this.mainSiteId
|
|
1839
|
+
});
|
|
1707
1840
|
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1841
|
+
case 7:
|
|
1842
|
+
mainSiteHash = _context29.sent;
|
|
1843
|
+
_context29.next = 10;
|
|
1844
|
+
return this.client.ContentObjectMetadata({
|
|
1845
|
+
versionHash: mainSiteHash,
|
|
1846
|
+
metadataSubtree: UrlJoin("public", "asset_metadata", "tenants", tenantSlug, "sites", eventSlug, "info"),
|
|
1847
|
+
resolveLinks: true,
|
|
1848
|
+
linkDepthLimit: 2,
|
|
1849
|
+
resolveIncludeSource: true,
|
|
1850
|
+
produceLinkUrls: true,
|
|
1851
|
+
select: [".", "drops"],
|
|
1852
|
+
noAuth: true
|
|
1853
|
+
});
|
|
1721
1854
|
|
|
1722
|
-
|
|
1723
|
-
|
|
1855
|
+
case 10:
|
|
1856
|
+
_context29.t0 = _context29.sent;
|
|
1724
1857
|
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1858
|
+
if (_context29.t0) {
|
|
1859
|
+
_context29.next = 13;
|
|
1860
|
+
break;
|
|
1861
|
+
}
|
|
1729
1862
|
|
|
1730
|
-
|
|
1863
|
+
_context29.t0 = [];
|
|
1731
1864
|
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1865
|
+
case 13:
|
|
1866
|
+
event = _context29.t0;
|
|
1867
|
+
eventId = Utils.DecodeVersionHash(event["."].source).objectId;
|
|
1868
|
+
event.drops.forEach(function (drop) {
|
|
1869
|
+
drop = _objectSpread(_objectSpread({}, drop), {}, {
|
|
1870
|
+
eventId: eventId
|
|
1871
|
+
});
|
|
1872
|
+
_this2.drops[tenantSlug][eventSlug][drop.uuid] = drop;
|
|
1873
|
+
_this2.drops[drop.uuid] = drop;
|
|
1738
1874
|
});
|
|
1739
|
-
_this2.drops[tenantSlug][eventSlug][drop.uuid] = drop;
|
|
1740
|
-
_this2.drops[drop.uuid] = drop;
|
|
1741
|
-
});
|
|
1742
1875
|
|
|
1743
|
-
|
|
1744
|
-
|
|
1876
|
+
case 16:
|
|
1877
|
+
return _context29.abrupt("return", this.drops[dropId]);
|
|
1745
1878
|
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1879
|
+
case 17:
|
|
1880
|
+
case "end":
|
|
1881
|
+
return _context29.stop();
|
|
1882
|
+
}
|
|
1749
1883
|
}
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
};
|
|
1884
|
+
}, _callee29, this);
|
|
1885
|
+
}));
|
|
1753
1886
|
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1887
|
+
return function (_x18) {
|
|
1888
|
+
return _ref55.apply(this, arguments);
|
|
1889
|
+
};
|
|
1890
|
+
}();
|
|
1891
|
+
|
|
1892
|
+
exports.SubmitDropVote = /*#__PURE__*/function () {
|
|
1893
|
+
var _ref57 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(_ref56) {
|
|
1894
|
+
var marketplaceParams, eventId, dropId, sku, marketplaceInfo;
|
|
1895
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
1896
|
+
while (1) {
|
|
1897
|
+
switch (_context30.prev = _context30.next) {
|
|
1898
|
+
case 0:
|
|
1899
|
+
marketplaceParams = _ref56.marketplaceParams, eventId = _ref56.eventId, dropId = _ref56.dropId, sku = _ref56.sku;
|
|
1900
|
+
_context30.next = 3;
|
|
1901
|
+
return this.MarketplaceInfo({
|
|
1902
|
+
marketplaceParams: marketplaceParams
|
|
1903
|
+
});
|
|
1765
1904
|
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1905
|
+
case 3:
|
|
1906
|
+
marketplaceInfo = _context30.sent;
|
|
1907
|
+
_context30.next = 6;
|
|
1908
|
+
return this.client.authClient.MakeAuthServiceRequest({
|
|
1909
|
+
path: UrlJoin("as", "wlt", "act", marketplaceInfo.tenant_id),
|
|
1910
|
+
method: "POST",
|
|
1911
|
+
body: {
|
|
1912
|
+
op: "vote-drop",
|
|
1913
|
+
evt: eventId,
|
|
1914
|
+
id: dropId,
|
|
1915
|
+
itm: sku
|
|
1916
|
+
},
|
|
1917
|
+
headers: {
|
|
1918
|
+
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1919
|
+
}
|
|
1920
|
+
});
|
|
1782
1921
|
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1922
|
+
case 6:
|
|
1923
|
+
case "end":
|
|
1924
|
+
return _context30.stop();
|
|
1925
|
+
}
|
|
1786
1926
|
}
|
|
1787
|
-
}
|
|
1788
|
-
}
|
|
1789
|
-
};
|
|
1790
|
-
|
|
1791
|
-
exports.DropStatus = function _callee30(_ref28) {
|
|
1792
|
-
var marketplace, eventId, dropId, response;
|
|
1793
|
-
return _regeneratorRuntime.async(function _callee30$(_context30) {
|
|
1794
|
-
while (1) {
|
|
1795
|
-
switch (_context30.prev = _context30.next) {
|
|
1796
|
-
case 0:
|
|
1797
|
-
marketplace = _ref28.marketplace, eventId = _ref28.eventId, dropId = _ref28.dropId;
|
|
1798
|
-
_context30.prev = 1;
|
|
1799
|
-
_context30.next = 4;
|
|
1800
|
-
return _regeneratorRuntime.awrap(Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
1801
|
-
path: UrlJoin("as", "wlt", "act", marketplace.tenant_id, eventId, dropId),
|
|
1802
|
-
method: "GET",
|
|
1803
|
-
headers: {
|
|
1804
|
-
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1805
|
-
}
|
|
1806
|
-
})));
|
|
1927
|
+
}, _callee30, this);
|
|
1928
|
+
}));
|
|
1807
1929
|
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1930
|
+
return function (_x19) {
|
|
1931
|
+
return _ref57.apply(this, arguments);
|
|
1932
|
+
};
|
|
1933
|
+
}();
|
|
1934
|
+
|
|
1935
|
+
exports.DropStatus = /*#__PURE__*/function () {
|
|
1936
|
+
var _ref59 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(_ref58) {
|
|
1937
|
+
var marketplace, eventId, dropId, response;
|
|
1938
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
1939
|
+
while (1) {
|
|
1940
|
+
switch (_context31.prev = _context31.next) {
|
|
1941
|
+
case 0:
|
|
1942
|
+
marketplace = _ref58.marketplace, eventId = _ref58.eventId, dropId = _ref58.dropId;
|
|
1943
|
+
_context31.prev = 1;
|
|
1944
|
+
_context31.next = 4;
|
|
1945
|
+
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
1946
|
+
path: UrlJoin("as", "wlt", "act", marketplace.tenant_id, eventId, dropId),
|
|
1947
|
+
method: "GET",
|
|
1948
|
+
headers: {
|
|
1949
|
+
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1950
|
+
}
|
|
1951
|
+
}));
|
|
1952
|
+
|
|
1953
|
+
case 4:
|
|
1954
|
+
response = _context31.sent;
|
|
1955
|
+
return _context31.abrupt("return", response.sort(function (a, b) {
|
|
1956
|
+
return a.ts > b.ts ? 1 : -1;
|
|
1957
|
+
})[0] || {
|
|
1958
|
+
status: "none"
|
|
1959
|
+
});
|
|
1815
1960
|
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1961
|
+
case 8:
|
|
1962
|
+
_context31.prev = 8;
|
|
1963
|
+
_context31.t0 = _context31["catch"](1);
|
|
1964
|
+
this.Log(_context31.t0, true);
|
|
1965
|
+
return _context31.abrupt("return", "");
|
|
1821
1966
|
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1967
|
+
case 12:
|
|
1968
|
+
case "end":
|
|
1969
|
+
return _context31.stop();
|
|
1970
|
+
}
|
|
1825
1971
|
}
|
|
1826
|
-
}
|
|
1827
|
-
}
|
|
1828
|
-
|
|
1972
|
+
}, _callee31, this, [[1, 8]]);
|
|
1973
|
+
}));
|
|
1974
|
+
|
|
1975
|
+
return function (_x20) {
|
|
1976
|
+
return _ref59.apply(this, arguments);
|
|
1977
|
+
};
|
|
1978
|
+
}();
|