@exodus/ethereum-api 2.24.0 → 2.24.1

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": "@exodus/ethereum-api",
3
- "version": "2.24.0",
3
+ "version": "2.24.1",
4
4
  "description": "Ethereum Api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -29,12 +29,12 @@
29
29
  "ms": "^2.1.1",
30
30
  "url": "0.10.3",
31
31
  "url-join": "4.0.0",
32
- "ws": "6.1.0"
32
+ "ws": "^6.1.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@exodus/assets": "^8.0.67",
36
36
  "@exodus/assets-base": "^8.0.136",
37
37
  "@exodus/models": "^8.7.2"
38
38
  },
39
- "gitHead": "43d1c84ed5ecc17a3970113097ec9ad6d58e4312"
39
+ "gitHead": "3ebe0a3ec7c9090ebbd451c0845b64090852cead"
40
40
  }
@@ -1,4 +1,4 @@
1
- import assert from 'assert'
1
+ import assert from 'minimalistic-assert'
2
2
  import request from './request'
3
3
 
4
4
  const isValidResponseCheck = (x) =>
@@ -1,4 +1,4 @@
1
- import assert from 'assert'
1
+ import assert from 'minimalistic-assert'
2
2
  import request from './request'
3
3
 
4
4
  const isValidResponseCheck = (x) =>
@@ -79,7 +79,8 @@ async function tryToDecodeApprovalTransaction(transaction) {
79
79
 
80
80
  const [grantedTo, balance] = decodedInput.values
81
81
 
82
- const symbol = (await getAssetSymbolFromContract(transaction.to)).toUpperCase() || 'Token'
82
+ const symbol =
83
+ (await getAssetSymbolFromContract(transaction.to)).toUpperCase() || 'Unknown Token'
83
84
 
84
85
  return [{ grantedTo, balance, symbol, decimals: undefined }] // ToDo: Return 'decimals' in the future once we support changing the approval amount.
85
86
  } catch (e) {
@@ -11,13 +11,10 @@ if (typeof process !== 'undefined' && (process.type === 'renderer' || process.ty
11
11
  } else {
12
12
  module.exports = require('ws')
13
13
  }
14
+ } else if (typeof WebSocket !== 'undefined') {
15
+ // THIS IS FOR BE
16
+ module.exports = globalThis.WebSocket
14
17
  } else {
15
- // eslint-disable-next-line no-undef
16
- if (global.window?.WebSocket) {
17
- // THIS IS FOR BE
18
- module.exports = global.window?.WebSocket
19
- } else {
20
- // THIS IS FOR UNIT TESTING.
21
- module.exports = require('ws')
22
- }
18
+ // THIS IS FOR UNIT TESTING.
19
+ module.exports = require('ws')
23
20
  }