Skip to content

Commit

Permalink
Merge branch 'development' into fix/xlm-airdrop-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Jun 3, 2019
2 parents 33ddb27 + 778b454 commit 159deb0
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 26 deletions.
2 changes: 1 addition & 1 deletion config/mocks/wallet-options-v4.json
Expand Up @@ -238,7 +238,7 @@
"partnerId": 24,
"production": false,
"iSignThisDomain": "https://stage-coinify-verify.isignthis.com",
"coinifyPaymentDomain": "https://pay.sandbox.coinify.com"
"coinifyPaymentDomain": "https://pay.coinify.com"
}
},
"sfox": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "blockchain-wallet-v4",
"version": "4.14.4",
"version": "4.14.5",
"license": "AGPL-3.0-or-later",
"private": true,
"author": {
Expand Down
Expand Up @@ -36,6 +36,7 @@ export const getData = state => {
subscriptions: getSubscriptions(state),
trade: getTrade(state),
canTrade: selectors.core.data.coinify.canTrade(state),
rateQuoteR: selectors.core.data.coinify.getRateQuote(state),
cannotTradeReason: selectors.core.data.coinify.cannotTradeReason(state),
canTradeAfter: selectors.core.data.coinify.canTradeAfter(state),
currency: formValueSelector('coinifyCheckoutBuy')(state, 'currency'),
Expand Down
Expand Up @@ -50,6 +50,7 @@ const CoinifyBuy = props => {
fetchBuyQuote,
refreshQuote,
buyQuoteR,
rateQuoteR,
cannotTradeReason,
canTradeAfter,
clearTradeError,
Expand Down Expand Up @@ -99,6 +100,7 @@ const CoinifyBuy = props => {
limits={limits.buy}
onFetchQuote={fetchBuyQuote}
quoteR={buyQuoteR}
rateQuoteR={rateQuoteR}
reason={'has_remaining'} // placeholder for now - coinify does not require a reason
symbol={symbol}
setMax={setMax}
Expand Down
Expand Up @@ -50,6 +50,7 @@ const OrderCheckout = ({
limits,
onOrderCheckoutSubmit,
quoteR,
rateQuoteR,
reason,
setMax,
setMin,
Expand All @@ -69,7 +70,7 @@ const OrderCheckout = ({
<Text>
<FormattedMessage id='bitcoin' defaultMessage='Bitcoin' />
</Text>
<Text size='14px'>1 BTC = {rateHelper(quoteR)}</Text>
<Text size='14px'>1 BTC = {rateHelper(rateQuoteR)}</Text>
</RateContainer>
</TopContainer>
{reason.indexOf('has_remaining') > -1 ? (
Expand Down
Expand Up @@ -11,10 +11,6 @@ import { getQuoteInputData } from './selectors'
import Loading from 'components/BuySell/Loading'

class QuoteInput extends Component {
componentDidMount () {
this.props.actions.initializeCheckoutForm(this.props.type)
}

render () {
const {
data,
Expand Down
Expand Up @@ -32,6 +32,7 @@ export const getData = state => {
trade: getTrade(state),
currency: formValueSelector('coinifyCheckoutSell')(state, 'currency'),
defaultCurrency: getCurrency(state),
rateQuoteR: selectors.core.data.coinify.getRateQuote(state),
checkoutBusy: selectors.components.coinify.getCoinifyCheckoutBusy(state),
paymentMedium: selectors.components.coinify.getCoinifyMedium(state),
step: selectors.components.coinify.getCoinifyCheckoutStep(state),
Expand Down
Expand Up @@ -28,6 +28,7 @@ const Sell = props => {
fetchSellQuote,
refreshQuote,
sellQuoteR,
rateQuoteR,
clearTradeError,
currency,
checkoutBusy,
Expand Down Expand Up @@ -70,6 +71,7 @@ const Sell = props => {
canTrade={canTrade}
changeTab={changeTab}
quoteR={sellQuoteR}
rateQuoteR={rateQuoteR}
onFetchQuote={fetchSellQuote}
limits={limits.sell}
type={'sell'}
Expand Down
5 changes: 2 additions & 3 deletions packages/blockchain-wallet-v4-frontend/webpack.debug.js
Expand Up @@ -129,18 +129,17 @@ module.exports = {
uglifyOptions: {
warnings: false,
compress: {
warnings: false,
keep_fnames: true
},
mangle: {
keep_fnames: true
}
},
parallel: true,
cache: true
cache: false
})
],
concatenateModules: false,
concatenateModules: true,
runtimeChunk: {
name: `manifest.${manifestCacheBust}`
},
Expand Down
2 changes: 1 addition & 1 deletion packages/blockchain-wallet-v4/package.json
Expand Up @@ -66,7 +66,7 @@
"bip32-path": "0.4.2",
"bip39": "2.5.0",
"bip69": "2.1.4",
"bitcoin-coinify-client": "0.9.0",
"bitcoin-coinify-client": "0.11.0",
"bitcoin-sfox-client": "0.4.4",
"bitcoinforksjs-lib": "git://github.com/blockchain/bitcoinjs-lib.git#opt-in-bitcoincash-sighash",
"bitcoinjs-lib": "3.1.1",
Expand Down
22 changes: 16 additions & 6 deletions packages/blockchain-wallet-v4/src/redux/data/coinify/reducers.js
Expand Up @@ -3,14 +3,15 @@ import * as AT from './actionTypes.js'
import Remote from '../../../remote'

const INITIAL_STATE = {
trade: Remote.NotAsked,
quote: Remote.NotAsked,
trades: Remote.NotAsked,
profile: Remote.NotAsked,
mediums: Remote.NotAsked,
kyc: Remote.NotAsked,
mediums: Remote.NotAsked,
nextAddress: null,
profile: Remote.NotAsked,
quote: Remote.NotAsked,
rateQuote: Remote.NotAsked,
subscriptions: Remote.NotAsked,
nextAddress: null
trade: Remote.NotAsked,
trades: Remote.NotAsked
}

const coinifyReducer = (state = INITIAL_STATE, action) => {
Expand All @@ -35,6 +36,15 @@ const coinifyReducer = (state = INITIAL_STATE, action) => {
case AT.COINIFY_FETCH_QUOTE_FAILURE: {
return assoc('quote', Remote.Failure(payload), state)
}
case AT.COINIFY_FETCH_RATE_QUOTE_LOADING: {
return assoc('rateQuote', Remote.Loading, state)
}
case AT.COINIFY_FETCH_RATE_QUOTE_SUCCESS: {
return assoc('rateQuote', Remote.Success(payload), state)
}
case AT.COINIFY_FETCH_RATE_QUOTE_FAILURE: {
return assoc('rateQuote', Remote.Failure(payload), state)
}
case AT.COINIFY_FETCH_TRADES_LOADING: {
return assoc('trades', Remote.Loading, state)
}
Expand Down
12 changes: 7 additions & 5 deletions packages/blockchain-wallet-v4/src/redux/data/coinify/sagas.js
Expand Up @@ -147,14 +147,16 @@ export default ({ api, options }) => {

const fetchRateQuote = function * (data) {
try {
yield put(A.fetchQuoteLoading())
const coinify = yield select(S.getProfile)
yield put(A.fetchRateQuoteLoading())
const { currency, type } = data.payload
const getQuote =
type === 'sell' ? coinify.getSellQuote : coinify.getBuyQuote
const quote = yield apply(coinify, getQuote, [-1e8, 'BTC', currency])
yield put(A.fetchQuoteSuccess(quote))
type === 'sell' ? coinify.data.getSellQuote : coinify.data.getBuyQuote
const quote = yield apply(coinify.data, getQuote, [-1e8, 'BTC', currency])
yield put(A.fetchRateQuoteSuccess(quote))
} catch (e) {
yield put(A.fetchQuoteFailure(e))
console.log(e)
yield put(A.fetchRateQuoteFailure(e))
}
}

Expand Down
Expand Up @@ -5,6 +5,8 @@ export const getCoinify = path([dataPath, 'coinify'])

export const getQuote = path([dataPath, 'coinify', 'quote'])

export const getRateQuote = path([dataPath, 'coinify', 'rateQuote'])

export const getTrades = path([dataPath, 'coinify', 'trades'])

export const getSubscriptions = path([dataPath, 'coinify', 'subscriptions'])
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -4885,10 +4885,10 @@ bip69@2.1.4:
dependencies:
safe-buffer "^5.1.1"

bitcoin-coinify-client@0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/bitcoin-coinify-client/-/bitcoin-coinify-client-0.9.0.tgz#70cd0e6b3e74ed0069ec617fb34b30fe519df9f4"
integrity sha512-wI/zg5Qgmz92uvNxHlwp0OkETOHsJxxI3W6YkDz9pgexBgQ0PVGGH61K9tOysBfdfxEIMBB7iM6dojlDqNRNGQ==
bitcoin-coinify-client@0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/bitcoin-coinify-client/-/bitcoin-coinify-client-0.11.0.tgz#8bb725aa5e9643d4ff6872942f4c88736c180394"
integrity sha512-4rHxUh2R35ERXuKtfo6vfzw2jOXarUr0N6CdzySvcBxTXeCzQk9+Jm9CURc9mMQuTbsQ7bDVkBItY7FautDOsg==
dependencies:
babel-polyfill "6.16.*"
babel-preset-es2015 "6.16.*"
Expand Down

0 comments on commit 159deb0

Please sign in to comment.