@exodus/balances 13.11.0 → 13.12.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,12 @@
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
+ ## [13.12.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@13.11.0...@exodus/balances@13.12.0) (2025-07-10)
7
+
8
+ ### Features
9
+
10
+ - feat: update basic utils in balances (#13183)
11
+
6
12
  ## [13.11.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@13.10.0...@exodus/balances@13.11.0) (2025-07-09)
7
13
 
8
14
  ### Features
package/module/index.js CHANGED
@@ -2,25 +2,25 @@ import { isNumberUnit } from '@exodus/currency'
2
2
  import { TxSet } from '@exodus/models'
3
3
  import lodash from 'lodash'
4
4
  import { difference as getChanges } from '@exodus/atoms'
5
- import { difference, flattenToPaths, pick, set } from '@exodus/basic-utils'
5
+ import {
6
+ cloneDeepWith,
7
+ difference,
8
+ flattenToPaths,
9
+ pickByArrayPaths,
10
+ set,
11
+ } from '@exodus/basic-utils'
6
12
  import makeConcurrent from 'make-concurrent'
7
13
  import { processAssetBalances, validateBalances } from './balances-utils.js'
8
14
  import defaultConfig from '../default-config.js'
9
15
 
10
16
  const { isEmpty, merge, zipObject } = lodash
11
17
 
12
- export const cloneBalances = (balances) => {
13
- if (isNumberUnit(balances)) {
14
- return balances
15
- }
16
-
17
- const cloned = Object.create(Object.getPrototypeOf(balances))
18
- for (const key in balances) {
19
- cloned[key] = cloneBalances(balances[key])
20
- }
21
-
22
- return cloned
23
- }
18
+ export const cloneBalances = (balances) =>
19
+ cloneDeepWith(balances, (value) => {
20
+ if (isNumberUnit(value)) {
21
+ return value
22
+ }
23
+ })
24
24
 
25
25
  const zipNonNull = (keys, values) =>
26
26
  zipObject(
@@ -206,7 +206,7 @@ class Balances {
206
206
  zero,
207
207
  })
208
208
  return validateBalances({
209
- balances: pick(balances, this.#balanceFields),
209
+ balances: pickByArrayPaths(balances, this.#balanceFields),
210
210
  asset,
211
211
  zero,
212
212
  logger: this.#logger,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/balances",
3
- "version": "13.11.0",
3
+ "version": "13.12.0",
4
4
  "description": "Tracks crypto balances across enabled wallet accounts.",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@exodus/atoms": "^9.0.0",
37
- "@exodus/basic-utils": "^3.0.1",
37
+ "@exodus/basic-utils": "^4.3.0",
38
38
  "@exodus/core-selectors": "^3.0.0",
39
39
  "@exodus/currency": "^5.0.2",
40
40
  "@exodus/errors": "^3.0.0",
@@ -67,5 +67,5 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "db4613f1399e3fa3c65135835bb0e84ba5feb520"
70
+ "gitHead": "20a4bbabfa39c51c7e52e628fb5fa7a8ed54c72f"
71
71
  }