diff options
author | Dan Finlay <somniac@me.com> | 2016-08-19 22:57:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-19 22:57:51 +0800 |
commit | 30af7e96cba7a88d46d3376097e4d44b715f834c (patch) | |
tree | c2bb2a52f309be3b781ac0ba6ef8df0b287d991c /ui/app/actions.js | |
parent | 9c29328085fbad82ce7bce4659ce6968405a7b3c (diff) | |
parent | 9cd85aea2f858cb79f82cde57e53096756092503 (diff) | |
download | tangerine-wallet-browser-30af7e96cba7a88d46d3376097e4d44b715f834c.tar.gz tangerine-wallet-browser-30af7e96cba7a88d46d3376097e4d44b715f834c.tar.zst tangerine-wallet-browser-30af7e96cba7a88d46d3376097e4d44b715f834c.zip |
Merge pull request #559 from MetaMask/shapeshiftTx
Shapeshift tx
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index dadf124d8..c6c932296 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -135,6 +135,8 @@ var actions = { // QR STUFF: SHOW_QR: 'SHOW_QR', getQr: getQr, + reshowQrCode: reshowQrCode, + SHOW_QR_VIEW: 'SHOW_QR_VIEW', } module.exports = actions @@ -717,6 +719,7 @@ function coinShiftRquest (data, marketData) { if (response.error) return dispatch(actions.showWarning(response.error)) var message = ` Deposit your ${response.depositType} to the address bellow:` + _accountManager.createShapeShiftTx(response.deposit, response.depositType) dispatch(actions.getQr(response.deposit, '125x125', [message].concat(marketData))) }) } @@ -738,6 +741,32 @@ function getQr (data, size, message) { }) } } +function reshowQrCode (data, coin) { + return (dispatch) => { + dispatch(actions.showLoadingIndication()) + shapeShiftRequest('marketinfo', {pair: `${coin.toLowerCase()}_eth`}, (mktResponse) => { + if (mktResponse.error) return dispatch(actions.showWarning(mktResponse.error)) + + var message = [ + `Deposit your ${coin} to the address bellow:`, + `Deposit Limit: ${mktResponse.limit}`, + `Deposit Minimum:${mktResponse.minimum}`, + ] + + qrRequest(data, '125x125', (response) => { + dispatch(actions.hideLoadingIndication()) + dispatch({ + type: actions.SHOW_QR_VIEW, + value: { + qr: response, + message: message, + data: data, + }, + }) + }) + }) + } +} function shapeShiftRequest (query, options, cb) { var queryResponse, method |