diff options
Add personal sign actions and template
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 6552e7f5c..6060d4299 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -90,6 +90,8 @@ var actions = { PREVIOUS_TX: 'PREV_TX', signMsg: signMsg, cancelMsg: cancelMsg, + signPersonalMsg, + cancelPersonalMsg, sendTx: sendTx, signTx: signTx, cancelTx: cancelTx, @@ -359,6 +361,20 @@ function signMsg (msgData) { } } +function signPersonalMsg (msgData) { + return (dispatch) => { + dispatch(actions.showLoadingIndication()) + + if (global.METAMASK_DEBUG) console.log(`background.signMessage`) + background.signPersonalMessage(msgData, (err) => { + dispatch(actions.hideLoadingIndication()) + + if (err) return dispatch(actions.displayWarning(err.message)) + dispatch(actions.completedTx(msgData.metamaskId)) + }) + } +} + function signTx (txData) { return (dispatch) => { if (global.METAMASK_DEBUG) console.log(`background.setGasMultiplier`) @@ -408,6 +424,12 @@ function cancelMsg (msgData) { return actions.completedTx(msgData.id) } +function cancelPersonalMsg (msgData) { + if (global.METAMASK_DEBUG) console.log(`background.cancelMessage`) + background.cancelPersonalMessage(msgData.id) + return actions.completedTx(msgData.id) +} + function cancelTx (txData) { if (global.METAMASK_DEBUG) console.log(`background.cancelTransaction`) background.cancelTransaction(txData.id) |