@exodus/headless 2.0.0-alpha.33 → 2.0.0-alpha.35

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 CHANGED
@@ -3,6 +3,19 @@
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.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
+
8
+ ### Bug Fixes
9
+
10
+ - add handler to clear connected-origins ([#1860](https://github.com/ExodusMovement/exodus-hydra/issues/1860)) ([0f294b4](https://github.com/ExodusMovement/exodus-hydra/commit/0f294b492f43ace082b5fb72bb5d0b9fa8d14351))
11
+ - passphraseCache is not an adapter ([#1744](https://github.com/ExodusMovement/exodus-hydra/issues/1744)) ([e382e7a](https://github.com/ExodusMovement/exodus-hydra/commit/e382e7a9ec95b4fb35231edb723cb25ceac07cc1))
12
+
13
+ ## [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)
14
+
15
+ ### Features
16
+
17
+ - 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))
18
+
6
19
  ## [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)
7
20
 
8
21
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/headless",
3
- "version": "2.0.0-alpha.33",
3
+ "version": "2.0.0-alpha.35",
4
4
  "description": "The headless Exodus wallet SDK",
5
5
  "author": "Exodus Movement Inc",
6
6
  "main": "src/index.js",
@@ -50,6 +50,7 @@
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": "^1.1.2",
53
54
  "@exodus/personal-notes": "^3.0.1",
54
55
  "@exodus/rates-monitor": "^2.0.0",
55
56
  "@exodus/referrals": "^5.2.0",
@@ -86,5 +87,5 @@
86
87
  "nock": "^13.3.1",
87
88
  "p-defer": "^4.0.0"
88
89
  },
89
- "gitHead": "415054e049df3eb22c79d8568bf071fdbc9c2f11"
90
+ "gitHead": "504b3ced568dec0994fda7d4170a34ec0ebdd82d"
90
91
  }
package/src/api.js CHANGED
@@ -1,23 +1,26 @@
1
1
  import { validateMnemonic as isMnemonicValid } from 'bip39'
2
2
 
