@exodus/ethereum-api 8.12.0 → 8.13.0
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [8.13.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.12.0...@exodus/ethereum-api@8.13.0) (2024-08-04)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add webSocketEnabled flag support for eth-monitor ([#3084](https://github.com/ExodusMovement/assets/issues/3084)) ([e9c684b](https://github.com/ExodusMovement/assets/commit/e9c684bd12798ab6aae067063e5e594d96f3ebeb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* dynamic evm naming ([#3074](https://github.com/ExodusMovement/assets/issues/3074)) ([da046a7](https://github.com/ExodusMovement/assets/commit/da046a73ef05e763c4ffda601c5b04d1c53fa8f0))
|
|
17
|
+
* **ethereum-api:** fix endless ws reconnection loop ([#3072](https://github.com/ExodusMovement/assets/issues/3072)) ([74da0f6](https://github.com/ExodusMovement/assets/commit/74da0f6ba1ebae49cf81993b6944b2814381a618))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
## [8.12.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.11.0...@exodus/ethereum-api@8.12.0) (2024-07-29)
|
|
7
22
|
|
|
8
23
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.13.0",
|
|
4
4
|
"description": "Ethereum Api",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"type": "git",
|
|
66
66
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "53f08ad71e1b8bb5a84b6cdf82c0177031497460"
|
|
69
69
|
}
|
|
@@ -13,7 +13,7 @@ export const createAssetPluginFactory = (config) => {
|
|
|
13
13
|
assert(config.meta.explorerUrl, 'meta.explorerUrl is required')
|
|
14
14
|
|
|
15
15
|
const chainId = config.chainId
|
|
16
|
-
const { explorerUrl, ...meta } = config.meta
|
|
16
|
+
const { explorerUrl, decimals, ...meta } = config.meta
|
|
17
17
|
const chainIdHex = '0x' + chainId.toString(16)
|
|
18
18
|
const name = `evm${chainIdHex}`.toLowerCase()
|
|
19
19
|
const ticker = name.toUpperCase()
|
|
@@ -24,7 +24,7 @@ export const createAssetPluginFactory = (config) => {
|
|
|
24
24
|
Kwei: 3,
|
|
25
25
|
Mwei: 6,
|
|
26
26
|
Gwei: 9,
|
|
27
|
-
[ticker]:
|
|
27
|
+
[ticker]: decimals || 18,
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
const currency = UnitType.create(units)
|
|
@@ -140,8 +140,10 @@ export const fromAddEthereumChainParameterToFactoryParams = (params) => {
|
|
|
140
140
|
chainId,
|
|
141
141
|
meta: {
|
|
142
142
|
explorerUrl: params.blockExplorerUrls[0],
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
displayNetworkName: params.chainName,
|
|
144
|
+
displayName: params.nativeCurrency.name || params.nativeCurrency.symbol,
|
|
145
|
+
displayTicker: params.nativeCurrency.symbol,
|
|
146
|
+
decimals: params.nativeCurrency.decimals,
|
|
145
147
|
primaryColor: color,
|
|
146
148
|
gradientColors: [color, color],
|
|
147
149
|
gradientCoords: {
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
// formatting, and populating-to-state all ETH/ETC/ERC20 transactions.
|
|
23
23
|
|
|
24
24
|
export class EthereumMonitor extends BaseMonitor {
|
|
25
|
-
constructor({ server, config, ...args }) {
|
|
25
|
+
constructor({ server, config, webSocketEnabled = true, ...args }) {
|
|
26
26
|
super(args)
|
|
27
27
|
this.server = server
|
|
28
28
|
this.config = { GAS_PRICE_FROM_WEBSOCKET: true, ...config }
|
|
@@ -34,6 +34,7 @@ export class EthereumMonitor extends BaseMonitor {
|
|
|
34
34
|
this.addHook('before-start', (...args) => this.beforeStart(...args))
|
|
35
35
|
this.addHook('after-stop', (...args) => this.afterStop(...args))
|
|
36
36
|
this.subscribedToGasPriceMap = new Map()
|
|
37
|
+
this._webSocketEnabled = webSocketEnabled
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
setServer(config = {}) {
|
|
@@ -253,6 +254,8 @@ export class EthereumMonitor extends BaseMonitor {
|
|
|
253
254
|
}
|
|
254
255
|
|
|
255
256
|
async _subscribeToWSNotifications() {
|
|
257
|
+
if (this._webSocketEnabled === false) return
|
|
258
|
+
|
|
256
259
|
const addressesByWalletAccount = await this.getReceiveAddressesByWalletAccount()
|
|
257
260
|
subscribeToWSNotifications({
|
|
258
261
|
addressesByWalletAccount,
|
|
@@ -276,6 +279,12 @@ export class EthereumMonitor extends BaseMonitor {
|
|
|
276
279
|
}
|
|
277
280
|
|
|
278
281
|
async beforeStart() {
|
|
282
|
+
await this._enableWSUpdates()
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
async _enableWSUpdates() {
|
|
286
|
+
if (this._webSocketEnabled === false) return
|
|
287
|
+
|
|
279
288
|
const addressesByWalletAccount = await this.getReceiveAddressesByWalletAccount()
|
|
280
289
|
enableWSUpdates({
|
|
281
290
|
interval: this.interval,
|