Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Watch Only): dont include watch only in main balance
- Loading branch information
plondon
committed
May 31, 2018
1 parent
9057dbc
commit 93da3bd
Showing
26 changed files
with
81 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../blockchain-wallet-v4-frontend/src/layouts/Wallet/MenuTop/Balance/BtcBalance/selectors.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { selectors } from 'data' | ||
|
||
export const getData = selectors.core.data.bitcoin.getBalance | ||
export const getData = selectors.core.data.bitcoin.getSpendableBalance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 12 additions & 5 deletions
17
packages/blockchain-wallet-v4-frontend/src/layouts/Wallet/MenuTop/Balance/selectors.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import { Remote } from 'blockchain-wallet-v4/src' | ||
import { selectors } from 'data' | ||
import { lift } from 'ramda' | ||
import { filter, reject, prop, lift } from 'ramda' | ||
|
||
export const getData = (state) => { | ||
const ethContextR = selectors.core.kvStore.ethereum.getContext(state) | ||
const bchContextR = Remote.of(selectors.core.kvStore.bch.getContext(state)) | ||
const btcContextR = Remote.of(selectors.core.wallet.getWalletContext(state)) | ||
|
||
const btcActiveAccountsR = selectors.core.common.btc.getActiveHDAccounts(state) | ||
const btcActiveAddressesR = selectors.core.common.btc.getActiveAddresses(state) | ||
const path = state.router.location.pathname | ||
const transform = lift((btcContext, ethContext, bchContext) => ({btcContext, ethContext, bchContext, path})) | ||
return transform(btcContextR, ethContextR, bchContextR) | ||
|
||
const transform = lift((btcActiveAddresses, btcActiveAccounts, ethContext, bchContext) => { | ||
const spendable = (a) => a.priv | ||
const accounts = btcActiveAccounts.map(prop('xpub')) | ||
const btcWatchOnlyContext = reject(spendable, btcActiveAddresses).map(prop('addr')) | ||
const btcSpendableContext = filter(spendable, btcActiveAddresses).map(prop('addr')).concat(accounts) | ||
return {btcSpendableContext, btcWatchOnlyContext, ethContext, bchContext, path} | ||
}) | ||
return transform(btcActiveAddressesR, btcActiveAccountsR, ethContextR, bchContextR) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import * as bitcoin from './bitcoin/selectors.js' | ||
import * as ethereum from './ethereum/selectors.js' | ||
import * as btc from './btc/selectors.js' | ||
import * as eth from './eth/selectors.js' | ||
import * as bch from './bch/selectors.js' | ||
|
||
export { | ||
bitcoin, | ||
ethereum, | ||
btc, | ||
eth, | ||
bch | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters