@exodus/assets-feature 7.0.0 → 7.0.2
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/package.json +5 -5
- package/plugin/index.js +13 -7
- package/report/index.js +2 -6
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
|
+
## [7.0.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@7.0.1...@exodus/assets-feature@7.0.2) (2025-02-21)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- fix: skip exporting most reports if wallet doesn't exist (#11553)
|
|
11
|
+
|
|
12
|
+
## [7.0.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@7.0.0...@exodus/assets-feature@7.0.1) (2025-02-18)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- fix: 'assets' and 'assets-add' race condition (#11521)
|
|
17
|
+
|
|
6
18
|
## [7.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@6.1.0...@exodus/assets-feature@7.0.0) (2025-02-17)
|
|
7
19
|
|
|
8
20
|
### ⚠ BREAKING CHANGES
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/assets-feature",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.2",
|
|
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",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@exodus/bitcoin-plugin": "^1.29.1",
|
|
54
54
|
"@exodus/bitcoinregtest-plugin": "^1.11.0",
|
|
55
55
|
"@exodus/bitcointestnet-plugin": "^1.13.1",
|
|
56
|
-
"@exodus/blockchain-metadata": "^15.8.
|
|
56
|
+
"@exodus/blockchain-metadata": "^15.8.5",
|
|
57
57
|
"@exodus/cardano-lib": "^2.2.0",
|
|
58
58
|
"@exodus/combined-assets-meta": "^3.0.0",
|
|
59
59
|
"@exodus/cosmos-plugin": "^1.3.3",
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
"@exodus/fusion-local": "^2.1.0",
|
|
63
63
|
"@exodus/keychain": "^7.3.0",
|
|
64
64
|
"@exodus/logger": "^1.2.3",
|
|
65
|
-
"@exodus/models": "^12.
|
|
65
|
+
"@exodus/models": "^12.7.0",
|
|
66
66
|
"@exodus/osmosis-plugin": "^1.3.3",
|
|
67
67
|
"@exodus/public-key-provider": "^4.1.0",
|
|
68
68
|
"@exodus/redux-dependency-injection": "^4.1.1",
|
|
69
69
|
"@exodus/storage-memory": "^2.2.2",
|
|
70
|
-
"@exodus/wallet-accounts": "^17.3.
|
|
70
|
+
"@exodus/wallet-accounts": "^17.3.1",
|
|
71
71
|
"@exodus/wild-emitter": "^1.0.0",
|
|
72
72
|
"bip39": "^3.1.0",
|
|
73
73
|
"events": "^3.3.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "7f7ccf5ba141c8c392a34e2004247658d2bf9c73"
|
|
81
81
|
}
|
package/plugin/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mapValues, pickBy } from '@exodus/basic-utils'
|
|
2
1
|
import { createAtomObserver } from '@exodus/atoms'
|
|
2
|
+
import { mapValues, pickBy } from '@exodus/basic-utils'
|
|
3
3
|
|
|
4
4
|
const createAssetsPlugin = ({
|
|
5
5
|
port,
|
|
@@ -11,8 +11,11 @@ const createAssetsPlugin = ({
|
|
|
11
11
|
legacyAddressModeAtom,
|
|
12
12
|
taprootAddressModeAtom,
|
|
13
13
|
}) => {
|
|
14
|
-
const emitAssets = async () => {
|
|
15
|
-
|
|
14
|
+
const emitAssets = async (assets) => {
|
|
15
|
+
if (!assets) {
|
|
16
|
+
;({ value: assets } = await assetsAtom.get())
|
|
17
|
+
}
|
|
18
|
+
|
|
16
19
|
const payload = {
|
|
17
20
|
assets,
|
|
18
21
|
defaultAccountStates: mapValues(
|
|
@@ -34,8 +37,14 @@ const createAssetsPlugin = ({
|
|
|
34
37
|
const subscribers = []
|
|
35
38
|
|
|
36
39
|
const onStart = async () => {
|
|
40
|
+
let emittedInitialAssets = false
|
|
37
41
|
subscribers.push(
|
|
38
|
-
assetsAtom.observe(({ added, updated, disabled }) => {
|
|
42
|
+
assetsAtom.observe(async ({ value, added, updated, disabled }) => {
|
|
43
|
+
if (!emittedInitialAssets) {
|
|
44
|
+
await emitAssets(value)
|
|
45
|
+
emittedInitialAssets = true
|
|
46
|
+
}
|
|
47
|
+
|
|
39
48
|
if (added.length > 0) {
|
|
40
49
|
port.emit('assets-add', added)
|
|
41
50
|
}
|
|
@@ -51,14 +60,11 @@ const createAssetsPlugin = ({
|
|
|
51
60
|
)
|
|
52
61
|
|
|
53
62
|
observers.forEach((observer) => observer.register())
|
|
54
|
-
|
|
55
63
|
await assetsModule.load()
|
|
56
|
-
await emitAssets()
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
const onLoad = async () => {
|
|
60
67
|
observers.forEach((observer) => observer.start())
|
|
61
|
-
|
|
62
68
|
await assetsModule.load()
|
|
63
69
|
await emitAssets()
|
|
64
70
|
}
|
package/report/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const createAssetsReport = ({
|
|
2
|
-
wallet,
|
|
3
2
|
assetsModule,
|
|
4
3
|
assetPreferences,
|
|
5
4
|
disabledPurposesAtom,
|
|
@@ -8,10 +7,8 @@ const createAssetsReport = ({
|
|
|
8
7
|
taprootAddressModeAtom,
|
|
9
8
|
}) => ({
|
|
10
9
|
namespace: 'assets',
|
|
11
|
-
export: async () => {
|
|
12
|
-
if (!
|
|
13
|
-
return {}
|
|
14
|
-
}
|
|
10
|
+
export: async ({ walletExists } = Object.create(null)) => {
|
|
11
|
+
if (!walletExists) return null
|
|
15
12
|
|
|
16
13
|
const [disabledBipPurposes, multiAddressMode, legacyAddressMode, taprootAddressMode] =
|
|
17
14
|
Promise.all([
|
|
@@ -43,7 +40,6 @@ const assetsReportDefinition = {
|
|
|
43
40
|
'multiAddressModeAtom',
|
|
44
41
|
'legacyAddressModeAtom',
|
|
45
42
|
'taprootAddressModeAtom',
|
|
46
|
-
'wallet',
|
|
47
43
|
],
|
|
48
44
|
}
|
|
49
45
|
|