Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1951 from LedgerHQ/develop
Browse files Browse the repository at this point in the history
Prepare 1.8.0
  • Loading branch information
gre authored Apr 24, 2019
2 parents d00c032 + 8eddae6 commit b19f070
Show file tree
Hide file tree
Showing 171 changed files with 3,358 additions and 4,000 deletions.
5 changes: 1 addition & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,4 @@ jobs:
key: v12-yarn-packages-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run: yarn lint
- run: ./node_modules/.bin/prettier -l "{src,webpack,.storybook,static/i18n}/**/*.js"
- run: yarn flow --quiet
- run: yarn test
- run: yarn ci
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package.json
test-e2e/**/*.json
test-e2e/**/*.json
56 changes: 27 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
"dist": "bash ./scripts/dist.sh",
"dist:dir": "bash ./scripts/dist-dir.sh",
"compile": "bash ./scripts/compile.sh",
"cli": "bash ./scripts/cli/cli.sh",
"lint": "eslint src webpack .storybook test-e2e",
"flow": "flow",
"test": "jest src",
"test-e2e": "jest test-e2e",
"test-sync": "bash test-e2e/sync/launch.sh",
"prettier": "prettier --write \"{src,webpack,.storybook,test-e2e}/**/*.{js,json}\"",
"ci": "yarn check --integrity && ./scripts/check-no-dups.sh && yarn lint && yarn flow && yarn prettier && yarn test",
"ci": "yarn check --integrity && ./scripts/check-no-dups.sh && yarn lint && yarn prettier && yarn test",
"storybook": "NODE_ENV=development STORYBOOK_ENV=1 start-storybook -s ./static -p 4444",
"publish-storybook": "bash ./scripts/legacy/publish-storybook.sh",
"reset-files": "bash ./scripts/legacy/reset-files.sh"
Expand All @@ -35,20 +34,21 @@
}
},
"dependencies": {
"@ledgerhq/devices": "^4.48.0",
"@ledgerhq/errors": "^4.48.0",
"@ledgerhq/hw-app-btc": "^4.48.0",
"@ledgerhq/hw-app-eth": "^4.48.0",
"@ledgerhq/hw-app-xrp": "^4.48.0",
"@ledgerhq/hw-transport": "^4.47.0",
"@ledgerhq/hw-transport-node-hid": "^4.48.0",
"@ledgerhq/ledger-core": "2.2.1-rc",
"@ledgerhq/live-common": "4.36.1",
"@ledgerhq/devices": "^4.54.0",
"@ledgerhq/electron-updater": "~3.3.0",
"@ledgerhq/errors": "^4.54.0",
"@ledgerhq/hw-app-btc": "^4.54.0",
"@ledgerhq/hw-app-eth": "^4.54.0",
"@ledgerhq/hw-app-xrp": "^4.54.0",
"@ledgerhq/hw-transport": "^4.54.0",
"@ledgerhq/hw-transport-node-hid": "^4.54.0",
"@ledgerhq/ledger-core": "^2.2.1-rc",
"@ledgerhq/live-common": "^5.0.0-alpha.18",
"animated": "^0.2.2",
"async": "^2.6.1",
"async": "^2.6.2",
"axios": "^0.18.0",
"babel-runtime": "^6.26.0",
"bignumber.js": "^7.2.1",
"bignumber.js": "^8.1.1",
"bitcoinjs-lib": "^3.3.2",
"bs58": "^4.0.1",
"color": "^3.0.0",
Expand All @@ -59,7 +59,6 @@
"eip55": "^1.0.3",
"electron-context-menu": "^0.10.0",
"electron-store": "^1.3.0",
"electron-updater": "^2.21.8",
"ethereumjs-tx": "^1.3.4",
"fuse.js": "^3.2.1",
"history": "^4.7.2",
Expand All @@ -68,24 +67,24 @@
"invariant": "^2.2.4",
"ip": "^1.1.5",
"jsqr": "^1.1.1",
"lodash": "^4.17.5",
"lodash": "^4.17.11",
"lru-cache": "^4.1.3",
"measure-scrollbar": "^1.1.0",
"moment": "^2.22.2",
"moment": "^2.24.0",
"openpgp": "^4.2.1",
"qrcode": "^1.2.0",
"qrloop": "0.8.1",
"qs": "^6.5.1",
"raven": "^2.5.0",
"raven-js": "^3.24.2",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-i18next": "^7.7.0",
"react-key-handler": "^1.0.1",
"react-markdown": "^3.3.2",
"react-mortal": "^3.2.0",
"react-motion": "^0.5.2",
"react-redux": "^5.0.7",
"react-redux": "5.0.7",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-router-redux": "5.0.0-alpha.9",
Expand All @@ -100,8 +99,8 @@
"ripple-bs58check": "^2.0.2",
"ripple-hashes": "^0.3.1",
"ripple-lib": "^1.0.0-beta.0",
"rxjs": "^6.2.1",
"rxjs-compat": "^6.2.1",
"rxjs": "^6.4.0",
"rxjs-compat": "^6.4.0",
"secp256k1": "3.3.1",
"semver": "^5.5.0",
"smoothscroll-polyfill": "^0.4.3",
Expand All @@ -115,7 +114,7 @@
"winston": "^3.0.0",
"winston-transport": "^4.2.0",
"write-file-atomic": "^2.3.0",
"ws": "^6.1.3",
"ws": "^6.2.1",
"zxcvbn": "^4.4.2"
},
"devDependencies": {
Expand Down Expand Up @@ -158,8 +157,8 @@
"chance": "^1.0.13",
"concurrently": "3.5.1",
"dotenv": "^5.0.1",
"electron": "1.8.8",
"electron-builder": "20.14.7",
"electron": "^2.0.17",
"electron-builder": "~20.34",
"electron-devtools-installer": "^2.2.3",
"electron-rebuild": "^1.7.3",
"electron-webpack": "^2.1.0",
Expand All @@ -171,17 +170,16 @@
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"flow-bin": "^0.74.0",
"flow-typed": "^2.4.0",
"flow-bin": "^0.95.1",
"flow-typed": "^2.5.1",
"hard-source-webpack-plugin": "^0.6.0",
"husky": "^0.14.3",
"inquirer": "^6.0.0",
"jest": "^22.4.3",
"js-yaml": "^3.10.0",
"node-loader": "^0.6.0",
"prettier": "^1.13.5",
"react-hot-loader": "^4.3.2",
"react-test-renderer": "^16.4.1",
"react-test-renderer": "^16.8.6",
"spectron": "^3.8.0",
"webpack": "^4.6.0",
"webpack-bundle-analyzer": "^2.11.1",
Expand All @@ -190,7 +188,7 @@
"yarn-deduplicate": "^1.1.1"
},
"engines": {
"node": ">=8.9.0 <=8.15.1",
"node": ">=8.9.0",
"yarn": "^1.10.1"
},
"private": true
Expand Down
9 changes: 0 additions & 9 deletions scripts/cli/cli.sh