3
3
  const createApi = ({ ioc, port }) => {
4
- const { assetsModule, passphraseCache } = ioc.getByType('adapter')
4
+ const { assetsModule } = ioc.getByType('adapter')
5
5
 
6
6
  const {
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, feeMonitors } = ioc.getByType('monitor')
21
+ const { feeMonitors, ratesMonitor, nftsMonitor } = ioc.getByType('monitor')
22
+ // TODO: decide where this belongs
23
+ const { passphraseCache } = ioc.getAll()
21
24
 
22
25
  const {
23
26
  // ...
@@ -33,6 +36,7 @@ const createApi = ({ ioc, port }) => {
33
36
  referrals.stop()
34
37
  remoteConfig.stop()
35
38
  feeMonitors.stop()
39
+ nftsMonitor.stop()
36
40
  }
37
41
 
38
42
  return {
@@ -114,13 +118,14 @@ const createApi = ({ ioc, port }) => {
114
118
  personalNotes: {
115
119
  upsert: personalNotes.upsert,
116
120
  },
117
- isMnemonicValid,
118
- subscribe: port.subscribe.bind(port),
119
- unsubscribe: port.unsubscribe.bind(port),
120
- stop,
121
+ nfts: {
122
+ upsertConfig: nfts.upsertConfig,
123
+ setMonitorInterval: nftsMonitor.setInterval,
124
+ },
121
125
  connectedOrigins: {
122
126
  get: connectedOriginsAtom.get,
123
127
  add: connectedOrigins.add,
128
+ clear: connectedOrigins.clear,
124
129
  untrust: connectedOrigins.untrust,
125
130
  isTrusted: connectedOrigins.isTrusted,
126
131
  isAutoApprove: connectedOrigins.isAutoApprove,
@@ -131,6 +136,10 @@ const createApi = ({ ioc, port }) => {
131
136
  updateConnection: connectedOrigins.updateConnection,
132
137
  clearConnections: connectedOrigins.clearConnections,
133
138
  },
139
+ isMnemonicValid,
140
+ subscribe: port.subscribe.bind(port),
141
+ unsubscribe: port.unsubscribe.bind(port),
142
+ stop,
134
143
  }
135
144
  }
136
145
 
package/src/constants.js CHANGED
@@ -2,14 +2,15 @@ export const atomsToAttach = [
2
2
  'apyRatesAtom',
3
3
  'availableAssetNamesAtom',
4
4
  'balancesAtom',
5
- 'cryptoNewsAtom',
6
5
  'connectedOriginsAtom',
6
+ 'cryptoNewsAtom',
7
7
  'currencyAtom',
8
8
  'enabledWalletAccountsAtom',
9
9
  'featureFlagsAtom',
10
10
  'geolocationAtom',
11
11
  'kycAtom',
12
12
  'languageAtom',
13
+ 'nftsConfigAtom',
13
14
  'personalNotesAtom',
14
15
  'referralsAtom',
15
16
  'topMoversAtom',
@@ -16,6 +16,7 @@ import {
16
16
  import { featureFlagsAtomDefinition } from '@exodus/feature-flags/atoms'
17
17
  import { geolocationAtomDefinition } from '@exodus/geolocation/atoms'
18
18
  import { kycAtomDefinition } from '@exodus/kyc/atoms'
19
+ import { nftsCacheAtomDefinition, nftsConfigsAtomDefinition } from '@exodus/nfts/atoms'
19
20
  import { personalNotesAtomDefinition } from '@exodus/personal-notes/atoms'
20
21
  import { ratesAtomDefinition } from '@exodus/rates-monitor/atoms'
21
22
  import { referralsAtomDefinition } from '@exodus/referrals/atoms'
@@ -169,6 +170,15 @@ const createAtomDependencies = () =>
169
170
  { definition: cryptoNewsAtomDefinition },
170
171
  { definition: restoreAtomDefinition },
171
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
+ },
172
182
  ].map(withType('atom'))
173
183
 
174
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
@@ -3,6 +3,7 @@ import cryptoNewsMonitorDefinition from '@exodus/crypto-news-monitor/monitor'
3
3
  import feeMonitorsDefinition from '@exodus/fee-monitors/monitor'
4
4
  import geolocationMonitorDefinition from '@exodus/geolocation/monitor'
5
5
  import marketHistoryMonitorDefinition from '@exodus/market-history/module'
6
+ import nftsMonitorDefinition from '@exodus/nfts/monitor'
6
7
  import ratesMonitorDefinition from '@exodus/rates-monitor/module'
7
8
  import localTopMoversMonitorDefinition from '@exodus/top-movers-monitor/monitor/local'
8
9
  import remoteTopMoversMonitorDefinition from '@exodus/top-movers-monitor/monitor/remote'
@@ -56,6 +57,10 @@ const createMonitorDependencies = ({ config }) =>
56
57
  definition: apyRatesMonitorDefinition,
57
58
  writesAtoms: ['apyRatesAtom'],
58
59
  },
60
+ {
61
+ definition: nftsMonitorDefinition,
62
+ writesAtoms: ['nftsCacheAtom'],
63
+ },
59
64
  ].map(withType('monitor'))
60
65
 
61
66
  export default createMonitorDependencies
package/src/index.js CHANGED
@@ -38,6 +38,7 @@ const createExodus = ({ adapters, config, port }) => {
38
38
  feeMonitors,
39
39
  geolocationMonitor,
40
40
  marketHistory,
41
+ nftsMonitor,
41
42
  ratesMonitor,
42
43
  topMoversMonitor,
43
44
  } = ioc.getByType('monitor')
@@ -69,6 +70,9 @@ const createExodus = ({ adapters, config, port }) => {
69
70
  // TODO: migrate to ratesAtom. Will be easier once it's on headless
70
71
  ratesMonitor.on('rates', (payload) => port.emit('rates', payload))
71
72
 
73
+ nftsMonitor.on('nfts', (data) => port.emit('nfts', data))
74
+ nftsMonitor.on('nfts-txs', (data) => port.emit('nfts-txs', data))
75
+
72
76
  application.hook('start', (payload) => {
73
77
  remoteConfig.load()
74
78
  featureFlags.load()
@@ -85,6 +89,7 @@ const createExodus = ({ adapters, config, port }) => {
85
89
  ratesMonitor.start()
86
90
  feeMonitors.start()
87
91
  apyRatesMonitor.start()
92
+ nftsMonitor.start()
88
93
 
89
94
  await assetsModule.load()
90
95
  await connectedOrigins.load()