@exodus/balances 3.0.0 → 4.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/CHANGELOG.md +89 -0
- package/{src → module}/index.js +17 -3
- package/package.json +16 -9
- /package/{src → module}/confirmed-balance.js +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [4.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@3.0.0...@exodus/balances@4.0.0) (2023-02-02)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
- export balances module from module/ and auto-bind config (#828)
|
|
11
|
+
- accept enabled wallet accounts atom (#544)
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- add `restricted-imports` eslint rule ([#719](https://github.com/ExodusMovement/exodus-hydra/issues/719)) ([175de9c](https://github.com/ExodusMovement/exodus-hydra/commit/175de9c19ec00e5a12441022c313837d58f38882))
|
|
16
|
+
- detect subscriptions further down the call graph ([#786](https://github.com/ExodusMovement/exodus-hydra/issues/786)) ([7abcc8f](https://github.com/ExodusMovement/exodus-hydra/commit/7abcc8f361302bbd3061688e55210e62ec684154))
|
|
17
|
+
|
|
18
|
+
### Code Refactoring
|
|
19
|
+
|
|
20
|
+
- accept enabled wallet accounts atom ([#544](https://github.com/ExodusMovement/exodus-hydra/issues/544)) ([bdeaf02](https://github.com/ExodusMovement/exodus-hydra/commit/bdeaf029b6080bbb42d575545e9b711faa21b6c8))
|
|
21
|
+
- export balances module from module/ and auto-bind config ([#828](https://github.com/ExodusMovement/exodus-hydra/issues/828)) ([d62d3b9](https://github.com/ExodusMovement/exodus-hydra/commit/d62d3b97554394442b0a12feb5f92ee352ec6255))
|
|
22
|
+
|
|
23
|
+
## [3.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@2.0.1...@exodus/balances@3.0.0) (2022-10-18)
|
|
24
|
+
|
|
25
|
+
### ⚠ BREAKING CHANGES
|
|
26
|
+
|
|
27
|
+
- add batching to blockchain metadata (#334)
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
- add batching to blockchain metadata ([#334](https://github.com/ExodusMovement/exodus-hydra/issues/334)) ([d3d612b](https://github.com/ExodusMovement/exodus-hydra/commit/d3d612bd04da18704c907163bab4978c12e3fe8c))
|
|
32
|
+
|
|
33
|
+
## [2.0.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@2.0.0...@exodus/balances@2.0.1) (2022-10-13)
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
- include confirmed-balance in package ([#320](https://github.com/ExodusMovement/exodus-hydra/issues/320)) ([a1b8515](https://github.com/ExodusMovement/exodus-hydra/commit/a1b8515d4700bd81595662b309848b262759201a))
|
|
38
|
+
|
|
39
|
+
## [2.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@1.2.1...@exodus/balances@2.0.0) (2022-10-13)
|
|
40
|
+
|
|
41
|
+
### ⚠ BREAKING CHANGES
|
|
42
|
+
|
|
43
|
+
- add getLoadedAccountStates and emit delta events on change only (#259)
|
|
44
|
+
|
|
45
|
+
### Features
|
|
46
|
+
|
|
47
|
+
- `confirmedBalance` ([#218](https://github.com/ExodusMovement/exodus-hydra/issues/218)) ([2268ba0](https://github.com/ExodusMovement/exodus-hydra/commit/2268ba08ac4ba8cec553d3a7d9063dbad3b2e715))
|
|
48
|
+
- add getLoadedAccountStates and emit delta events on change only ([#259](https://github.com/ExodusMovement/exodus-hydra/issues/259)) ([783e08e](https://github.com/ExodusMovement/exodus-hydra/commit/783e08e8f944e6eba6ccbd37a2ee720d3f7e059f))
|
|
49
|
+
|
|
50
|
+
### Bug Fixes
|
|
51
|
+
|
|
52
|
+
- listen loaded event only once ([#278](https://github.com/ExodusMovement/exodus-hydra/issues/278)) ([154eaf1](https://github.com/ExodusMovement/exodus-hydra/commit/154eaf131c4a92be378f579f9762ae589a76ace4))
|
|
53
|
+
|
|
54
|
+
## [1.2.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@1.2.0...@exodus/balances@1.2.1) (2022-09-26)
|
|
55
|
+
|
|
56
|
+
Refactor(balances): provide all potentially relevant txLogs to getBalancesFromBlockchainMetadata
|
|
57
|
+
https://github.com/ExodusMovement/exodus-hydra/pull/223
|
|
58
|
+
|
|
59
|
+
## [1.2.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@1.1.2...@exodus/balances@1.2.0) (2022-09-23)
|
|
60
|
+
|
|
61
|
+
### Features
|
|
62
|
+
|
|
63
|
+
- emit balance only after blockchain metadata is loaded ([#245](https://github.com/ExodusMovement/exodus-hydra/issues/245)) ([a6348bf](https://github.com/ExodusMovement/exodus-hydra/commit/a6348bf96fa06268975f2f35fbc164ac19798695))
|
|
64
|
+
|
|
65
|
+
## [1.1.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@1.1.1...@exodus/balances@1.1.2) (2022-09-20)
|
|
66
|
+
|
|
67
|
+
**Note:** Version bump only for package @exodus/balances
|
|
68
|
+
|
|
69
|
+
- **balances:** refactor: wait till blockchain metadata is loaded ([#242](https://github.com/ExodusMovement/exodus-hydra/pull/242)) ([642b64e](https://github.com/ExodusMovement/exodus-hydra/commit/642b64e2e8ede129896834f5aef527563e9694a0))
|
|
70
|
+
|
|
71
|
+
## [1.1.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@1.1.0...@exodus/balances@1.1.1) (2022-09-06)
|
|
72
|
+
|
|
73
|
+
### Bug Fixes
|
|
74
|
+
|
|
75
|
+
- **fiat-balances:** undesired balance reset ([#219](https://github.com/ExodusMovement/exodus-hydra/issues/219)) ([642b64e](https://github.com/ExodusMovement/exodus-hydra/commit/642b64e2e8ede129896834f5aef527563e9694a0))
|
|
76
|
+
|
|
77
|
+
### Reverts
|
|
78
|
+
|
|
79
|
+
- Revert "refactor: always emit balance in defaultUnit (#222)" (#224) ([dd301d6](https://github.com/ExodusMovement/exodus-hydra/commit/dd301d6573a27473e7e469c466245ef513a1e64e)), closes [#222](https://github.com/ExodusMovement/exodus-hydra/issues/222) [#224](https://github.com/ExodusMovement/exodus-hydra/issues/224)
|
|
80
|
+
|
|
81
|
+
## [1.1.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@1.0.1...@exodus/balances@1.1.0) (2022-08-25)
|
|
82
|
+
|
|
83
|
+
### Features
|
|
84
|
+
|
|
85
|
+
- bump basic-utils ([#200](https://github.com/ExodusMovement/exodus-hydra/issues/200))
|
|
86
|
+
|
|
87
|
+
### Bug Fixes
|
|
88
|
+
|
|
89
|
+
- lost token balances on portfolio recompute ([#206](https://github.com/ExodusMovement/exodus-hydra/issues/206)) ([318b8cf](https://github.com/ExodusMovement/exodus-hydra/commit/318b8cf7771d4d030f9730e94897b900c4b21c60))
|
package/{src → module}/index.js
RENAMED
|
@@ -17,6 +17,8 @@ const zipNonNull = (keys, values) =>
|
|
|
17
17
|
values.filter((value) => value != null)
|
|
18
18
|
)
|
|
19
19
|
|
|
20
|
+
export const MODULE_ID = 'balances'
|
|
21
|
+
|
|
20
22
|
class Balances extends ExodusModule {
|
|
21
23
|
#assetsModule
|
|
22
24
|
#blockchainMetadata
|
|
@@ -27,8 +29,14 @@ class Balances extends ExodusModule {
|
|
|
27
29
|
#oldBalances = Object.create(null)
|
|
28
30
|
#balances = Object.create(null)
|
|
29
31
|
|
|
30
|
-
constructor({
|
|
31
|
-
|
|
32
|
+
constructor({
|
|
33
|
+
assetsModule,
|
|
34
|
+
blockchainMetadata,
|
|
35
|
+
walletAccountsAtom,
|
|
36
|
+
config: { balanceFields },
|
|
37
|
+
logger,
|
|
38
|
+
}) {
|
|
39
|
+
super({ name: MODULE_ID, logger })
|
|
32
40
|
|
|
33
41
|
this.#assetsModule = assetsModule
|
|
34
42
|
this.#blockchainMetadata = blockchainMetadata
|
|
@@ -48,6 +56,7 @@ class Balances extends ExodusModule {
|
|
|
48
56
|
this.#recompute = shareQueue(this.#recompute)
|
|
49
57
|
|
|
50
58
|
blockchainMetadata.once('load-wallet-accounts', () => {
|
|
59
|
+
// eslint-disable-next-line hydra/module-side-effects
|
|
51
60
|
walletAccountsAtom.observe((payload) => {
|
|
52
61
|
this.#setWalletAccounts(
|
|
53
62
|
Object.keys(payload).filter((walletAccount) => payload[walletAccount].enabled)
|
|
@@ -303,4 +312,9 @@ class Balances extends ExodusModule {
|
|
|
303
312
|
|
|
304
313
|
const createBalances = (opts) => new Balances(opts)
|
|
305
314
|
|
|
306
|
-
export default
|
|
315
|
+
export default {
|
|
316
|
+
id: MODULE_ID,
|
|
317
|
+
type: 'module',
|
|
318
|
+
factory: createBalances,
|
|
319
|
+
dependencies: ['assetsModule', 'blockchainMetadata', 'walletAccountsAtom', 'config', 'logger'],
|
|
320
|
+
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/balances",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "balances",
|
|
5
5
|
"author": "Exodus Movement Inc",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "jest",
|
|
9
|
-
"lint": "eslint .",
|
|
9
|
+
"lint": "eslint . --ignore-path ../../.gitignore",
|
|
10
10
|
"lint:fix": "yarn lint --fix"
|
|
11
11
|
},
|
|
12
|
-
"main": "src/index.js",
|
|
13
12
|
"files": [
|
|
14
|
-
"
|
|
13
|
+
"module",
|
|
14
|
+
"atoms",
|
|
15
|
+
"README.md",
|
|
16
|
+
"CHANGELOG.md",
|
|
17
|
+
"!**/__tests__"
|
|
15
18
|
],
|
|
16
19
|
"repository": {
|
|
17
20
|
"type": "git",
|
|
@@ -23,19 +26,23 @@
|
|
|
23
26
|
},
|
|
24
27
|
"dependencies": {
|
|
25
28
|
"@exodus/currency": "^2.1.2",
|
|
26
|
-
"@exodus/module": "^1.
|
|
29
|
+
"@exodus/module": "^1.1.0",
|
|
27
30
|
"lodash": "^4.17.21",
|
|
28
31
|
"make-concurrent": "^4.0.0"
|
|
29
32
|
},
|
|
30
33
|
"peerDependencies": {
|
|
31
|
-
"@exodus/blockchain-metadata": "
|
|
34
|
+
"@exodus/blockchain-metadata": "*"
|
|
32
35
|
},
|
|
33
36
|
"devDependencies": {
|
|
34
37
|
"@exodus/atoms": "^2.3.0",
|
|
35
38
|
"@exodus/basic-utils": "^1.0.0",
|
|
36
|
-
"@exodus/blockchain-metadata": "
|
|
39
|
+
"@exodus/blockchain-metadata": "*",
|
|
37
40
|
"@exodus/models": "^8.9.0",
|
|
38
|
-
"@exodus/storage-memory": "*"
|
|
41
|
+
"@exodus/storage-memory": "*",
|
|
42
|
+
"@exodus/wallet-accounts": "*",
|
|
43
|
+
"eslint": "^8.33.0",
|
|
44
|
+
"events": "^3.3.0",
|
|
45
|
+
"jest": "^29.1.2"
|
|
39
46
|
},
|
|
40
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "a72d79cc75c6c02876d745a498bf28b256d7f99e"
|
|
41
48
|
}
|
|
File without changes
|