This file was deleted.

21 changes: 0 additions & 21 deletions scripts/cli/getDevice.js

This file was deleted.

104 changes: 0 additions & 104 deletions scripts/cli/txBetweenAccounts.js

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/create-release-shasums.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ set -e
function main {
ASSETS_FILTER="(AppImage|zip|exe)"
PKG_VER=$(grep version package.json | sed -E 's/.*: "(.*)",/\1/g')
OUTPUT_FILE="ledger-live-desktop-$PKG_VER.sha512sum"

read -p "> release version ($PKG_VER): " -r RELEASE_VERSION
RELEASE_VERSION=${RELEASE_VERSION:-$PKG_VER}
OUTPUT_FILE="ledger-live-desktop-$RELEASE_VERSION.sha512sum"

RELEASES=$(do_request "/repos/LedgerHQ/ledger-live-desktop/releases")
printf """
Expand Down
2 changes: 1 addition & 1 deletion scripts/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function installFlowTyped {
"Failed installing flow-typed definitions"

runJob \
"rm flow-typed/npm/{react-i18next_v7.x.x.js,styled-components_v3.x.x.js,winston*,react-hot-loader_*}" \
"rm -f flow-typed/npm/{reselect_*,redux-actions_*,react-redux_*,react-i18next_v7.x.x.js,styled-components_v3.x.x.js,winston*}" \
"Removing broken flow-typed definitions" \
"Removed broken flow-typed definitions" \
"Failed removing broken flow-typed definitions"
Expand Down
77 changes: 77 additions & 0 deletions src/actions/portfolio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// @flow
import {
getBalanceHistory,
getBalanceHistoryWithCountervalue,
getPortfolio,
} from '@ledgerhq/live-common/lib/portfolio'
import type { Account, PortfolioRange } from '@ledgerhq/live-common/lib/types'
import {
exchangeSettingsForAccountSelector,
counterValueCurrencySelector,
counterValueExchangeSelector,
intermediaryCurrency,
} from 'reducers/settings'
import CounterValues from 'helpers/countervalues'
import type { State } from 'reducers'

export const balanceHistorySelector = (
state: State,
{
account,
range,
}: {
account: Account,
range: PortfolioRange,
},
) => getBalanceHistory(account, range)

export const balanceHistoryWithCountervalueSelector = (
state: State,
{
account,
range,
}: {
account: Account,
range: PortfolioRange,
},
) => {
const counterValueCurrency = counterValueCurrencySelector(state)
const counterValueExchange = counterValueExchangeSelector(state)
const accountExchange = exchangeSettingsForAccountSelector(state, { account })
return getBalanceHistoryWithCountervalue(account, range, (_, value, date) =>
CounterValues.calculateWithIntermediarySelector(state, {
value,
date,
from: account.currency,
fromExchange: accountExchange,
intermediary: intermediaryCurrency,
toExchange: counterValueExchange,
to: counterValueCurrency,
}),
)
}

export const portfolioSelector = (
state: State,
{
accounts,
range,
}: {
accounts: Account[],
range: PortfolioRange,
},
) => {
const counterValueCurrency = counterValueCurrencySelector(state)
const counterValueExchange = counterValueExchangeSelector(state)
return getPortfolio(accounts, range, (account, value, date) =>
CounterValues.calculateWithIntermediarySelector(state, {
value,
date,
from: account.currency,
fromExchange: exchangeSettingsForAccountSelector(state, { account }),
intermediary: intermediaryCurrency,
toExchange: counterValueExchange,
to: counterValueCurrency,
}),
)
}
Loading

0 comments on commit b19f070

Please sign in to comment.