@exodus/assets-feature 6.1.0 → 7.0.1
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 +18 -0
- package/client/asset-client-interface.js +58 -54
- package/index.js +2 -0
- package/package.json +6 -5
- package/plugin/index.js +13 -7
- package/report/index.js +50 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@7.0.0...@exodus/assets-feature@7.0.1) (2025-02-18)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- fix: 'assets' and 'assets-add' race condition (#11521)
|
|
11
|
+
|
|
12
|
+
## [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)
|
|
13
|
+
|
|
14
|
+
### ⚠ BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
- make ACI fields private (#11460)
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- feat: assets-feature report (#11496)
|
|
21
|
+
|
|
22
|
+
- refactor!: make ACI fields private (#11460)
|
|
23
|
+
|
|
6
24
|
## [6.1.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@6.0.4...@exodus/assets-feature@6.1.0) (2025-02-10)
|
|
7
25
|
|
|
8
26
|
### Features
|
|
@@ -5,57 +5,61 @@ import assert from 'minimalistic-assert'
|
|
|
5
5
|
const { isEmpty } = lodash
|
|
6
6
|
|
|
7
7
|
class AssetClientInterface {
|
|
8
|
+
#addressProvider
|
|
9
|
+
#assetsModule
|
|
8
10
|
#availableAssetNamesAtom
|
|
9
|
-
#
|
|
10
|
-
#enabledWalletAccountsAtom
|
|
11
|
-
#transactionSigner
|
|
12
|
-
#publicKeyProvider
|
|
11
|
+
#blockchainMetadata
|
|
13
12
|
#config
|
|
14
13
|
#createLogger
|
|
14
|
+
#enabledWalletAccountsAtom
|
|
15
|
+
#feeMonitors
|
|
16
|
+
#publicKeyProvider
|
|
17
|
+
#transactionSigner
|
|
18
|
+
#walletAccountsAtom
|
|
15
19
|
|
|
16
20
|
constructor({
|
|
21
|
+
addressProvider,
|
|
22
|
+
assetsModule,
|
|
23
|
+
availableAssetNamesAtom,
|
|
17
24
|
blockchainMetadata,
|
|
18
25
|
createLogger,
|
|
19
|
-
|
|
26
|
+
config,
|
|
20
27
|
enabledWalletAccountsAtom,
|
|
21
|
-
assetsModule,
|
|
22
|
-
availableAssetNamesAtom,
|
|
23
|
-
addressProvider,
|
|
24
28
|
feeMonitors,
|
|
25
|
-
transactionSigner,
|
|
26
29
|
publicKeyProvider,
|
|
27
|
-
|
|
30
|
+
transactionSigner,
|
|
31
|
+
walletAccountsAtom,
|
|
28
32
|
}) {
|
|
29
|
-
this
|
|
30
|
-
this.#
|
|
31
|
-
this.#enabledWalletAccountsAtom = enabledWalletAccountsAtom
|
|
32
|
-
this.assetsModule = assetsModule
|
|
33
|
-
this.addressProvider = addressProvider
|
|
34
|
-
this.feeMonitors = feeMonitors
|
|
33
|
+
this.#addressProvider = addressProvider
|
|
34
|
+
this.#assetsModule = assetsModule
|
|
35
35
|
this.#availableAssetNamesAtom = availableAssetNamesAtom
|
|
36
|
-
this.#
|
|
37
|
-
this.#publicKeyProvider = publicKeyProvider
|
|
36
|
+
this.#blockchainMetadata = blockchainMetadata
|
|
38
37
|
this.#config = config
|
|
39
38
|
this.#createLogger = createLogger || (() => console)
|
|
39
|
+
this.#enabledWalletAccountsAtom = enabledWalletAccountsAtom
|
|
40
|
+
this.#feeMonitors = feeMonitors
|
|
41
|
+
this.#publicKeyProvider = publicKeyProvider
|
|
42
|
+
this.#transactionSigner = transactionSigner
|
|
43
|
+
this.#walletAccountsAtom = walletAccountsAtom
|
|
40
44
|
|
|
41
45
|
assetsModule.initialize({ assetClientInterface: this })
|
|
42
46
|
}
|
|
43
47
|
|
|
44
|
-
createLogger(namespace) {
|
|
48
|
+
createLogger = (namespace) => {
|
|
45
49
|
return this.#createLogger(namespace)
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
// txHistory interface
|
|
49
53
|
|
|
50
54
|
getTxHistory = async ({ assetName, walletAccount }) => {
|
|
51
|
-
return this
|
|
55
|
+
return this.#blockchainMetadata.getTxLog({ assetName, walletAccount })
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
async
|
|
55
|
-
return this
|
|
58
|
+
getTxLog = async ({ assetName, walletAccount }) => {
|
|
59
|
+
return this.#blockchainMetadata.getTxLog({ assetName, walletAccount })
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
async
|
|
62
|
+
updateTxLogAndNotify = async (params) => {
|
|
59
63
|
return this.updateTxLogAndNotifyBatch(params).commit()
|
|
60
64
|
}
|
|
61
65
|
|
|
@@ -64,7 +68,7 @@ class AssetClientInterface {
|
|
|
64
68
|
walletAccount,
|
|
65
69
|
txs,
|
|
66
70
|
refresh = false,
|
|
67
|
-
batch = this
|
|
71
|
+
batch = this.#blockchainMetadata.batch(),
|
|
68
72
|
}) => {
|
|
69
73
|
return refresh
|
|
70
74
|
? batch.overwriteTxs({ assetName, walletAccount, txs })
|
|
@@ -79,18 +83,18 @@ class AssetClientInterface {
|
|
|
79
83
|
assetName,
|
|
80
84
|
walletAccount,
|
|
81
85
|
txs,
|
|
82
|
-
batch = this
|
|
86
|
+
batch = this.#blockchainMetadata.batch(),
|
|
83
87
|
}) => {
|
|
84
88
|
return batch.removeTxs({ assetName, walletAccount, txs })
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
// accountState interface
|
|
88
92
|
|
|
89
|
-
async
|
|
90
|
-
return this
|
|
93
|
+
getAccountState = async ({ assetName, walletAccount }) => {
|
|
94
|
+
return this.#blockchainMetadata.getAccountState({ assetName, walletAccount })
|
|
91
95
|
}
|
|
92
96
|
|
|
93
|
-
async
|
|
97
|
+
updateAccountState = async ({ assetName, walletAccount, ...params }) => {
|
|
94
98
|
let { accountState } = params
|
|
95
99
|
if (!accountState) {
|
|
96
100
|
accountState = await this.getAccountState({ assetName, walletAccount })
|
|
@@ -109,7 +113,7 @@ class AssetClientInterface {
|
|
|
109
113
|
walletAccount,
|
|
110
114
|
newData,
|
|
111
115
|
accountState,
|
|
112
|
-
batch = this
|
|
116
|
+
batch = this.#blockchainMetadata.batch(),
|
|
113
117
|
}) => {
|
|
114
118
|
// merge mem to keep the previous accountMem behavior
|
|
115
119
|
if (!isEmpty(newData?.mem) && (!accountState || accountState.mem)) {
|
|
@@ -125,9 +129,9 @@ class AssetClientInterface {
|
|
|
125
129
|
|
|
126
130
|
// walletAccounts interface
|
|
127
131
|
|
|
128
|
-
async
|
|
132
|
+
getWalletAccounts = async ({ assetName }) => {
|
|
129
133
|
// In the future, the list of wallets may be different based on the provided assets
|
|
130
|
-
const asset = this
|
|
134
|
+
const asset = this.#assetsModule.getAsset(assetName)
|
|
131
135
|
assert(asset, `${assetName} is not supported`)
|
|
132
136
|
const enabledWalletAccounts = await this.#enabledWalletAccountsAtom.get()
|
|
133
137
|
return filterAsync(Object.keys(enabledWalletAccounts), async (walletAccount) => {
|
|
@@ -143,19 +147,19 @@ class AssetClientInterface {
|
|
|
143
147
|
|
|
144
148
|
// assets interface
|
|
145
149
|
|
|
146
|
-
async
|
|
150
|
+
getAssetsForNetwork = async ({ baseAssetName }) => {
|
|
147
151
|
const availableAssetNames = new Set(await this.#availableAssetNamesAtom.get())
|
|
148
152
|
return pickBy(
|
|
149
|
-
this
|
|
153
|
+
this.#assetsModule.getAssets(),
|
|
150
154
|
(asset) => asset.baseAsset.name === baseAssetName && availableAssetNames.has(asset.name)
|
|
151
155
|
)
|
|
152
156
|
}
|
|
153
157
|
|
|
154
158
|
// configParams interface
|
|
155
159
|
|
|
156
|
-
async
|
|
160
|
+
getAssetConfig = async ({ assetName, walletAccount }) => {
|
|
157
161
|
const walletAccountInstance = await this.#getWalletAccount(walletAccount)
|
|
158
|
-
const asset = this
|
|
162
|
+
const asset = this.#assetsModule.getAsset(assetName)
|
|
159
163
|
assert(asset, `assetName ${assetName} is not supported`)
|
|
160
164
|
assert(walletAccountInstance, `walletAccountInstance ${walletAccount} is not available`)
|
|
161
165
|
|
|
@@ -181,29 +185,29 @@ class AssetClientInterface {
|
|
|
181
185
|
return out
|
|
182
186
|
}
|
|
183
187
|
|
|
184
|
-
async
|
|
185
|
-
const baseAsset = this
|
|
188
|
+
getConfirmationsNumber = async ({ assetName }) => {
|
|
189
|
+
const baseAsset = this.#assetsModule.getAsset(assetName).baseAsset
|
|
186
190
|
return baseAsset.api?.getConfirmationsNumber ? baseAsset.api.getConfirmationsNumber() : 1
|
|
187
191
|
}
|
|
188
192
|
|
|
189
|
-
async
|
|
190
|
-
await this
|
|
193
|
+
updateFeeConfig = async ({ assetName, feeConfig }) => {
|
|
194
|
+
await this.#feeMonitors.updateFee({ assetName, feeData: feeConfig })
|
|
191
195
|
}
|
|
192
196
|
|
|
193
|
-
async
|
|
194
|
-
const baseAssetName = this
|
|
195
|
-
return this
|
|
197
|
+
getFeeData = async ({ assetName }) => {
|
|
198
|
+
const baseAssetName = this.#assetsModule.getAsset(assetName).baseAsset.name
|
|
199
|
+
return this.#feeMonitors.getFeeData({ assetName: baseAssetName })
|
|
196
200
|
}
|
|
197
201
|
|
|
198
202
|
getFeeConfig = async ({ assetName }) => {
|
|
199
|
-
return this
|
|
203
|
+
return this.#feeMonitors.getFeeData({ assetName })
|
|
200
204
|
}
|
|
201
205
|
|
|
202
206
|
// batch interface
|
|
203
207
|
|
|
204
208
|
// The interface consumer does not need to know the structure of the returned batch object, just
|
|
205
209
|
// that it needs to be passed along wherever operations need to be batched.
|
|
206
|
-
createOperationsBatch = () => this
|
|
210
|
+
createOperationsBatch = () => this.#blockchainMetadata.batch()
|
|
207
211
|
|
|
208
212
|
executeOperationsBatch = async (batch) => batch.commit()
|
|
209
213
|
|
|
@@ -220,7 +224,7 @@ class AssetClientInterface {
|
|
|
220
224
|
;[purpose] = await this.getSupportedPurposes({ assetName, walletAccount })
|
|
221
225
|
}
|
|
222
226
|
|
|
223
|
-
const asset = this
|
|
227
|
+
const asset = this.#assetsModule.getAsset(assetName)
|
|
224
228
|
const walletAccountInstance = await this.#getWalletAccount(walletAccount)
|
|
225
229
|
const keyIdentifier = asset.baseAsset.api.getKeyIdentifier({
|
|
226
230
|
purpose,
|
|
@@ -237,7 +241,7 @@ class AssetClientInterface {
|
|
|
237
241
|
}
|
|
238
242
|
|
|
239
243
|
getExtendedPublicKey = async ({ assetName, walletAccount, purpose }) => {
|
|
240
|
-
const asset = this
|
|
244
|
+
const asset = this.#assetsModule.getAsset(assetName)
|
|
241
245
|
const [walletAccountInstance, purposes] = await Promise.all([
|
|
242
246
|
this.#getWalletAccount(walletAccount),
|
|
243
247
|
purpose === undefined
|
|
@@ -262,7 +266,7 @@ class AssetClientInterface {
|
|
|
262
266
|
}
|
|
263
267
|
|
|
264
268
|
getAddress = async (opts) => {
|
|
265
|
-
return this
|
|
269
|
+
return this.#addressProvider.getAddress({
|
|
266
270
|
...opts,
|
|
267
271
|
walletAccount: await this.#getWalletAccount(opts.walletAccount),
|
|
268
272
|
})
|
|
@@ -274,14 +278,14 @@ class AssetClientInterface {
|
|
|
274
278
|
}
|
|
275
279
|
|
|
276
280
|
getReceiveAddressObject = async (opts) => {
|
|
277
|
-
return this
|
|
281
|
+
return this.#addressProvider.getReceiveAddress({
|
|
278
282
|
...opts,
|
|
279
283
|
walletAccount: await this.#getWalletAccount(opts.walletAccount),
|
|
280
284
|
})
|
|
281
285
|
}
|
|
282
286
|
|
|
283
287
|
getReceiveAddresses = async (opts) => {
|
|
284
|
-
const addresses = await this
|
|
288
|
+
const addresses = await this.#addressProvider.getReceiveAddresses({
|
|
285
289
|
...opts,
|
|
286
290
|
walletAccount: await this.#getWalletAccount(opts.walletAccount),
|
|
287
291
|
})
|
|
@@ -290,7 +294,7 @@ class AssetClientInterface {
|
|
|
290
294
|
}
|
|
291
295
|
|
|
292
296
|
getChangeAddresses = async (opts) => {
|
|
293
|
-
const addresses = await this
|
|
297
|
+
const addresses = await this.#addressProvider.getChangeAddresses({
|
|
294
298
|
...opts,
|
|
295
299
|
walletAccount: await this.#getWalletAccount(opts.walletAccount),
|
|
296
300
|
})
|
|
@@ -304,14 +308,14 @@ class AssetClientInterface {
|
|
|
304
308
|
}
|
|
305
309
|
|
|
306
310
|
getSupportedPurposes = async ({ assetName, walletAccount }) => {
|
|
307
|
-
return this
|
|
311
|
+
return this.#addressProvider.getSupportedPurposes({
|
|
308
312
|
assetName,
|
|
309
313
|
walletAccount: await this.#getWalletAccount(walletAccount),
|
|
310
314
|
})
|
|
311
315
|
}
|
|
312
316
|
|
|
313
317
|
getUnusedAddressIndexes = async ({ assetName, walletAccount, highestUnusedIndexes }) => {
|
|
314
|
-
return this
|
|
318
|
+
return this.#addressProvider.getUnusedAddressIndexes({
|
|
315
319
|
assetName,
|
|
316
320
|
walletAccount: await this.#getWalletAccount(walletAccount),
|
|
317
321
|
highestUnusedIndexes,
|
|
@@ -323,7 +327,7 @@ class AssetClientInterface {
|
|
|
323
327
|
}
|
|
324
328
|
|
|
325
329
|
getNextChangeAddress = async ({ assetName, walletAccount }) => {
|
|
326
|
-
return this
|
|
330
|
+
return this.#addressProvider.getUnusedAddress({
|
|
327
331
|
assetName,
|
|
328
332
|
walletAccount: await this.#getWalletAccount(walletAccount),
|
|
329
333
|
chainIndex: 1,
|
|
@@ -333,7 +337,7 @@ class AssetClientInterface {
|
|
|
333
337
|
// wallet interface
|
|
334
338
|
|
|
335
339
|
signTransaction = async ({ assetName, unsignedTx, walletAccount: walletAccountName }) => {
|
|
336
|
-
const baseAssetName = this
|
|
340
|
+
const baseAssetName = this.#assetsModule.getAsset(assetName).baseAsset.name
|
|
337
341
|
const walletAccount = await this.#getWalletAccount(walletAccountName)
|
|
338
342
|
return this.#transactionSigner.signTransaction({ baseAssetName, unsignedTx, walletAccount })
|
|
339
343
|
}
|
package/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import assetModuleDefinition from './module/index.js'
|
|
|
9
9
|
import customTokensMonitorDefinition from './monitor/index.js'
|
|
10
10
|
import assetPreferencesDefinition from './module/asset-preferences.js'
|
|
11
11
|
import assetsAtomDefinition from './atoms/assets.js'
|
|
12
|
+
import assetsReportDefinition from './report/index.js'
|
|
12
13
|
import { defaultConfig } from './constants.js'
|
|
13
14
|
|
|
14
15
|
const assets = (config = Object.create(null)) => {
|
|
@@ -53,6 +54,7 @@ const assets = (config = Object.create(null)) => {
|
|
|
53
54
|
},
|
|
54
55
|
{ definition: assetPreferencesDefinition },
|
|
55
56
|
{ if: { registered: ['customTokensStorage'] }, definition: customTokensMonitorDefinition },
|
|
57
|
+
{ definition: assetsReportDefinition },
|
|
56
58
|
],
|
|
57
59
|
}
|
|
58
60
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/assets-feature",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
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",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"monitor",
|
|
20
20
|
"plugin",
|
|
21
21
|
"redux",
|
|
22
|
+
"report",
|
|
22
23
|
"constants.js",
|
|
23
24
|
"index.d.ts",
|
|
24
25
|
"CHANGELOG.md",
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
"@exodus/bitcoin-plugin": "^1.29.1",
|
|
53
54
|
"@exodus/bitcoinregtest-plugin": "^1.11.0",
|
|
54
55
|
"@exodus/bitcointestnet-plugin": "^1.13.1",
|
|
55
|
-
"@exodus/blockchain-metadata": "^15.
|
|
56
|
+
"@exodus/blockchain-metadata": "^15.8.3",
|
|
56
57
|
"@exodus/cardano-lib": "^2.2.0",
|
|
57
58
|
"@exodus/combined-assets-meta": "^3.0.0",
|
|
58
59
|
"@exodus/cosmos-plugin": "^1.3.3",
|
|
@@ -61,12 +62,12 @@
|
|
|
61
62
|
"@exodus/fusion-local": "^2.1.0",
|
|
62
63
|
"@exodus/keychain": "^7.3.0",
|
|
63
64
|
"@exodus/logger": "^1.2.3",
|
|
64
|
-
"@exodus/models": "^12.
|
|
65
|
+
"@exodus/models": "^12.7.0",
|
|
65
66
|
"@exodus/osmosis-plugin": "^1.3.3",
|
|
66
67
|
"@exodus/public-key-provider": "^4.1.0",
|
|
67
68
|
"@exodus/redux-dependency-injection": "^4.1.1",
|
|
68
69
|
"@exodus/storage-memory": "^2.2.2",
|
|
69
|
-
"@exodus/wallet-accounts": "^17.
|
|
70
|
+
"@exodus/wallet-accounts": "^17.3.0",
|
|
70
71
|
"@exodus/wild-emitter": "^1.0.0",
|
|
71
72
|
"bip39": "^3.1.0",
|
|
72
73
|
"events": "^3.3.0",
|
|
@@ -76,5 +77,5 @@
|
|
|
76
77
|
"publishConfig": {
|
|
77
78
|
"access": "public"
|
|
78
79
|
},
|
|
79
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "1ff0aaa12cb83e9c68aa10e111714f9c5760ab16"
|
|
80
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
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const createAssetsReport = ({
|
|
2
|
+
wallet,
|
|
3
|
+
assetsModule,
|
|
4
|
+
assetPreferences,
|
|
5
|
+
disabledPurposesAtom,
|
|
6
|
+
multiAddressModeAtom,
|
|
7
|
+
legacyAddressModeAtom,
|
|
8
|
+
taprootAddressModeAtom,
|
|
9
|
+
}) => ({
|
|
10
|
+
namespace: 'assets',
|
|
11
|
+
export: async () => {
|
|
12
|
+
if (!(await wallet.exists())) {
|
|
13
|
+
return {}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const [disabledBipPurposes, multiAddressMode, legacyAddressMode, taprootAddressMode] =
|
|
17
|
+
Promise.all([
|
|
18
|
+
disabledPurposesAtom.get(),
|
|
19
|
+
multiAddressModeAtom.get(),
|
|
20
|
+
legacyAddressModeAtom.get(),
|
|
21
|
+
taprootAddressModeAtom.get(),
|
|
22
|
+
])
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
preferences: {
|
|
26
|
+
disabledBipPurposes,
|
|
27
|
+
multiAddressMode,
|
|
28
|
+
legacyAddressMode,
|
|
29
|
+
taprootAddressMode,
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const assetsReportDefinition = {
|
|
36
|
+
id: 'assetsReport',
|
|
37
|
+
type: 'report',
|
|
38
|
+
factory: createAssetsReport,
|
|
39
|
+
dependencies: [
|
|
40
|
+
'assetsModule',
|
|
41
|
+
'assetPreferences',
|
|
42
|
+
'disabledPurposesAtom',
|
|
43
|
+
'multiAddressModeAtom',
|
|
44
|
+
'legacyAddressModeAtom',
|
|
45
|
+
'taprootAddressModeAtom',
|
|
46
|
+
'wallet',
|
|
47
|
+
],
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default assetsReportDefinition
|