From d88d2975740d29efa887843e0163e7489da106fd Mon Sep 17 00:00:00 2001 From: jonesmarvin8 <83104039+jonesmarvin8@users.noreply.github.com> Date: Tue, 21 Apr 2026 17:42:27 -0400 Subject: [PATCH] add script file for easier wallet access --- .../cli/python => python}/keycard_wallet.py | 0 wallet/src/cli/python/keycard_testing.py | 43 ------------------- wallet/src/cli/python_path.rs | 3 +- wallet_with_keycard.sh | 20 +++++++++ 4 files changed, 21 insertions(+), 45 deletions(-) rename {wallet/src/cli/python => python}/keycard_wallet.py (100%) delete mode 100644 wallet/src/cli/python/keycard_testing.py create mode 100644 wallet_with_keycard.sh diff --git a/wallet/src/cli/python/keycard_wallet.py b/python/keycard_wallet.py similarity index 100% rename from wallet/src/cli/python/keycard_wallet.py rename to python/keycard_wallet.py diff --git a/wallet/src/cli/python/keycard_testing.py b/wallet/src/cli/python/keycard_testing.py deleted file mode 100644 index b7c72295..00000000 --- a/wallet/src/cli/python/keycard_testing.py +++ /dev/null @@ -1,43 +0,0 @@ -import keycard_wallet as keycard_wallet -import time # For testing - - - -my_wallet = keycard_wallet.KeycardWallet() -print("Setup communication with card...", my_wallet.setup_communication()) - -#my_wallet.load_account_keys() - -#pub_key = my_wallet.get_public_signing_key() - -# TODO: now I want to specify LEE -#print(f"Public key: {list(pub_key)}") - -#my_wallet.debug_key_export() -#priv_key = my_wallet.get_private_signing_key() -#print(f"Private key: {list(priv_key)}") - -#my_wallet.remove_account_keys() - -print("Disconnection", my_wallet.disconnect()) # To not do a stupid - -""" -my_wallet.setup_communication() - - - -# TODO: issues here -#priv_key = my_wallet.get_private_key() -#print(f"Private key: {list(priv_key)}") - - -#signature = my_wallet.sign_message_current_key() -#print(f"Signature: {signature.signature.hex()}") - -#signature = my_wallet.sign_message_with_path("m/44'/60'/0'/0/1") -#print(f"Signature: {signature.signature.hex()}") - -my_wallet.disconnect() # To not do a stupid -""" - - diff --git a/wallet/src/cli/python_path.rs b/wallet/src/cli/python_path.rs index 62a399ba..fb720e43 100644 --- a/wallet/src/cli/python_path.rs +++ b/wallet/src/cli/python_path.rs @@ -10,8 +10,7 @@ pub fn add_python_path(py: Python) -> PyResult<()> { let paths_to_add: Vec = vec![ current_dir.join("python"), - current_dir.join("python").join("keycard-py-lee-schnorr"), // ← add this - //current_dir.join("python").join("keycard-py-lee-schnorr").join(".venv").join("Lib").join("site-packages"), + current_dir.join("python").join("keycard-py"), ]; // Sanity check — warns early if a path doesn't exist diff --git a/wallet_with_keycard.sh b/wallet_with_keycard.sh new file mode 100644 index 00000000..e1d96d33 --- /dev/null +++ b/wallet_with_keycard.sh @@ -0,0 +1,20 @@ +cargo install --path wallet --force + + +python3 -m venv venv +source venv/bin/activate +python3 -m pip install pyscard +python3 -m pip install mnemonic +python3 -m pip install ecdsa +python3 -m pip install pyaes + +cd python + +git clone --branch lee-schnorr --single-branch https://github.com/bitgamma/keycard-py.git +cd keycard-py +python3 -m venv venv +source venv/bin/activate +pip install -e . + + +