@eluvio/elv-client-js 4.0.64 → 4.0.66

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.
@@ -95,10 +95,14 @@ var FormatNFTDetails = function FormatNFTDetails(entry) {
95
95
  } else {
96
96
  details.Offers = info.offers || [];
97
97
  }
98
- return {
98
+ var result = {
99
99
  metadata: metadata,
100
100
  details: details
101
101
  };
102
+ if (entry.nft_template) {
103
+ result.nft_template = entry.nft_template;
104
+ }
105
+ return result;
102
106
  };
103
107
  exports.FormatNFTDetails = FormatNFTDetails;
104
108
  var FormatNFTMetadata = function FormatNFTMetadata(walletClient, nft) {
@@ -1412,6 +1412,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
1412
1412
  _ref21,
1413
1413
  contents,
1414
1414
  paging,
1415
+ modesToFormat,
1415
1416
  _args20 = arguments;
1416
1417
  return _regeneratorRuntime.wrap(function _callee20$(_context20) {
1417
1418
  while (1) switch (_context20.prev = _context20.next) {
@@ -1632,6 +1633,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
1632
1633
  _ref21 = _context20.t1;
1633
1634
  contents = _ref21.contents;
1634
1635
  paging = _ref21.paging;
1636
+ modesToFormat = ["owned", "listings", "owned-full-meta"];
1635
1637
  return _context20.abrupt("return", {
1636
1638
  paging: {
1637
1639
  start: params.start,
@@ -1640,14 +1642,14 @@ var ElvWalletClient = /*#__PURE__*/function () {
1640
1642
  more: paging.total > start + limit
1641
1643
  },
1642
1644
  results: (contents || []).map(function (item) {
1643
- return ["owned", "listings"].includes(mode) ? FormatNFT(_this6, item) : item;
1645
+ return modesToFormat.includes(mode) ? FormatNFT(_this6, item) : item;
1644
1646
  })
1645
1647
  });
1646
- case 71:
1647
- _context20.prev = 71;
1648
+ case 72:
1649
+ _context20.prev = 72;
1648
1650
  _context20.t4 = _context20["catch"](14);
1649
1651
  if (!(_context20.t4.status && _context20.t4.status.toString() === "404")) {
1650
- _context20.next = 75;
1652
+ _context20.next = 76;
1651
1653
  break;
1652
1654
  }
1653
1655
  return _context20.abrupt("return", {
@@ -1659,13 +1661,13 @@ var ElvWalletClient = /*#__PURE__*/function () {
1659
1661
  },
1660
1662
  results: []
1661
1663
  });
1662
- case 75:
1663
- throw _context20.t4;
1664
1664
  case 76:
1665
+ throw _context20.t4;
1666
+ case 77:
1665
1667
  case "end":
1666
1668
  return _context20.stop();
1667
1669
  }
1668
- }, _callee20, this, [[14, 71]]);
1670
+ }, _callee20, this, [[14, 72]]);
1669
1671
  }));
1670
1672
  function FilteredQuery() {
1671
1673
  return _FilteredQuery.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.0.64",
3
+ "version": "4.0.66",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -88,10 +88,16 @@ const FormatNFTDetails = function(entry) {
88
88
  details.Offers = info.offers || [];
89
89
  }
90
90
 
91
- return {
91
+ const result = {
92
92
  metadata,
93
93
  details
94
94
  };
95
+
96
+ if(entry.nft_template) {
97
+ result.nft_template = entry.nft_template;
98
+ }
99
+
100
+ return result;
95
101
  };
96
102
 
97
103
  exports.FormatNFTDetails = FormatNFTDetails;
@@ -1244,6 +1244,7 @@ class ElvWalletClient {
1244
1244
  })
1245
1245
  ) || [];
1246
1246
 
1247
+ const modesToFormat = ["owned", "listings", "owned-full-meta"];
1247
1248
  return {
1248
1249
  paging: {
1249
1250
  start: params.start,
@@ -1251,7 +1252,7 @@ class ElvWalletClient {
1251
1252
  total: paging.total,
1252
1253
  more: paging.total > start + limit
1253
1254
  },
1254
- results: (contents || []).map(item => ["owned", "listings"].includes(mode) ? FormatNFT(this, item) : item)
1255
+ results: (contents || []).map(item => modesToFormat.includes(mode) ? FormatNFT(this, item) : item)
1255
1256
  };
1256
1257
  } catch(error) {
1257
1258
  if(error.status && error.status.toString() === "404") {