@exodus/headless 2.0.0-alpha.35 → 2.0.0-alpha.37
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 +10 -0
- package/package.json +5 -5
- package/src/api.js +5 -5
- package/src/atoms/attach.js +0 -9
- package/src/dependencies/modules.js +2 -37
- package/src/index.js +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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
|
+
## [2.0.0-alpha.37](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.36...@exodus/headless@2.0.0-alpha.37) (2023-06-09)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **headless:** stop clearing atoms on attach ([#1854](https://github.com/ExodusMovement/exodus-hydra/issues/1854)) ([16a7f23](https://github.com/ExodusMovement/exodus-hydra/commit/16a7f23fccbc2355810fa1ca837886922056c6f0))
|
|
11
|
+
|
|
12
|
+
## [2.0.0-alpha.36](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.35...@exodus/headless@2.0.0-alpha.36) (2023-06-09)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @exodus/headless
|
|
15
|
+
|
|
6
16
|
## [2.0.0-alpha.35](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.34...@exodus/headless@2.0.0-alpha.35) (2023-06-08)
|
|
7
17
|
|
|
8
18
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/headless",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.37",
|
|
4
4
|
"description": "The headless Exodus wallet SDK",
|
|
5
5
|
"author": "Exodus Movement Inc",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test": "jest --runInBand"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@exodus/
|
|
29
|
+
"@exodus/address-provider": "^4.0.0",
|
|
30
30
|
"@exodus/apy-rates": "^2.1.0",
|
|
31
31
|
"@exodus/atoms": "^3.5.3",
|
|
32
32
|
"@exodus/auto-enable-assets-plugin": "^4.0.1",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@exodus/kyc": "^3.4.0",
|
|
51
51
|
"@exodus/market-history": "^3.1.0",
|
|
52
52
|
"@exodus/module": "^1.0.0",
|
|
53
|
-
"@exodus/nfts": "^
|
|
53
|
+
"@exodus/nfts": "^2.0.0",
|
|
54
54
|
"@exodus/personal-notes": "^3.0.1",
|
|
55
55
|
"@exodus/rates-monitor": "^2.0.0",
|
|
56
|
-
"@exodus/referrals": "^
|
|
56
|
+
"@exodus/referrals": "^6.0.0",
|
|
57
57
|
"@exodus/top-movers-monitor": "^2.0.1",
|
|
58
58
|
"@exodus/wallet": "^6.0.1",
|
|
59
59
|
"@exodus/wallet-accounts": "^8.0.1",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"nock": "^13.3.1",
|
|
88
88
|
"p-defer": "^4.0.0"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "5e1b4886d5de0224d5f9e0b4d08d05e1d4890861"
|
|
91
91
|
}
|
package/src/api.js
CHANGED
|
@@ -4,7 +4,7 @@ const createApi = ({ ioc, port }) => {
|
|
|
4
4
|
const { assetsModule } = ioc.getByType('adapter')
|
|
5
5
|
|
|
6
6
|
const {
|
|
7
|
-
|
|
7
|
+
addressProvider,
|
|
8
8
|
application,
|
|
9
9
|
blockchainMetadata,
|
|
10
10
|
connectedOrigins,
|
|
@@ -101,10 +101,10 @@ const createApi = ({ ioc, port }) => {
|
|
|
101
101
|
rates: {
|
|
102
102
|
refresh: () => ratesMonitor.update(),
|
|
103
103
|
},
|
|
104
|
-
|
|
105
|
-
getAddress:
|
|
106
|
-
getSupportedPurposes:
|
|
107
|
-
getReceiveAddress:
|
|
104
|
+
addressProvider: {
|
|
105
|
+
getAddress: addressProvider.getAddress.bind(addressProvider),
|
|
106
|
+
getSupportedPurposes: addressProvider.getSupportedPurposes.bind(addressProvider),
|
|
107
|
+
getReceiveAddress: addressProvider.getReceiveAddress.bind(addressProvider),
|
|
108
108
|
},
|
|
109
109
|
kyc: {
|
|
110
110
|
start: kyc.start,
|
package/src/atoms/attach.js
CHANGED
|
@@ -17,15 +17,6 @@ const attachAtom = ({ port, application, logger, atom, atomId, lifecycleEvents }
|
|
|
17
17
|
})
|
|
18
18
|
)
|
|
19
19
|
|
|
20
|
-
application.on('clear', async () => {
|
|
21
|
-
try {
|
|
22
|
-
await atom?.set(undefined)
|
|
23
|
-
} catch (error) {
|
|
24
|
-
logger.debug('failed to clear atom', error)
|
|
25
|
-
// noop. atom might not support set
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
|
|
29
20
|
atom.observe((value) => {
|
|
30
21
|
if (loaded) emitAtomValue({ port, atomId, atom, value })
|
|
31
22
|
})
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import createInMemoryAddressCache from '@exodus/addresses-provider/address-cache-memory'
|
|
3
|
-
import createMockableAddressesProvider from '@exodus/addresses-provider/mock'
|
|
1
|
+
import createAddressProviderDependencies from '@exodus/address-provider'
|
|
4
2
|
import availableAssetsModuleDefinition from '@exodus/available-assets/module'
|
|
5
3
|
import balancesDefinition from '@exodus/balances/module'
|
|
6
4
|
import blockchainMetadataDefinition from '@exodus/blockchain-metadata/module'
|
|
@@ -80,40 +78,7 @@ const createModuleDependencies = ({ config }) =>
|
|
|
80
78
|
definition: featureFlagsDefinition,
|
|
81
79
|
writesAtoms: ['featureFlagAtoms'],
|
|
82
80
|
},
|
|
83
|
-
|
|
84
|
-
definition: {
|
|
85
|
-
id: 'addressCache',
|
|
86
|
-
factory: createInMemoryAddressCache,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
config.addressesProvider?.mockAddresses
|
|
90
|
-
? {
|
|
91
|
-
definition: {
|
|
92
|
-
id: 'addressesProvider',
|
|
93
|
-
factory: createMockableAddressesProvider,
|
|
94
|
-
dependencies: [
|
|
95
|
-
'assetsModule',
|
|
96
|
-
'keychain',
|
|
97
|
-
'keyIdentifierProvider',
|
|
98
|
-
'blockchainMetadata',
|
|
99
|
-
'addressCache',
|
|
100
|
-
'mockConfigAtom',
|
|
101
|
-
],
|
|
102
|
-
},
|
|
103
|
-
}
|
|
104
|
-
: {
|
|
105
|
-
definition: {
|
|
106
|
-
id: 'addressesProvider',
|
|
107
|
-
factory: createAddressesProvider,
|
|
108
|
-
dependencies: [
|
|
109
|
-
'assetsModule',
|
|
110
|
-
'keychain',
|
|
111
|
-
'keyIdentifierProvider',
|
|
112
|
-
'blockchainMetadata',
|
|
113
|
-
'addressCache',
|
|
114
|
-
],
|
|
115
|
-
},
|
|
116
|
-
},
|
|
81
|
+
...createAddressProviderDependencies(config.addressProvider),
|
|
117
82
|
{
|
|
118
83
|
definition: kycDefinition,
|
|
119
84
|
writesAtoms: ['kycAtom'],
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { pick } from '@exodus/basic-utils'
|
|
2
|
-
import { PersonalNoteSet } from '@exodus/models'
|
|
3
2
|
|
|
4
3
|
import createApi from './api'
|
|
5
4
|
import attachAtoms from './atoms/attach'
|
|
@@ -17,19 +16,21 @@ const createExodus = ({ adapters, config, port }) => {
|
|
|
17
16
|
|
|
18
17
|
const { assetsModule, storage } = ioc.getByType('adapter')
|
|
19
18
|
|
|
20
|
-
const {
|
|
19
|
+
const { languageAtom } = ioc.getByType('atom')
|
|
21
20
|
|
|
22
21
|
const {
|
|
23
22
|
application,
|
|
24
23
|
blockchainMetadata,
|
|
24
|
+
connectedOrigins,
|
|
25
25
|
enabledAssets,
|
|
26
26
|
featureFlags,
|
|
27
27
|
kyc,
|
|
28
|
+
nfts,
|
|
29
|
+
personalNotes,
|
|
28
30
|
referrals,
|
|
29
31
|
remoteConfig,
|
|
30
32
|
unlockEncryptedStorage,
|
|
31
33
|
walletAccounts,
|
|
32
|
-
connectedOrigins,
|
|
33
34
|
} = ioc.getByType('module')
|
|
34
35
|
|
|
35
36
|
const {
|
|
@@ -129,10 +130,13 @@ const createExodus = ({ adapters, config, port }) => {
|
|
|
129
130
|
blockchainMetadata.clear(),
|
|
130
131
|
enabledAssets.clear(),
|
|
131
132
|
connectedOrigins.clear(),
|
|
133
|
+
featureFlags.clear(),
|
|
134
|
+
languageAtom.set(undefined),
|
|
132
135
|
])
|
|
133
136
|
|
|
134
|
-
// TEMP: dont wait
|
|
135
|
-
|
|
137
|
+
// TEMP: dont wait to clear as encrypted storage is not yet unlocked
|
|
138
|
+
personalNotes.clear()
|
|
139
|
+
nfts.clear()
|
|
136
140
|
|
|
137
141
|
port.emit('clear')
|
|
138
142
|
})
|