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