@exodus/headless 2.0.0-alpha.32 → 2.0.0-alpha.34
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 -2
- package/src/api.js +12 -6
- package/src/constants.js +3 -1
- package/src/dependencies/atoms.js +12 -0
- package/src/dependencies/modules.js +4 -0
- package/src/dependencies/monitors.js +10 -0
- package/src/index.js +7 -0
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
|
+
## [2.0.0-alpha.34](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.33...@exodus/headless@2.0.0-alpha.34) (2023-06-07)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- migrate nfts module and monitor to headless ([#1812](https://github.com/ExodusMovement/exodus-hydra/issues/1812)) ([55e3ac2](https://github.com/ExodusMovement/exodus-hydra/commit/55e3ac2755ba69339c331cb440e89458b039f128))
|
|
11
|
+
|
|
12
|
+
## [2.0.0-alpha.33](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.32...@exodus/headless@2.0.0-alpha.33) (2023-06-07)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- add apy rates monitor to headless ([#1830](https://github.com/ExodusMovement/exodus-hydra/issues/1830)) ([6040f4e](https://github.com/ExodusMovement/exodus-hydra/commit/6040f4eacc4b0ea29a25a28c21f6d4c07c833dd4))
|
|
17
|
+
|
|
6
18
|
## [2.0.0-alpha.32](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.31...@exodus/headless@2.0.0-alpha.32) (2023-06-06)
|
|
7
19
|
|
|
8
20
|
### Features
|
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.34",
|
|
4
4
|
"description": "The headless Exodus wallet SDK",
|
|
5
5
|
"author": "Exodus Movement Inc",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@exodus/addresses-provider": "^3.0.2",
|
|
30
|
+
"@exodus/apy-rates": "^2.1.0",
|
|
30
31
|
"@exodus/atoms": "^3.5.3",
|
|
31
32
|
"@exodus/auto-enable-assets-plugin": "^4.0.1",
|
|
32
33
|
"@exodus/available-assets": "^2.0.0",
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
"@exodus/kyc": "^3.4.0",
|
|
50
51
|
"@exodus/market-history": "^3.1.0",
|
|
51
52
|
"@exodus/module": "^1.0.0",
|
|
53
|
+
"@exodus/nfts": "^1.1.2",
|
|
52
54
|
"@exodus/personal-notes": "^3.0.1",
|
|
53
55
|
"@exodus/rates-monitor": "^2.0.0",
|
|
54
56
|
"@exodus/referrals": "^5.2.0",
|
|
@@ -77,6 +79,7 @@
|
|
|
77
79
|
"@exodus/wild-emitter": "^1.0.0",
|
|
78
80
|
"buffer-json": "^2.0.0",
|
|
79
81
|
"deepmerge": "^4.2.2",
|
|
82
|
+
"delay": "^5.0.0",
|
|
80
83
|
"eslint": "^8.33.0",
|
|
81
84
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
82
85
|
"events": "^3.3.0",
|
|
@@ -84,5 +87,5 @@
|
|
|
84
87
|
"nock": "^13.3.1",
|
|
85
88
|
"p-defer": "^4.0.0"
|
|
86
89
|
},
|
|
87
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "c4a1772dfddd27da094bfb08ba8e2bada2387de7"
|
|
88
91
|
}
|
package/src/api.js
CHANGED
|
@@ -7,17 +7,18 @@ const createApi = ({ ioc, port }) => {
|
|
|
7
7
|
addressesProvider,
|
|
8
8
|
application,
|
|
9
9
|
blockchainMetadata,
|
|
10
|
+
connectedOrigins,
|
|
10
11
|
enabledAssets,
|
|
11
12
|
kyc,
|
|
13
|
+
nfts,
|
|
12
14
|
personalNotes,
|
|
13
15
|
referrals,
|
|
14
16
|
remoteConfig,
|
|
15
17
|
wallet,
|
|
16
18
|
walletAccounts,
|
|
17
|
-
connectedOrigins,
|
|
18
19
|
} = ioc.getByType('module')
|
|
19
20
|
|
|
20
|
-
const { ratesMonitor,
|
|
21
|
+
const { feeMonitors, ratesMonitor, nftsMonitor } = ioc.getByType('monitor')
|
|
21
22
|
|
|
22
23
|
const {
|
|
23
24
|
// ...
|
|
@@ -33,6 +34,7 @@ const createApi = ({ ioc, port }) => {
|
|
|
33
34
|
referrals.stop()
|
|
34
35
|
remoteConfig.stop()
|
|
35
36
|
feeMonitors.stop()
|
|
37
|
+
nftsMonitor.stop()
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
return {
|
|
@@ -114,10 +116,10 @@ const createApi = ({ ioc, port }) => {
|
|
|
114
116
|
personalNotes: {
|
|
115
117
|
upsert: personalNotes.upsert,
|
|
116
118
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
nfts: {
|
|
120
|
+
upsertConfig: nfts.upsertConfig,
|
|
121
|
+
setMonitorInterval: nftsMonitor.setInterval,
|
|
122
|
+
},
|
|
121
123
|
connectedOrigins: {
|
|
122
124
|
get: connectedOriginsAtom.get,
|
|
123
125
|
add: connectedOrigins.add,
|
|
@@ -131,6 +133,10 @@ const createApi = ({ ioc, port }) => {
|
|
|
131
133
|
updateConnection: connectedOrigins.updateConnection,
|
|
132
134
|
clearConnections: connectedOrigins.clearConnections,
|
|
133
135
|
},
|
|
136
|
+
isMnemonicValid,
|
|
137
|
+
subscribe: port.subscribe.bind(port),
|
|
138
|
+
unsubscribe: port.unsubscribe.bind(port),
|
|
139
|
+
stop,
|
|
134
140
|
}
|
|
135
141
|
}
|
|
136
142
|
|
package/src/constants.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
export const atomsToAttach = [
|
|
2
|
+
'apyRatesAtom',
|
|
2
3
|
'availableAssetNamesAtom',
|
|
3
4
|
'balancesAtom',
|
|
4
|
-
'cryptoNewsAtom',
|
|
5
5
|
'connectedOriginsAtom',
|
|
6
|
+
'cryptoNewsAtom',
|
|
6
7
|
'currencyAtom',
|
|
7
8
|
'enabledWalletAccountsAtom',
|
|
8
9
|
'featureFlagsAtom',
|
|
9
10
|
'geolocationAtom',
|
|
10
11
|
'kycAtom',
|
|
11
12
|
'languageAtom',
|
|
13
|
+
'nftsConfigAtom',
|
|
12
14
|
'personalNotesAtom',
|
|
13
15
|
'referralsAtom',
|
|
14
16
|
'topMoversAtom',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { apyRatesAtomDefinition } from '@exodus/apy-rates/atoms'
|
|
1
2
|
import {
|
|
2
3
|
createFusionAtomFactory,
|
|
3
4
|
createInMemoryAtom,
|
|
@@ -15,6 +16,7 @@ import {
|
|
|
15
16
|
import { featureFlagsAtomDefinition } from '@exodus/feature-flags/atoms'
|
|
16
17
|
import { geolocationAtomDefinition } from '@exodus/geolocation/atoms'
|
|
17
18
|
import { kycAtomDefinition } from '@exodus/kyc/atoms'
|
|
19
|
+
import { nftsCacheAtomDefinition, nftsConfigsAtomDefinition } from '@exodus/nfts/atoms'
|
|
18
20
|
import { personalNotesAtomDefinition } from '@exodus/personal-notes/atoms'
|
|
19
21
|
import { ratesAtomDefinition } from '@exodus/rates-monitor/atoms'
|
|
20
22
|
import { referralsAtomDefinition } from '@exodus/referrals/atoms'
|
|
@@ -167,6 +169,16 @@ const createAtomDependencies = () =>
|
|
|
167
169
|
{ definition: topMoversAtomDefinition },
|
|
168
170
|
{ definition: cryptoNewsAtomDefinition },
|
|
169
171
|
{ definition: restoreAtomDefinition },
|
|
172
|
+
{ definition: apyRatesAtomDefinition },
|
|
173
|
+
{
|
|
174
|
+
definition: nftsCacheAtomDefinition,
|
|
175
|
+
storage: { namespace: 'nftsCache' },
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
definition: nftsConfigsAtomDefinition,
|
|
179
|
+
aliases: [{ implementationId: 'unsafeStorage', interfaceId: 'storage' }],
|
|
180
|
+
storage: { namespace: 'nfts-config' },
|
|
181
|
+
},
|
|
170
182
|
].map(withType('atom'))
|
|
171
183
|
|
|
172
184
|
export default createAtomDependencies
|
|
@@ -12,6 +12,7 @@ import featureFlagsDefinition from '@exodus/feature-flags/module'
|
|
|
12
12
|
import createKeyIdentifierProvider from '@exodus/key-identifier-provider'
|
|
13
13
|
import keychainDefinition from '@exodus/keychain/module'
|
|
14
14
|
import kycDefinition from '@exodus/kyc/module'
|
|
15
|
+
import nftsModuleDefinition from '@exodus/nfts/module'
|
|
15
16
|
import personalNotesDefinition from '@exodus/personal-notes/module'
|
|
16
17
|
import referralsDefinition from '@exodus/referrals/module'
|
|
17
18
|
import walletDefinition from '@exodus/wallet/module'
|
|
@@ -135,6 +136,9 @@ const createModuleDependencies = ({ config }) =>
|
|
|
135
136
|
definition: connectedOriginsDefinition,
|
|
136
137
|
writesAtoms: ['connectedOriginsAtom'],
|
|
137
138
|
},
|
|
139
|
+
{
|
|
140
|
+
definition: nftsModuleDefinition,
|
|
141
|
+
},
|
|
138
142
|
].map(withType('module'))
|
|
139
143
|
|
|
140
144
|
export default createModuleDependencies
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import apyRatesMonitorDefinition from '@exodus/apy-rates/monitor'
|
|
1
2
|
import cryptoNewsMonitorDefinition from '@exodus/crypto-news-monitor/monitor'
|
|
2
3
|
import feeMonitorsDefinition from '@exodus/fee-monitors/monitor'
|
|
3
4
|
import geolocationMonitorDefinition from '@exodus/geolocation/monitor'
|
|
4
5
|
import marketHistoryMonitorDefinition from '@exodus/market-history/module'
|
|
6
|
+
import nftsMonitorDefinition from '@exodus/nfts/monitor'
|
|
5
7
|
import ratesMonitorDefinition from '@exodus/rates-monitor/module'
|
|
6
8
|
import localTopMoversMonitorDefinition from '@exodus/top-movers-monitor/monitor/local'
|
|
7
9
|
import remoteTopMoversMonitorDefinition from '@exodus/top-movers-monitor/monitor/remote'
|
|
@@ -51,6 +53,14 @@ const createMonitorDependencies = ({ config }) =>
|
|
|
51
53
|
definition: cryptoNewsMonitorDefinition,
|
|
52
54
|
writesAtoms: ['cryptoNewsAtom'],
|
|
53
55
|
},
|
|
56
|
+
{
|
|
57
|
+
definition: apyRatesMonitorDefinition,
|
|
58
|
+
writesAtoms: ['apyRatesAtom'],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
definition: nftsMonitorDefinition,
|
|
62
|
+
writesAtoms: ['nftsCacheAtom'],
|
|
63
|
+
},
|
|
54
64
|
].map(withType('monitor'))
|
|
55
65
|
|
|
56
66
|
export default createMonitorDependencies
|
package/src/index.js
CHANGED
|
@@ -33,10 +33,12 @@ const createExodus = ({ adapters, config, port }) => {
|
|
|
33
33
|
} = ioc.getByType('module')
|
|
34
34
|
|
|
35
35
|
const {
|
|
36
|
+
apyRatesMonitor,
|
|
36
37
|
cryptoNewsMonitor,
|
|
37
38
|
feeMonitors,
|
|
38
39
|
geolocationMonitor,
|
|
39
40
|
marketHistory,
|
|
41
|
+
nftsMonitor,
|
|
40
42
|
ratesMonitor,
|
|
41
43
|
topMoversMonitor,
|
|
42
44
|
} = ioc.getByType('monitor')
|
|
@@ -68,6 +70,9 @@ const createExodus = ({ adapters, config, port }) => {
|
|
|
68
70
|
// TODO: migrate to ratesAtom. Will be easier once it's on headless
|
|
69
71
|
ratesMonitor.on('rates', (payload) => port.emit('rates', payload))
|
|
70
72
|
|
|
73
|
+
nftsMonitor.on('nfts', (data) => port.emit('nfts', data))
|
|
74
|
+
nftsMonitor.on('nfts-txs', (data) => port.emit('nfts-txs', data))
|
|
75
|
+
|
|
71
76
|
application.hook('start', (payload) => {
|
|
72
77
|
remoteConfig.load()
|
|
73
78
|
featureFlags.load()
|
|
@@ -83,6 +88,8 @@ const createExodus = ({ adapters, config, port }) => {
|
|
|
83
88
|
marketHistory.start()
|
|
84
89
|
ratesMonitor.start()
|
|
85
90
|
feeMonitors.start()
|
|
91
|
+
apyRatesMonitor.start()
|
|
92
|
+
nftsMonitor.start()
|
|
86
93
|
|
|
87
94
|
await assetsModule.load()
|
|
88
95
|
await connectedOrigins.load()
|