@exodus/headless 2.0.0-alpha.62 → 2.0.0-alpha.64
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 +40 -0
- package/package.json +12 -12
- package/src/index.js +3 -15
- package/src/features/market-history/index.js +0 -69
- package/src/features/market-history/plugin.js +0 -21
- package/src/features/wallet/api.js +0 -34
- package/src/features/wallet/index.js +0 -24
- package/src/features/wallet/locked-atom.js +0 -10
- package/src/features/wallet/restore-atom.js +0 -10
- package/src/features/wallet/restore-plugin.js +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,46 @@
|
|
|
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.64](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.63...@exodus/headless@2.0.0-alpha.64) (2023-07-06)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
- market-history feature (#2361)
|
|
11
|
+
- move atoms from headless to market-history (#2360)
|
|
12
|
+
- **headless:** extract connected origins (#2352)
|
|
13
|
+
- move in-memory address cache to address cache module (#2336)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
- don't use in-memory cache in tests ([#2344](https://github.com/ExodusMovement/exodus-hydra/issues/2344)) ([48bf0e4](https://github.com/ExodusMovement/exodus-hydra/commit/48bf0e4edfc0fc36ae9a1ec76360f619c6e2f864))
|
|
18
|
+
- **headless:** extract connected origins ([#2352](https://github.com/ExodusMovement/exodus-hydra/issues/2352)) ([41b8172](https://github.com/ExodusMovement/exodus-hydra/commit/41b8172f326d1f414523851fa2e3f3fb074aafba))
|
|
19
|
+
- market-history feature ([#2361](https://github.com/ExodusMovement/exodus-hydra/issues/2361)) ([9132471](https://github.com/ExodusMovement/exodus-hydra/commit/9132471cafdf95f46760b6d4528e91210493cab1))
|
|
20
|
+
|
|
21
|
+
### Code Refactoring
|
|
22
|
+
|
|
23
|
+
- move in-memory address cache to address cache module ([#2336](https://github.com/ExodusMovement/exodus-hydra/issues/2336)) ([d28a6c9](https://github.com/ExodusMovement/exodus-hydra/commit/d28a6c9843356d86262fb308cf40ecad023dc196))
|
|
24
|
+
|
|
25
|
+
### Miscellaneous Chores
|
|
26
|
+
|
|
27
|
+
- move atoms from headless to market-history ([#2360](https://github.com/ExodusMovement/exodus-hydra/issues/2360)) ([d452d74](https://github.com/ExodusMovement/exodus-hydra/commit/d452d74a8874ab5cb3221212405e2c45bb8d046f))
|
|
28
|
+
|
|
29
|
+
## [2.0.0-alpha.63](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.62...@exodus/headless@2.0.0-alpha.63) (2023-07-06)
|
|
30
|
+
|
|
31
|
+
### ⚠ BREAKING CHANGES
|
|
32
|
+
|
|
33
|
+
- **headless:** do not ship top-movers (#2333)
|
|
34
|
+
- **headless:** do not ship apy-rates (#2329)
|
|
35
|
+
- **headless:** do not ship kyc (#2327)
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
- export `wallet` feature ([#2345](https://github.com/ExodusMovement/exodus-hydra/issues/2345)) ([3c5f636](https://github.com/ExodusMovement/exodus-hydra/commit/3c5f6363b7d158ab4b47c28475907e33587f7587))
|
|
40
|
+
- **headless:** do not ship ab-testing ([#2330](https://github.com/ExodusMovement/exodus-hydra/issues/2330)) ([70be5ce](https://github.com/ExodusMovement/exodus-hydra/commit/70be5ce74c5ac1e197f2f03dcb6914248f1017d6))
|
|
41
|
+
- **headless:** do not ship apy-rates ([#2329](https://github.com/ExodusMovement/exodus-hydra/issues/2329)) ([94a4419](https://github.com/ExodusMovement/exodus-hydra/commit/94a441968d45d593c1853a2664415a28d515b4f9))
|
|
42
|
+
- **headless:** do not ship crypto-news ([#2332](https://github.com/ExodusMovement/exodus-hydra/issues/2332)) ([54f5775](https://github.com/ExodusMovement/exodus-hydra/commit/54f5775b1195bab98e6dca1bb85779d613de58bc))
|
|
43
|
+
- **headless:** do not ship kyc ([#2327](https://github.com/ExodusMovement/exodus-hydra/issues/2327)) ([38bf19e](https://github.com/ExodusMovement/exodus-hydra/commit/38bf19edac7337b757a3444b3275f46a85394931))
|
|
44
|
+
- **headless:** do not ship top-movers ([#2333](https://github.com/ExodusMovement/exodus-hydra/issues/2333)) ([10adeab](https://github.com/ExodusMovement/exodus-hydra/commit/10adeab9fa3059cdc6ac68a2c803a10c6225fa5c))
|
|
45
|
+
|
|
6
46
|
## [2.0.0-alpha.62](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.61...@exodus/headless@2.0.0-alpha.62) (2023-07-05)
|
|
7
47
|
|
|
8
48
|
**Note:** Version bump only for package @exodus/headless
|
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.64",
|
|
4
4
|
"description": "The platform-agnostic Exodus wallet SDK",
|
|
5
5
|
"author": "Exodus Movement Inc.",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -26,9 +26,7 @@
|
|
|
26
26
|
"test": "jest --runInBand"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@exodus/
|
|
30
|
-
"@exodus/address-provider": "^5.0.0",
|
|
31
|
-
"@exodus/apy-rates": "^3.0.0",
|
|
29
|
+
"@exodus/address-provider": "^6.0.0",
|
|
32
30
|
"@exodus/atoms": "^5.2.1",
|
|
33
31
|
"@exodus/auto-enable-assets-plugin": "^4.0.1",
|
|
34
32
|
"@exodus/available-assets": "^2.0.2",
|
|
@@ -36,8 +34,6 @@
|
|
|
36
34
|
"@exodus/basic-utils": "^2.0.0",
|
|
37
35
|
"@exodus/blockchain-metadata": "^8.1.0",
|
|
38
36
|
"@exodus/config": "^7.0.0",
|
|
39
|
-
"@exodus/connected-origins": "^2.0.0",
|
|
40
|
-
"@exodus/crypto-news-monitor": "^3.0.0",
|
|
41
37
|
"@exodus/dependency-injection": "^2.0.0",
|
|
42
38
|
"@exodus/dependency-preprocessors": "^2.8.2",
|
|
43
39
|
"@exodus/enabled-assets": "^6.0.2",
|
|
@@ -49,13 +45,11 @@
|
|
|
49
45
|
"@exodus/geolocation": "^2.0.1",
|
|
50
46
|
"@exodus/key-identifier-provider": "^1.1.3",
|
|
51
47
|
"@exodus/keychain": "^4.1.0",
|
|
52
|
-
"@exodus/
|
|
53
|
-
"@exodus/market-history": "^4.0.0",
|
|
48
|
+
"@exodus/market-history": "^5.0.0",
|
|
54
49
|
"@exodus/module": "^1.0.0",
|
|
55
50
|
"@exodus/nfts": "^2.1.1",
|
|
56
51
|
"@exodus/rates-monitor": "^2.0.1",
|
|
57
|
-
"@exodus/
|
|
58
|
-
"@exodus/wallet": "^6.0.1",
|
|
52
|
+
"@exodus/wallet": "^6.3.0",
|
|
59
53
|
"@exodus/wallet-accounts": "^8.0.1",
|
|
60
54
|
"@exodus/wallet-compatibility-modes": "^2.0.0",
|
|
61
55
|
"bip39": "^2.6.0",
|
|
@@ -64,20 +58,26 @@
|
|
|
64
58
|
"minimalistic-assert": "^1.0.1"
|
|
65
59
|
},
|
|
66
60
|
"devDependencies": {
|
|
61
|
+
"@exodus/ab-testing": "^6.0.0",
|
|
67
62
|
"@exodus/algorand-lib": "^2.0.1",
|
|
68
63
|
"@exodus/algorand-meta": "^1.1.4",
|
|
64
|
+
"@exodus/apy-rates": "^3.0.0",
|
|
69
65
|
"@exodus/bitcoin-lib": "^2.2.1",
|
|
70
66
|
"@exodus/bitcoin-meta": "^1.0.0",
|
|
67
|
+
"@exodus/connected-origins": "^2.0.0",
|
|
68
|
+
"@exodus/crypto-news-monitor": "^3.0.0",
|
|
71
69
|
"@exodus/currency": "^2.2.0",
|
|
72
70
|
"@exodus/ethereum-lib": "^2.22.2",
|
|
73
71
|
"@exodus/ethereum-meta": "^1.0.23",
|
|
72
|
+
"@exodus/kyc": "^4.0.0",
|
|
74
73
|
"@exodus/models": "^8.11.1",
|
|
75
74
|
"@exodus/personal-notes": "^3.3.0",
|
|
76
|
-
"@exodus/referrals": "^6.0.
|
|
75
|
+
"@exodus/referrals": "^6.0.3",
|
|
77
76
|
"@exodus/solana-lib": "^1.3.11",
|
|
78
77
|
"@exodus/solana-meta": "^1.0.2",
|
|
79
78
|
"@exodus/storage-encrypted": "^1.1.2",
|
|
80
79
|
"@exodus/storage-memory": "^2.1.0",
|
|
80
|
+
"@exodus/top-movers-monitor": "^3.0.0",
|
|
81
81
|
"@exodus/wild-emitter": "^1.0.0",
|
|
82
82
|
"buffer-json": "^2.0.0",
|
|
83
83
|
"deepmerge": "^4.2.2",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"nock": "^13.3.1",
|
|
90
90
|
"p-defer": "^4.0.0"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "ea31e65df21404fc765c8513fbc9e5d754e7fa1f"
|
|
93
93
|
}
|
package/src/index.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import abTesting from '@exodus/ab-testing'
|
|
2
1
|
import addressProvider from '@exodus/address-provider'
|
|
3
|
-
import apyRates from '@exodus/apy-rates'
|
|
4
2
|
import { pick } from '@exodus/basic-utils'
|
|
5
|
-
import connectedOrigins from '@exodus/connected-origins'
|
|
6
|
-
import cryptoNews from '@exodus/crypto-news-monitor'
|
|
7
3
|
import keychain from '@exodus/keychain'
|
|
8
|
-
import
|
|
9
|
-
import
|
|
4
|
+
import marketHistory from '@exodus/market-history'
|
|
5
|
+
import wallet from '@exodus/wallet'
|
|
10
6
|
|
|
11
7
|
import createApi from './api'
|
|
12
8
|
import attachAtoms from './atoms/attach'
|
|
@@ -20,19 +16,17 @@ import fees from './features/fees'
|
|
|
20
16
|
import fiatBalances from './features/fiat-balances'
|
|
21
17
|
import geolocation from './features/geolocation'
|
|
22
18
|
import locale from './features/locale'
|
|
23
|
-
import marketHistory from './features/market-history'
|
|
24
19
|
import nfts from './features/nfts'
|
|
25
20
|
import pricing from './features/pricing'
|
|
26
21
|
import rates from './features/rates'
|
|
27
22
|
import remoteConfig from './features/remote-config'
|
|
28
|
-
import wallet from './features/wallet'
|
|
29
23
|
import walletAccounts from './features/wallet-accounts'
|
|
30
24
|
import createIOC from './ioc'
|
|
31
25
|
import attachPlugins from './plugins/attach'
|
|
32
26
|
|
|
33
27
|
const createExodus = ({ adapters, config, port }) => {
|
|
34
28
|
const ioc = createIOC({ adapters, config })
|
|
35
|
-
const { headless: headlessConfig
|
|
29
|
+
const { headless: headlessConfig } = config
|
|
36
30
|
|
|
37
31
|
ioc.use(wallet())
|
|
38
32
|
ioc.use(keychain(config.keychain))
|
|
@@ -48,15 +42,9 @@ const createExodus = ({ adapters, config, port }) => {
|
|
|
48
42
|
ioc.use(pricing())
|
|
49
43
|
ioc.use(fees())
|
|
50
44
|
ioc.use(rates())
|
|
51
|
-
ioc.use(apyRates())
|
|
52
45
|
ioc.use(featureFlags())
|
|
53
46
|
ioc.use(locale())
|
|
54
47
|
ioc.use(nfts())
|
|
55
|
-
ioc.use(kyc())
|
|
56
|
-
ioc.use(connectedOrigins())
|
|
57
|
-
ioc.use(abTesting())
|
|
58
|
-
ioc.use(cryptoNews())
|
|
59
|
-
ioc.use(topMovers({ config: topMoversMonitor }))
|
|
60
48
|
ioc.use(addressProvider({ config: config.addressProvider }))
|
|
61
49
|
|
|
62
50
|
ioc.register({ definition: { id: 'port', type: 'port', factory: () => port } })
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { createInMemoryAtom, createRemoteConfigAtomFactory } from '@exodus/atoms'
|
|
2
|
-
import { marketHistoryAtomDefinition } from '@exodus/market-history/atoms'
|
|
3
|
-
import marketHistoryMonitorDefinition from '@exodus/market-history/module'
|
|
4
|
-
|
|
5
|
-
import marketHistoryPluginDefinition from './plugin'
|
|
6
|
-
|
|
7
|
-
const marketHistory = () => {
|
|
8
|
-
return {
|
|
9
|
-
id: 'marketHistory',
|
|
10
|
-
definitions: [
|
|
11
|
-
{
|
|
12
|
-
definition: { type: 'monitor', ...marketHistoryMonitorDefinition },
|
|
13
|
-
writesAtoms: ['marketHistoryAtom'],
|
|
14
|
-
storage: { namespace: 'marketHistory' },
|
|
15
|
-
aliases: [
|
|
16
|
-
{
|
|
17
|
-
implementationId: 'unsafeStorage',
|
|
18
|
-
interfaceId: 'storage',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
implementationId: 'marketHistoryClearCacheAtom',
|
|
22
|
-
interfaceId: 'clearCacheAtom',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
implementationId: 'remoteConfigClearMarketHistoryCacheAtom',
|
|
26
|
-
interfaceId: 'remoteConfigClearCacheAtom',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
implementationId: 'marketHistoryRefreshIntervalAtom',
|
|
30
|
-
interfaceId: 'remoteConfigRefreshIntervalAtom',
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
// TODO: move to @exodus/market-history
|
|
35
|
-
{
|
|
36
|
-
definition: {
|
|
37
|
-
id: 'marketHistoryClearCacheAtom',
|
|
38
|
-
type: 'atom',
|
|
39
|
-
factory: ({ config }) => createInMemoryAtom(config),
|
|
40
|
-
dependencies: ['config'],
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
// TODO: move to @exodus/market-history
|
|
44
|
-
{
|
|
45
|
-
definition: {
|
|
46
|
-
id: 'remoteConfigClearMarketHistoryCacheAtom',
|
|
47
|
-
type: 'atom',
|
|
48
|
-
factory: ({ config, remoteConfig }) =>
|
|
49
|
-
createRemoteConfigAtomFactory({ remoteConfig })(config),
|
|
50
|
-
dependencies: ['config', 'remoteConfig'],
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
// TODO: move to @exodus/market-history
|
|
54
|
-
{
|
|
55
|
-
definition: {
|
|
56
|
-
id: 'marketHistoryRefreshIntervalAtom',
|
|
57
|
-
type: 'atom',
|
|
58
|
-
factory: ({ config, remoteConfig }) =>
|
|
59
|
-
createRemoteConfigAtomFactory({ remoteConfig })(config),
|
|
60
|
-
dependencies: ['config', 'remoteConfig'],
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
{ definition: marketHistoryPluginDefinition },
|
|
64
|
-
{ definition: marketHistoryAtomDefinition },
|
|
65
|
-
],
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export default marketHistory
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const createMarketHistoryLifecyclePlugin = ({ marketHistory, marketHistoryAtom, port }) => {
|
|
2
|
-
marketHistoryAtom.observe(({ data, changes }) =>
|
|
3
|
-
port.emit('market-history', {
|
|
4
|
-
data,
|
|
5
|
-
changes,
|
|
6
|
-
})
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
const onUnlock = () => {
|
|
10
|
-
marketHistory.start()
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return { onUnlock }
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
id: 'marketHistoryLifecyclePlugin',
|
|
18
|
-
type: 'plugin',
|
|
19
|
-
factory: createMarketHistoryLifecyclePlugin,
|
|
20
|
-
dependencies: ['marketHistory', 'port', 'marketHistoryAtom'],
|
|
21
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const createWalletApi = ({ wallet, application, passphraseCache }) => {
|
|
2
|
-
const restoreFromCurrentPhrase = async ({ passphrase } = {}) => {
|
|
3
|
-
if (!passphrase) passphrase = await passphraseCache.get()
|
|
4
|
-
const mnemonic = await application.getMnemonic({ passphrase })
|
|
5
|
-
await application.import({ passphrase, mnemonic })
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
wallet: {
|
|
10
|
-
exists: () => wallet.exists(),
|
|
11
|
-
start: application.start,
|
|
12
|
-
load: application.load,
|
|
13
|
-
unload: application.unload,
|
|
14
|
-
create: application.create,
|
|
15
|
-
lock: application.lock,
|
|
16
|
-
unlock: application.unlock,
|
|
17
|
-
import: application.import,
|
|
18
|
-
delete: application.delete,
|
|
19
|
-
getMnemonic: application.getMnemonic,
|
|
20
|
-
setBackedUp: application.setBackedUp,
|
|
21
|
-
changePassphrase: application.changePassphrase,
|
|
22
|
-
changeLockTimer: application.changeLockTimer,
|
|
23
|
-
restoreFromCurrentPhrase,
|
|
24
|
-
isLocked: () => wallet.isLocked(),
|
|
25
|
-
},
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default {
|
|
30
|
-
id: 'walletApi',
|
|
31
|
-
type: 'api',
|
|
32
|
-
factory: createWalletApi,
|
|
33
|
-
dependencies: ['wallet', 'application', 'passphraseCache'],
|
|
34
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import walletDefinition from '@exodus/wallet/module'
|
|
2
|
-
|
|
3
|
-
import walletApi from './api'
|
|
4
|
-
import lockedAtomDefinition from './locked-atom'
|
|
5
|
-
import restoreAtomDefinition from './restore-atom'
|
|
6
|
-
import restorePluginDefinition from './restore-plugin'
|
|
7
|
-
|
|
8
|
-
const wallet = () => {
|
|
9
|
-
return {
|
|
10
|
-
id: 'wallet',
|
|
11
|
-
definitions: [
|
|
12
|
-
{
|
|
13
|
-
definition: { type: 'module', ...walletDefinition },
|
|
14
|
-
writesAtoms: ['lockedAtom'],
|
|
15
|
-
},
|
|
16
|
-
{ definition: lockedAtomDefinition },
|
|
17
|
-
{ definition: restoreAtomDefinition },
|
|
18
|
-
{ definition: restorePluginDefinition, writesAtoms: ['restoreAtom'] },
|
|
19
|
-
{ definition: walletApi },
|
|
20
|
-
],
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default wallet
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const restorePlugin = ({ restoreAtom }) => {
|
|
2
|
-
return {
|
|
3
|
-
onStart: async ({ isRestoring }) => {
|
|
4
|
-
await restoreAtom.set(!!isRestoring)
|
|
5
|
-
},
|
|
6
|
-
onAssetsSynced: async () => {
|
|
7
|
-
await restoreAtom.set(false)
|
|
8
|
-
},
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
id: 'restorePlugin',
|
|
14
|
-
type: 'plugin',
|
|
15
|
-
factory: restorePlugin,
|
|
16
|
-
dependencies: ['restoreAtom'],
|
|
17
|
-
}
|