@exodus/ethereum-api 8.12.0 → 8.13.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/CHANGELOG.md CHANGED
@@ -3,6 +3,30 @@
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.1](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.13.0...@exodus/ethereum-api@8.13.1) (2024-08-07)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * eth staking tx-send compatibility ([#3112](https://github.com/ExodusMovement/assets/issues/3112)) ([c5c9160](https://github.com/ExodusMovement/assets/commit/c5c916070451d347f9b0c3b6a0f3de6265025704))
12
+
13
+
14
+
15
+ ## [8.13.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.12.0...@exodus/ethereum-api@8.13.0) (2024-08-04)
16
+
17
+
18
+ ### Features
19
+
20
+ * add webSocketEnabled flag support for eth-monitor ([#3084](https://github.com/ExodusMovement/assets/issues/3084)) ([e9c684b](https://github.com/ExodusMovement/assets/commit/e9c684bd12798ab6aae067063e5e594d96f3ebeb))
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * dynamic evm naming ([#3074](https://github.com/ExodusMovement/assets/issues/3074)) ([da046a7](https://github.com/ExodusMovement/assets/commit/da046a73ef05e763c4ffda601c5b04d1c53fa8f0))
26
+ * **ethereum-api:** fix endless ws reconnection loop ([#3072](https://github.com/ExodusMovement/assets/issues/3072)) ([74da0f6](https://github.com/ExodusMovement/assets/commit/74da0f6ba1ebae49cf81993b6944b2814381a618))
27
+
28
+
29
+
6
30
  ## [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
31
 
8
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "8.12.0",
3
+ "version": "8.13.1",
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": "447eda32eb5b21fad62968d560b7fc4b7a2a4553"
68
+ "gitHead": "6f74d1acedf14defa2a949dc756495dbab413ceb"
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]: config.decimals || 18,
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
- displayName: params.chainName,
144
- displayTicker: params.nativeCurrency.name || params.nativeCurrency.symbol,
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: {
@@ -64,9 +64,7 @@ export function create(defaultURL, ensAssetName) {
64
64
  },
65
65
 
66
66
  stop() {
67
- if (ws.isCreated()) {
68
- ws.close()
69
- }
67
+ ws.close()
70
68
  },
71
69
 
72
70
  ws,
@@ -262,6 +262,15 @@ export function createEthereumStakingService({
262
262
  walletAccount,
263
263
  address: to,
264
264
  amount: amount || asset.currency.ZERO,
265
+ // unified tx-send param
266
+ shouldLog: true,
267
+ txInput,
268
+ feeAmount: fee,
269
+ feeOpts: {
270
+ gasPrice,
271
+ gasLimit,
272
+ },
273
+ // mobile: tx-send parms
265
274
  options: {
266
275
  shouldLog: true,
267
276
  txInput,
@@ -278,6 +278,15 @@ export function createPolygonStakingService({ assetClientInterface, createAndBro
278
278
  walletAccount,
279
279
  address: to,
280
280
  amount: ethereum.currency.ZERO,
281
+ // unified tx-send param
282
+ shouldLog: true,
283
+ txInput,
284
+ feeAmount: fee,
285
+ feeOpts: {
286
+ gasPrice,
287
+ gasLimit,
288
+ },
289
+ // mobile: tx-send parms
281
290
  options: {
282
291
  shouldLog: true,
283
292
  txInput,
@@ -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,