@exodus/market-history 9.0.0 → 9.0.2
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,16 @@
|
|
|
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
|
+
## [9.0.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/market-history@9.0.1...@exodus/market-history@9.0.2) (2024-07-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @exodus/market-history
|
|
9
|
+
|
|
10
|
+
## [9.0.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/market-history@9.0.0...@exodus/market-history@9.0.1) (2024-07-11)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- missing current time ([#7786](https://github.com/ExodusMovement/exodus-hydra/issues/7786)) ([aeb6c8b](https://github.com/ExodusMovement/exodus-hydra/commit/aeb6c8b69265ec38e0829d07110f42ab79aeb00c))
|
|
15
|
+
|
|
6
16
|
## [9.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/market-history@8.0.0...@exodus/market-history@9.0.0) (2024-06-25)
|
|
7
17
|
|
|
8
18
|
### ⚠ BREAKING CHANGES
|
package/atoms/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { createInMemoryAtom
|
|
1
|
+
import { createInMemoryAtom } from '@exodus/atoms'
|
|
2
|
+
import { createRemoteConfigAtomFactory } from '@exodus/remote-config-atoms'
|
|
2
3
|
|
|
3
4
|
export const marketHistoryAtomDefinition = {
|
|
4
5
|
id: 'marketHistoryAtom',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/market-history",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.2",
|
|
4
4
|
"description": "Fetches historical prices for assets",
|
|
5
5
|
"author": "Exodus Movement, Inc.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -22,11 +22,12 @@
|
|
|
22
22
|
"!**/__tests__/**"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@exodus/atoms": "^
|
|
25
|
+
"@exodus/atoms": "^8.0.0",
|
|
26
26
|
"@exodus/basic-utils": "^2.0.0",
|
|
27
27
|
"@exodus/dayjs": "^1.0.2",
|
|
28
28
|
"@exodus/module": "^1.1.0",
|
|
29
29
|
"@exodus/price-api": "^3.3.4",
|
|
30
|
+
"@exodus/remote-config-atoms": "^1.0.1",
|
|
30
31
|
"lodash": "^4.17.21",
|
|
31
32
|
"make-concurrent": "^5.4.0",
|
|
32
33
|
"ms": "^0.7.1",
|
|
@@ -35,12 +36,12 @@
|
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@exodus/assets": "^8.0.94",
|
|
37
38
|
"@exodus/assets-base": "^8.1.6",
|
|
38
|
-
"@exodus/assets-feature": "^5.
|
|
39
|
+
"@exodus/assets-feature": "^5.8.1",
|
|
39
40
|
"@exodus/bitcoin-meta": "^1.0.1",
|
|
40
41
|
"@exodus/ethereum-meta": "^1.0.30",
|
|
41
|
-
"@exodus/locale": "^2.2.
|
|
42
|
+
"@exodus/locale": "^2.2.1",
|
|
42
43
|
"@exodus/logger": "^1.1.0",
|
|
43
|
-
"@exodus/rates-monitor": "^4.3.
|
|
44
|
+
"@exodus/rates-monitor": "^4.3.2",
|
|
44
45
|
"@exodus/redux-dependency-injection": "^3.2.3",
|
|
45
46
|
"@exodus/storage-memory": "^2.1.1",
|
|
46
47
|
"events": "^3.3.0",
|
|
@@ -54,5 +55,5 @@
|
|
|
54
55
|
"type": "git",
|
|
55
56
|
"url": "git+https://github.com/ExodusMovement/exodus-hydra.git"
|
|
56
57
|
},
|
|
57
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "a76a22c96445bcaa05e18de0e0c323cf9dd04cba"
|
|
58
59
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import memoizeGetPrices from './helpers/memoize-get-price'
|
|
2
2
|
|
|
3
|
-
const resultFunction = (getAssetDailyPrices, rates, assets) =>
|
|
4
|
-
memoizeGetPrices(getAssetDailyPrices, rates, 'daily', assets)
|
|
3
|
+
const resultFunction = (getAssetDailyPrices, rates, assets, startOfHourTime) =>
|
|
4
|
+
memoizeGetPrices(getAssetDailyPrices, rates, 'daily', assets, startOfHourTime)
|
|
5
5
|
|
|
6
6
|
const getDailyPriceSelector = {
|
|
7
7
|
id: 'getDailyPrice',
|
|
@@ -11,6 +11,7 @@ const getDailyPriceSelector = {
|
|
|
11
11
|
{ selector: 'getAssetDailyPrices' },
|
|
12
12
|
{ selector: 'fiatRates', module: 'rates' },
|
|
13
13
|
{ module: 'assets', selector: 'all' },
|
|
14
|
+
{ selector: 'startOfHour', module: 'time' },
|
|
14
15
|
],
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import memoizeGetPrices from './helpers/memoize-get-price'
|
|
2
2
|
|
|
3
|
-
const resultFunction = (getAssetHourlyPrices, rates, assets) =>
|
|
4
|
-
memoizeGetPrices(getAssetHourlyPrices, rates, 'hourly', assets)
|
|
3
|
+
const resultFunction = (getAssetHourlyPrices, rates, assets, startOfHourTime) =>
|
|
4
|
+
memoizeGetPrices(getAssetHourlyPrices, rates, 'hourly', assets, startOfHourTime)
|
|
5
5
|
|
|
6
6
|
const getHourlyPriceSelector = {
|
|
7
7
|
id: 'getHourlyPrice',
|
|
@@ -11,6 +11,7 @@ const getHourlyPriceSelector = {
|
|
|
11
11
|
{ selector: 'getAssetHourlyPrices' },
|
|
12
12
|
{ selector: 'fiatRates', module: 'rates' },
|
|
13
13
|
{ module: 'assets', selector: 'all' },
|
|
14
|
+
{ selector: 'startOfHour', module: 'time' },
|
|
14
15
|
],
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -2,13 +2,14 @@ import appendPricesWithRate from './append-prices-with-rate'
|
|
|
2
2
|
import { memoize } from 'lodash'
|
|
3
3
|
import { prepareTime } from './date-utils'
|
|
4
4
|
|
|
5
|
-
const memoizeGetPrices = (getAssetPrices, rates, type, assets) => {
|
|
5
|
+
const memoizeGetPrices = (getAssetPrices, rates, type, assets, currentTime) => {
|
|
6
6
|
const getHistoricalPrice = (assetName, time) => {
|
|
7
7
|
const rate = rates[assets[assetName].ticker]
|
|
8
8
|
const historicalPrices = getAssetPrices(assetName)
|
|
9
|
-
const pricesWithRate = appendPricesWithRate({ historicalPrices, rate, type })
|
|
9
|
+
const pricesWithRate = appendPricesWithRate({ historicalPrices, rate, type, currentTime })
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const preparedTime = prepareTime(time, type)
|
|
12
|
+
return pricesWithRate?.[preparedTime] || null
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
return memoize(
|