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