Skip to content

Commit

Permalink
fix(sb): fiat tx fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip London committed Jul 21, 2020
1 parent ae41bbc commit 3109a2c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
Expand Up @@ -6,7 +6,8 @@ import {
ExtractSuccess,
FiatType,
FiatTypeEnum,
SupportedCoinType
SupportedCoinType,
WalletFiatType
} from 'core/types'
import { connect, ConnectedProps } from 'react-redux'
import { fiatToString } from 'core/exchange/currency'
Expand Down Expand Up @@ -241,7 +242,7 @@ export class WalletBalanceDropdown extends Component<Props> {
<Text size='24px' weight={500} color='grey800'>
{fiatToString({
value: unsafe_data.sbBalance?.available || '0',
unit: unsafe_data.currency
unit: this.props.coin as WalletFiatType
})}
</Text>
)}
Expand Down Expand Up @@ -278,7 +279,7 @@ export class WalletBalanceDropdown extends Component<Props> {
{': '}
{fiatToString({
value: unsafe_data.sbBalance?.pending || '0',
unit: unsafe_data.currency
unit: this.props.coin as WalletFiatType
})}
</Text>
)}
Expand Down Expand Up @@ -376,7 +377,7 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
const connector = connect(mapStateToProps, mapDispatchToProps)

export type OwnProps = {
coin: CoinType
coin: CoinType | WalletFiatType
coinModel: SupportedCoinType
isCoinErc20: boolean
}
Expand Down
@@ -1,5 +1,11 @@
import * as balanceSelectors from 'components/Balances/wallet/selectors'
import { CoinTypeEnum, ExtractSuccess, FiatType, RatesType } from 'core/types'
import {
CoinType,
CoinTypeEnum,
ExtractSuccess,
FiatType,
RatesType
} from 'core/types'
import { Exchange, Remote } from 'blockchain-wallet-v4/src'
import { getData as getAlgoAddressData } from 'components/Form/SelectBoxAlgoAddresses/selectors'
import { getData as getBchAddressData } from 'components/Form/SelectBoxBchAddresses/selectors'
Expand Down Expand Up @@ -83,7 +89,10 @@ export const getData = (state, ownProps: OwnProps) => {
balanceDataR = Remote.Success(0)
coinRatesR = selectors.core.data.eth.getErc20Rates(state, 'pax')
}
const price24HrR = selectors.core.data.misc.getPrice24H(coin, state)
const price24HrR = selectors.core.data.misc.getPrice24H(
coin as CoinType,
state
)
const currencyR = selectors.core.settings.getCurrency(state)
const sbBalancesR = selectors.components.simpleBuy.getSBBalances(state)

Expand All @@ -101,7 +110,7 @@ export const getData = (state, ownProps: OwnProps) => {
if (coin in CoinTypeEnum) {
value = Exchange.convertCoinToCoin({
value: balanceData,
coin,
coin: coin as CoinType,
baseToStandard: true
}).value
currentValue = Exchange.convertCoinToFiat(
Expand Down
Expand Up @@ -250,13 +250,13 @@ export default ({
})
: authorizedGet({
url: nabuUrl,
ignoreQueryParams: true,
endPoint: '/payments/transactions?product=SIMPLEBUY',
endPoint: '/payments/transactions',
data: {
currency,
limit,
type,
state
product: 'SIMPLEBUY',
state,
type
}
})

Expand Down

0 comments on commit 3109a2c

Please sign in to comment.