feat(wizard): add ability to select wallet address

This commit is contained in:
2022-03-01 16:36:58 +03:00
parent 1d4b0512ad
commit 556366a933
4 changed files with 35 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ from giftable_erc20_token import GiftableToken
from hexathon import add_0x, strip_0x
# local imports
from cic.ext.eth.rpc import parse_adapter
from cic.ext.eth.rpc import parse_adapter, list_keys
from cic.extension import Extension

View File

@@ -52,3 +52,17 @@ def parse_adapter(config, signer_hint):
rpc.connect_by_config(config)
return (rpc.conn, signer)
# TODO Find a better place for this
def list_keys(config, signer_hint):
keystore = None
if signer_hint is None:
logg.info("signer hint missing")
return None
st = os.stat(signer_hint)
if stat.S_ISDIR(st.st_mode):
logg.debug("signer hint is directory")
keystore = EthKeystoreDirectory()
keystore.process_dir(signer_hint, default_password=config.get('WALLET_PASSPHRASE', ''))
return keystore.list()