From 7b796a4276588231412f3ebbe1b39443af7c64fb Mon Sep 17 00:00:00 2001 From: Victor Grau Serrat Date: Thu, 15 Mar 2018 12:59:53 -0400 Subject: [PATCH] MAINT: [mktplace] sign_msg opens browser window --- catalyst/marketplace/utils/auth_utils.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/catalyst/marketplace/utils/auth_utils.py b/catalyst/marketplace/utils/auth_utils.py index ab3c668d..f4d893a8 100644 --- a/catalyst/marketplace/utils/auth_utils.py +++ b/catalyst/marketplace/utils/auth_utils.py @@ -1,5 +1,6 @@ import hashlib import hmac +import webbrowser import requests import time @@ -45,10 +46,17 @@ def get_key_secret(pubAddr, wallet='mew'): nonce = '0x{}'.format(d['nonce']) if wallet == 'mew': + url = 'https://www.myetherwallet.com/signmsg.html' + print('\nObtaining a key/secret pair to streamline all future ' 'requests with the authentication server.\n' - 'Visit https://www.myetherwallet.com/signmsg.html and sign the ' - 'following message:\n{}'.format(nonce)) + 'Visit {url} and sign the ' + 'following message:\n{nonce}'.format( + url=url, + nonce=nonce)) + + webbrowser.open_new(url) + signature = input('Copy and Paste the "sig" field from ' 'the signature here (without the double quotes, ' 'only the HEX value):\n')