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