feat(wizard): add ability to select wallet address
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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()
|
||||
Reference in New Issue
Block a user