@eluvio/elv-client-js 3.2.24 → 3.2.26

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.
@@ -22,7 +22,7 @@ var WalletConfiguration = {
22
22
  appUrl: "https://wallet.contentfabric.io"
23
23
  }
24
24
  },
25
- __MARKETPLACE_ORDER: ["PREVIEW", "wwe-marketplace-main", "maskverse-marketplace", "dolly-marketplace", "oc-marketplace", "cirkay-marketplace", "emp-marketplace", "microsoft", "indieflix-marketplace", "angels-airwaves-marketplace"]
25
+ __MARKETPLACE_ORDER: ["PREVIEW", "wwe-marketplace-main", "realcannonballrun-marketplace", "maskverse-marketplace", "dolly-marketplace", "oc-marketplace", "cirkay-marketplace", "emp-marketplace", "microsoft", "indieflix-marketplace", "angels-airwaves-marketplace"]
26
26
  }; // No production environment on demo
27
27
 
28
28
  WalletConfiguration.demo.production = WalletConfiguration.demo.staging; // Allow demo to be referred to as demov3
@@ -77,7 +77,6 @@ var FormatNFTDetails = function FormatNFTDetails(entry) {
77
77
  ContractId: "ictr".concat(Utils.AddressToHash(info.contract_addr)),
78
78
  ContractName: info.contract_name,
79
79
  Cap: info.cap,
80
- Offers: info.offers || [],
81
80
  TokenIdStr: info.token_id_str,
82
81
  TokenUri: info.token_uri,
83
82
  TokenOrdinal: info.ordinal,
@@ -100,6 +99,8 @@ var FormatNFTDetails = function FormatNFTDetails(entry) {
100
99
  Price: entry.price,
101
100
  Fee: entry.fee
102
101
  });
102
+ } else {
103
+ details.Offers = info.offers || [];
103
104
  }
104
105
 
105
106
  return {
@@ -1230,7 +1230,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
1230
1230
  }
1231
1231
 
1232
1232
  if (this.cachedMarketplaces[marketplaceId]) {
1233
- _context15.next = 20;
1233
+ _context15.next = 21;
1234
1234
  break;
1235
1235
  }
1236
1236
 
@@ -1316,6 +1316,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
1316
1316
  marketplace.retrievedAt = Date.now();
1317
1317
  marketplace.marketplaceId = marketplaceId;
1318
1318
  marketplace.versionHash = marketplaceHash;
1319
+ marketplace.marketplaceHash = marketplaceHash;
1319
1320
 
1320
1321
  if (this.previewMarketplaceId && marketplaceId === this.previewMarketplaceId) {
1321
1322
  marketplace.branding.preview = true;
@@ -1345,10 +1346,10 @@ var ElvWalletClient = /*#__PURE__*/function () {
1345
1346
  });
1346
1347
  this.cachedMarketplaces[marketplaceId] = marketplace;
1347
1348
 
1348
- case 20:
1349
+ case 21:
1349
1350
  return _context15.abrupt("return", this.cachedMarketplaces[marketplaceId]);
1350
1351
 
1351
- case 21:
1352
+ case 22:
1352
1353
  case "end":
1353
1354
  return _context15.stop();
1354
1355
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "3.2.24",
3
+ "version": "3.2.26",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -56,7 +56,6 @@ const FormatNFTDetails = function(entry) {
56
56
  ContractId: `ictr${Utils.AddressToHash(info.contract_addr)}`,
57
57
  ContractName: info.contract_name,
58
58
  Cap: info.cap,
59
- Offers: info.offers || [],
60
59
  TokenIdStr: info.token_id_str,
61
60
  TokenUri: info.token_uri,
62
61
  TokenOrdinal: info.ordinal,
@@ -78,6 +77,8 @@ const FormatNFTDetails = function(entry) {
78
77
  Price: entry.price,
79
78
  Fee: entry.fee
80
79
  };
80
+ } else {
81
+ details.Offers = info.offers || [];
81
82
  }
82
83
 
83
84
  return {
@@ -76,10 +76,12 @@ class ElvWalletClient {
76
76
  * @param {string} mode=production - Environment to use (`production`, `staging`)
77
77
  * @param {Object=} marketplaceParams - Marketplace parameters
78
78
  * @param {boolean=} storeAuthToken=true - If specified, auth tokens will be stored in localstorage (if available)
79
+ * @param {Object=} client - Existing instance of ElvClient to use instead of initializing a new one
79
80
  *
80
81
  * @returns {Promise<ElvWalletClient>}
81
82
  */
82
83
  static async Initialize({
84
+ client,
83
85
  appId="general",
84
86
  network="main",
85
87
  mode="production",
@@ -95,7 +97,9 @@ class ElvWalletClient {
95
97
  throw Error(`ElvWalletClient: Invalid mode ${mode}`);
96
98
  }
97
99
 
98
- const client = await ElvClient.FromNetworkName({networkName: network, assumeV3: true});
100
+ if(!client) {
101
+ client = await ElvClient.FromNetworkName({networkName: network, assumeV3: true});
102
+ }
99
103
 
100
104
  let previewMarketplaceHash = previewMarketplaceId;
101
105
  if(previewMarketplaceHash && !previewMarketplaceHash.startsWith("hq__")) {
@@ -785,6 +789,7 @@ class ElvWalletClient {
785
789
  marketplace.retrievedAt = Date.now();
786
790
  marketplace.marketplaceId = marketplaceId;
787
791
  marketplace.versionHash = marketplaceHash;
792
+ marketplace.marketplaceHash = marketplaceHash;
788
793
 
789
794
  if(this.previewMarketplaceId && marketplaceId === this.previewMarketplaceId) {
790
795
  marketplace.branding.preview = true;