@exodus/balances 2.0.1 → 3.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/balances",
3
- "version": "2.0.1",
3
+ "version": "3.0.0",
4
4
  "description": "balances",
5
5
  "author": "Exodus Movement Inc",
6
6
  "license": "UNLICENSED",
@@ -9,9 +9,9 @@
9
9
  "lint": "eslint .",
10
10
  "lint:fix": "yarn lint --fix"
11
11
  },
12
+ "main": "src/index.js",
12
13
  "files": [
13
- "index.js",
14
- "confirmed-balance.js"
14
+ "src"
15
15
  ],
16
16
  "repository": {
17
17
  "type": "git",
@@ -28,14 +28,14 @@
28
28
  "make-concurrent": "^4.0.0"
29
29
  },
30
30
  "peerDependencies": {
31
- "@exodus/blockchain-metadata": "^3.0.0"
31
+ "@exodus/blockchain-metadata": "^4.0.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@exodus/atoms": "^2.3.0",
35
35
  "@exodus/basic-utils": "^1.0.0",
36
- "@exodus/blockchain-metadata": "*",
36
+ "@exodus/blockchain-metadata": "^4.0.0",
37
37
  "@exodus/models": "^8.9.0",
38
38
  "@exodus/storage-memory": "*"
39
39
  },
40
- "gitHead": "9ef26663a0f2415380d7bebc4c97acfbe8be35f0"
40
+ "gitHead": "47c8cb54d8cbbdfe978221fd421a6c269fbd9547"
41
41
  }
@@ -4,6 +4,7 @@ import ExodusModule from '@exodus/module'
4
4
  import { cloneDeepWith, difference, isEmpty, merge, set, zipObject } from 'lodash'
5
5
  import makeConcurrent from 'make-concurrent'
6
6
  import getConfirmedBalance from './confirmed-balance'
7
+ import { assetSourceEntries } from '@exodus/blockchain-metadata'
7
8
 
8
9
  const cloneBalances = (balances) =>
9
10
  cloneDeepWith(balances, (val) => {
@@ -53,8 +54,12 @@ class Balances extends ExodusModule {
53
54
  )
54
55
  })
55
56
 
56
- blockchainMetadata.on('account-state', this.#handleAccountStateUpdate)
57
- blockchainMetadata.on('tx-log', this.#handleTxLogUpdate)
57
+ blockchainMetadata.on('account-states-update', (payload) =>
58
+ assetSourceEntries(payload, 'account-state').forEach(this.#handleAccountStateUpdate)
59
+ )
60
+ blockchainMetadata.on('tx-logs-update', (payload) =>
61
+ assetSourceEntries(payload, 'tx-log').forEach(this.#handleTxLogUpdate)
62
+ )
58
63
  })
59
64
 
60
65
  assetsModule.on('assets-add', this.#onAssetsChanged)