@exodus/assets-feature 4.1.0 → 4.1.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,13 @@
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
+ ## [4.1.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@4.1.0...@exodus/assets-feature@4.1.1) (2024-01-19)
7
+
8
+ ### Bug Fixes
9
+
10
+ - merge mem ([#5448](https://github.com/ExodusMovement/exodus-hydra/issues/5448)) ([a6fb606](https://github.com/ExodusMovement/exodus-hydra/commit/a6fb6065bdabf0b9ebf0a678c5e748198f2dd100))
11
+ - remove duplicated analytics plugin ([#5442](https://github.com/ExodusMovement/exodus-hydra/issues/5442)) ([e453417](https://github.com/ExodusMovement/exodus-hydra/commit/e453417ee9f11574655031d91f060bff86bd0894))
12
+
6
13
  ## [4.1.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@4.0.2...@exodus/assets-feature@4.1.0) (2024-01-12)
7
14
 
8
15
  ### Features
@@ -102,15 +102,15 @@ class AssetClientInterface {
102
102
  accountState,
103
103
  batch = this.blockchainMetadata.batch(),
104
104
  }) => {
105
- if (!isEmpty(newData)) {
106
- return batch.updateAccountState({ assetName, walletAccount, newData })
107
- }
108
-
109
105
  // merge mem to keep the previous accountMem behavior
110
- if (newData.mem && (!accountState || accountState.mem)) {
106
+ if (!isEmpty(newData?.mem) && (!accountState || accountState.mem)) {
111
107
  newData = { ...newData, mem: { ...accountState?.mem, ...newData.mem } }
112
108
  }
113
109
 
110
+ if (!isEmpty(newData)) {
111
+ return batch.updateAccountState({ assetName, walletAccount, newData })
112
+ }
113
+
114
114
  return batch
115
115
  }
116
116
 
package/index.js CHANGED
@@ -7,7 +7,6 @@ import assetModuleDefinition from './module'
7
7
  import customTokensMonitorDefinition from './monitor'
8
8
  import assetPreferencesDefinition from './module/asset-preferences'
9
9
  import assetsAtomDefinition from './atoms/assets'
10
- import enabledAssetsAnalyticsPluginDefinition from './plugin/analytics'
11
10
 
12
11
  const assets = ({ config = {} } = {}) => {
13
12
  return {
@@ -36,10 +35,6 @@ const assets = ({ config = {} } = {}) => {
36
35
  },
37
36
  { definition: assetPreferencesDefinition },
38
37
  { definition: customTokensMonitorDefinition },
39
- {
40
- if: { registered: ['analytics'] },
41
- definition: enabledAssetsAnalyticsPluginDefinition,
42
- },
43
38
  ],
44
39
  }
45
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/assets-feature",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Assets module, clients and apis",
6
6
  "main": "index.js",
@@ -48,6 +48,7 @@
48
48
  "@exodus/bitcoin-plugin": "^1.0.3",
49
49
  "@exodus/bitcoinregtest-plugin": "^1.0.3",
50
50
  "@exodus/bitcointestnet-plugin": "^1.0.3",
51
+ "@exodus/blockchain-metadata": "^15.1.0",
51
52
  "@exodus/combined-assets-meta": "^1.2.5",
52
53
  "@exodus/cosmos-plugin": "^1.0.0",
53
54
  "@exodus/ethereum-meta": "^1.1.0",
@@ -63,5 +64,5 @@
63
64
  "msw": "^2.0.0",
64
65
  "redux": "^4.0.0"
65
66
  },
66
- "gitHead": "dae8c9d4c3dc27060210398351c9c3d9ed0caab7"
67
+ "gitHead": "021b200f9c9b2ba5c9e5fb2c7002c1f88b50d3c6"
67
68
  }
@@ -1,26 +0,0 @@
1
- const createEnabledAssetsAnalyticsPlugin = ({ analytics, enabledAssetsAtom }) => {
2
- let unsubscribe
3
-
4
- const onStart = () => {
5
- analytics.requireDefaultProperties(['numberOfAssetsEnabled'])
6
-
7
- unsubscribe = enabledAssetsAtom.observe((enabledAssets) => {
8
- const numberOfAssetsEnabled = Object.keys(enabledAssets).length
9
-
10
- analytics.setDefaultProperties({ numberOfAssetsEnabled })
11
- })
12
- }
13
-
14
- const onStop = () => unsubscribe()
15
-
16
- return { onStart, onStop }
17
- }
18
-
19
- const enabledAssetsAnalyticsPluginDefinition = {
20
- id: 'enabledAssetsAnalyticsPlugin',
21
- type: 'plugin',
22
- factory: createEnabledAssetsAnalyticsPlugin,
23
- dependencies: ['analytics', 'enabledAssetsAtom'],
24
- }
25
-
26
- export default enabledAssetsAnalyticsPluginDefinition