@exodus/ethereum-api 3.1.0 → 3.2.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": "3.1.0",
3
+ "version": "3.2.1",
4
4
  "description": "Ethereum Api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -16,11 +16,11 @@
16
16
  "dependencies": {
17
17
  "@exodus/asset-lib": "^3.7.1",
18
18
  "@exodus/crypto": "^1.0.0-rc.0",
19
- "@exodus/ethereum-lib": "^2.22.2",
19
+ "@exodus/ethereum-lib": "^2.23.1",
20
20
  "@exodus/ethereumjs-util": "^7.1.0-exodus.6",
21
21
  "@exodus/fetch": "^1.2.1",
22
22
  "@exodus/simple-retry": "^0.0.6",
23
- "@exodus/solidity-contract": "^1.0.1",
23
+ "@exodus/solidity-contract": "^1.1.3",
24
24
  "events": "^1.1.1",
25
25
  "idna-uts46-hx": "^2.3.1",
26
26
  "js-sha3": "^0.8.0",
@@ -34,5 +34,5 @@
34
34
  "devDependencies": {
35
35
  "@exodus/models": "^8.10.4"
36
36
  },
37
- "gitHead": "d97519a8bacb8f2d9700248b2d7723fef284c56c"
37
+ "gitHead": "f4833357ea26e5970d1d5a7306150d76ee5f9c1d"
38
38
  }
@@ -85,7 +85,14 @@ export default function createWebSocket(getURL) {
85
85
  ws.onmessage = null
86
86
  ws.onopen = null
87
87
  ws.onclose = null
88
- ws.close()
88
+ try {
89
+ ws.close()
90
+ } catch (e) {
91
+ if (!/WebSocket was closed before the connection was established/.test(e.message)) {
92
+ throw e
93
+ }
94
+ }
95
+
89
96
  ws = null
90
97
  clearPing()
91
98
  events.emit('close')
@@ -61,9 +61,7 @@ export async function fetchGasLimit({
61
61
 
62
62
  const _isToken = isToken(asset)
63
63
  if (_isToken) {
64
- txInput = ethUtil.bufferToHex(
65
- asset.contract.transfer.build(toAddress, amount.toBase().toString({ unit: false }))
66
- )
64
+ txInput = ethUtil.bufferToHex(asset.contract.transfer.build(toAddress, amount.toBaseString()))
67
65
  amount = asset.baseAsset.currency.ZERO
68
66
  toAddress = asset.contract.address
69
67
  } else if (!isContract) {