diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/WalletBalanceDropdown/index.tsx b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/WalletBalanceDropdown/index.tsx index 74327481a91..9d62f2a9d2b 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/WalletBalanceDropdown/index.tsx +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/WalletBalanceDropdown/index.tsx @@ -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' @@ -241,7 +242,7 @@ export class WalletBalanceDropdown extends Component { {fiatToString({ value: unsafe_data.sbBalance?.available || '0', - unit: unsafe_data.currency + unit: this.props.coin as WalletFiatType })} )} @@ -278,7 +279,7 @@ export class WalletBalanceDropdown extends Component { {': '} {fiatToString({ value: unsafe_data.sbBalance?.pending || '0', - unit: unsafe_data.currency + unit: this.props.coin as WalletFiatType })} )} @@ -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 } diff --git a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/WalletBalanceDropdown/selectors.ts b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/WalletBalanceDropdown/selectors.ts index bbfa4cdd891..4e590d906b2 100644 --- a/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/WalletBalanceDropdown/selectors.ts +++ b/packages/blockchain-wallet-v4-frontend/src/scenes/Transactions/WalletBalanceDropdown/selectors.ts @@ -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' @@ -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) @@ -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( diff --git a/packages/blockchain-wallet-v4/src/network/api/simpleBuy/index.ts b/packages/blockchain-wallet-v4/src/network/api/simpleBuy/index.ts index a45038cf507..d33ab6b2b28 100644 --- a/packages/blockchain-wallet-v4/src/network/api/simpleBuy/index.ts +++ b/packages/blockchain-wallet-v4/src/network/api/simpleBuy/index.ts @@ -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 } })