@exodus/market-history 7.3.1 → 7.4.1

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,22 @@
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
+ ## [7.4.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/market-history@7.4.0...@exodus/market-history@7.4.1) (2024-06-11)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **pricing:** increase market history jitter ([#7332](https://github.com/ExodusMovement/exodus-hydra/issues/7332)) ([fdd2c24](https://github.com/ExodusMovement/exodus-hydra/commit/fdd2c24b60f7761956bc5d52d225d523ad8be52b))
11
+
12
+ ## [7.4.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/market-history@7.3.1...@exodus/market-history@7.4.0) (2024-03-01)
13
+
14
+ ### Features
15
+
16
+ - add marketHistory feature default config ([#5929](https://github.com/ExodusMovement/exodus-hydra/issues/5929)) ([ff746b7](https://github.com/ExodusMovement/exodus-hydra/commit/ff746b7f13dd72b033ae22d3d7b9e3991906f7d3))
17
+
18
+ ### Bug Fixes
19
+
20
+ - missing dependencies ([#5322](https://github.com/ExodusMovement/exodus-hydra/issues/5322)) ([01efedc](https://github.com/ExodusMovement/exodus-hydra/commit/01efedc7508fb14925277fdcd388afb721ac3dd1))
21
+
6
22
  ## [7.3.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/market-history@7.3.0...@exodus/market-history@7.3.1) (2024-01-04)
7
23
 
8
24
  ### Bug Fixes
package/index.js CHANGED
@@ -9,7 +9,18 @@ import marketHistoryMonitorDefinition from './module'
9
9
  import marketHistoryPluginDefinition from './plugin'
10
10
  import marketHistoryApiDefinition from './api'
11
11
 
12
- const marketHistory = () => {
12
+ const CLEAR_MARKET_HISTORY_VERSION = 'infrastructure.marketHistory.clearVersion'
13
+ const REFRESH_INTERVAL_ATOM_PATH = 'infrastructure.marketHistory.refreshInterval'
14
+
15
+ const marketHistory = (
16
+ {
17
+ clearHistoryCacheDefaultValue = null,
18
+ remoteConfigClearHistoryCachePath = CLEAR_MARKET_HISTORY_VERSION,
19
+ remoteConfigClearHistoryCacheDefaultValue = null,
20
+ marketHistoryRefreshIntervalPath = REFRESH_INTERVAL_ATOM_PATH,
21
+ marketHistoryRefreshIntervalDefaultValue = null,
22
+ } = Object.create(null)
23
+ ) => {
13
24
  return {
14
25
  id: 'marketHistory',
15
26
  definitions: [
@@ -38,12 +49,23 @@ const marketHistory = () => {
38
49
  },
39
50
  {
40
51
  definition: marketHistoryClearCacheAtomDefinition,
52
+ config: {
53
+ defaultValue: clearHistoryCacheDefaultValue,
54
+ },
41
55
  },
42
56
  {
43
57
  definition: remoteConfigClearMarketHistoryCacheAtomDefinition,
58
+ config: {
59
+ path: remoteConfigClearHistoryCachePath,
60
+ defaultValue: remoteConfigClearHistoryCacheDefaultValue,
61
+ },
44
62
  },
45
63
  {
46
64
  definition: marketHistoryRefreshIntervalAtomDefinition,
65
+ config: {
66
+ path: marketHistoryRefreshIntervalPath,
67
+ defaultValue: marketHistoryRefreshIntervalDefaultValue,
68
+ },
47
69
  },
48
70
  { definition: marketHistoryPluginDefinition },
49
71
  { definition: marketHistoryAtomDefinition },
package/module/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { mapValues, SynchronizedTime } from '@exodus/basic-utils'
2
- import ExodusModule from '@exodus/module'
2
+ import ExodusModule from '@exodus/module' // eslint-disable-line import/no-deprecated
3
3
  import { fetchHistoricalPrices, fetchPricesInterval } from '@exodus/price-api'
4
4
  import ms from 'ms'
5
5
 
@@ -339,26 +339,25 @@ class MarketHistoryMonitor extends ExodusModule {
339
339
  }
340
340
 
341
341
  #setupTimers = () => {
342
- const jitter = ms('3s')
342
+ const jitters = {
343
+ day: ms('3m'),
344
+ hour: ms('15s'),
345
+ }
343
346
  const getCurrentTime = SynchronizedTime.now
344
- const updateDayPrices = this.update.bind(this, 'day')
345
- const updateHourPrices = this.update.bind(this, 'hour')
346
-
347
- fetchPricesInterval({
348
- func: updateDayPrices,
349
- abortController: this.#abortController,
350
- granularity: 'day',
351
- getJitter: () => jitter,
352
- getCurrentTime,
353
- })
347
+ const updatePrices = (granularity) => this.update.bind(this, granularity)
354
348
 
355
- fetchPricesInterval({
356
- func: updateHourPrices,
357
- abortController: this.#abortController,
358
- granularity: 'hour',
359
- getJitter: () => jitter,
360
- getCurrentTime,
361
- })
349
+ const fetchPricesForGranularity = (granularity) => {
350
+ fetchPricesInterval({
351
+ func: updatePrices(granularity),
352
+ abortController: this.#abortController,
353
+ granularity,
354
+ getJitter: () => jitters[granularity],
355
+ getCurrentTime,
356
+ })
357
+ }
358
+
359
+ fetchPricesForGranularity('day')
360
+ fetchPricesForGranularity('hour')
362
361
  }
363
362
 
364
363
  start = async () => {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@exodus/market-history",
3
- "version": "7.3.1",
3
+ "version": "7.4.1",
4
4
  "description": "Fetches historical prices for assets",
5
- "author": "Exodus Movement Inc.",
5
+ "author": "Exodus Movement, Inc.",
6
6
  "license": "UNLICENSED",
7
7
  "scripts": {
8
- "lint": "eslint . --ignore-path ../../.gitignore",
8
+ "lint": "run -T eslint . --ignore-path ../../.gitignore",
9
9
  "lint:fix": "yarn lint --fix",
10
- "test": "jest"
10
+ "test": "run -T jest"
11
11
  },
12
12
  "main": "index.js",
13
13
  "files": [
@@ -22,6 +22,7 @@
22
22
  "!**/__tests__/**"
23
23
  ],
24
24
  "dependencies": {
25
+ "@exodus/atoms": "^7.0.1",
25
26
  "@exodus/basic-utils": "^2.0.0",
26
27
  "@exodus/module": "^1.1.0",
27
28
  "@exodus/price-api": "^3.3.3",
@@ -32,22 +33,16 @@
32
33
  "devDependencies": {
33
34
  "@exodus/assets": "^8.0.94",
34
35
  "@exodus/assets-base": "^8.1.6",
35
- "@exodus/assets-feature": "^4.0.1",
36
- "@exodus/atoms": "^7.0.0",
36
+ "@exodus/assets-feature": "^5.4.0",
37
37
  "@exodus/bitcoin-meta": "^1.0.1",
38
38
  "@exodus/ethereum-meta": "^1.0.30",
39
- "@exodus/locale": "^2.0.2",
40
- "@exodus/rates-monitor": "^4.1.1",
41
- "@exodus/redux-dependency-injection": "^3.0.0",
39
+ "@exodus/locale": "^2.2.0",
40
+ "@exodus/rates-monitor": "^4.2.0",
41
+ "@exodus/redux-dependency-injection": "^3.1.0",
42
42
  "@exodus/storage-memory": "^2.1.1",
43
- "eslint": "^8.44.0",
44
43
  "events": "^3.3.0",
45
- "jest": "^29.1.2",
46
44
  "redux": "^4.0.0"
47
45
  },
48
- "peerDependencies": {
49
- "debug": ">= 3.0.0"
50
- },
51
46
  "homepage": "https://github.com/ExodusMovement/exodus-hydra/tree/master/features/market-history",
52
47
  "bugs": {
53
48
  "url": "https://github.com/ExodusMovement/exodus-hydra/issues?q=is%3Aissue+is%3Aopen+label%3Amarket-history"
@@ -56,5 +51,5 @@
56
51
  "type": "git",
57
52
  "url": "git+https://github.com/ExodusMovement/exodus-hydra.git"
58
53
  },
59
- "gitHead": "232a59a81ab1be084c2eeedd26f34c4135215192"
54
+ "gitHead": "9dce273eb7fd5e08e530b0991fba47a2fdc91d5c"
60
55
  }