@manifoldxyz/marketplace-sdk 3.0.12 → 3.0.14

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.
@@ -52,7 +52,6 @@ var MarketplaceTopic;
52
52
  exports.MarketplaceTopic = MarketplaceTopic;
53
53
  var APIEndpoints;
54
54
  (function (APIEndpoints) {
55
- APIEndpoints["GOERLI"] = "https://goerli.marketplace.api.manifoldxyz.dev";
56
55
  APIEndpoints["MAINNET"] = "https://marketplace.api.manifoldxyz.dev";
57
56
  APIEndpoints["OPTIMISM"] = "https://optimism.marketplace.api.manifoldxyz.dev";
58
57
  APIEndpoints["BASE"] = "https://base.marketplace.api.manifoldxyz.dev";
@@ -1295,8 +1294,8 @@ class MarketplaceListing {
1295
1294
  return response.json();
1296
1295
  }
1297
1296
  }
1298
- // No response, so fallback to server only if Arweave, IPFS or OpenSea endpoints
1299
- if (isArweave || isIPFS || isOpenSea) {
1297
+ // Fall back if no response, or non-200 if Arweave, IPFS or OpenSea endpoints
1298
+ if (!response || isArweave || isIPFS || isOpenSea) {
1300
1299
  response = yield fetch(`${this._getEndpoint()}/token/${tokenAddress}/${tokenId}/metadata`);
1301
1300
  if (response.status === 200) {
1302
1301
  return response.json();
@@ -1388,9 +1387,6 @@ class MarketplaceListing {
1388
1387
  else if (network === frontend_provider_types_1.EthereumNetwork.BASE) {
1389
1388
  return APIEndpoints.BASE;
1390
1389
  }
1391
- else if (network == frontend_provider_types_1.EthereumNetwork.GOERLI) {
1392
- return APIEndpoints.GOERLI;
1393
- }
1394
1390
  else {
1395
1391
  throw new Error(`Network not supported: ${network}`);
1396
1392
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manifoldxyz/marketplace-sdk",
3
- "version": "3.0.12",
3
+ "version": "3.0.14",
4
4
  "typings": "dist/index.d.ts",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
@@ -45,8 +45,8 @@
45
45
  "@manifoldxyz/contract-abis": "^1.0.0",
46
46
  "@manifoldxyz/ens-batch-lookup-ethers": "^0.0.2",
47
47
  "@manifoldxyz/frontend-provider-types": "^1.0.0",
48
- "@manifoldxyz/manifold-provider-client": "^0.0.5",
48
+ "@manifoldxyz/manifold-provider-client": "^0.0.6",
49
49
  "keccak256": "^1.0.6",
50
50
  "merkletreejs": "^0.2.32"
51
51
  }
52
- }
52
+ }
@@ -46,7 +46,6 @@ enum MarketplaceTopic {
46
46
  }
47
47
 
48
48
  enum APIEndpoints {
49
- GOERLI = 'https://goerli.marketplace.api.manifoldxyz.dev',
50
49
  MAINNET = 'https://marketplace.api.manifoldxyz.dev',
51
50
  OPTIMISM = 'https://optimism.marketplace.api.manifoldxyz.dev',
52
51
  BASE = 'https://base.marketplace.api.manifoldxyz.dev',
@@ -1612,8 +1611,8 @@ class MarketplaceListing {
1612
1611
  return response.json();
1613
1612
  }
1614
1613
  }
1615
- // No response, so fallback to server only if Arweave, IPFS or OpenSea endpoints
1616
- if (isArweave || isIPFS || isOpenSea) {
1614
+ // Fall back if no response, or non-200 if Arweave, IPFS or OpenSea endpoints
1615
+ if (!response || isArweave || isIPFS || isOpenSea) {
1617
1616
  response = await fetch(`${this._getEndpoint()}/token/${tokenAddress}/${tokenId}/metadata`);
1618
1617
  if (response.status === 200) {
1619
1618
  return response.json();
@@ -1713,8 +1712,6 @@ class MarketplaceListing {
1713
1712
  return APIEndpoints.OPTIMISM;
1714
1713
  } else if (network === EthereumNetwork.BASE) {
1715
1714
  return APIEndpoints.BASE;
1716
- } else if (network == EthereumNetwork.GOERLI) {
1717
- return APIEndpoints.GOERLI;
1718
1715
  } else {
1719
1716
  throw new Error(`Network not supported: ${network}`);
1720
1717
  }