@eluvio/elv-client-js 4.0.7 → 4.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.0.7",
3
+ "version": "4.0.8",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
package/src/Crypto.js CHANGED
@@ -1,4 +1,4 @@
1
- const Buffer = require("buffer/").Buffer;
1
+ if(typeof globalThis.Buffer === "undefined") { globalThis.Buffer = require("buffer/").Buffer; }
2
2
 
3
3
  const bs58 = require("bs58");
4
4
  const Stream = require("stream");
@@ -7,7 +7,7 @@ const Utils = require("./Utils");
7
7
  if(typeof crypto === "undefined") {
8
8
  const crypto = require("crypto");
9
9
  crypto.getRandomValues = arr => crypto.randomBytes(arr.length);
10
- global.crypto = crypto;
10
+ globalThis.crypto = crypto;
11
11
  }
12
12
 
13
13
  let ElvCrypto;
package/src/ElvClient.js CHANGED
@@ -1,4 +1,4 @@
1
- const Buffer = require("buffer/").Buffer;
1
+ if(typeof globalThis.Buffer === "undefined") { globalThis.Buffer = require("buffer/").Buffer; }
2
2
 
3
3
  const URI = require("urijs");
4
4
  const Ethers = require("ethers");
@@ -31,7 +31,7 @@ const networks = {
31
31
  if(Utils.Platform() === Utils.PLATFORM_NODE) {
32
32
  // Define Response in node
33
33
  // eslint-disable-next-line no-global-assign
34
- global.Response = (require("node-fetch")).Response;
34
+ globalThis.Response = (require("node-fetch")).Response;
35
35
  }
36
36
 
37
37
  /**
package/src/Utils.js CHANGED
@@ -1,4 +1,4 @@
1
- const Buffer = require("buffer/").Buffer;
1
+ if(typeof globalThis.Buffer === "undefined") { globalThis.Buffer = require("buffer/").Buffer; }
2
2
 
3
3
  const bs58 = require("bs58");
4
4
  const BigNumber = require("bignumber.js").default;
@@ -10,7 +10,7 @@ let fs;
10
10
  if(Utils.Platform() === Utils.PLATFORM_NODE) {
11
11
  // Define Response in node
12
12
  // eslint-disable-next-line no-global-assign
13
- global.Response = (require("node-fetch")).Response;
13
+ globalThis.Response = (require("node-fetch")).Response;
14
14
  fs = require("fs");
15
15
  }
16
16
 
@@ -55,8 +55,8 @@ const FormatNFTDetails = function(entry) {
55
55
  USDCOnly: !!paymentAccounts.find(entry => entry.preferred),
56
56
  EthUSDCAccepted: !!paymentAccounts.find(account => account.type === "eth"),
57
57
  EthUSDCOnly: !!paymentAccounts.find(account => account.type === "eth" && account.preferred),
58
- SolUSDCAccepted: !!paymentAccounts.find(account => account.type === "eth"),
59
- SolUSDCOnly: !!paymentAccounts.find(account => account.type === "eth" && account.preferred),
58
+ SolUSDCAccepted: !!paymentAccounts.find(account => account.type === "sol"),
59
+ SolUSDCOnly: !!paymentAccounts.find(account => account.type === "sol" && account.preferred),
60
60
 
61
61
  TenantId: entry.tenant || entry.tenant_id,
62
62
  ContractAddr: info.contract_addr,