diff options
author | Sergey Ukustov <sergey@ukstv.me> | 2017-09-30 00:24:08 +0800 |
---|---|---|
committer | Sergey Ukustov <sergey@ukstv.me> | 2017-09-30 00:40:46 +0800 |
commit | c2b8dada91c90788dcd81a0318c52a66b4b769d1 (patch) | |
tree | 599c21d3ff09e5ac1c01062940337d6eb2c5d4fb /ui/app/actions.js | |
parent | cdf41c28573822c7c4d50efe7dfa34a062825d7f (diff) | |
download | tangerine-wallet-browser-c2b8dada91c90788dcd81a0318c52a66b4b769d1.tar tangerine-wallet-browser-c2b8dada91c90788dcd81a0318c52a66b4b769d1.tar.gz tangerine-wallet-browser-c2b8dada91c90788dcd81a0318c52a66b4b769d1.tar.bz2 tangerine-wallet-browser-c2b8dada91c90788dcd81a0318c52a66b4b769d1.tar.lz tangerine-wallet-browser-c2b8dada91c90788dcd81a0318c52a66b4b769d1.tar.xz tangerine-wallet-browser-c2b8dada91c90788dcd81a0318c52a66b4b769d1.tar.zst tangerine-wallet-browser-c2b8dada91c90788dcd81a0318c52a66b4b769d1.zip |
Add eth_signTypedData handler
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index e793e6a21..84a1b8dcc 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -97,6 +97,8 @@ var actions = { cancelMsg: cancelMsg, signPersonalMsg, cancelPersonalMsg, + signTypedMsg, + cancelTypedMsg, signTx: signTx, updateAndApproveTx, cancelTx: cancelTx, @@ -395,6 +397,25 @@ function signPersonalMsg (msgData) { } } +function signTypedMsg (msgData) { + log.debug('action - signTypedMsg') + return (dispatch) => { + dispatch(actions.showLoadingIndication()) + + log.debug(`actions calling background.signTypedMessage`) + background.signTypedMessage(msgData, (err, newState) => { + log.debug('signTypedMessage called back') + dispatch(actions.updateMetamaskState(newState)) + dispatch(actions.hideLoadingIndication()) + + if (err) log.error(err) + if (err) return dispatch(actions.displayWarning(err.message)) + + dispatch(actions.completedTx(msgData.metamaskId)) + }) + } +} + function signTx (txData) { return (dispatch) => { dispatch(actions.showLoadingIndication()) @@ -449,6 +470,12 @@ function cancelPersonalMsg (msgData) { return actions.completedTx(id) } +function cancelTypedMsg (msgData) { + const id = msgData.id + background.cancelTypedMessage(id) + return actions.completedTx(id) +} + function cancelTx (txData) { return (dispatch) => { log.debug(`background.cancelTransaction`) |