@exodus/headless 2.0.0-alpha.90 → 2.0.0-alpha.94

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,45 @@
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.94](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.93...@exodus/headless@2.0.0-alpha.94) (2023-07-27)
7
+
8
+ ### Features
9
+
10
+ - integrate safe report into headless ([#2952](https://github.com/ExodusMovement/exodus-hydra/issues/2952)) ([49c8cf9](https://github.com/ExodusMovement/exodus-hydra/commit/49c8cf93022204c3e2dfadf95b5af2ca7151976e))
11
+
12
+ ## [2.0.0-alpha.93](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.89...@exodus/headless@2.0.0-alpha.93) (2023-07-26)
13
+
14
+ ### ⚠ BREAKING CHANGES
15
+
16
+ - fee-monitors feature (#2930)
17
+
18
+ ### Features
19
+
20
+ - fee-monitors feature ([#2930](https://github.com/ExodusMovement/exodus-hydra/issues/2930)) ([9c0a6a0](https://github.com/ExodusMovement/exodus-hydra/commit/9c0a6a0967599fd4007c6987d0ebc539a4bbcb40))
21
+ - pricing feature ([#2933](https://github.com/ExodusMovement/exodus-hydra/issues/2933)) ([4b668a9](https://github.com/ExodusMovement/exodus-hydra/commit/4b668a9ee8f48abf4323379c0923a54a1d1f6c9b))
22
+ - upgrade blockchain-metadata in headless ([#2949](https://github.com/ExodusMovement/exodus-hydra/issues/2949)) ([1204d7f](https://github.com/ExodusMovement/exodus-hydra/commit/1204d7fcd8710ad611e3085f8ed0c95b5d28546b))
23
+
24
+ ## [2.0.0-alpha.92](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.89...@exodus/headless@2.0.0-alpha.92) (2023-07-26)
25
+
26
+ ### ⚠ BREAKING CHANGES
27
+
28
+ - fee-monitors feature (#2930)
29
+
30
+ ### Features
31
+
32
+ - fee-monitors feature ([#2930](https://github.com/ExodusMovement/exodus-hydra/issues/2930)) ([9c0a6a0](https://github.com/ExodusMovement/exodus-hydra/commit/9c0a6a0967599fd4007c6987d0ebc539a4bbcb40))
33
+ - pricing feature ([#2933](https://github.com/ExodusMovement/exodus-hydra/issues/2933)) ([4b668a9](https://github.com/ExodusMovement/exodus-hydra/commit/4b668a9ee8f48abf4323379c0923a54a1d1f6c9b))
34
+
35
+ ## [2.0.0-alpha.91](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.89...@exodus/headless@2.0.0-alpha.91) (2023-07-26)
36
+
37
+ ### ⚠ BREAKING CHANGES
38
+
39
+ - fee-monitors feature (#2930)
40
+
41
+ ### Features
42
+
43
+ - fee-monitors feature ([#2930](https://github.com/ExodusMovement/exodus-hydra/issues/2930)) ([9c0a6a0](https://github.com/ExodusMovement/exodus-hydra/commit/9c0a6a0967599fd4007c6987d0ebc539a4bbcb40))
44
+
6
45
  ## [2.0.0-alpha.90](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/headless@2.0.0-alpha.89...@exodus/headless@2.0.0-alpha.90) (2023-07-26)
7
46
 
8
47
  ### BREAKING CHANGES
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/headless",
3
- "version": "2.0.0-alpha.90",
3
+ "version": "2.0.0-alpha.94",
4
4
  "description": "The platform-agnostic Exodus wallet SDK",
5
5
  "author": "Exodus Movement Inc.",
6
6
  "main": "src/index.js",
@@ -27,18 +27,17 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@exodus/address-provider": "^6.0.0",
30
- "@exodus/atoms": "^5.2.3",
30
+ "@exodus/atoms": "^5.3.0",
31
31
  "@exodus/auto-enable-assets-plugin": "^4.0.1",
32
32
  "@exodus/available-assets": "^3.0.0",
33
33
  "@exodus/balances": "^7.0.0",
34
34
  "@exodus/basic-utils": "^2.0.0",
35
- "@exodus/blockchain-metadata": "^10.0.0",
35
+ "@exodus/blockchain-metadata": "^11.0.0",
36
36
  "@exodus/dependency-injection": "^2.0.1",
37
37
  "@exodus/dependency-preprocessors": "^2.8.4",
38
38
  "@exodus/enabled-assets": "^7.0.0",
39
- "@exodus/exodus-pricing-client": "^1.2.0",
40
39
  "@exodus/feature-flags": "^4.0.0",
41
- "@exodus/fee-monitors": "^1.0.0",
40
+ "@exodus/fee-monitors": "^2.0.0",
42
41
  "@exodus/fetch": "^1.2.1",
43
42
  "@exodus/fusion": "^6.0.0",
44
43
  "@exodus/geolocation": "^2.1.1",
@@ -46,6 +45,7 @@
46
45
  "@exodus/keychain": "^4.1.0",
47
46
  "@exodus/locale": "^1.1.0",
48
47
  "@exodus/module": "^1.0.0",
48
+ "@exodus/pricing": "^1.1.0",
49
49
  "@exodus/rates-monitor": "^3.0.0",
50
50
  "@exodus/remote-config": "^2.0.0",
51
51
  "@exodus/restore-progress-tracker": "^2.0.5",
@@ -69,6 +69,7 @@
69
69
  "@exodus/currency": "^2.2.0",
70
70
  "@exodus/ethereum-lib": "^2.22.2",
71
71
  "@exodus/ethereum-meta": "^1.0.23",
72
+ "@exodus/exodus-pricing-client": "^1.2.0",
72
73
  "@exodus/kyc": "^4.0.0",
73
74
  "@exodus/market-history": "^5.0.1",
74
75
  "@exodus/models": "^8.11.1",
@@ -91,5 +92,5 @@
91
92
  "nock": "^13.3.1",
92
93
  "p-defer": "^4.0.0"
93
94
  },
94
- "gitHead": "f223f4b6c217ef5850af8b32df9e3d14def51def"
95
+ "gitHead": "4ad077f03886f3013a58a5307a782599a880ff2f"
95
96
  }
package/src/api.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import { validateMnemonic as isMnemonicValid } from 'bip39'
2
2
 
3
+ import createReporting from './reporting'
4
+
3
5
  const createApi = ({ ioc, port }) => {
4
6
  const apis = ioc.getByType('api')
5
7
  const { remoteConfig } = ioc.getByType('module')
@@ -14,6 +16,7 @@ const createApi = ({ ioc, port }) => {
14
16
 
15
17
  return {
16
18
  ...Object.assign({}, ...Object.values(apis)),
19
+ ...createReporting({ ioc }),
17
20
  isMnemonicValid,
18
21
  subscribe: port.subscribe.bind(port),
19
22
  unsubscribe: port.unsubscribe.bind(port),
package/src/index.js CHANGED
@@ -5,9 +5,11 @@ import { pick } from '@exodus/basic-utils'
5
5
  import blockchainMetadata from '@exodus/blockchain-metadata'
6
6
  import enabledAssets from '@exodus/enabled-assets'
7
7
  import featureFlags from '@exodus/feature-flags'
8
+ import fees from '@exodus/fee-monitors'
8
9
  import geolocation from '@exodus/geolocation'
9
10
  import keychain from '@exodus/keychain'
10
11
  import locale from '@exodus/locale'
12
+ import pricing from '@exodus/pricing'
11
13
  import rates from '@exodus/rates-monitor'
12
14
  import remoteConfig from '@exodus/remote-config'
13
15
  import restoreProgressTracker from '@exodus/restore-progress-tracker'
@@ -17,8 +19,6 @@ import walletAccounts from '@exodus/wallet-accounts'
17
19
  import createApi from './api'
18
20
  import attachAtoms from './atoms/attach'
19
21
  import { atomsToAttach } from './constants'
20
- import fees from './features/fees'
21
- import pricing from './features/pricing'
22
22
  import createIOC from './ioc'
23
23
  import attachPlugins from './plugins/attach'
24
24
 
@@ -0,0 +1,25 @@
1
+ import { zipObject } from 'lodash'
2
+
3
+ const createReporting = ({ ioc }) => {
4
+ const getReports = async () => {
5
+ const nodes = ioc.getByType('report')
6
+ const reports = Object.values(nodes)
7
+
8
+ const resolvedReports = await Promise.allSettled(reports.map((report) => report.export()))
9
+
10
+ const namespaces = reports.map((report) => report.namespace)
11
+ const data = resolvedReports.map((outcome) =>
12
+ outcome.status === 'fulfilled' ? outcome.value : { error: outcome.reason }
13
+ )
14
+
15
+ return zipObject(namespaces, data)
16
+ }
17
+
18
+ return {
19
+ reporting: {
20
+ export: getReports,
21
+ },
22
+ }
23
+ }
24
+
25
+ export default createReporting
@@ -1,16 +0,0 @@
1
- import feeMonitorsDefinition from '@exodus/fee-monitors/monitor'
2
-
3
- import feesPlugin from './plugin'
4
-
5
- const fees = () => {
6
- return {
7
- id: 'fees',
8
- definitions: [
9
- // ...
10
- { definition: feeMonitorsDefinition },
11
- { definition: feesPlugin },
12
- ],
13
- }
14
- }
15
-
16
- export default fees
@@ -1,19 +0,0 @@
1
- const createFeesLifecyclePlugin = ({ feeMonitors, port }) => {
2
- feeMonitors.on('fees-load', (payload) => port.emit('fees-load', payload))
3
- feeMonitors.on('fees-update', (payload) => port.emit('fees-update', payload))
4
-
5
- const onUnlock = () => {
6
- feeMonitors.start()
7
- }
8
-
9
- return { onUnlock }
10
- }
11
-
12
- const feesLifecyclePluginDefinition = {
13
- id: 'feesLifecyclePlugin',
14
- type: 'plugin',
15
- factory: createFeesLifecyclePlugin,
16
- dependencies: ['feeMonitors', 'port'],
17
- }
18
-
19
- export default feesLifecyclePluginDefinition
@@ -1,15 +0,0 @@
1
- const pricingApi = ({ pricingClient }) => ({
2
- pricing: {
3
- currentPrice: pricingClient.currentPrice,
4
- historicalPrice: pricingClient.historicalPrice,
5
- ticker: pricingClient.ticker,
6
- },
7
- })
8
-
9
- // eslint-disable-next-line @exodus/export-default/named
10
- export default {
11
- id: 'pricingApi',
12
- type: 'api',
13
- factory: pricingApi,
14
- dependencies: ['pricingClient'],
15
- }
@@ -1,35 +0,0 @@
1
- import { createRemoteConfigAtomFactory } from '@exodus/atoms'
2
- import createExodusPricingClient from '@exodus/exodus-pricing-client'
3
-
4
- import pricingApi from './api'
5
-
6
- const pricing = () => {
7
- return {
8
- id: 'pricing',
9
- definitions: [
10
- {
11
- definition: {
12
- id: 'pricingClient',
13
- type: 'module',
14
- factory: createExodusPricingClient,
15
- dependencies: ['fetch', 'pricingServerUrlAtom'],
16
- },
17
- },
18
- {
19
- definition: {
20
- id: 'pricingServerUrlAtom',
21
- type: 'atom',
22
- factory: ({ config, remoteConfig }) =>
23
- createRemoteConfigAtomFactory({ remoteConfig })({
24
- path: config.pricingServerPath,
25
- defaultValue: config.defaultPricingServerUrl,
26
- }),
27
- dependencies: ['config', 'remoteConfig'],
28
- },
29
- },
30
- { definition: pricingApi },
31
- ],
32
- }
33
- }
34
-
35
- export default pricing