@eluvio/elv-client-js 4.0.10 → 4.0.11
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 +9 -10
- package/dist/ElvWalletClient-node-min.js +9 -10
- package/dist/src/AuthorizationClient.js +2070 -1550
- package/dist/src/ContentObjectVerification.js +185 -134
- package/dist/src/Crypto.js +319 -224
- package/dist/src/ElvClient.js +1114 -822
- 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 +299 -159
- 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 +4196 -3323
- package/dist/src/client/ContentManagement.js +2288 -1814
- package/dist/src/client/Contracts.js +614 -468
- package/dist/src/client/Files.js +1831 -1490
- 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 +1763 -1368
- 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 +122 -76
- package/dist/src/walletClient/index.js +1496 -1171
- package/package.json +1 -1
- package/src/AuthorizationClient.js +5 -5
- package/src/client/Files.js +1 -1
- package/testScripts/CreateMezMonolithic.js +0 -779
|
@@ -1,16 +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
|
-
|
|
12
|
-
var MergeWith = require("lodash/mergeWith");
|
|
16
|
+
FormatNFTDetails = _require.FormatNFTDetails,
|
|
17
|
+
FormatNFTMetadata = _require.FormatNFTMetadata,
|
|
18
|
+
FormatNFT = _require.FormatNFT;
|
|
13
19
|
|
|
20
|
+
var MergeWith = require("lodash/mergeWith");
|
|
14
21
|
/**
|
|
15
22
|
* Methods
|
|
16
23
|
*
|
|
@@ -28,10 +35,13 @@ var MergeWith = require("lodash/mergeWith");
|
|
|
28
35
|
*
|
|
29
36
|
* @returns {Object} - User info
|
|
30
37
|
*/
|
|
38
|
+
|
|
39
|
+
|
|
31
40
|
exports.UserInfo = function () {
|
|
32
41
|
if (!this.loggedIn) {
|
|
33
42
|
return;
|
|
34
43
|
}
|
|
44
|
+
|
|
35
45
|
return {
|
|
36
46
|
name: this.__authorization.email || this.UserAddress(),
|
|
37
47
|
address: this.UserAddress(),
|
|
@@ -40,7 +50,6 @@ exports.UserInfo = function () {
|
|
|
40
50
|
walletName: this.__authorization.walletName
|
|
41
51
|
};
|
|
42
52
|
};
|
|
43
|
-
|
|
44
53
|
/**
|
|
45
54
|
* <b><i>Requires login</i></b>
|
|
46
55
|
*
|
|
@@ -50,13 +59,15 @@ exports.UserInfo = function () {
|
|
|
50
59
|
*
|
|
51
60
|
* @returns {string} - The address of the current user
|
|
52
61
|
*/
|
|
62
|
+
|
|
63
|
+
|
|
53
64
|
exports.UserAddress = function () {
|
|
54
65
|
if (!this.loggedIn) {
|
|
55
66
|
return;
|
|
56
67
|
}
|
|
68
|
+
|
|
57
69
|
return this.client.utils.DecodeSignedToken(this.AuthToken()).payload.adr;
|
|
58
70
|
};
|
|
59
|
-
|
|
60
71
|
/**
|
|
61
72
|
* <b><i>Requires login</i></b>
|
|
62
73
|
*
|
|
@@ -72,115 +83,132 @@ exports.UserAddress = function () {
|
|
|
72
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>
|
|
73
84
|
* </ul>
|
|
74
85
|
*/
|
|
86
|
+
|
|
87
|
+
|
|
75
88
|
exports.UserWalletBalance = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
76
89
|
var checkOnboard,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
+
|
|
94
108
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
95
|
-
while (1)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
case 3:
|
|
104
|
-
_context.t0 = this.client.utils;
|
|
105
|
-
_context.next = 6;
|
|
106
|
-
return this.client.authClient.MakeAuthServiceRequest({
|
|
107
|
-
path: UrlJoin("as", "wlt", "mkt", "bal"),
|
|
108
|
-
method: "GET",
|
|
109
|
-
headers: {
|
|
110
|
-
Authorization: "Bearer ".concat(this.AuthToken())
|
|
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;
|
|
111
117
|
}
|
|
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
|
-
|
|
149
|
-
|
|
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;
|
|
150
156
|
}
|
|
151
|
-
});
|
|
152
|
-
case 27:
|
|
153
|
-
_context.next = 29;
|
|
154
|
-
return this.UserWalletBalance(false);
|
|
155
|
-
case 29:
|
|
156
|
-
return _context.abrupt("return", _context.sent);
|
|
157
|
-
case 30:
|
|
158
|
-
balances = {
|
|
159
|
-
totalWalletBalance: totalWalletBalance,
|
|
160
|
-
availableWalletBalance: availableWalletBalance,
|
|
161
|
-
lockedWalletBalance: lockedWalletBalance,
|
|
162
|
-
pendingWalletBalance: pendingWalletBalance,
|
|
163
|
-
withdrawableWalletBalance: withdrawableWalletBalance
|
|
164
|
-
};
|
|
165
|
-
if (userStripeEnabled) {
|
|
166
|
-
balances.userStripeId = userStripeId;
|
|
167
|
-
balances.userStripeEnabled = userStripeEnabled;
|
|
168
|
-
}
|
|
169
157
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
+
}
|
|
180
209
|
}
|
|
181
210
|
}, _callee, this);
|
|
182
211
|
}));
|
|
183
|
-
|
|
184
212
|
/**
|
|
185
213
|
* Retrieve all valid names for filtering user items. Full item names are required for filtering results by name.
|
|
186
214
|
*
|
|
@@ -193,57 +221,69 @@ exports.UserWalletBalance = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regene
|
|
|
193
221
|
*
|
|
194
222
|
* @returns {Promise<Array<String>>} - A list of item names
|
|
195
223
|
*/
|
|
224
|
+
|
|
196
225
|
exports.UserItemNames = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
197
226
|
var _ref3,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
227
|
+
marketplaceParams,
|
|
228
|
+
userAddress,
|
|
229
|
+
filters,
|
|
230
|
+
_args2 = arguments;
|
|
231
|
+
|
|
202
232
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
203
|
-
while (1)
|
|
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
|
-
|
|
230
|
-
queryParams: {
|
|
231
|
-
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)));
|
|
232
260
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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
|
+
}
|
|
243
284
|
}
|
|
244
285
|
}, _callee2, this);
|
|
245
286
|
}));
|
|
246
|
-
|
|
247
287
|
/**
|
|
248
288
|
* Retrieve all valid edition names for filtering the specified item. Full edition names are required for filtering results by edition.
|
|
249
289
|
*
|
|
@@ -255,39 +295,45 @@ exports.UserItemNames = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerato
|
|
|
255
295
|
*
|
|
256
296
|
* @returns {Promise<Array<String>>} - A list of item editions
|
|
257
297
|
*/
|
|
298
|
+
|
|
258
299
|
exports.UserItemEditionNames = /*#__PURE__*/function () {
|
|
259
300
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
|
|
260
301
|
var displayName;
|
|
261
302
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
262
|
-
while (1)
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
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
|
+
}
|
|
283
329
|
}
|
|
284
330
|
}, _callee3, this);
|
|
285
331
|
}));
|
|
332
|
+
|
|
286
333
|
return function (_x) {
|
|
287
334
|
return _ref5.apply(this, arguments);
|
|
288
335
|
};
|
|
289
336
|
}();
|
|
290
|
-
|
|
291
337
|
/**
|
|
292
338
|
* Retrieve all valid attribute names and values. Full attribute names and values are required for filtering results by attribute.
|
|
293
339
|
*
|
|
@@ -301,73 +347,87 @@ exports.UserItemEditionNames = /*#__PURE__*/function () {
|
|
|
301
347
|
*
|
|
302
348
|
* @returns {Promise<Array<String>>} - A list of item names
|
|
303
349
|
*/
|
|
350
|
+
|
|
351
|
+
|
|
304
352
|
exports.UserItemAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
305
353
|
var _ref7,
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
354
|
+
marketplaceParams,
|
|
355
|
+
displayName,
|
|
356
|
+
userAddress,
|
|
357
|
+
filters,
|
|
358
|
+
attributes,
|
|
359
|
+
_args4 = arguments;
|
|
360
|
+
|
|
312
361
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
313
|
-
while (1)
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
_context4.t1 = "tenant:eq:";
|
|
323
|
-
_context4.next = 7;
|
|
324
|
-
return this.MarketplaceInfo({
|
|
325
|
-
marketplaceParams: marketplaceParams
|
|
326
|
-
});
|
|
327
|
-
case 7:
|
|
328
|
-
_context4.t2 = _context4.sent.tenantId;
|
|
329
|
-
_context4.t3 = _context4.t1.concat.call(_context4.t1, _context4.t2);
|
|
330
|
-
_context4.t0.push.call(_context4.t0, _context4.t3);
|
|
331
|
-
case 10:
|
|
332
|
-
if (userAddress) {
|
|
333
|
-
filters.push("wlt:eq:".concat(Utils.FormatAddress(userAddress)));
|
|
334
|
-
}
|
|
335
|
-
if (displayName) {
|
|
336
|
-
filters.push("meta/display_name:eq:".concat(displayName));
|
|
337
|
-
}
|
|
338
|
-
_context4.t4 = Utils;
|
|
339
|
-
_context4.next = 15;
|
|
340
|
-
return this.client.authClient.MakeAuthServiceRequest({
|
|
341
|
-
path: UrlJoin("as", "wlt", "attributes"),
|
|
342
|
-
method: "GET",
|
|
343
|
-
queryParams: {
|
|
344
|
-
filter: filters
|
|
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;
|
|
345
371
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
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
|
+
}
|
|
367
428
|
}
|
|
368
429
|
}, _callee4, this);
|
|
369
430
|
}));
|
|
370
|
-
|
|
371
431
|
/**
|
|
372
432
|
* <b><i>Requires login</i></b>
|
|
373
433
|
*
|
|
@@ -388,26 +448,30 @@ exports.UserItemAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regen
|
|
|
388
448
|
*
|
|
389
449
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
390
450
|
*/
|
|
451
|
+
|
|
391
452
|
exports.UserItems = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
392
453
|
var _ref11,
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
454
|
+
_ref11$sortBy,
|
|
455
|
+
sortBy,
|
|
456
|
+
_args5 = arguments;
|
|
457
|
+
|
|
396
458
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
397
|
-
while (1)
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
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
|
+
}
|
|
407
472
|
}
|
|
408
473
|
}, _callee5, this);
|
|
409
474
|
}));
|
|
410
|
-
|
|
411
475
|
/**
|
|
412
476
|
* Return all listings for the current user. Not paginated.
|
|
413
477
|
*
|
|
@@ -422,43 +486,48 @@ exports.UserItems = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
|
|
|
422
486
|
*
|
|
423
487
|
* @returns {Promise<Array<Object>>} - List of current user's listings
|
|
424
488
|
*/
|
|
489
|
+
|
|
425
490
|
exports.UserListings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
426
491
|
var _ref13,
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
492
|
+
userAddress,
|
|
493
|
+
_ref13$sortBy,
|
|
494
|
+
sortBy,
|
|
495
|
+
_ref13$sortDesc,
|
|
496
|
+
sortDesc,
|
|
497
|
+
contractAddress,
|
|
498
|
+
tokenId,
|
|
499
|
+
marketplaceParams,
|
|
500
|
+
_args6 = arguments;
|
|
501
|
+
|
|
436
502
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
437
|
-
while (1)
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
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
|
+
}
|
|
458
528
|
}
|
|
459
529
|
}, _callee6, this);
|
|
460
530
|
}));
|
|
461
|
-
|
|
462
531
|
/**
|
|
463
532
|
* Return all sales for the current user. Not paginated.
|
|
464
533
|
*
|
|
@@ -474,42 +543,47 @@ exports.UserListings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
|
|
|
474
543
|
*
|
|
475
544
|
* @returns {Promise<Array<Object>>} - List of current user's sales
|
|
476
545
|
*/
|
|
546
|
+
|
|
477
547
|
exports.UserSales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
478
548
|
var _ref15,
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
549
|
+
userAddress,
|
|
550
|
+
_ref15$sortBy,
|
|
551
|
+
sortBy,
|
|
552
|
+
_ref15$sortDesc,
|
|
553
|
+
sortDesc,
|
|
554
|
+
contractAddress,
|
|
555
|
+
tokenId,
|
|
556
|
+
marketplaceParams,
|
|
557
|
+
_args7 = arguments;
|
|
558
|
+
|
|
488
559
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
489
|
-
while (1)
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
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
|
+
}
|
|
509
584
|
}
|
|
510
585
|
}, _callee7, this);
|
|
511
586
|
}));
|
|
512
|
-
|
|
513
587
|
/**
|
|
514
588
|
* Return all transfers and sales for the current user. Not paginated.
|
|
515
589
|
*
|
|
@@ -525,42 +599,47 @@ exports.UserSales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
|
|
|
525
599
|
*
|
|
526
600
|
* @returns {Promise<Array<Object>>} - List of current user's sales
|
|
527
601
|
*/
|
|
602
|
+
|
|
528
603
|
exports.UserTransfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
529
604
|
var _ref17,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
605
|
+
userAddress,
|
|
606
|
+
_ref17$sortBy,
|
|
607
|
+
sortBy,
|
|
608
|
+
_ref17$sortDesc,
|
|
609
|
+
sortDesc,
|
|
610
|
+
contractAddress,
|
|
611
|
+
tokenId,
|
|
612
|
+
marketplaceParams,
|
|
613
|
+
_args8 = arguments;
|
|
614
|
+
|
|
539
615
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
540
|
-
while (1)
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
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
|
+
}
|
|
560
640
|
}
|
|
561
641
|
}, _callee8, this);
|
|
562
642
|
}));
|
|
563
|
-
|
|
564
643
|
/* TENANT */
|
|
565
644
|
|
|
566
645
|
/**
|
|
@@ -575,44 +654,53 @@ exports.UserTransfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerato
|
|
|
575
654
|
*
|
|
576
655
|
* @returns {Promise<Object>} - The tenant configuration
|
|
577
656
|
*/
|
|
657
|
+
|
|
578
658
|
exports.TenantConfiguration = /*#__PURE__*/function () {
|
|
579
659
|
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref18) {
|
|
580
660
|
var tenantId, contractAddress;
|
|
581
661
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
582
|
-
while (1)
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
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
|
+
}
|
|
608
696
|
}
|
|
609
697
|
}, _callee9, this, [[1, 10]]);
|
|
610
698
|
}));
|
|
699
|
+
|
|
611
700
|
return function (_x2) {
|
|
612
701
|
return _ref19.apply(this, arguments);
|
|
613
702
|
};
|
|
614
703
|
}();
|
|
615
|
-
|
|
616
704
|
/**
|
|
617
705
|
* Retrieve the current exchange rate for the specified currency to USD
|
|
618
706
|
*
|
|
@@ -620,37 +708,46 @@ exports.TenantConfiguration = /*#__PURE__*/function () {
|
|
|
620
708
|
* @namedParams
|
|
621
709
|
* @param {string} currency - The currency for which to retrieve the USD exchange rate
|
|
622
710
|
*/
|
|
711
|
+
|
|
712
|
+
|
|
623
713
|
exports.ExchangeRate = /*#__PURE__*/function () {
|
|
624
714
|
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref20) {
|
|
625
715
|
var currency;
|
|
626
716
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
627
|
-
while (1)
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
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
|
+
}
|
|
646
743
|
}
|
|
647
744
|
}, _callee10, this);
|
|
648
745
|
}));
|
|
746
|
+
|
|
649
747
|
return function (_x3) {
|
|
650
748
|
return _ref21.apply(this, arguments);
|
|
651
749
|
};
|
|
652
750
|
}();
|
|
653
|
-
|
|
654
751
|
/* MARKETPLACE */
|
|
655
752
|
|
|
656
753
|
/**
|
|
@@ -664,52 +761,63 @@ exports.ExchangeRate = /*#__PURE__*/function () {
|
|
|
664
761
|
*
|
|
665
762
|
* @returns {Promise<Object>} - Stock info for items in the marketplace
|
|
666
763
|
*/
|
|
764
|
+
|
|
765
|
+
|
|
667
766
|
exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
668
767
|
var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref22) {
|
|
669
768
|
var marketplaceParams, tenantId, marketplaceInfo;
|
|
670
769
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
671
|
-
while (1)
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
_context11.next = 6;
|
|
682
|
-
break;
|
|
683
|
-
}
|
|
684
|
-
_context11.next = 5;
|
|
685
|
-
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
686
|
-
path: UrlJoin("as", "wlt", "nft", "info", tenantId),
|
|
687
|
-
method: "GET",
|
|
688
|
-
headers: {
|
|
689
|
-
Authorization: "Bearer ".concat(this.AuthToken())
|
|
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;
|
|
690
780
|
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
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
|
+
}
|
|
705
813
|
}
|
|
706
814
|
}, _callee11, this);
|
|
707
815
|
}));
|
|
816
|
+
|
|
708
817
|
return function (_x4) {
|
|
709
818
|
return _ref23.apply(this, arguments);
|
|
710
819
|
};
|
|
711
820
|
}();
|
|
712
|
-
|
|
713
821
|
/**
|
|
714
822
|
* Retrieve basic information about a specific available marketplace with the specified tenant/marketplace slug, ID, or hash.
|
|
715
823
|
*
|
|
@@ -723,26 +831,32 @@ exports.MarketplaceStock = /*#__PURE__*/function () {
|
|
|
723
831
|
*
|
|
724
832
|
* @returns {Promise<Object>} - Info about the marketplace
|
|
725
833
|
*/
|
|
834
|
+
|
|
835
|
+
|
|
726
836
|
exports.MarketplaceInfo = function (_ref24) {
|
|
727
837
|
var marketplaceParams = _ref24.marketplaceParams;
|
|
838
|
+
|
|
728
839
|
var _ref25 = marketplaceParams || {},
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
840
|
+
tenantSlug = _ref25.tenantSlug,
|
|
841
|
+
marketplaceSlug = _ref25.marketplaceSlug,
|
|
842
|
+
marketplaceId = _ref25.marketplaceId,
|
|
843
|
+
marketplaceHash = _ref25.marketplaceHash;
|
|
844
|
+
|
|
733
845
|
var marketplaceInfo;
|
|
846
|
+
|
|
734
847
|
if (tenantSlug && marketplaceSlug) {
|
|
735
848
|
marketplaceInfo = (this.availableMarketplaces[tenantSlug] || {})[marketplaceSlug];
|
|
736
849
|
} else {
|
|
737
850
|
marketplaceId = marketplaceHash ? this.client.utils.DecodeVersionHash(marketplaceHash).objectId : marketplaceId;
|
|
738
851
|
marketplaceInfo = this.availableMarketplacesById[marketplaceId];
|
|
739
852
|
}
|
|
853
|
+
|
|
740
854
|
if (!marketplaceInfo) {
|
|
741
855
|
throw Error("Eluvio Wallet Client: Unable to find marketplace with parameters ".concat(JSON.stringify(arguments)));
|
|
742
856
|
}
|
|
857
|
+
|
|
743
858
|
return marketplaceInfo;
|
|
744
859
|
};
|
|
745
|
-
|
|
746
860
|
/**
|
|
747
861
|
* Retrieve custom CSS for the specified marketplace
|
|
748
862
|
*
|
|
@@ -752,43 +866,52 @@ exports.MarketplaceInfo = function (_ref24) {
|
|
|
752
866
|
*
|
|
753
867
|
* @returns {Promise<string>} - The CSS of the marketplace
|
|
754
868
|
*/
|
|
869
|
+
|
|
870
|
+
|
|
755
871
|
exports.MarketplaceCSS = /*#__PURE__*/function () {
|
|
756
872
|
var _ref27 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref26) {
|
|
757
873
|
var marketplaceParams, marketplaceInfo, marketplaceHash;
|
|
758
874
|
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
759
|
-
while (1)
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
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
|
+
}
|
|
784
907
|
}
|
|
785
908
|
}, _callee12, this);
|
|
786
909
|
}));
|
|
910
|
+
|
|
787
911
|
return function (_x5) {
|
|
788
912
|
return _ref27.apply(this, arguments);
|
|
789
913
|
};
|
|
790
914
|
}();
|
|
791
|
-
|
|
792
915
|
/**
|
|
793
916
|
* Retrieve info about all available marketplaces
|
|
794
917
|
*
|
|
@@ -799,31 +922,39 @@ exports.MarketplaceCSS = /*#__PURE__*/function () {
|
|
|
799
922
|
*
|
|
800
923
|
* @returns {Promise<Object>} - Info about available marketplaces
|
|
801
924
|
*/
|
|
925
|
+
|
|
926
|
+
|
|
802
927
|
exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
|
803
928
|
var _ref29,
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
929
|
+
organizeById,
|
|
930
|
+
_ref29$forceReload,
|
|
931
|
+
forceReload,
|
|
932
|
+
_args13 = arguments;
|
|
933
|
+
|
|
808
934
|
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
809
|
-
while (1)
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
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
|
+
|
|
813
945
|
_context13.next = 4;
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
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
|
+
}
|
|
823
955
|
}
|
|
824
956
|
}, _callee13, this);
|
|
825
957
|
}));
|
|
826
|
-
|
|
827
958
|
/**
|
|
828
959
|
* Retrieve full information about the specified marketplace
|
|
829
960
|
*
|
|
@@ -835,25 +966,29 @@ exports.AvailableMarketplaces = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_re
|
|
|
835
966
|
*
|
|
836
967
|
* @returns {Promise<Object>} - The full information for the marketplace
|
|
837
968
|
*/
|
|
969
|
+
|
|
838
970
|
exports.Marketplace = /*#__PURE__*/function () {
|
|
839
971
|
var _ref31 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref30) {
|
|
840
972
|
var marketplaceParams;
|
|
841
973
|
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
842
|
-
while (1)
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
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
|
+
}
|
|
849
984
|
}
|
|
850
985
|
}, _callee14, this);
|
|
851
986
|
}));
|
|
987
|
+
|
|
852
988
|
return function (_x6) {
|
|
853
989
|
return _ref31.apply(this, arguments);
|
|
854
990
|
};
|
|
855
991
|
}();
|
|
856
|
-
|
|
857
992
|
/* NFTS */
|
|
858
993
|
|
|
859
994
|
/**
|
|
@@ -865,31 +1000,37 @@ exports.Marketplace = /*#__PURE__*/function () {
|
|
|
865
1000
|
*
|
|
866
1001
|
* @returns {Promise<Object>} - Information about the specified contract
|
|
867
1002
|
*/
|
|
1003
|
+
|
|
1004
|
+
|
|
868
1005
|
exports.NFTContractStats = /*#__PURE__*/function () {
|
|
869
1006
|
var _ref33 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref32) {
|
|
870
1007
|
var contractAddress;
|
|
871
1008
|
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
872
|
-
while (1)
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
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
|
+
}
|
|
885
1026
|
}
|
|
886
1027
|
}, _callee15, this);
|
|
887
1028
|
}));
|
|
1029
|
+
|
|
888
1030
|
return function (_x7) {
|
|
889
1031
|
return _ref33.apply(this, arguments);
|
|
890
1032
|
};
|
|
891
1033
|
}();
|
|
892
|
-
|
|
893
1034
|
/**
|
|
894
1035
|
* Load full info for the specified NFT
|
|
895
1036
|
*
|
|
@@ -898,81 +1039,99 @@ exports.NFTContractStats = /*#__PURE__*/function () {
|
|
|
898
1039
|
* @param {string} contractAddress - The contract address of the NFT
|
|
899
1040
|
* @param {string} tokenId - The token ID of the NFT
|
|
900
1041
|
*/
|
|
1042
|
+
|
|
1043
|
+
|
|
901
1044
|
exports.NFT = /*#__PURE__*/function () {
|
|
902
1045
|
var _ref35 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(_ref34) {
|
|
903
1046
|
var tokenId, contractAddress, nft, assetMetadata, localizedMetadata;
|
|
904
1047
|
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
905
|
-
while (1)
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
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
|
+
}
|
|
968
1127
|
}
|
|
969
1128
|
}, _callee16, this);
|
|
970
1129
|
}));
|
|
1130
|
+
|
|
971
1131
|
return function (_x8) {
|
|
972
1132
|
return _ref35.apply(this, arguments);
|
|
973
1133
|
};
|
|
974
1134
|
}();
|
|
975
|
-
|
|
976
1135
|
/**
|
|
977
1136
|
* <b><i>Requires login</i></b>
|
|
978
1137
|
*
|
|
@@ -984,45 +1143,54 @@ exports.NFT = /*#__PURE__*/function () {
|
|
|
984
1143
|
* @param {string} tokenId - The token ID of the NFT
|
|
985
1144
|
* @param {string} targetAddress - The address to which to transfer the NFT
|
|
986
1145
|
*/
|
|
1146
|
+
|
|
1147
|
+
|
|
987
1148
|
exports.TransferNFT = /*#__PURE__*/function () {
|
|
988
1149
|
var _ref37 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref36) {
|
|
989
1150
|
var contractAddress, tokenId, targetAddress;
|
|
990
1151
|
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
991
|
-
while (1)
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
case 3:
|
|
1000
|
-
_context17.next = 5;
|
|
1001
|
-
return this.client.authClient.MakeAuthServiceRequest({
|
|
1002
|
-
path: UrlJoin("as", "wlt", "mkt", "xfer"),
|
|
1003
|
-
method: "POST",
|
|
1004
|
-
body: {
|
|
1005
|
-
contract: Utils.FormatAddress(contractAddress),
|
|
1006
|
-
token: tokenId,
|
|
1007
|
-
to_addr: Utils.FormatAddress(targetAddress)
|
|
1008
|
-
},
|
|
1009
|
-
headers: {
|
|
1010
|
-
Authorization: "Bearer ".concat(this.AuthToken())
|
|
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;
|
|
1011
1160
|
}
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
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
|
+
}
|
|
1018
1186
|
}
|
|
1019
1187
|
}, _callee17, this);
|
|
1020
1188
|
}));
|
|
1189
|
+
|
|
1021
1190
|
return function (_x9) {
|
|
1022
1191
|
return _ref37.apply(this, arguments);
|
|
1023
1192
|
};
|
|
1024
1193
|
}();
|
|
1025
|
-
|
|
1026
1194
|
/** LISTINGS */
|
|
1027
1195
|
|
|
1028
1196
|
/**
|
|
@@ -1034,47 +1202,58 @@ exports.TransferNFT = /*#__PURE__*/function () {
|
|
|
1034
1202
|
*
|
|
1035
1203
|
* @returns {Promise<Object>} - The status of the listing
|
|
1036
1204
|
*/
|
|
1205
|
+
|
|
1206
|
+
|
|
1037
1207
|
exports.ListingStatus = /*#__PURE__*/function () {
|
|
1038
1208
|
var _ref39 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(_ref38) {
|
|
1039
1209
|
var listingId;
|
|
1040
1210
|
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
1041
|
-
while (1)
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
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
|
+
}
|
|
1070
1249
|
}
|
|
1071
1250
|
}, _callee18, this, [[1, 11]]);
|
|
1072
1251
|
}));
|
|
1252
|
+
|
|
1073
1253
|
return function (_x10) {
|
|
1074
1254
|
return _ref39.apply(this, arguments);
|
|
1075
1255
|
};
|
|
1076
1256
|
}();
|
|
1077
|
-
|
|
1078
1257
|
/**
|
|
1079
1258
|
* Retrieve a specific listing
|
|
1080
1259
|
*
|
|
@@ -1086,39 +1265,46 @@ exports.ListingStatus = /*#__PURE__*/function () {
|
|
|
1086
1265
|
*
|
|
1087
1266
|
* @returns {Promise<Object>} - The listing
|
|
1088
1267
|
*/
|
|
1268
|
+
|
|
1269
|
+
|
|
1089
1270
|
exports.Listing = /*#__PURE__*/function () {
|
|
1090
1271
|
var _ref41 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref40) {
|
|
1091
1272
|
var listingId;
|
|
1092
1273
|
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
1093
|
-
while (1)
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
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
|
+
}
|
|
1114
1300
|
}
|
|
1115
1301
|
}, _callee19, this);
|
|
1116
1302
|
}));
|
|
1303
|
+
|
|
1117
1304
|
return function (_x11) {
|
|
1118
1305
|
return _ref41.apply(this, arguments);
|
|
1119
1306
|
};
|
|
1120
1307
|
}();
|
|
1121
|
-
|
|
1122
1308
|
/**
|
|
1123
1309
|
* Retrieve listings matching the specified parameters.
|
|
1124
1310
|
*
|
|
@@ -1152,21 +1338,25 @@ exports.Listing = /*#__PURE__*/function () {
|
|
|
1152
1338
|
*
|
|
1153
1339
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
1154
1340
|
*/
|
|
1341
|
+
|
|
1342
|
+
|
|
1155
1343
|
exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
|
|
1156
1344
|
var _args20 = arguments;
|
|
1157
1345
|
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
1158
|
-
while (1)
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
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
|
+
}
|
|
1166
1357
|
}
|
|
1167
1358
|
}, _callee20, this);
|
|
1168
1359
|
}));
|
|
1169
|
-
|
|
1170
1360
|
/**
|
|
1171
1361
|
* Retrieve stats for listings matching the specified parameters.
|
|
1172
1362
|
*
|
|
@@ -1199,21 +1389,24 @@ exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRunt
|
|
|
1199
1389
|
*
|
|
1200
1390
|
* @returns {Promise<Object>} - Statistics about listings. All prices in USD.
|
|
1201
1391
|
*/
|
|
1392
|
+
|
|
1202
1393
|
exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
|
|
1203
1394
|
var _args21 = arguments;
|
|
1204
1395
|
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
1205
|
-
while (1)
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
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
|
+
}
|
|
1213
1407
|
}
|
|
1214
1408
|
}, _callee21, this);
|
|
1215
1409
|
}));
|
|
1216
|
-
|
|
1217
1410
|
/**
|
|
1218
1411
|
* Retrieve sales matching the specified parameters.
|
|
1219
1412
|
*
|
|
@@ -1245,21 +1438,24 @@ exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
|
|
|
1245
1438
|
*
|
|
1246
1439
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
1247
1440
|
*/
|
|
1441
|
+
|
|
1248
1442
|
exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
|
|
1249
1443
|
var _args22 = arguments;
|
|
1250
1444
|
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
1251
|
-
while (1)
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
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
|
+
}
|
|
1259
1456
|
}
|
|
1260
1457
|
}, _callee22, this);
|
|
1261
1458
|
}));
|
|
1262
|
-
|
|
1263
1459
|
/**
|
|
1264
1460
|
* Retrieve sales and transfers matching the specified parameters.
|
|
1265
1461
|
*
|
|
@@ -1291,21 +1487,24 @@ exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
|
1291
1487
|
*
|
|
1292
1488
|
* @returns {Promise<Object>} - Results of the query and pagination info
|
|
1293
1489
|
*/
|
|
1490
|
+
|
|
1294
1491
|
exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
|
|
1295
1492
|
var _args23 = arguments;
|
|
1296
1493
|
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
1297
|
-
while (1)
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
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
|
+
}
|
|
1305
1505
|
}
|
|
1306
1506
|
}, _callee23, this);
|
|
1307
1507
|
}));
|
|
1308
|
-
|
|
1309
1508
|
/**
|
|
1310
1509
|
* Retrieve stats for listings matching the specified parameters.
|
|
1311
1510
|
*
|
|
@@ -1337,21 +1536,24 @@ exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
|
|
|
1337
1536
|
*
|
|
1338
1537
|
* @returns {Promise<Object>} - Statistics about sales. All prices in USD.
|
|
1339
1538
|
*/
|
|
1539
|
+
|
|
1340
1540
|
exports.SalesStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
|
|
1341
1541
|
var _args24 = arguments;
|
|
1342
1542
|
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
1343
|
-
while (1)
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
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
|
+
}
|
|
1351
1554
|
}
|
|
1352
1555
|
}, _callee24, this);
|
|
1353
1556
|
}));
|
|
1354
|
-
|
|
1355
1557
|
/**
|
|
1356
1558
|
* Get the leaderboard rankings for the specified marketplace. If user address is specified, will return the ranking for the specified user (if present)
|
|
1357
1559
|
*
|
|
@@ -1364,72 +1566,88 @@ exports.SalesStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRu
|
|
|
1364
1566
|
*
|
|
1365
1567
|
* @returns {Promise<Array|Object>} - Returns a list of leaderboard rankings or, if userAddress is specified, ranking for that user.
|
|
1366
1568
|
*/
|
|
1569
|
+
|
|
1367
1570
|
exports.Leaderboard = /*#__PURE__*/function () {
|
|
1368
1571
|
var _ref48 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref47) {
|
|
1369
1572
|
var userAddress,
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1573
|
+
marketplaceParams,
|
|
1574
|
+
params,
|
|
1575
|
+
_args25 = arguments;
|
|
1373
1576
|
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
1374
|
-
while (1)
|
|
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
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
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
|
+
}
|
|
1425
1643
|
}
|
|
1426
1644
|
}, _callee25, this);
|
|
1427
1645
|
}));
|
|
1646
|
+
|
|
1428
1647
|
return function (_x12) {
|
|
1429
1648
|
return _ref48.apply(this, arguments);
|
|
1430
1649
|
};
|
|
1431
1650
|
}();
|
|
1432
|
-
|
|
1433
1651
|
/**
|
|
1434
1652
|
* <b><i>Requires login</i></b>
|
|
1435
1653
|
*
|
|
@@ -1444,69 +1662,81 @@ exports.Leaderboard = /*#__PURE__*/function () {
|
|
|
1444
1662
|
*
|
|
1445
1663
|
* @returns {Promise<string>} - The listing ID of the created listing
|
|
1446
1664
|
*/
|
|
1665
|
+
|
|
1666
|
+
|
|
1447
1667
|
exports.CreateListing = /*#__PURE__*/function () {
|
|
1448
1668
|
var _ref50 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(_ref49) {
|
|
1449
1669
|
var contractAddress, tokenId, price, listingId;
|
|
1450
1670
|
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
1451
|
-
while (1)
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
_context26.next = 6;
|
|
1461
|
-
return this.client.authClient.MakeAuthServiceRequest({
|
|
1462
|
-
path: UrlJoin("as", "wlt", "mkt"),
|
|
1463
|
-
method: "PUT",
|
|
1464
|
-
body: {
|
|
1465
|
-
id: listingId,
|
|
1466
|
-
price: parseFloat(price)
|
|
1467
|
-
},
|
|
1468
|
-
headers: {
|
|
1469
|
-
Authorization: "Bearer ".concat(this.AuthToken())
|
|
1470
|
-
}
|
|
1471
|
-
});
|
|
1472
|
-
case 6:
|
|
1473
|
-
_context26.t1 = _context26.sent;
|
|
1474
|
-
_context26.next = 9;
|
|
1475
|
-
return _context26.t0.ResponseToFormat.call(_context26.t0, "text", _context26.t1);
|
|
1476
|
-
case 9:
|
|
1477
|
-
return _context26.abrupt("return", _context26.sent);
|
|
1478
|
-
case 12:
|
|
1479
|
-
_context26.t2 = Utils;
|
|
1480
|
-
_context26.next = 15;
|
|
1481
|
-
return this.client.authClient.MakeAuthServiceRequest({
|
|
1482
|
-
path: UrlJoin("as", "wlt", "mkt"),
|
|
1483
|
-
method: "POST",
|
|
1484
|
-
body: {
|
|
1485
|
-
contract: contractAddress,
|
|
1486
|
-
token: tokenId,
|
|
1487
|
-
price: parseFloat(price)
|
|
1488
|
-
},
|
|
1489
|
-
headers: {
|
|
1490
|
-
Authorization: "Bearer ".concat(this.AuthToken())
|
|
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;
|
|
1491
1680
|
}
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
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
|
+
}
|
|
1502
1732
|
}
|
|
1503
1733
|
}, _callee26, this);
|
|
1504
1734
|
}));
|
|
1735
|
+
|
|
1505
1736
|
return function (_x13) {
|
|
1506
1737
|
return _ref50.apply(this, arguments);
|
|
1507
1738
|
};
|
|
1508
1739
|
}();
|
|
1509
|
-
|
|
1510
1740
|
/**
|
|
1511
1741
|
* <b><i>Requires login</i></b>
|
|
1512
1742
|
*
|
|
@@ -1516,32 +1746,37 @@ exports.CreateListing = /*#__PURE__*/function () {
|
|
|
1516
1746
|
* @namedParams
|
|
1517
1747
|
* @param {string} listingId - The ID of the listing to remove
|
|
1518
1748
|
*/
|
|
1749
|
+
|
|
1750
|
+
|
|
1519
1751
|
exports.RemoveListing = /*#__PURE__*/function () {
|
|
1520
1752
|
var _ref52 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(_ref51) {
|
|
1521
1753
|
var listingId;
|
|
1522
1754
|
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
1523
|
-
while (1)
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
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
|
+
}
|
|
1537
1772
|
}
|
|
1538
1773
|
}, _callee27, this);
|
|
1539
1774
|
}));
|
|
1775
|
+
|
|
1540
1776
|
return function (_x14) {
|
|
1541
1777
|
return _ref52.apply(this, arguments);
|
|
1542
1778
|
};
|
|
1543
1779
|
}();
|
|
1544
|
-
|
|
1545
1780
|
/**
|
|
1546
1781
|
* Retrieve all valid names for filtering listing sales names. Full item names are required for filtering sales results by name.
|
|
1547
1782
|
*
|
|
@@ -1553,50 +1788,61 @@ exports.RemoveListing = /*#__PURE__*/function () {
|
|
|
1553
1788
|
*
|
|
1554
1789
|
* @returns {Promise<Array<String>>} - A list of item names
|
|
1555
1790
|
*/
|
|
1791
|
+
|
|
1792
|
+
|
|
1556
1793
|
exports.SalesNames = /*#__PURE__*/function () {
|
|
1557
1794
|
var _ref54 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(_ref53) {
|
|
1558
1795
|
var marketplaceParams, tenantId;
|
|
1559
1796
|
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
1560
|
-
while (1)
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
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
|
+
}
|
|
1592
1838
|
}
|
|
1593
1839
|
}, _callee28, this);
|
|
1594
1840
|
}));
|
|
1841
|
+
|
|
1595
1842
|
return function (_x15) {
|
|
1596
1843
|
return _ref54.apply(this, arguments);
|
|
1597
1844
|
};
|
|
1598
1845
|
}();
|
|
1599
|
-
|
|
1600
1846
|
/**
|
|
1601
1847
|
* Retrieve all valid names for filtering listings. Full item names are required for filtering listing results by name.
|
|
1602
1848
|
*
|
|
@@ -1608,50 +1854,61 @@ exports.SalesNames = /*#__PURE__*/function () {
|
|
|
1608
1854
|
*
|
|
1609
1855
|
* @returns {Promise<Array<String>>} - A list of item names
|
|
1610
1856
|
*/
|
|
1857
|
+
|
|
1858
|
+
|
|
1611
1859
|
exports.ListingNames = /*#__PURE__*/function () {
|
|
1612
1860
|
var _ref56 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(_ref55) {
|
|
1613
1861
|
var marketplaceParams, tenantId;
|
|
1614
1862
|
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
1615
|
-
while (1)
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
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
|
+
}
|
|
1647
1904
|
}
|
|
1648
1905
|
}, _callee29, this);
|
|
1649
1906
|
}));
|
|
1907
|
+
|
|
1650
1908
|
return function (_x16) {
|
|
1651
1909
|
return _ref56.apply(this, arguments);
|
|
1652
1910
|
};
|
|
1653
1911
|
}();
|
|
1654
|
-
|
|
1655
1912
|
/**
|
|
1656
1913
|
* Retrieve all valid edition names of the specified item. Full item edition names are required for filtering listing results by edition.
|
|
1657
1914
|
*
|
|
@@ -1661,39 +1918,46 @@ exports.ListingNames = /*#__PURE__*/function () {
|
|
|
1661
1918
|
*
|
|
1662
1919
|
* @returns {Promise<Array<String>>} - A list of item editions
|
|
1663
1920
|
*/
|
|
1921
|
+
|
|
1922
|
+
|
|
1664
1923
|
exports.ListingEditionNames = /*#__PURE__*/function () {
|
|
1665
1924
|
var _ref58 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(_ref57) {
|
|
1666
1925
|
var displayName;
|
|
1667
1926
|
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
1668
|
-
while (1)
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
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
|
+
}
|
|
1689
1953
|
}
|
|
1690
1954
|
}, _callee30, this);
|
|
1691
1955
|
}));
|
|
1956
|
+
|
|
1692
1957
|
return function (_x17) {
|
|
1693
1958
|
return _ref58.apply(this, arguments);
|
|
1694
1959
|
};
|
|
1695
1960
|
}();
|
|
1696
|
-
|
|
1697
1961
|
/**
|
|
1698
1962
|
* Retrieve names of all valid attributes for listed items. Full attribute names and values are required for filtering listing results by attributes.
|
|
1699
1963
|
*
|
|
@@ -1706,69 +1970,82 @@ exports.ListingEditionNames = /*#__PURE__*/function () {
|
|
|
1706
1970
|
*
|
|
1707
1971
|
* @returns {Promise<Array<String>>} - A list of valid attributes
|
|
1708
1972
|
*/
|
|
1973
|
+
|
|
1974
|
+
|
|
1709
1975
|
exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
|
|
1710
1976
|
var _ref60,
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1977
|
+
marketplaceParams,
|
|
1978
|
+
displayName,
|
|
1979
|
+
filters,
|
|
1980
|
+
attributes,
|
|
1981
|
+
_args31 = arguments;
|
|
1982
|
+
|
|
1716
1983
|
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
1717
|
-
while (1)
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
_context31.t1 = "tenant:eq:";
|
|
1727
|
-
_context31.next = 7;
|
|
1728
|
-
return this.MarketplaceInfo({
|
|
1729
|
-
marketplaceParams: marketplaceParams
|
|
1730
|
-
});
|
|
1731
|
-
case 7:
|
|
1732
|
-
_context31.t2 = _context31.sent.tenantId;
|
|
1733
|
-
_context31.t3 = _context31.t1.concat.call(_context31.t1, _context31.t2);
|
|
1734
|
-
_context31.t0.push.call(_context31.t0, _context31.t3);
|
|
1735
|
-
case 10:
|
|
1736
|
-
if (displayName) {
|
|
1737
|
-
filters.push("nft/display_name:eq:".concat(displayName));
|
|
1738
|
-
}
|
|
1739
|
-
_context31.t4 = Utils;
|
|
1740
|
-
_context31.next = 14;
|
|
1741
|
-
return this.client.authClient.MakeAuthServiceRequest({
|
|
1742
|
-
path: UrlJoin("as", "mkt", "attributes"),
|
|
1743
|
-
method: "GET",
|
|
1744
|
-
queryParams: {
|
|
1745
|
-
filter: filters
|
|
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;
|
|
1746
1993
|
}
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
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
|
+
}
|
|
1768
2046
|
}
|
|
1769
2047
|
}, _callee31, this);
|
|
1770
2048
|
}));
|
|
1771
|
-
|
|
1772
2049
|
/* PURCHASE / CLAIM */
|
|
1773
2050
|
|
|
1774
2051
|
/**
|
|
@@ -1782,44 +2059,49 @@ exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regene
|
|
|
1782
2059
|
* @param {string} sku - The SKU of the item to claim
|
|
1783
2060
|
* @param {string=} email - Email address of the user. If specified, this will bind the user to the tenant of the specified marketplace
|
|
1784
2061
|
*/
|
|
2062
|
+
|
|
1785
2063
|
exports.ClaimItem = /*#__PURE__*/function () {
|
|
1786
2064
|
var _ref64 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(_ref63) {
|
|
1787
2065
|
var marketplaceParams, sku, email, marketplaceInfo;
|
|
1788
2066
|
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
1789
|
-
while (1)
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
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
|
+
}
|
|
1815
2097
|
}
|
|
1816
2098
|
}, _callee32, this);
|
|
1817
2099
|
}));
|
|
2100
|
+
|
|
1818
2101
|
return function (_x18) {
|
|
1819
2102
|
return _ref64.apply(this, arguments);
|
|
1820
2103
|
};
|
|
1821
2104
|
}();
|
|
1822
|
-
|
|
1823
2105
|
/* MINTING STATUS */
|
|
1824
2106
|
|
|
1825
2107
|
/**
|
|
@@ -1832,55 +2114,66 @@ exports.ClaimItem = /*#__PURE__*/function () {
|
|
|
1832
2114
|
*
|
|
1833
2115
|
* @returns {Promise<Object>} - The status of the purchase
|
|
1834
2116
|
*/
|
|
2117
|
+
|
|
2118
|
+
|
|
1835
2119
|
exports.ListingPurchaseStatus = /*#__PURE__*/function () {
|
|
1836
2120
|
var _ref66 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(_ref65) {
|
|
1837
2121
|
var listingId, confirmationId, listingStatus, statuses;
|
|
1838
2122
|
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
1839
|
-
while (1)
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
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
|
+
}
|
|
1876
2169
|
}
|
|
1877
2170
|
}, _callee33, this, [[1, 13]]);
|
|
1878
2171
|
}));
|
|
2172
|
+
|
|
1879
2173
|
return function (_x19) {
|
|
1880
2174
|
return _ref66.apply(this, arguments);
|
|
1881
2175
|
};
|
|
1882
2176
|
}();
|
|
1883
|
-
|
|
1884
2177
|
/**
|
|
1885
2178
|
* Return status of the specified marketplace purchase
|
|
1886
2179
|
*
|
|
@@ -1891,49 +2184,57 @@ exports.ListingPurchaseStatus = /*#__PURE__*/function () {
|
|
|
1891
2184
|
*
|
|
1892
2185
|
* @returns {Promise<Object>} - The minting status of the purchaseed item(s)
|
|
1893
2186
|
*/
|
|
2187
|
+
|
|
2188
|
+
|
|
1894
2189
|
exports.PurchaseStatus = /*#__PURE__*/function () {
|
|
1895
2190
|
var _ref68 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(_ref67) {
|
|
1896
2191
|
var marketplaceParams, confirmationId, marketplaceInfo, statuses;
|
|
1897
2192
|
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
1898
|
-
while (1)
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
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
|
+
}
|
|
1929
2230
|
}
|
|
1930
2231
|
}, _callee34, this, [[1, 11]]);
|
|
1931
2232
|
}));
|
|
2233
|
+
|
|
1932
2234
|
return function (_x20) {
|
|
1933
2235
|
return _ref68.apply(this, arguments);
|
|
1934
2236
|
};
|
|
1935
2237
|
}();
|
|
1936
|
-
|
|
1937
2238
|
/**
|
|
1938
2239
|
* Return status of the specified item claim
|
|
1939
2240
|
*
|
|
@@ -1944,49 +2245,57 @@ exports.PurchaseStatus = /*#__PURE__*/function () {
|
|
|
1944
2245
|
*
|
|
1945
2246
|
* @returns {Promise<Object>} - The minting status of the claim
|
|
1946
2247
|
*/
|
|
2248
|
+
|
|
2249
|
+
|
|
1947
2250
|
exports.ClaimStatus = /*#__PURE__*/function () {
|
|
1948
2251
|
var _ref70 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(_ref69) {
|
|
1949
2252
|
var marketplaceParams, sku, marketplaceInfo, statuses;
|
|
1950
2253
|
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
1951
|
-
while (1)
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
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
|
+
}
|
|
1982
2291
|
}
|
|
1983
2292
|
}, _callee35, this, [[1, 11]]);
|
|
1984
2293
|
}));
|
|
2294
|
+
|
|
1985
2295
|
return function (_x21) {
|
|
1986
2296
|
return _ref70.apply(this, arguments);
|
|
1987
2297
|
};
|
|
1988
2298
|
}();
|
|
1989
|
-
|
|
1990
2299
|
/**
|
|
1991
2300
|
* Return status of the specified pack opening
|
|
1992
2301
|
*
|
|
@@ -1997,49 +2306,57 @@ exports.ClaimStatus = /*#__PURE__*/function () {
|
|
|
1997
2306
|
*
|
|
1998
2307
|
* @returns {Promise<Object>} - The status of the pack opening
|
|
1999
2308
|
*/
|
|
2309
|
+
|
|
2310
|
+
|
|
2000
2311
|
exports.PackOpenStatus = /*#__PURE__*/function () {
|
|
2001
2312
|
var _ref72 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(_ref71) {
|
|
2002
2313
|
var contractAddress, tokenId, tenantConfig, statuses;
|
|
2003
2314
|
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
2004
|
-
while (1)
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
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
|
+
}
|
|
2035
2352
|
}
|
|
2036
2353
|
}, _callee36, this, [[1, 11]]);
|
|
2037
2354
|
}));
|
|
2355
|
+
|
|
2038
2356
|
return function (_x22) {
|
|
2039
2357
|
return _ref72.apply(this, arguments);
|
|
2040
2358
|
};
|
|
2041
2359
|
}();
|
|
2042
|
-
|
|
2043
2360
|
/**
|
|
2044
2361
|
* Return status of the specified collection redemption
|
|
2045
2362
|
*
|
|
@@ -2050,375 +2367,453 @@ exports.PackOpenStatus = /*#__PURE__*/function () {
|
|
|
2050
2367
|
*
|
|
2051
2368
|
* @returns {Promise<Object>} - The status of the collection redemption
|
|
2052
2369
|
*/
|
|
2370
|
+
|
|
2371
|
+
|
|
2053
2372
|
exports.CollectionRedemptionStatus = /*#__PURE__*/function () {
|
|
2054
2373
|
var _ref74 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(_ref73) {
|
|
2055
2374
|
var marketplaceParams, confirmationId, statuses;
|
|
2056
2375
|
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
|
|
2057
|
-
while (1)
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
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
|
+
}
|
|
2082
2406
|
}
|
|
2083
2407
|
}, _callee37, this, [[1, 8]]);
|
|
2084
2408
|
}));
|
|
2409
|
+
|
|
2085
2410
|
return function (_x23) {
|
|
2086
2411
|
return _ref74.apply(this, arguments);
|
|
2087
2412
|
};
|
|
2088
2413
|
}();
|
|
2089
|
-
|
|
2090
2414
|
/* EVENTS */
|
|
2091
2415
|
|
|
2416
|
+
|
|
2092
2417
|
exports.LoadDrop = /*#__PURE__*/function () {
|
|
2093
2418
|
var _ref76 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(_ref75) {
|
|
2094
2419
|
var _this = this;
|
|
2420
|
+
|
|
2095
2421
|
var tenantSlug, eventSlug, dropId, mainSiteHash, event, eventId;
|
|
2096
2422
|
return _regeneratorRuntime.wrap(function _callee38$(_context38) {
|
|
2097
|
-
while (1)
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
metadataSubtree: UrlJoin("public", "asset_metadata", "tenants", tenantSlug, "sites", eventSlug, "info"),
|
|
2123
|
-
resolveLinks: true,
|
|
2124
|
-
linkDepthLimit: 2,
|
|
2125
|
-
resolveIncludeSource: true,
|
|
2126
|
-
produceLinkUrls: true,
|
|
2127
|
-
select: [".", "drops"],
|
|
2128
|
-
noAuth: true
|
|
2129
|
-
});
|
|
2130
|
-
case 10:
|
|
2131
|
-
_context38.t0 = _context38.sent;
|
|
2132
|
-
if (_context38.t0) {
|
|
2133
|
-
_context38.next = 13;
|
|
2134
|
-
break;
|
|
2135
|
-
}
|
|
2136
|
-
_context38.t0 = [];
|
|
2137
|
-
case 13:
|
|
2138
|
-
event = _context38.t0;
|
|
2139
|
-
eventId = Utils.DecodeVersionHash(event["."].source).objectId;
|
|
2140
|
-
event.drops.forEach(function (drop) {
|
|
2141
|
-
drop = _objectSpread(_objectSpread({}, drop), {}, {
|
|
2142
|
-
eventId: eventId
|
|
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
|
|
2143
2448
|
});
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
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
|
+
}
|
|
2152
2492
|
}
|
|
2153
2493
|
}, _callee38, this);
|
|
2154
2494
|
}));
|
|
2495
|
+
|
|
2155
2496
|
return function (_x24) {
|
|
2156
2497
|
return _ref76.apply(this, arguments);
|
|
2157
2498
|
};
|
|
2158
2499
|
}();
|
|
2500
|
+
|
|
2159
2501
|
exports.SubmitDropVote = /*#__PURE__*/function () {
|
|
2160
2502
|
var _ref78 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(_ref77) {
|
|
2161
2503
|
var marketplaceParams, eventId, dropId, sku, marketplaceInfo;
|
|
2162
2504
|
return _regeneratorRuntime.wrap(function _callee39$(_context39) {
|
|
2163
|
-
while (1)
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
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
|
+
}
|
|
2189
2535
|
}
|
|
2190
2536
|
}, _callee39, this);
|
|
2191
2537
|
}));
|
|
2538
|
+
|
|
2192
2539
|
return function (_x25) {
|
|
2193
2540
|
return _ref78.apply(this, arguments);
|
|
2194
2541
|
};
|
|
2195
2542
|
}();
|
|
2543
|
+
|
|
2196
2544
|
exports.DropStatus = /*#__PURE__*/function () {
|
|
2197
2545
|
var _ref80 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(_ref79) {
|
|
2198
2546
|
var marketplace, eventId, dropId, response;
|
|
2199
2547
|
return _regeneratorRuntime.wrap(function _callee40$(_context40) {
|
|
2200
|
-
while (1)
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
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
|
+
}
|
|
2227
2580
|
}
|
|
2228
2581
|
}, _callee40, this, [[1, 8]]);
|
|
2229
2582
|
}));
|
|
2583
|
+
|
|
2230
2584
|
return function (_x26) {
|
|
2231
2585
|
return _ref80.apply(this, arguments);
|
|
2232
2586
|
};
|
|
2233
2587
|
}();
|
|
2234
|
-
|
|
2235
2588
|
/* OFFERS */
|
|
2236
2589
|
// TODO: Document
|
|
2237
2590
|
|
|
2591
|
+
|
|
2238
2592
|
exports.MarketplaceOffers = /*#__PURE__*/function () {
|
|
2239
2593
|
var _ref82 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(_ref81) {
|
|
2240
2594
|
var contractAddress, tokenId, buyerAddress, sellerAddress, statuses, _ref81$start, start, _ref81$limit, limit, path, queryParams, offers;
|
|
2595
|
+
|
|
2241
2596
|
return _regeneratorRuntime.wrap(function _callee41$(_context41) {
|
|
2242
|
-
while (1)
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
path = UrlJoin(path, "c", Utils.FormatAddress(contractAddress));
|
|
2253
|
-
if (tokenId) {
|
|
2254
|
-
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));
|
|
2255
2607
|
}
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
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
|
+
}
|
|
2282
2647
|
}
|
|
2283
2648
|
}, _callee41, this);
|
|
2284
2649
|
}));
|
|
2650
|
+
|
|
2285
2651
|
return function (_x27) {
|
|
2286
2652
|
return _ref82.apply(this, arguments);
|
|
2287
2653
|
};
|
|
2288
2654
|
}();
|
|
2655
|
+
|
|
2289
2656
|
exports.CreateMarketplaceOffer = /*#__PURE__*/function () {
|
|
2290
2657
|
var _ref84 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(_ref83) {
|
|
2291
2658
|
var contractAddress, tokenId, offerId, price, expiresAt, response;
|
|
2292
2659
|
return _regeneratorRuntime.wrap(function _callee42$(_context42) {
|
|
2293
|
-
while (1)
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2302
|
-
path: UrlJoin("as", "wlt", "mkt", "offers", offerId),
|
|
2303
|
-
method: "PUT",
|
|
2304
|
-
body: {
|
|
2305
|
-
price: price,
|
|
2306
|
-
expiration: Math.floor(expiresAt / 1000)
|
|
2307
|
-
},
|
|
2308
|
-
headers: {
|
|
2309
|
-
Authorization: "Bearer ".concat(this.AuthToken())
|
|
2310
|
-
}
|
|
2311
|
-
}));
|
|
2312
|
-
case 4:
|
|
2313
|
-
response = _context42.sent;
|
|
2314
|
-
_context42.next = 10;
|
|
2315
|
-
break;
|
|
2316
|
-
case 7:
|
|
2317
|
-
_context42.next = 9;
|
|
2318
|
-
return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
|
|
2319
|
-
path: UrlJoin("as", "wlt", "mkt", "offers", contractAddress, tokenId),
|
|
2320
|
-
method: "POST",
|
|
2321
|
-
body: {
|
|
2322
|
-
contract: contractAddress,
|
|
2323
|
-
token: tokenId,
|
|
2324
|
-
price: price,
|
|
2325
|
-
expiration: Math.floor(expiresAt / 1000)
|
|
2326
|
-
},
|
|
2327
|
-
headers: {
|
|
2328
|
-
Authorization: "Bearer ".concat(this.AuthToken())
|
|
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;
|
|
2329
2668
|
}
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
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
|
+
}
|
|
2338
2714
|
}
|
|
2339
2715
|
}, _callee42, this);
|
|
2340
2716
|
}));
|
|
2717
|
+
|
|
2341
2718
|
return function (_x28) {
|
|
2342
2719
|
return _ref84.apply(this, arguments);
|
|
2343
2720
|
};
|
|
2344
2721
|
}();
|
|
2722
|
+
|
|
2345
2723
|
exports.RemoveMarketplaceOffer = /*#__PURE__*/function () {
|
|
2346
2724
|
var _ref86 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(_ref85) {
|
|
2347
2725
|
var offerId;
|
|
2348
2726
|
return _regeneratorRuntime.wrap(function _callee43$(_context43) {
|
|
2349
|
-
while (1)
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
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
|
+
}
|
|
2365
2747
|
}
|
|
2366
2748
|
}, _callee43, this);
|
|
2367
2749
|
}));
|
|
2750
|
+
|
|
2368
2751
|
return function (_x29) {
|
|
2369
2752
|
return _ref86.apply(this, arguments);
|
|
2370
2753
|
};
|
|
2371
2754
|
}();
|
|
2755
|
+
|
|
2372
2756
|
exports.AcceptMarketplaceOffer = /*#__PURE__*/function () {
|
|
2373
2757
|
var _ref88 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(_ref87) {
|
|
2374
2758
|
var offerId;
|
|
2375
2759
|
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
2376
|
-
while (1)
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
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
|
+
}
|
|
2392
2780
|
}
|
|
2393
2781
|
}, _callee44, this);
|
|
2394
2782
|
}));
|
|
2783
|
+
|
|
2395
2784
|
return function (_x30) {
|
|
2396
2785
|
return _ref88.apply(this, arguments);
|
|
2397
2786
|
};
|
|
2398
2787
|
}();
|
|
2788
|
+
|
|
2399
2789
|
exports.RejectMarketplaceOffer = /*#__PURE__*/function () {
|
|
2400
2790
|
var _ref90 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(_ref89) {
|
|
2401
2791
|
var offerId;
|
|
2402
2792
|
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
2403
|
-
while (1)
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
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
|
+
}
|
|
2419
2813
|
}
|
|
2420
2814
|
}, _callee45, this);
|
|
2421
2815
|
}));
|
|
2816
|
+
|
|
2422
2817
|
return function (_x31) {
|
|
2423
2818
|
return _ref90.apply(this, arguments);
|
|
2424
2819
|
};
|