@eluvio/elv-client-js 4.0.40 → 4.0.42

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.
@@ -470,6 +470,8 @@ exports.UserListings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
470
470
  * @param {Object=} marketplaceParams - Filter results by marketplace
471
471
  * @param {string=} contractAddress - Filter results by the address of the NFT contract
472
472
  * @param {string=} tokenId - Filter by token ID (if filtering by contract address)
473
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
474
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
473
475
  * @param {integer=} lastNDays - Filter by results listed in the past N days
474
476
  *
475
477
  * @returns {Promise<Array<Object>>} - List of current user's sales
@@ -483,12 +485,15 @@ exports.UserSales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
483
485
  sortDesc,
484
486
  contractAddress,
485
487
  tokenId,
488
+ startTime,
489
+ endTime,
490
+ lastNDays,
486
491
  marketplaceParams,
487
492
  _args7 = arguments;
488
493
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
489
494
  while (1) switch (_context7.prev = _context7.next) {
490
495
  case 0:
491
- _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;
496
+ _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, startTime = _ref15.startTime, endTime = _ref15.endTime, lastNDays = _ref15.lastNDays, marketplaceParams = _ref15.marketplaceParams;
492
497
  _context7.next = 3;
493
498
  return this.FilteredQuery({
494
499
  mode: "sales",
@@ -497,6 +502,9 @@ exports.UserSales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
497
502
  sortBy: sortBy,
498
503
  sortDesc: sortDesc,
499
504
  sellerAddress: userAddress || this.UserAddress(),
505
+ startTime: startTime,
506
+ endTime: endTime,
507
+ lastNDays: lastNDays,
500
508
  marketplaceParams: marketplaceParams,
501
509
  contractAddress: contractAddress,
502
510
  tokenId: tokenId
@@ -521,6 +529,8 @@ exports.UserSales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
521
529
  * @param {Object=} marketplaceParams - Filter results by marketplace
522
530
  * @param {string=} contractAddress - Filter results by the address of the NFT contract
523
531
  * @param {string=} tokenId - Filter by token ID (if filtering by contract address)
532
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
533
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
524
534
  * @param {integer=} lastNDays - Filter by results listed in the past N days
525
535
  *
526
536
  * @returns {Promise<Array<Object>>} - List of current user's sales
@@ -534,12 +544,15 @@ exports.UserTransfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerato
534
544
  sortDesc,
535
545
  contractAddress,
536
546
  tokenId,
547
+ startTime,
548
+ endTime,
549
+ lastNDays,
537
550
  marketplaceParams,
538
551
  _args8 = arguments;
539
552
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
540
553
  while (1) switch (_context8.prev = _context8.next) {
541
554
  case 0:
542
- _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;
555
+ _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, startTime = _ref17.startTime, endTime = _ref17.endTime, lastNDays = _ref17.lastNDays, marketplaceParams = _ref17.marketplaceParams;
543
556
  _context8.next = 3;
544
557
  return this.FilteredQuery({
545
558
  mode: "transfers",
@@ -550,7 +563,10 @@ exports.UserTransfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerato
550
563
  sellerAddress: userAddress || this.UserAddress(),
551
564
  marketplaceParams: marketplaceParams,
552
565
  contractAddress: contractAddress,
553
- tokenId: tokenId
566
+ tokenId: tokenId,
567
+ startTime: startTime,
568
+ endTime: endTime,
569
+ lastNDays: lastNDays
554
570
  });
555
571
  case 3:
556
572
  return _context8.abrupt("return", _context8.sent.results);
@@ -1189,6 +1205,8 @@ exports.Listing = /*#__PURE__*/function () {
1189
1205
  * @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
1190
1206
  * @param {Object=} marketplaceParams - Filter results by marketplace
1191
1207
  * @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
1208
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
1209
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
1192
1210
  * @param {integer=} lastNDays - Filter by results listed in the past N days
1193
1211
  * @param {boolean=} includeCheckoutLocked - If specified, listings which are currently in the checkout process (and not so currently purchasable) will be included in the results. By default they are excluded.
1194
1212
  *
@@ -1237,6 +1255,8 @@ exports.Listings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRunt
1237
1255
  * @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
1238
1256
  * @param {Object=} marketplaceParams - Filter results by marketplace
1239
1257
  * @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
1258
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
1259
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
1240
1260
  * @param {integer=} lastNDays - Filter by results listed in the past N days
1241
1261
  *
1242
1262
  * @returns {Promise<Object>} - Statistics about listings. All prices in USD.
@@ -1283,6 +1303,8 @@ exports.ListingStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator
1283
1303
  * @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
1284
1304
  * @param {Object=} marketplaceParams - Filter results by marketplace
1285
1305
  * @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
1306
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
1307
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
1286
1308
  * @param {integer=} lastNDays - Filter by results listed in the past N days
1287
1309
  *
1288
1310
  * @returns {Promise<Object>} - Results of the query and pagination info
@@ -1329,6 +1351,8 @@ exports.Sales = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
1329
1351
  * @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
1330
1352
  * @param {Object=} marketplaceParams - Filter results by marketplace
1331
1353
  * @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
1354
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
1355
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
1332
1356
  * @param {integer=} lastNDays - Filter by results listed in the past N days
1333
1357
  *
1334
1358
  * @returns {Promise<Object>} - Results of the query and pagination info
@@ -1375,6 +1399,8 @@ exports.Transfers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRun
1375
1399
  * @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
1376
1400
  * @param {Object=} marketplaceParams - Filter results by marketplace
1377
1401
  * @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
1402
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
1403
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
1378
1404
  * @param {integer=} lastNDays - Filter by results listed in the past N days
1379
1405
  *
1380
1406
  * @returns {Promise<Object>} - Statistics about sales. All prices in USD.
@@ -914,11 +914,11 @@ var ElvWalletClient = /*#__PURE__*/function () {
914
914
  key: "SetCodeAuth",
915
915
  value: function () {
916
916
  var _SetCodeAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref15) {
917
- var code, authToken;
917
+ var code, address, type, authToken;
918
918
  return _regeneratorRuntime.wrap(function _callee14$(_context14) {
919
919
  while (1) switch (_context14.prev = _context14.next) {
920
920
  case 0:
921
- code = _ref15.code, authToken = _ref15.authToken;
921
+ code = _ref15.code, address = _ref15.address, type = _ref15.type, authToken = _ref15.authToken;
922
922
  _context14.next = 3;
923
923
  return Utils.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({
924
924
  path: UrlJoin("as", "wlt", "login", "session", code),
@@ -930,7 +930,12 @@ var ElvWalletClient = /*#__PURE__*/function () {
930
930
  op: "set",
931
931
  id: code,
932
932
  format: "auth_token",
933
- payload: authToken
933
+ payload: JSON.stringify({
934
+ addr: Utils.FormatAddress(address),
935
+ eth: address ? "ikms".concat(Utils.AddressToHash(address)) : "",
936
+ type: type,
937
+ token: authToken
938
+ })
934
939
  }
935
940
  }));
936
941
  case 3:
@@ -989,6 +994,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
989
994
  var _this4 = this;
990
995
  var forceReload,
991
996
  metadata,
997
+ marketplaceOrder,
992
998
  previewTenantSlug,
993
999
  previewMarketplaceSlug,
994
1000
  previewMarketplaceMetadata,
@@ -1009,7 +1015,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
1009
1015
  return this.client.ContentObjectMetadata({
1010
1016
  libraryId: this.mainSiteLibraryId,
1011
1017
  objectId: this.mainSiteId,
1012
- metadataSubtree: "public/asset_metadata/tenants",
1018
+ metadataSubtree: "public/asset_metadata",
1013
1019
  resolveLinks: true,
1014
1020
  linkDepthLimit: 2,
1015
1021
  resolveIncludeSource: true,
@@ -1017,13 +1023,17 @@ var ElvWalletClient = /*#__PURE__*/function () {
1017
1023
  produceLinkUrls: true,
1018
1024
  authorizationToken: this.publicStaticToken,
1019
1025
  noAuth: true,
1020
- select: ["*/.", "*/info/branding", "*/marketplaces/*/.", "*/marketplaces/*/info/tenant_id", "*/marketplaces/*/info/tenant_name", "*/marketplaces/*/info/branding", "*/marketplaces/*/info/storefront/background", "*/marketplaces/*/info/storefront/background_mobile"],
1021
- remove: ["*/info/branding/wallet_css", "*/marketplaces/*/info/branding/custom_css"]
1026
+ select: ["info/marketplace_order", "tenants/*/.", "tenants/*/info/branding", "tenants/*/marketplaces/*/.", "tenants/*/marketplaces/*/info/tenant_id", "tenants/*/marketplaces/*/info/tenant_name", "tenants/*/marketplaces/*/info/branding", "tenants/*/marketplaces/*/info/storefront/background", "tenants/*/marketplaces/*/info/storefront/background_mobile"],
1027
+ remove: ["tenants/*/info/branding/wallet_css", "tenants/*/marketplaces/*/info/branding/custom_css"]
1022
1028
  });
1023
1029
  case 5:
1024
1030
  metadata = _context16.sent;
1031
+ marketplaceOrder = ((metadata || {}).info || {}).marketplace_order || [];
1032
+ metadata = (metadata || {}).tenants || {};
1033
+
1034
+ // If preview marketplace is specified, load it appropriately
1025
1035
  if (!this.previewMarketplaceId) {
1026
- _context16.next = 21;
1036
+ _context16.next = 23;
1027
1037
  break;
1028
1038
  }
1029
1039
  previewTenantSlug = "PREVIEW";
@@ -1046,10 +1056,10 @@ var ElvWalletClient = /*#__PURE__*/function () {
1046
1056
 
1047
1057
  // Marketplace not present in branch, or preview version is different - Load metadata directly
1048
1058
  if (previewMarketplaceMetadata) {
1049
- _context16.next = 14;
1059
+ _context16.next = 16;
1050
1060
  break;
1051
1061
  }
1052
- _context16.next = 12;
1062
+ _context16.next = 14;
1053
1063
  return this.client.ContentObjectMetadata({
1054
1064
  versionHash: this.previewMarketplaceHash,
1055
1065
  metadataSubtree: "public/asset_metadata",
@@ -1059,12 +1069,12 @@ var ElvWalletClient = /*#__PURE__*/function () {
1059
1069
  select: ["slug", "info/tenant_id", "info/tenant_name", "info/branding"],
1060
1070
  remove: ["info/branding/custom_css"]
1061
1071
  });
1062
- case 12:
1072
+ case 14:
1063
1073
  previewMarketplaceMetadata = _context16.sent;
1064
1074
  if (!previewMarketplaceSlug) {
1065
1075
  previewMarketplaceSlug = previewMarketplaceMetadata.slug;
1066
1076
  }
1067
- case 14:
1077
+ case 16:
1068
1078
  previewMarketplaceMetadata["."] = {
1069
1079
  source: this.previewMarketplaceHash
1070
1080
  };
@@ -1076,7 +1086,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
1076
1086
  metadata[previewTenantSlug] = metadata[previewTenantSlug] || {};
1077
1087
  metadata[previewTenantSlug].marketplaces = metadata[previewTenantSlug].marketplaces || {};
1078
1088
  metadata[previewTenantSlug].marketplaces[previewMarketplaceSlug] = previewMarketplaceMetadata;
1079
- case 21:
1089
+ case 23:
1080
1090
  availableMarketplaces = _objectSpread({}, this.availableMarketplaces || {});
1081
1091
  availableMarketplacesById = _objectSpread({}, this.availableMarketplacesById || {});
1082
1092
  Object.keys(metadata || {}).forEach(function (tenantSlug) {
@@ -1096,7 +1106,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
1096
1106
  marketplaceId: objectId,
1097
1107
  marketplaceHash: versionHash,
1098
1108
  tenantBranding: (metadata[tenantSlug].info || {}).branding || {},
1099
- order: Configuration.__MARKETPLACE_ORDER.findIndex(function (slug) {
1109
+ order: marketplaceOrder.findIndex(function (slug) {
1100
1110
  return slug === marketplaceSlug;
1101
1111
  })
1102
1112
  });
@@ -1119,7 +1129,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
1119
1129
  });
1120
1130
  this.availableMarketplaces = availableMarketplaces;
1121
1131
  this.availableMarketplacesById = availableMarketplacesById;
1122
- case 26:
1132
+ case 28:
1123
1133
  case "end":
1124
1134
  return _context16.stop();
1125
1135
  }
@@ -1363,6 +1373,8 @@ var ElvWalletClient = /*#__PURE__*/function () {
1363
1373
  sellerAddress,
1364
1374
  _ref19$lastNDays,
1365
1375
  lastNDays,
1376
+ startTime,
1377
+ endTime,
1366
1378
  _ref19$includeCheckou,
1367
1379
  includeCheckoutLocked,
1368
1380
  _ref19$start,
@@ -1381,7 +1393,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
1381
1393
  return _regeneratorRuntime.wrap(function _callee20$(_context20) {
1382
1394
  while (1) switch (_context20.prev = _context20.next) {
1383
1395
  case 0:
1384
- _ref19 = _args20.length > 0 && _args20[0] !== undefined ? _args20[0] : {}, _ref19$mode = _ref19.mode, mode = _ref19$mode === void 0 ? "listings" : _ref19$mode, _ref19$sortBy = _ref19.sortBy, sortBy = _ref19$sortBy === void 0 ? "created" : _ref19$sortBy, _ref19$sortDesc = _ref19.sortDesc, sortDesc = _ref19$sortDesc === void 0 ? false : _ref19$sortDesc, filter = _ref19.filter, editionFilters = _ref19.editionFilters, attributeFilters = _ref19.attributeFilters, contractAddress = _ref19.contractAddress, tokenId = _ref19.tokenId, currency = _ref19.currency, marketplaceParams = _ref19.marketplaceParams, tenantId = _ref19.tenantId, collectionIndexes = _ref19.collectionIndexes, priceRange = _ref19.priceRange, tokenIdRange = _ref19.tokenIdRange, capLimit = _ref19.capLimit, userAddress = _ref19.userAddress, sellerAddress = _ref19.sellerAddress, _ref19$lastNDays = _ref19.lastNDays, lastNDays = _ref19$lastNDays === void 0 ? -1 : _ref19$lastNDays, _ref19$includeCheckou = _ref19.includeCheckoutLocked, includeCheckoutLocked = _ref19$includeCheckou === void 0 ? false : _ref19$includeCheckou, _ref19$start = _ref19.start, start = _ref19$start === void 0 ? 0 : _ref19$start, _ref19$limit = _ref19.limit, limit = _ref19$limit === void 0 ? 50 : _ref19$limit;
1396
+ _ref19 = _args20.length > 0 && _args20[0] !== undefined ? _args20[0] : {}, _ref19$mode = _ref19.mode, mode = _ref19$mode === void 0 ? "listings" : _ref19$mode, _ref19$sortBy = _ref19.sortBy, sortBy = _ref19$sortBy === void 0 ? "created" : _ref19$sortBy, _ref19$sortDesc = _ref19.sortDesc, sortDesc = _ref19$sortDesc === void 0 ? false : _ref19$sortDesc, filter = _ref19.filter, editionFilters = _ref19.editionFilters, attributeFilters = _ref19.attributeFilters, contractAddress = _ref19.contractAddress, tokenId = _ref19.tokenId, currency = _ref19.currency, marketplaceParams = _ref19.marketplaceParams, tenantId = _ref19.tenantId, collectionIndexes = _ref19.collectionIndexes, priceRange = _ref19.priceRange, tokenIdRange = _ref19.tokenIdRange, capLimit = _ref19.capLimit, userAddress = _ref19.userAddress, sellerAddress = _ref19.sellerAddress, _ref19$lastNDays = _ref19.lastNDays, lastNDays = _ref19$lastNDays === void 0 ? -1 : _ref19$lastNDays, startTime = _ref19.startTime, endTime = _ref19.endTime, _ref19$includeCheckou = _ref19.includeCheckoutLocked, includeCheckoutLocked = _ref19$includeCheckou === void 0 ? false : _ref19$includeCheckou, _ref19$start = _ref19.start, start = _ref19$start === void 0 ? 0 : _ref19$start, _ref19$limit = _ref19.limit, limit = _ref19$limit === void 0 ? 50 : _ref19$limit;
1385
1397
  collectionIndexes = (collectionIndexes || []).map(function (i) {
1386
1398
  return parseInt(i);
1387
1399
  });
@@ -1492,7 +1504,14 @@ var ElvWalletClient = /*#__PURE__*/function () {
1492
1504
  if (currency) {
1493
1505
  filters.push("link_type:eq:sol");
1494
1506
  }
1495
- if (lastNDays && lastNDays > 0) {
1507
+ if (startTime || endTime) {
1508
+ if (startTime) {
1509
+ filters.push("created:gt:".concat(parseInt(startTime) / 1000));
1510
+ }
1511
+ if (endTime) {
1512
+ filters.push("created:lt:".concat(parseInt(endTime) / 1000));
1513
+ }
1514
+ } else if (lastNDays && lastNDays > 0) {
1496
1515
  filters.push("created:gt:".concat((Date.now() / 1000 - lastNDays * 24 * 60 * 60).toFixed(0)));
1497
1516
  }
1498
1517
  if (priceRange) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.0.40",
3
+ "version": "4.0.42",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -291,11 +291,13 @@ exports.UserListings = async function({userAddress, sortBy="created", sortDesc=f
291
291
  * @param {Object=} marketplaceParams - Filter results by marketplace
292
292
  * @param {string=} contractAddress - Filter results by the address of the NFT contract
293
293
  * @param {string=} tokenId - Filter by token ID (if filtering by contract address)
294
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
295
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
294
296
  * @param {integer=} lastNDays - Filter by results listed in the past N days
295
297
  *
296
298
  * @returns {Promise<Array<Object>>} - List of current user's sales
297
299
  */
298
- exports.UserSales = async function({userAddress, sortBy="created", sortDesc=false, contractAddress, tokenId, marketplaceParams}={}) {
300
+ exports.UserSales = async function({userAddress, sortBy="created", sortDesc=false, contractAddress, tokenId, startTime, endTime, lastNDays, marketplaceParams}={}) {
299
301
  return (
300
302
  await this.FilteredQuery({
301
303
  mode: "sales",
@@ -304,6 +306,9 @@ exports.UserSales = async function({userAddress, sortBy="created", sortDesc=fals
304
306
  sortBy,
305
307
  sortDesc,
306
308
  sellerAddress: userAddress || this.UserAddress(),
309
+ startTime,
310
+ endTime,
311
+ lastNDays,
307
312
  marketplaceParams,
308
313
  contractAddress,
309
314
  tokenId
@@ -322,11 +327,13 @@ exports.UserSales = async function({userAddress, sortBy="created", sortDesc=fals
322
327
  * @param {Object=} marketplaceParams - Filter results by marketplace
323
328
  * @param {string=} contractAddress - Filter results by the address of the NFT contract
324
329
  * @param {string=} tokenId - Filter by token ID (if filtering by contract address)
330
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
331
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
325
332
  * @param {integer=} lastNDays - Filter by results listed in the past N days
326
333
  *
327
334
  * @returns {Promise<Array<Object>>} - List of current user's sales
328
335
  */
329
- exports.UserTransfers = async function({userAddress, sortBy="created", sortDesc=false, contractAddress, tokenId, marketplaceParams}={}) {
336
+ exports.UserTransfers = async function({userAddress, sortBy="created", sortDesc=false, contractAddress, tokenId, startTime, endTime, lastNDays, marketplaceParams}={}) {
330
337
  return (
331
338
  await this.FilteredQuery({
332
339
  mode: "transfers",
@@ -337,7 +344,10 @@ exports.UserTransfers = async function({userAddress, sortBy="created", sortDesc=
337
344
  sellerAddress: userAddress || this.UserAddress(),
338
345
  marketplaceParams,
339
346
  contractAddress,
340
- tokenId
347
+ tokenId,
348
+ startTime,
349
+ endTime,
350
+ lastNDays
341
351
  })
342
352
  ).results;
343
353
  };
@@ -724,6 +734,8 @@ exports.Listing = async function({listingId}) {
724
734
  * @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
725
735
  * @param {Object=} marketplaceParams - Filter results by marketplace
726
736
  * @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
737
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
738
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
727
739
  * @param {integer=} lastNDays - Filter by results listed in the past N days
728
740
  * @param {boolean=} includeCheckoutLocked - If specified, listings which are currently in the checkout process (and not so currently purchasable) will be included in the results. By default they are excluded.
729
741
  *
@@ -761,6 +773,8 @@ exports.Listings = async function() {
761
773
  * @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
762
774
  * @param {Object=} marketplaceParams - Filter results by marketplace
763
775
  * @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
776
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
777
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
764
778
  * @param {integer=} lastNDays - Filter by results listed in the past N days
765
779
  *
766
780
  * @returns {Promise<Object>} - Statistics about listings. All prices in USD.
@@ -796,6 +810,8 @@ exports.ListingStats = async function() {
796
810
  * @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
797
811
  * @param {Object=} marketplaceParams - Filter results by marketplace
798
812
  * @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
813
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
814
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
799
815
  * @param {integer=} lastNDays - Filter by results listed in the past N days
800
816
  *
801
817
  * @returns {Promise<Object>} - Results of the query and pagination info
@@ -831,6 +847,8 @@ exports.Sales = async function() {
831
847
  * @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
832
848
  * @param {Object=} marketplaceParams - Filter results by marketplace
833
849
  * @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
850
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
851
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
834
852
  * @param {integer=} lastNDays - Filter by results listed in the past N days
835
853
  *
836
854
  * @returns {Promise<Object>} - Results of the query and pagination info
@@ -866,6 +884,8 @@ exports.Transfers = async function() {
866
884
  * @param {string=} currency - Filter results by purchase currency. Available options: `usdc`
867
885
  * @param {Object=} marketplaceParams - Filter results by marketplace
868
886
  * @param {Array<integer>=} collectionIndexes - If filtering by marketplace, filter by collection(s). The index refers to the index in the array `marketplace.collections`
887
+ * @param {integer=} startTime - Filter by results listed after the specified time (in milliseconds since epoch)
888
+ * @param {integer=} endTime - Filter by results listed before the specified time (in milliseconds since epoch)
869
889
  * @param {integer=} lastNDays - Filter by results listed in the past N days
870
890
  *
871
891
  * @returns {Promise<Object>} - Statistics about sales. All prices in USD.
@@ -720,7 +720,7 @@ class ElvWalletClient {
720
720
  let metadata = await this.client.ContentObjectMetadata({
721
721
  libraryId: this.mainSiteLibraryId,
722
722
  objectId: this.mainSiteId,
723
- metadataSubtree: "public/asset_metadata/tenants",
723
+ metadataSubtree: "public/asset_metadata",
724
724
  resolveLinks: true,
725
725
  linkDepthLimit: 2,
726
726
  resolveIncludeSource: true,
@@ -729,21 +729,25 @@ class ElvWalletClient {
729
729
  authorizationToken: this.publicStaticToken,
730
730
  noAuth: true,
731
731
  select: [
732
- "*/.",
733
- "*/info/branding",
734
- "*/marketplaces/*/.",
735
- "*/marketplaces/*/info/tenant_id",
736
- "*/marketplaces/*/info/tenant_name",
737
- "*/marketplaces/*/info/branding",
738
- "*/marketplaces/*/info/storefront/background",
739
- "*/marketplaces/*/info/storefront/background_mobile"
732
+ "info/marketplace_order",
733
+ "tenants/*/.",
734
+ "tenants/*/info/branding",
735
+ "tenants/*/marketplaces/*/.",
736
+ "tenants/*/marketplaces/*/info/tenant_id",
737
+ "tenants/*/marketplaces/*/info/tenant_name",
738
+ "tenants/*/marketplaces/*/info/branding",
739
+ "tenants/*/marketplaces/*/info/storefront/background",
740
+ "tenants/*/marketplaces/*/info/storefront/background_mobile"
740
741
  ],
741
742
  remove: [
742
- "*/info/branding/wallet_css",
743
- "*/marketplaces/*/info/branding/custom_css"
743
+ "tenants/*/info/branding/wallet_css",
744
+ "tenants/*/marketplaces/*/info/branding/custom_css"
744
745
  ]
745
746
  });
746
747
 
748
+ const marketplaceOrder = ((metadata || {}).info || {}).marketplace_order || [];
749
+ metadata = (metadata || {}).tenants || {};
750
+
747
751
  // If preview marketplace is specified, load it appropriately
748
752
  if(this.previewMarketplaceId) {
749
753
  let previewTenantSlug = "PREVIEW";
@@ -827,7 +831,7 @@ class ElvWalletClient {
827
831
  marketplaceId: objectId,
828
832
  marketplaceHash: versionHash,
829
833
  tenantBranding: (metadata[tenantSlug].info || {}).branding || {},
830
- order: Configuration.__MARKETPLACE_ORDER.findIndex(slug => slug === marketplaceSlug)
834
+ order: marketplaceOrder.findIndex(slug => slug === marketplaceSlug)
831
835
  };
832
836
 
833
837
  availableMarketplacesById[objectId] = availableMarketplaces[tenantSlug][marketplaceSlug];
@@ -1000,6 +1004,8 @@ class ElvWalletClient {
1000
1004
  userAddress,
1001
1005
  sellerAddress,
1002
1006
  lastNDays=-1,
1007
+ startTime,
1008
+ endTime,
1003
1009
  includeCheckoutLocked=false,
1004
1010
  start=0,
1005
1011
  limit=50
@@ -1116,7 +1122,15 @@ class ElvWalletClient {
1116
1122
  filters.push("link_type:eq:sol");
1117
1123
  }
1118
1124
 
1119
- if(lastNDays && lastNDays > 0) {
1125
+ if(startTime || endTime) {
1126
+ if(startTime) {
1127
+ filters.push(`created:gt:${parseInt(startTime) / 1000}`);
1128
+ }
1129
+
1130
+ if(endTime) {
1131
+ filters.push(`created:lt:${parseInt(endTime) / 1000}`);
1132
+ }
1133
+ } else if(lastNDays && lastNDays > 0) {
1120
1134
  filters.push(`created:gt:${((Date.now() / 1000) - ( lastNDays * 24 * 60 * 60 )).toFixed(0)}`);
1121
1135
  }
1122
1136