@exodus/assets-feature 9.5.0 → 9.7.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 +12 -0
- package/atoms/legacy-address-mode.js +15 -6
- package/atoms/taproot-address-mode.js +15 -6
- package/client/asset-client-interface.js +20 -1
- package/client/index.js +1 -0
- package/index.js +8 -2
- package/module/asset-preferences.js +37 -16
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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
|
+
## [9.7.0](https://github.com/ExodusMovement/exodus/compare/@exodus/assets-feature@9.6.0...@exodus/assets-feature@9.7.0) (2026-11-06)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **assets-feature:** tick only the wallet accounts that monitor a network ([#48644](https://github.com/ExodusMovement/exodus/issues/48644)) ([677c0ce](https://github.com/ExodusMovement/exodus/commit/677c0cef246b6f5a01d77ee00e72815e9c89e512))
|
|
11
|
+
|
|
12
|
+
## [9.6.0](https://github.com/ExodusMovement/exodus/compare/@exodus/assets-feature@9.5.0...@exodus/assets-feature@9.6.0) (2026-10-28)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- **assets-feature:** allow bitcoin testnet and regtest address modes ([#47982](https://github.com/ExodusMovement/exodus/issues/47982)) ([e242c66](https://github.com/ExodusMovement/exodus/commit/e242c6627965e7f1f78a44e1a4538752af16c51b))
|
|
17
|
+
|
|
6
18
|
## [9.5.0](https://github.com/ExodusMovement/exodus/compare/@exodus/assets-feature@9.4.0...@exodus/assets-feature@9.5.0) (2026-10-12)
|
|
7
19
|
|
|
8
20
|
### Features
|
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
import { compute } from '@exodus/atoms'
|
|
1
|
+
import { combine, compute, createStorageAtomFactory } from '@exodus/atoms'
|
|
2
2
|
import { createFusionAtom } from '@exodus/fusion-atoms'
|
|
3
3
|
|
|
4
|
-
const createLegacyAddressModeAtom = ({ fusion }) => {
|
|
4
|
+
const createLegacyAddressModeAtom = ({ storage, fusion, logger }) => {
|
|
5
|
+
const storageAtom = createStorageAtomFactory({ storage, logger })({
|
|
6
|
+
key: 'legacyAddressMode',
|
|
7
|
+
defaultValue: {},
|
|
8
|
+
isSoleWriter: true,
|
|
9
|
+
})
|
|
10
|
+
|
|
5
11
|
const bitcoinFusionAtom = createFusionAtom({
|
|
6
12
|
fusion,
|
|
7
13
|
path: `bitcoinLegacyAddressEnabled`,
|
|
8
14
|
})
|
|
9
15
|
|
|
10
16
|
const computedAtom = compute({
|
|
11
|
-
atom: bitcoinFusionAtom,
|
|
12
|
-
selector: (bitcoin) => (bitcoin === undefined ?
|
|
17
|
+
atom: combine({ storage: storageAtom, bitcoin: bitcoinFusionAtom }),
|
|
18
|
+
selector: ({ storage, bitcoin }) => (bitcoin === undefined ? storage : { ...storage, bitcoin }),
|
|
13
19
|
})
|
|
14
20
|
|
|
15
21
|
const set = async (value) => {
|
|
16
|
-
const { bitcoin } =
|
|
22
|
+
const { bitcoin, ...rest } =
|
|
23
|
+
typeof value === 'function' ? value(await computedAtom.get()) : value
|
|
24
|
+
|
|
25
|
+
await storageAtom.set(rest)
|
|
17
26
|
|
|
18
27
|
const bitcoinPreviousValue = await bitcoinFusionAtom.get()
|
|
19
28
|
if (bitcoinPreviousValue !== bitcoin) {
|
|
@@ -28,7 +37,7 @@ const legacyAddressModeAtomDefinition = {
|
|
|
28
37
|
id: 'legacyAddressModeAtom',
|
|
29
38
|
type: 'atom',
|
|
30
39
|
factory: createLegacyAddressModeAtom,
|
|
31
|
-
dependencies: ['fusion'],
|
|
40
|
+
dependencies: ['storage', 'fusion', 'logger'],
|
|
32
41
|
public: true,
|
|
33
42
|
}
|
|
34
43
|
|
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
import { compute } from '@exodus/atoms'
|
|
1
|
+
import { combine, compute, createStorageAtomFactory } from '@exodus/atoms'
|
|
2
2
|
import { createFusionAtom } from '@exodus/fusion-atoms'
|
|
3
3
|
|
|
4
|
-
const createTaprootAddressModeAtom = ({ fusion }) => {
|
|
4
|
+
const createTaprootAddressModeAtom = ({ storage, fusion, logger }) => {
|
|
5
|
+
const storageAtom = createStorageAtomFactory({ storage, logger })({
|
|
6
|
+
key: 'taprootAddressMode',
|
|
7
|
+
defaultValue: {},
|
|
8
|
+
isSoleWriter: true,
|
|
9
|
+
})
|
|
10
|
+
|
|
5
11
|
const bitcoinFusionAtom = createFusionAtom({
|
|
6
12
|
fusion,
|
|
7
13
|
path: `bitcoinTaprootAddressEnabled`,
|
|
8
14
|
})
|
|
9
15
|
|
|
10
16
|
const computedAtom = compute({
|
|
11
|
-
atom: bitcoinFusionAtom,
|
|
12
|
-
selector: (bitcoin) => (bitcoin === undefined ?
|
|
17
|
+
atom: combine({ storage: storageAtom, bitcoin: bitcoinFusionAtom }),
|
|
18
|
+
selector: ({ storage, bitcoin }) => (bitcoin === undefined ? storage : { ...storage, bitcoin }),
|
|
13
19
|
})
|
|
14
20
|
|
|
15
21
|
const set = async (value) => {
|
|
16
|
-
const { bitcoin } =
|
|
22
|
+
const { bitcoin, ...rest } =
|
|
23
|
+
typeof value === 'function' ? value(await computedAtom.get()) : value
|
|
24
|
+
|
|
25
|
+
await storageAtom.set(rest)
|
|
17
26
|
|
|
18
27
|
const bitcoinPreviousValue = await bitcoinFusionAtom.get()
|
|
19
28
|
if (bitcoinPreviousValue !== bitcoin) {
|
|
@@ -28,7 +37,7 @@ const taprootAddressModeAtomDefinition = {
|
|
|
28
37
|
id: 'taprootAddressModeAtom',
|
|
29
38
|
type: 'atom',
|
|
30
39
|
factory: createTaprootAddressModeAtom,
|
|
31
|
-
dependencies: ['fusion'],
|
|
40
|
+
dependencies: ['storage', 'fusion', 'logger'],
|
|
32
41
|
public: true,
|
|
33
42
|
}
|
|
34
43
|
|
|
@@ -17,6 +17,7 @@ class AssetClientInterface {
|
|
|
17
17
|
#walletAccountsAtom
|
|
18
18
|
#multisigAtom
|
|
19
19
|
#featureFlagAtoms
|
|
20
|
+
#resolvedMonitorNetworksByWalletAccountAtom
|
|
20
21
|
#freshlyCreated = false
|
|
21
22
|
|
|
22
23
|
constructor({
|
|
@@ -35,6 +36,7 @@ class AssetClientInterface {
|
|
|
35
36
|
walletAccountsAtom,
|
|
36
37
|
multisigAtom,
|
|
37
38
|
featureFlagAtoms,
|
|
39
|
+
resolvedMonitorNetworksByWalletAccountAtom,
|
|
38
40
|
}) {
|
|
39
41
|
this.#addressProvider = addressProvider
|
|
40
42
|
this.#assetsModule = assetsModule
|
|
@@ -51,6 +53,7 @@ class AssetClientInterface {
|
|
|
51
53
|
this.#walletAccountsAtom = walletAccountsAtom
|
|
52
54
|
this.#multisigAtom = multisigAtom
|
|
53
55
|
this.#featureFlagAtoms = featureFlagAtoms
|
|
56
|
+
this.#resolvedMonitorNetworksByWalletAccountAtom = resolvedMonitorNetworksByWalletAccountAtom
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
setFreshlyCreated = (value) => {
|
|
@@ -156,8 +159,12 @@ class AssetClientInterface {
|
|
|
156
159
|
const supportedWalletAccounts = Object.keys(enabledWalletAccounts).filter((walletAccount) =>
|
|
157
160
|
availableAssetNamesByWalletAccount[walletAccount]?.includes(assetName)
|
|
158
161
|
)
|
|
162
|
+
const monitoredWalletAccounts = await this.#filterMonitoredWalletAccounts({
|
|
163
|
+
walletAccounts: supportedWalletAccounts,
|
|
164
|
+
baseAssetName: asset.baseAsset.name,
|
|
165
|
+
})
|
|
159
166
|
|
|
160
|
-
return filterAsync(
|
|
167
|
+
return filterAsync(monitoredWalletAccounts, async (walletAccount) => {
|
|
161
168
|
try {
|
|
162
169
|
// hardware wallet account may not support coin, to check this get address
|
|
163
170
|
await this.getReceiveAddress({ assetName, walletAccount, useCache: true })
|
|
@@ -395,6 +402,18 @@ class AssetClientInterface {
|
|
|
395
402
|
const walletAccount = await this.#getWalletAccount(walletAccountName)
|
|
396
403
|
return this.#transactionSigner.signTransaction({ baseAssetName, unsignedTx, walletAccount })
|
|
397
404
|
}
|
|
405
|
+
|
|
406
|
+
// a wallet account syncs only the networks headless resolved for it; one it doesn't list syncs as before
|
|
407
|
+
#filterMonitoredWalletAccounts = async ({ walletAccounts, baseAssetName }) => {
|
|
408
|
+
if (!this.#resolvedMonitorNetworksByWalletAccountAtom) return walletAccounts
|
|
409
|
+
|
|
410
|
+
const networksByWalletAccount = await this.#resolvedMonitorNetworksByWalletAccountAtom.get()
|
|
411
|
+
return walletAccounts.filter(
|
|
412
|
+
(walletAccount) =>
|
|
413
|
+
!networksByWalletAccount[walletAccount] ||
|
|
414
|
+
networksByWalletAccount[walletAccount].includes(baseAssetName)
|
|
415
|
+
)
|
|
416
|
+
}
|
|
398
417
|
}
|
|
399
418
|
|
|
400
419
|
const createAssetClientInterface = (args) => new AssetClientInterface(args)
|
package/client/index.js
CHANGED
package/index.js
CHANGED
|
@@ -40,8 +40,14 @@ const assets = (config = Object.create(null)) => {
|
|
|
40
40
|
storage: { namespace: 'assetPreferences' },
|
|
41
41
|
config: multiAddressMode,
|
|
42
42
|
},
|
|
43
|
-
{
|
|
44
|
-
|
|
43
|
+
{
|
|
44
|
+
definition: legacyAddressModeAtomDefinition,
|
|
45
|
+
storage: { namespace: 'assetPreferences' },
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
definition: taprootAddressModeAtomDefinition,
|
|
49
|
+
storage: { namespace: 'assetPreferences' },
|
|
50
|
+
},
|
|
45
51
|
{ definition: assetsAtomDefinition },
|
|
46
52
|
{
|
|
47
53
|
definition: disabledPurposesAtomDefinition,
|
|
@@ -1,24 +1,40 @@
|
|
|
1
1
|
import { omit } from '@exodus/basic-utils'
|
|
2
2
|
import assert from 'minimalistic-assert'
|
|
3
3
|
|
|
4
|
+
const supportsLegacyAddressMode = (asset) => asset?.useBip84 === true
|
|
5
|
+
const supportsTaprootAddressMode = (asset) => asset?.useBip86 === true
|
|
6
|
+
|
|
4
7
|
class AssetPreferences {
|
|
8
|
+
#assetsModule
|
|
5
9
|
#disabledPurposesAtom
|
|
6
10
|
#multiAddressModeAtom
|
|
7
11
|
#legacyAddressModeAtom
|
|
8
12
|
#taprootAddressModeAtom
|
|
9
13
|
|
|
10
14
|
constructor({
|
|
15
|
+
assetsModule,
|
|
11
16
|
disabledPurposesAtom,
|
|
12
17
|
multiAddressModeAtom,
|
|
13
18
|
legacyAddressModeAtom,
|
|
14
19
|
taprootAddressModeAtom,
|
|
15
20
|
}) {
|
|
21
|
+
this.#assetsModule = assetsModule
|
|
16
22
|
this.#disabledPurposesAtom = disabledPurposesAtom
|
|
17
23
|
this.#multiAddressModeAtom = multiAddressModeAtom
|
|
18
24
|
this.#legacyAddressModeAtom = legacyAddressModeAtom
|
|
19
25
|
this.#taprootAddressModeAtom = taprootAddressModeAtom
|
|
20
26
|
}
|
|
21
27
|
|
|
28
|
+
#assertAssetsSupport = ({ assetNames, method, isSupported }) => {
|
|
29
|
+
assert(assetNames.length > 0, `${method} requires at least one asset`)
|
|
30
|
+
for (const assetName of assetNames) {
|
|
31
|
+
assert(
|
|
32
|
+
isSupported(this.#assetsModule.getAsset(assetName)),
|
|
33
|
+
`${method} does not support ${assetName}`
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
22
38
|
enableMultiAddressMode = ({ assetNames }) =>
|
|
23
39
|
this.#multiAddressModeAtom.set((value) => ({
|
|
24
40
|
...value,
|
|
@@ -38,10 +54,11 @@ class AssetPreferences {
|
|
|
38
54
|
}))
|
|
39
55
|
|
|
40
56
|
enableLegacyAddressMode = async ({ assetNames }) => {
|
|
41
|
-
|
|
42
|
-
assetNames
|
|
43
|
-
'enableLegacyAddressMode
|
|
44
|
-
|
|
57
|
+
this.#assertAssetsSupport({
|
|
58
|
+
assetNames,
|
|
59
|
+
method: 'enableLegacyAddressMode',
|
|
60
|
+
isSupported: supportsLegacyAddressMode,
|
|
61
|
+
})
|
|
45
62
|
|
|
46
63
|
await this.#legacyAddressModeAtom.set((value) => ({
|
|
47
64
|
...value,
|
|
@@ -53,19 +70,21 @@ class AssetPreferences {
|
|
|
53
70
|
}
|
|
54
71
|
|
|
55
72
|
disableLegacyAddressMode = async ({ assetNames }) => {
|
|
56
|
-
|
|
57
|
-
assetNames
|
|
58
|
-
'disableLegacyAddressMode
|
|
59
|
-
|
|
73
|
+
this.#assertAssetsSupport({
|
|
74
|
+
assetNames,
|
|
75
|
+
method: 'disableLegacyAddressMode',
|
|
76
|
+
isSupported: supportsLegacyAddressMode,
|
|
77
|
+
})
|
|
60
78
|
|
|
61
79
|
await this.#legacyAddressModeAtom.set((value) => omit(value, assetNames))
|
|
62
80
|
}
|
|
63
81
|
|
|
64
82
|
enableTaprootAddressMode = async ({ assetNames }) => {
|
|
65
|
-
|
|
66
|
-
assetNames
|
|
67
|
-
'enableTaprootAddressMode
|
|
68
|
-
|
|
83
|
+
this.#assertAssetsSupport({
|
|
84
|
+
assetNames,
|
|
85
|
+
method: 'enableTaprootAddressMode',
|
|
86
|
+
isSupported: supportsTaprootAddressMode,
|
|
87
|
+
})
|
|
69
88
|
|
|
70
89
|
await this.#taprootAddressModeAtom.set((value) => ({
|
|
71
90
|
...value,
|
|
@@ -77,10 +96,11 @@ class AssetPreferences {
|
|
|
77
96
|
}
|
|
78
97
|
|
|
79
98
|
disableTaprootAddressMode = async ({ assetNames }) => {
|
|
80
|
-
|
|
81
|
-
assetNames
|
|
82
|
-
'disableTaprootAddressMode
|
|
83
|
-
|
|
99
|
+
this.#assertAssetsSupport({
|
|
100
|
+
assetNames,
|
|
101
|
+
method: 'disableTaprootAddressMode',
|
|
102
|
+
isSupported: supportsTaprootAddressMode,
|
|
103
|
+
})
|
|
84
104
|
|
|
85
105
|
await this.#taprootAddressModeAtom.set((value) => omit(value, assetNames))
|
|
86
106
|
}
|
|
@@ -115,6 +135,7 @@ const assetPreferencesDefinition = {
|
|
|
115
135
|
type: 'module',
|
|
116
136
|
factory: (opts) => new AssetPreferences(opts),
|
|
117
137
|
dependencies: [
|
|
138
|
+
'assetsModule',
|
|
118
139
|
'disabledPurposesAtom',
|
|
119
140
|
'multiAddressModeAtom',
|
|
120
141
|
'legacyAddressModeAtom',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/assets-feature",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "This Exodus SDK feature provides access to instances of all blockchain asset adapters supported by the wallet, and enables you to search for and add custom tokens at runtime.",
|
|
6
6
|
"type": "module",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@exodus/atoms": "^10.3.5",
|
|
44
44
|
"@exodus/basic-utils": "^5.2.1",
|
|
45
45
|
"@exodus/fetch": "^1.3.0",
|
|
46
|
-
"@exodus/fusion-atoms": "^1.4.
|
|
47
|
-
"@exodus/timer": "^1.2.
|
|
46
|
+
"@exodus/fusion-atoms": "^1.4.1",
|
|
47
|
+
"@exodus/timer": "^1.2.3",
|
|
48
48
|
"lodash": "^4.17.21",
|
|
49
49
|
"make-concurrent": "^5.4.0",
|
|
50
50
|
"minimalistic-assert": "^1.0.1",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@exodus/bip32": "^4.3.1",
|
|
56
56
|
"@exodus/bip39": "^1.1.1",
|
|
57
|
-
"@exodus/bip44-constants": "^195.0.
|
|
57
|
+
"@exodus/bip44-constants": "^195.0.3",
|
|
58
58
|
"@exodus/bitcoin-meta": "^2.0.0",
|
|
59
59
|
"@exodus/bitcoin-plugin": "^2.0.0",
|
|
60
60
|
"@exodus/bitcoinregtest-plugin": "^2.0.0",
|
|
@@ -66,14 +66,14 @@
|
|
|
66
66
|
"@exodus/ethereum-plugin": "^3.1.1",
|
|
67
67
|
"@exodus/fusion-local": "^2.1.1",
|
|
68
68
|
"@exodus/keychain": "^12.1.0",
|
|
69
|
-
"@exodus/logger": "^1.2.
|
|
70
|
-
"@exodus/models": "^13.3.
|
|
69
|
+
"@exodus/logger": "^1.2.4",
|
|
70
|
+
"@exodus/models": "^13.3.3",
|
|
71
71
|
"@exodus/osmosis-plugin": "^1.3.3",
|
|
72
72
|
"@exodus/public-key-provider": "^4.3.2",
|
|
73
73
|
"@exodus/redux-dependency-injection": "^5.0.0",
|
|
74
74
|
"@exodus/storage-memory": "^2.4.1",
|
|
75
75
|
"@exodus/wallet-accounts": "^20.4.12",
|
|
76
|
-
"@exodus/wild-emitter": "^1.1.
|
|
76
|
+
"@exodus/wild-emitter": "^1.1.3",
|
|
77
77
|
"events": "^3.3.0",
|
|
78
78
|
"msw": "^2.0.0",
|
|
79
79
|
"redux": "^4.0.0"
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"access": "public",
|
|
83
83
|
"provenance": false
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "b85bfa3efae23683d672b98d7ab6ff5cfb952c7c"
|
|
86
86
|
}
|