From c7fc0075f0c0edf109b135d1e710754f3b0d9e31 Mon Sep 17 00:00:00 2001 From: YanNaingWinn Date: Wed, 19 Nov 2025 00:45:51 +0700 Subject: [PATCH 1/4] Renamed package --- .github/workflows/docs.yml | 18 +- .gitignore | 2 - CHANGELOG.rst | 274 ++---------------- MANIFEST.in | 6 +- Pipfile | 2 +- README.md | 22 +- {cryptnoxpro => cryptnox_cli}/__init__.py | 2 +- .../command/__init__.py | 0 {cryptnoxpro => cryptnox_cli}/command/btc.py | 12 +- .../command/card/__init__.py | 0 .../command/card/info.py | 10 +- .../command/card/initialize.py | 0 .../command/card_configuration.py | 24 +- .../command/cards.py | 0 .../command/change_pin.py | 6 +- .../command/change_puk.py | 4 +- .../command/command.py | 18 +- .../command/config.py | 0 .../command/decrypt.py | 20 +- .../command/erc_token/__init__.py | 0 .../command/erc_token/contract.py | 6 +- .../command/erc_token/info.py | 20 +- .../command/erc_token/initialize.py | 14 +- {cryptnoxpro => cryptnox_cli}/command/eth.py | 12 +- .../command/factory.py | 0 .../command/get_clearpubkey.py | 14 +- .../command/get_xpub.py | 14 +- .../command/helper/__init__.py | 0 .../command/helper/backup.py | 0 .../command/helper/cards.py | 36 +-- .../command/helper/config.py | 22 +- .../command/helper/download_folder.py | 0 .../command/helper/helper_methods.py | 12 +- .../command/helper/notification.py | 0 .../command/helper/security.py | 18 +- .../command/helper/seed_backup.py | 0 .../command/helper/ui.py | 12 +- .../command/history.py | 0 {cryptnoxpro => cryptnox_cli}/command/info.py | 0 .../command/initialize.py | 0 .../command/options/__init__.py | 0 .../command/options/common.py | 0 .../command/options/eth.py | 0 .../command/options/options.py | 2 +- .../command/reset.py | 4 +- {cryptnoxpro => cryptnox_cli}/command/seed.py | 26 +- .../command/server.py | 6 +- .../command/transfer.py | 0 .../command/unknown.py | 0 .../command/unlock_pin.py | 0 .../command/user_key.py | 10 +- .../command/user_keys/__init__.py | 0 .../command/user_keys/authentication.py | 16 +- .../command/user_keys/aws_kms/__init__.py | 0 .../command/user_keys/aws_kms/aws_kms.py | 4 +- .../command/user_keys/hello/__init__.py | 0 .../command/user_keys/hello/exceptions.py | 0 .../command/user_keys/hello/hello.py | 4 +- .../command/user_keys/hello/windows_hello.py | 0 .../command/user_keys/piv/__init__.py | 0 .../command/user_keys/piv/piv.py | 4 +- .../command/user_keys/piv/piv_card.py | 0 .../command/user_keys/user_key_base.py | 10 +- {cryptnoxpro => cryptnox_cli}/config.py | 14 +- cryptnox_cli/constants.py | 5 + .../contract_abi/erc1155.json | 0 .../contract_abi/erc20.json | 0 .../contract_abi/erc721.json | 0 {cryptnoxpro => cryptnox_cli}/enums.py | 0 .../interactive_cli.py | 10 +- {cryptnoxpro => cryptnox_cli}/lib/__init__.py | 0 .../lib/cryptos/__init__.py | 0 .../lib/cryptos/blocks.py | 0 .../lib/cryptos/coins/__init__.py | 0 .../lib/cryptos/coins/base.py | 0 .../lib/cryptos/coins/bitcoin.py | 0 .../lib/cryptos/composite.py | 0 .../lib/cryptos/constants.py | 0 .../lib/cryptos/deterministic.py | 0 .../lib/cryptos/english.txt | 0 .../lib/cryptos/keystore.py | 0 .../lib/cryptos/main.py | 0 .../lib/cryptos/mnemonic.py | 0 .../lib/cryptos/pbkdf2.py | 0 .../lib/cryptos/ripemd.py | 0 .../lib/cryptos/segwit_addr.py | 0 .../lib/cryptos/specials.py | 0 .../lib/cryptos/stealth.py | 0 .../lib/cryptos/transaction.py | 0 .../lib/cryptos/wallet.py | 0 .../lib/cryptos/wallet_utils.py | 0 {cryptnoxpro => cryptnox_cli}/main.py | 8 +- .../wallet/__init__.py | 0 {cryptnoxpro => cryptnox_cli}/wallet/btc.py | 2 +- .../wallet/eth/__init__.py | 0 .../wallet/eth/api.py | 2 +- .../wallet/eth/endpoint.py | 0 .../wallet/validators.py | 0 cryptnoxpro/constants.py | 5 - dev-requirements.txt | Bin 7936 -> 7946 bytes docs/cli.rst | 14 +- docs/conf.py | 8 +- docs/cryptnox_cli.command.card.rst | 44 +++ ...rst => cryptnox_cli.command.erc_token.rst} | 24 +- ...er.rst => cryptnox_cli.command.helper.rst} | 42 +-- ...s.rst => cryptnox_cli.command.options.rst} | 22 +- ...o.command.rst => cryptnox_cli.command.rst} | 104 +++---- ...ryptnox_cli.command.user_keys.aws_kms.rst} | 8 +- ... cryptnox_cli.command.user_keys.hello.rst} | 16 +- ...=> cryptnox_cli.command.user_keys.piv.rst} | 12 +- docs/cryptnox_cli.command.user_keys.rst | 64 ++++ docs/cryptnox_cli.lib.cryptos.coins.rst | 39 +++ docs/cryptnox_cli.lib.cryptos.rst | 158 ++++++++++ docs/cryptnox_cli.lib.rst | 22 ++ docs/{cryptnoxpro.rst => cryptnox_cli.rst} | 36 +-- ...et.eth.rst => cryptnox_cli.wallet.eth.rst} | 24 +- ...pro.wallet.rst => cryptnox_cli.wallet.rst} | 16 +- docs/cryptnoxpro.command.card.rst | 44 --- docs/cryptnoxpro.command.user_keys.rst | 64 ---- docs/cryptnoxpro.lib.cryptos.coins.rst | 39 --- docs/cryptnoxpro.lib.cryptos.rst | 158 ---------- docs/cryptnoxpro.lib.rst | 22 -- docs/index.rst | 6 +- docs/modules.rst | 3 +- docs/overview.rst | 4 +- requirements.txt | Bin 6022 -> 5906 bytes setup.cfg | 12 +- setup.py | 2 +- setup.spec | 10 +- 129 files changed, 755 insertions(+), 994 deletions(-) rename {cryptnoxpro => cryptnox_cli}/__init__.py (53%) rename {cryptnoxpro => cryptnox_cli}/command/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/btc.py (86%) rename {cryptnoxpro => cryptnox_cli}/command/card/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/card/info.py (92%) rename {cryptnoxpro => cryptnox_cli}/command/card/initialize.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/card_configuration.py (80%) rename {cryptnoxpro => cryptnox_cli}/command/cards.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/change_pin.py (87%) rename {cryptnoxpro => cryptnox_cli}/command/change_puk.py (94%) rename {cryptnoxpro => cryptnox_cli}/command/command.py (86%) rename {cryptnoxpro => cryptnox_cli}/command/config.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/decrypt.py (94%) rename {cryptnoxpro => cryptnox_cli}/command/erc_token/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/erc_token/contract.py (96%) rename {cryptnoxpro => cryptnox_cli}/command/erc_token/info.py (94%) rename {cryptnoxpro => cryptnox_cli}/command/erc_token/initialize.py (94%) rename {cryptnoxpro => cryptnox_cli}/command/eth.py (98%) rename {cryptnoxpro => cryptnox_cli}/command/factory.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/get_clearpubkey.py (93%) rename {cryptnoxpro => cryptnox_cli}/command/get_xpub.py (93%) rename {cryptnoxpro => cryptnox_cli}/command/helper/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/helper/backup.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/helper/cards.py (89%) rename {cryptnoxpro => cryptnox_cli}/command/helper/config.py (87%) rename {cryptnoxpro => cryptnox_cli}/command/helper/download_folder.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/helper/helper_methods.py (88%) rename {cryptnoxpro => cryptnox_cli}/command/helper/notification.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/helper/security.py (91%) rename {cryptnoxpro => cryptnox_cli}/command/helper/seed_backup.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/helper/ui.py (96%) rename {cryptnoxpro => cryptnox_cli}/command/history.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/info.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/initialize.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/options/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/options/common.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/options/eth.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/options/options.py (99%) rename {cryptnoxpro => cryptnox_cli}/command/reset.py (90%) rename {cryptnoxpro => cryptnox_cli}/command/seed.py (95%) rename {cryptnoxpro => cryptnox_cli}/command/server.py (95%) rename {cryptnoxpro => cryptnox_cli}/command/transfer.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/unknown.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/unlock_pin.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_key.py (89%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/authentication.py (90%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/aws_kms/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/aws_kms/aws_kms.py (98%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/hello/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/hello/exceptions.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/hello/hello.py (97%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/hello/windows_hello.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/piv/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/piv/piv.py (97%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/piv/piv_card.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/user_key_base.py (91%) rename {cryptnoxpro => cryptnox_cli}/config.py (81%) create mode 100644 cryptnox_cli/constants.py rename {cryptnoxpro => cryptnox_cli}/contract_abi/erc1155.json (100%) rename {cryptnoxpro => cryptnox_cli}/contract_abi/erc20.json (100%) rename {cryptnoxpro => cryptnox_cli}/contract_abi/erc721.json (100%) rename {cryptnoxpro => cryptnox_cli}/enums.py (100%) rename {cryptnoxpro => cryptnox_cli}/interactive_cli.py (97%) rename {cryptnoxpro => cryptnox_cli}/lib/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/blocks.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/coins/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/coins/base.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/coins/bitcoin.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/composite.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/constants.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/deterministic.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/english.txt (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/keystore.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/main.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/mnemonic.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/pbkdf2.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/ripemd.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/segwit_addr.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/specials.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/stealth.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/transaction.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/wallet.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/wallet_utils.py (100%) rename {cryptnoxpro => cryptnox_cli}/main.py (94%) rename {cryptnoxpro => cryptnox_cli}/wallet/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/wallet/btc.py (99%) rename {cryptnoxpro => cryptnox_cli}/wallet/eth/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/wallet/eth/api.py (99%) rename {cryptnoxpro => cryptnox_cli}/wallet/eth/endpoint.py (100%) rename {cryptnoxpro => cryptnox_cli}/wallet/validators.py (100%) delete mode 100644 cryptnoxpro/constants.py create mode 100644 docs/cryptnox_cli.command.card.rst rename docs/{cryptnoxpro.command.erc_token.rst => cryptnox_cli.command.erc_token.rst} (50%) rename docs/{cryptnoxpro.command.helper.rst => cryptnox_cli.command.helper.rst} (52%) rename docs/{cryptnoxpro.command.options.rst => cryptnox_cli.command.options.rst} (50%) rename docs/{cryptnoxpro.command.rst => cryptnox_cli.command.rst} (51%) rename docs/{cryptnoxpro.command.user_keys.aws_kms.rst => cryptnox_cli.command.user_keys.aws_kms.rst} (54%) rename docs/{cryptnoxpro.command.user_keys.hello.rst => cryptnox_cli.command.user_keys.hello.rst} (51%) rename docs/{cryptnoxpro.command.user_keys.piv.rst => cryptnox_cli.command.user_keys.piv.rst} (54%) create mode 100644 docs/cryptnox_cli.command.user_keys.rst create mode 100644 docs/cryptnox_cli.lib.cryptos.coins.rst create mode 100644 docs/cryptnox_cli.lib.cryptos.rst create mode 100644 docs/cryptnox_cli.lib.rst rename docs/{cryptnoxpro.rst => cryptnox_cli.rst} (51%) rename docs/{cryptnoxpro.wallet.eth.rst => cryptnox_cli.wallet.eth.rst} (54%) rename docs/{cryptnoxpro.wallet.rst => cryptnox_cli.wallet.rst} (57%) delete mode 100644 docs/cryptnoxpro.command.card.rst delete mode 100644 docs/cryptnoxpro.command.user_keys.rst delete mode 100644 docs/cryptnoxpro.lib.cryptos.coins.rst delete mode 100644 docs/cryptnoxpro.lib.cryptos.rst delete mode 100644 docs/cryptnoxpro.lib.rst diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6663636..6bf0182 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout cryptnoxpro repository + - name: Checkout cryptnox-cli repository uses: actions/checkout@v4 with: - path: cryptnoxpro + path: cryptnox-cli - name: Set up Python uses: actions/setup-python@v5 @@ -25,12 +25,12 @@ jobs: - name: Install dependencies run: | - cd cryptnoxpro + cd cryptnox-cli pip install sphinx sphinx-rtd-theme - name: Build Sphinx documentation run: | - cd cryptnoxpro + cd cryptnox-cli sphinx-build -b html docs docs/_build/html - name: Checkout documentation repository @@ -42,14 +42,14 @@ jobs: - name: Update documentation run: | - # Remove old cryptnoxpro folder if it exists - rm -rf docs-repo/cryptnoxpro + # Remove old cryptnox-cli folder if it exists + rm -rf docs-repo/cryptnox-cli # Copy new documentation - cp -r cryptnoxpro/docs/_build/html docs-repo/cryptnoxpro + cp -r cryptnox-cli/docs/_build/html docs-repo/cryptnox-cli # Add a timestamp file for tracking - echo "Last updated: $(date)" > docs-repo/cryptnoxpro/last-updated.txt + echo "Last updated: $(date)" > docs-repo/cryptnox-cli/last-updated.txt - name: Commit and push changes run: | @@ -57,5 +57,5 @@ jobs: git config --local user.email "yann@oinsm.ch" git config --local user.name "YanNaingWinn" git add . - git commit -m "Update cryptnoxpro documentation from cryptnoxpro@${{ github.sha }}" || exit 0 + git commit -m "Update cryptnox-cli documentation from cryptnox-cli@${{ github.sha }}" || exit 0 git push diff --git a/.gitignore b/.gitignore index 66fe372..0e0f597 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,3 @@ signature.sig cardpub.pub docs/_build/ - -cryptnoxpro.egg-info diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 79eaef4..b0edd76 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,274 +2,38 @@ Changelog ========= -All notable changes to this project will be documented in this file. - -The format is based on `Keep a Changelog `_\ , -and this project adheres to `Semantic Versioning `_. - -`Unreleased `_ --------------------------------------------------------------------------------------- - -`2.8.0 `_ - 2022-01-31 +`1.0.0 `_ ------------------------------------------------------------------------------------------------ Added ^^^^^ - -- Option to start a server and access the card remotely - -`2.7.0 `_ - 2022-11-28 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -- Card can be opened with AWS KMS key instead of PIN code -- Option to backup to cloud when seed is uploaded or recovered - -`2.6.0 `_ - 2022-09-30 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -- ERC1155 contract ABI to system for selection for use - -Fixed -^^^^^ - -- `eosio` command `get` subcommand help not shown - -`2.5.0 `_ - 2022-08-11 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -- Default servers for AWS backup and restore -- Default randomized alias for AWS backup -- Use `rootkey.csv` file from download folder for AWS backup and restore, delete credentials after operation +- Package renamed from ``cryptnoxpro`` to ``cryptnox_cli`` + - Install using: ``pip install cryptnox-cli`` +- BIP39 passphrase support for seed generation and recovery +- BIP39 passphrase length limitation and validation +- Sphinx documentation framework for comprehensive CLI documentation +- GitHub Actions workflows for automated documentation deployment +- Constants file for centralized configuration management +- Flake8 code quality checks in CI/CD workflow Changed ^^^^^^^ -- In case of exception write the error log into user folder instead of installation folder +- Updated README with improved documentation and examples +- Modified documentation configuration and deployment process +- Reconfigured documentation deployment workflow +- Updated setup configuration (setup.cfg) for better package management +- Improved code organization with constants file Fixed ^^^^^ -- Missing word for retrying PIN code -- Seed phrase of length other than 12 or 24 words is accepted by the system - -`2.4.0 `_ - 2022-07-19 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -- Python 3.10 support -- For NFT cards abi url parsing +- Resolved runtime import errors +- Fixed flake8 code style errors throughout the codebase +- Fixed PUK retries persistence issue Removed ^^^^^^^ -- Python 3.6 support - -Fixed -^^^^^ - -- Application crashing when using current key with derivation path - -`2.3.0 `_ - 2022-06-07 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -- Remote mode for connecting over a port - -Changed -^^^^^^^ - -- Installation instructions added missing instructions - -`2.2.2 `_ - 2022-03-17 ------------------------------------------------------------------------------------------------- - -Fixed -^^^^^ - -* Init not finished with NFT card when ABI is large - -`2.2.1 `_ - 2022-03-14 ------------------------------------------------------------------------------------------------- - -Fixed -^^^^^ - -* Application crashes when initializing NFT card -* Help not show on some commands -* List of cards is doubled when executing list command -* Seed backup to KMS name of backup error message not clear enough -* Card not reloaded after dual seed generation -* Application crashes during dual seed generation while waiting for second card - -`2.2.0 `_ - 2022-01-31 ------------------------------------------------------------------------------------------------- - -Changed -^^^^^^^ - -* Combined two scripts into one -* Demo mode renamed to easy mode -* Application name changed to Cryptnox Pro - -Fixed -^^^^^ - -* Error handling while waiting for card when timeout is exceeded -* Error handling when a user enters value for mnemonic that is invalid for BIP39 -* Input for user key description to allow numbers and letters -* Crash when showing seed backup options for AWS server - -`2.1.0 `_ - 2022-01-04 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -* Separate CLI for working with NFT cards -* eht command contract parameter to send ERC20 tokens - -Fixed -^^^^^ - -* Exception handling in multiple places. - -`2.0.0 `_ - 2021-10-13 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -* Dynamic fee calculation for Bitcoin and Ethereum networks - -Changed -^^^^^^^ - -* Recovering seed from mnemonic compliant with BIP39 -* Derivation paths to be compliant with BIP44 - -Fixed -^^^^^ - -* Send/transfer memo for EOSIO -* Signing multi-input transaction for BTC with user key -* Precision of amounts for sending -* AWS backup wrong credentials crash the application -* verbose option is not doing anything -* EOS transfer doesn't use sender but behaves as send command - - -`1.3.2 `_ - 2021-10-13 ------------------------------------------------------------------------------------------------- - -Changed -^^^^^^^ - -* Ethereum endpoint through cryptnox node updated to use different domains on standard ports -* With ``info`` command for balance show the issue instead of "--" - -Fixed -^^^^^ - -* ``exit`` keyword when input is requested from user, like PIN or PUK code -* Bitcoin sending with multiple inputs is rejected by the node - -`1.3.1 `_ - 2021-10-07 ------------------------------------------------------------------------------------------------- - -Fixed -^^^^^ - -* Crash when calling config under currencies - -`1.3.0 `_ - 2021-10-06 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -* card_config can update the status of PIN-less path and PIN authentication. - -Changed -^^^^^^^ - -* Configuration is saved into the card instead of a file. - -Fixed -^^^^^ - -* When waiting for card after card is detected the application crashes. -* Ethereum network name conversion - -`1.2.0 `_ - 2021-09-16 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -* New endpoint for Ethereum network used by default. User can still the infura network with a project key - -Changed -^^^^^^^ - -* Ordering in config command to BTC, ETH, EOS. -* When changing PIN or PUK code message made clear that the card is not initialized. -* Resetting uninitialized card message updated. -* User key check if card is initialized before continuing. -* In change_puk check current PUK before asking for new one. -* Show warning on command if card origin is unknown or fake instead of exiting command. - -Fixed -^^^^^ - -* In demo mode when asked for PUK code, entering anything will go into loop asking for the code. -* There is no message when adding piv, but piv is not present - -`1.1.0 `_ - 2021-09-16 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -* Backup and restore of entropy for seed generation to KMS in HSM. - - -`1.0.2 `_ - 2021-09-09 ------------------------------------------------------------------------------------------------- - -Changed -^^^^^^^ - -* Improve setup process. - - -`1.0.1 `_ - 2021-08-20 ------------------------------------------------------------------------------------------------- - -Fixed -^^^^^ - -* Update package on PiPI. - -`1.0.0 `_ - 2021-08-20 ---------------------------------------------------------------------------------------------- - -Added -^^^^^ - -* Command line interface with commands for interacting with Cryptnox cards. -* Interactive mode. -* Pipfile and requirements for setting up environment. -* Setup file to install the library. +- Removed cleos dependency +- Removed Ropsten testnet support (deprecated network) diff --git a/MANIFEST.in b/MANIFEST.in index 0233014..4d9522c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include LICENSE include CHANGELOG.rst -include README.rst -include cryptnoxpro/contract_abi/*.json -include cryptnoxpro/lib/cryptos/english.txt +include README.md +include cryptnox_cli/contract_abi/*.json +include cryptnox_cli/lib/cryptos/english.txt diff --git a/Pipfile b/Pipfile index b7c1bb5..bf80be1 100644 --- a/Pipfile +++ b/Pipfile @@ -17,7 +17,7 @@ base58 = "*" boto3 = "*" ecdsa = "*" colander = "*" -cryptnoxpy = ">=2.0.0" +cryptnox-sdk-py >= "1.0.0" lazy-import = "*" pytz = "*" requests = "*" diff --git a/README.md b/README.md index 00ee1a8..f3a78b4 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,19 @@ cryptnox-icon

-

Cryptnox Pro — Smartcard CLI

+

Cryptnox CLI — Smartcard CLI


-[![PyPI](https://img.shields.io/pypi/v/cryptnoxpro.svg)](https://pypi.org/project/cryptnoxpro/) -[![Python versions](https://img.shields.io/pypi/pyversions/cryptnoxpro.svg)](https://pypi.org/project/cryptnoxpro/) -[![Documentation status](https://img.shields.io/badge/docs-latest-blue)](https://cryptnox-software.github.io/cryptnoxpro) +[![PyPI](https://img.shields.io/pypi/v/cryptnox-cli.svg)](https://pypi.org/project/cryptnox-cli/) +[![Python versions](https://img.shields.io/pypi/pyversions/cryptnox-cli.svg)](https://pypi.org/project/cryptnox-cli/) +[![Documentation status](https://img.shields.io/badge/docs-latest-blue)](https://cryptnox-software.github.io/cryptnox-cli) [![License: GPLv3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ## About -`cryptnoxpro` is a command-line interface for managing **Cryptnox Smartcards**, enabling secure seed initialization and cryptographic signing for **Bitcoin** and **Ethereum**. +`cryptnox-cli` is a command-line interface for managing **Cryptnox Smartcards**, enabling secure seed initialization and cryptographic signing for **Bitcoin** and **Ethereum**. ## Supported hardware @@ -26,24 +26,24 @@ Get your card and readers here: [shop.cryptnox.com](https://shop.cryptnox.com) ## Installation -> 💡 This is only a minimal setup. Additional packages may be required depending on your operating system. See [Installation and Requirements](https://cryptnox-software.github.io/cryptnoxpro/overview.html#installation-and-requirements). +> 💡 This is only a minimal setup. Additional packages may be required depending on your operating system. See [Installation and Requirements](https://cryptnox-software.github.io/cryptnox-cli/overview.html#installation-and-requirements). ### From PyPI ```bash -pip install cryptnoxpro +pip install cryptnox-cli ``` ### From source ```bash -git clone https://github.com/cryptnox-software/cryptnoxpro.git -cd cryptnoxpro +git clone https://github.com/cryptnox-software/cryptnox-cli.git +cd cryptnox-cli pip install . ``` This installs the package and makes the `cryptnox` command available (if your Python installation is in your system `PATH`). ## Quick usage examples -> 💡 The examples below are only a subset of available commands. The complete list of commands and detailed usage instructions is described in the [official documentation](https://cryptnox-software.github.io/cryptnoxpro). +> 💡 The examples below are only a subset of available commands. The complete list of commands and detailed usage instructions is described in the [official documentation](https://cryptnox-software.github.io/cryptnox-cli). ### 1. Dual initialization 1. Factory reset each card: @@ -82,7 +82,7 @@ This installs the package and makes the `cryptnox` command available (if your Py ## Documentation -The full **User & Developer documentation** is available at the [CryptnoxPro Documentation](https://cryptnox-software.github.io/cryptnoxpro). It covers installation and setup, usage guides and examples, CLI command reference, and developer notes with API details. +The full **User & Developer documentation** is available at the [Cryptnox CLI Documentation](https://cryptnox-software.github.io/cryptnox-cli). It covers installation and setup, usage guides and examples, CLI command reference, and developer notes with API details. ## License diff --git a/cryptnoxpro/__init__.py b/cryptnox_cli/__init__.py similarity index 53% rename from cryptnoxpro/__init__.py rename to cryptnox_cli/__init__.py index b1197e4..650d6c1 100644 --- a/cryptnoxpro/__init__.py +++ b/cryptnox_cli/__init__.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -__version__ = "2.9.1" +__version__ = "1.0.0" diff --git a/cryptnoxpro/command/__init__.py b/cryptnox_cli/command/__init__.py similarity index 100% rename from cryptnoxpro/command/__init__.py rename to cryptnox_cli/command/__init__.py diff --git a/cryptnoxpro/command/btc.py b/cryptnox_cli/command/btc.py similarity index 86% rename from cryptnoxpro/command/btc.py rename to cryptnox_cli/command/btc.py index 11a4d2e..bf85502 100644 --- a/cryptnoxpro/command/btc.py +++ b/cryptnox_cli/command/btc.py @@ -4,7 +4,7 @@ """ from typing import List -import cryptnoxpy +import cryptnox_sdk_py from .command import Command from .helper.config import create_config_method @@ -41,19 +41,19 @@ def _execute(self, card) -> int: return 0 - def _send(self, card: cryptnoxpy.Card) -> None: + def _send(self, card: cryptnox_sdk_py.Card) -> None: config = get_configuration(card)["btc"] network = self.data.network or config.get("network", "testnet") try: - derivation = cryptnoxpy.Derivation[config["derivation"]] + derivation = cryptnox_sdk_py.Derivation[config["derivation"]] except KeyError: print("Derivation is invalid") return endpoint = BlkHubApi(network) - path = b"" if derivation == cryptnoxpy.Derivation.CURRENT_KEY else BTCwallet.PATH + path = b"" if derivation == cryptnox_sdk_py.Derivation.CURRENT_KEY else BTCwallet.PATH pubkey = card.get_public_key(derivation, path=path) wallet = BTCwallet(pubkey, network, endpoint, card) @@ -80,10 +80,10 @@ def _send(self, card: cryptnoxpy.Card) -> None: print(f"\nTransaction id: {message[13:]}\nBalance might take 30 s to be refreshed") @staticmethod - def _sign(card: cryptnoxpy.Card, derivation: cryptnoxpy.Derivation, + def _sign(card: cryptnox_sdk_py.Card, derivation: cryptnox_sdk_py.Derivation, data_hashes: List[bytes]) -> List[bytes]: signatures = [] - if card.auth_type == cryptnoxpy.AuthType.PIN and len(data_hashes) > 1: + if card.auth_type == cryptnox_sdk_py.AuthType.PIN and len(data_hashes) > 1: pin_code = check_pin_code(card) else: pin_code = "" diff --git a/cryptnoxpro/command/card/__init__.py b/cryptnox_cli/command/card/__init__.py similarity index 100% rename from cryptnoxpro/command/card/__init__.py rename to cryptnox_cli/command/card/__init__.py diff --git a/cryptnoxpro/command/card/info.py b/cryptnox_cli/command/card/info.py similarity index 92% rename from cryptnoxpro/command/card/info.py rename to cryptnox_cli/command/card/info.py index 240149c..352e5c6 100644 --- a/cryptnoxpro/command/card/info.py +++ b/cryptnox_cli/command/card/info.py @@ -4,7 +4,7 @@ """ from typing import List, Dict -import cryptnoxpy +import cryptnox_sdk_py import web3 from argparse import Namespace from tabulate import tabulate @@ -59,13 +59,13 @@ def execute(card) -> int: def _get_btc_info(card) -> dict: config = get_configuration(card)["btc"] try: - derivation = cryptnoxpy.Derivation[config["derivation"]].value + derivation = cryptnox_sdk_py.Derivation[config["derivation"]].value except KeyError: return {"name": "Bad derivation type"} network = config.get("network", "testnet").lower() endpoint = BlkHubApi(network) - path = b"" if derivation == cryptnoxpy.Derivation.CURRENT_KEY else BTCwallet.PATH + path = b"" if derivation == cryptnox_sdk_py.Derivation.CURRENT_KEY else BTCwallet.PATH pubkey = card.get_public_key(derivation, path=path) wallet = BTCwallet(pubkey, network, endpoint, card) @@ -90,7 +90,7 @@ def _get_eth_info(card) -> dict: config = get_configuration(card)["eth"] network = enums.EthNetwork[config.get("network", "infura").upper()] try: - derivation = cryptnoxpy.Derivation[config["derivation"]].value + derivation = cryptnox_sdk_py.Derivation[config["derivation"]].value except KeyError: return {"name": "Bad derivation type"} try: @@ -99,7 +99,7 @@ def _get_eth_info(card) -> dict: print(error) return {} - path = "" if derivation == cryptnoxpy.Derivation.CURRENT_KEY else eth.Api.PATH + path = "" if derivation == cryptnox_sdk_py.Derivation.CURRENT_KEY else eth.Api.PATH public_key = card.get_public_key(derivation, path=path, compressed=False) address = eth.checksum_address(public_key) diff --git a/cryptnoxpro/command/card/initialize.py b/cryptnox_cli/command/card/initialize.py similarity index 100% rename from cryptnoxpro/command/card/initialize.py rename to cryptnox_cli/command/card/initialize.py diff --git a/cryptnoxpro/command/card_configuration.py b/cryptnox_cli/command/card_configuration.py similarity index 80% rename from cryptnoxpro/command/card_configuration.py rename to cryptnox_cli/command/card_configuration.py index 5b52945..df46806 100644 --- a/cryptnoxpro/command/card_configuration.py +++ b/cryptnox_cli/command/card_configuration.py @@ -2,7 +2,7 @@ """ Module containing the class for printing card configuration """ -import cryptnoxpy +import cryptnox_sdk_py from tabulate import tabulate from .command import Command @@ -19,16 +19,16 @@ class CardConfiguration(Command): Command for printing card configuraton """ _SEED_SOURCE_TO_STRING = { - cryptnoxpy.SeedSource.NO_SEED: "No seed", - cryptnoxpy.SeedSource.SINGLE: "Single 256K1 EC pair", - cryptnoxpy.SeedSource.EXTENDED: "Extended 256K1 EC pair BIP32 node", - cryptnoxpy.SeedSource.EXTERNAL: "Externally generated", - cryptnoxpy.SeedSource.INTERNAL: "Internally generated", - cryptnoxpy.SeedSource.DUAL: "Dual initialized" + cryptnox_sdk_py.SeedSource.NO_SEED: "No seed", + cryptnox_sdk_py.SeedSource.SINGLE: "Single 256K1 EC pair", + cryptnox_sdk_py.SeedSource.EXTENDED: "Extended 256K1 EC pair BIP32 node", + cryptnox_sdk_py.SeedSource.EXTERNAL: "Externally generated", + cryptnox_sdk_py.SeedSource.INTERNAL: "Internally generated", + cryptnox_sdk_py.SeedSource.DUAL: "Dual initialized" } _name = enums.Command.CARD_CONFIGURATION.value - def _execute(self, card: cryptnoxpy.Card) -> int: + def _execute(self, card: cryptnox_sdk_py.Card) -> int: if self.data.value: if self.data.key == "pinless": path = "m/43'/60'/1581'" if CardConfiguration._str_to_bool(self.data.value) else "" @@ -53,7 +53,7 @@ def _execute(self, card: cryptnoxpy.Card) -> int: return CardConfiguration.show(card) @staticmethod - def show(card: cryptnoxpy.Card) -> int: + def show(card: cryptnox_sdk_py.Card) -> int: data = [ ["Card initialisation", CardConfiguration._bool_to_str(card.initialized)] ] @@ -69,10 +69,10 @@ def show(card: cryptnoxpy.Card) -> int: ] try: data += [ - ["RSA 2048 user key", CardConfiguration._bool_to_str(card.user_key_enabled(cryptnoxpy.SlotIndex.RSA))], + ["RSA 2048 user key", CardConfiguration._bool_to_str(card.user_key_enabled(cryptnox_sdk_py.SlotIndex.RSA))], ["ECC 256 user key", - CardConfiguration._bool_to_str(card.user_key_enabled(cryptnoxpy.SlotIndex.EC256R1))], - ["FIDO2 user key", CardConfiguration._bool_to_str(card.user_key_enabled(cryptnoxpy.SlotIndex.FIDO))] + CardConfiguration._bool_to_str(card.user_key_enabled(cryptnox_sdk_py.SlotIndex.EC256R1))], + ["FIDO2 user key", CardConfiguration._bool_to_str(card.user_key_enabled(cryptnox_sdk_py.SlotIndex.FIDO))] ] except NotImplementedError: data += [["User keys", "Not available"]] diff --git a/cryptnoxpro/command/cards.py b/cryptnox_cli/command/cards.py similarity index 100% rename from cryptnoxpro/command/cards.py rename to cryptnox_cli/command/cards.py diff --git a/cryptnoxpro/command/change_pin.py b/cryptnox_cli/command/change_pin.py similarity index 87% rename from cryptnoxpro/command/change_pin.py rename to cryptnox_cli/command/change_pin.py index daf8cb3..0cd2a98 100644 --- a/cryptnoxpro/command/change_pin.py +++ b/cryptnox_cli/command/change_pin.py @@ -2,7 +2,7 @@ """ Module containing command for changing PIN code of the card """ -import cryptnoxpy +import cryptnox_sdk_py from .command import Command from .helper import ( @@ -22,14 +22,14 @@ class ChangePin(Command): """ _name = enums.Command.CHANGE_PIN.value - def _execute(self, card: cryptnoxpy.Card) -> int: + def _execute(self, card: cryptnox_sdk_py.Card) -> int: if not card.initialized: ui.print_warning("Card is not initialized") print("To initialize card run : init\nTo initialize card in easy mode run : init -e") return -1 - if card.auth_type != cryptnoxpy.AuthType.PIN: + if card.auth_type != cryptnox_sdk_py.AuthType.PIN: security.check_pin_code(card) if security.is_easy_mode(card.info): diff --git a/cryptnoxpro/command/change_puk.py b/cryptnox_cli/command/change_puk.py similarity index 94% rename from cryptnoxpro/command/change_puk.py rename to cryptnox_cli/command/change_puk.py index 98ce242..c3e3d8d 100644 --- a/cryptnoxpro/command/change_puk.py +++ b/cryptnox_cli/command/change_puk.py @@ -2,7 +2,7 @@ """ Module containing command for changing PIN code of the card """ -import cryptnoxpy +import cryptnox_sdk_py from .command import Command from .helper import ( @@ -22,7 +22,7 @@ class ChangePuk(Command): """ _name = enums.Command.CHANGE_PUK.value - def _execute(self, card: cryptnoxpy.Card) -> int: + def _execute(self, card: cryptnox_sdk_py.Card) -> int: if not card.initialized: ui.print_warning("Card is not initialized") print("To initialize card run : init\nTo initialize card in easy mode run : init -e") diff --git a/cryptnoxpro/command/command.py b/cryptnox_cli/command/command.py similarity index 86% rename from cryptnoxpro/command/command.py rename to cryptnox_cli/command/command.py index 2bba79d..1e531ea 100644 --- a/cryptnoxpro/command/command.py +++ b/cryptnox_cli/command/command.py @@ -4,7 +4,7 @@ """ import abc -import cryptnoxpy +import cryptnox_sdk_py import requests.exceptions from argparse import Namespace from tabulate import tabulate @@ -58,7 +58,7 @@ def _handle_execution(self, serial_number: int = None) -> int: pass try: card = self._cards[self.serial_number] - except (ExitException, TimeoutException, cryptnoxpy.exceptions.CryptnoxException) as error: + except (ExitException, TimeoutException, cryptnox_sdk_py.exceptions.CryptnoxException) as error: print(error) return -1 except requests.exceptions.RequestException as error: @@ -70,26 +70,26 @@ def _handle_execution(self, serial_number: int = None) -> int: def run_execute(self, card) -> int: print(f"Using card with serial number {card.serial_number}") origin = card.origin - if origin == cryptnoxpy.enums.Origin.UNKNOWN: + if origin == cryptnox_sdk_py.enums.Origin.UNKNOWN: ui.print_warning("Origin of card can't be checked. Check your internet connection.") - elif origin == cryptnoxpy.enums.Origin.FAKE: + elif origin == cryptnox_sdk_py.enums.Origin.FAKE: ui.print_warning(f"Card with serial number {card.serial_number} is not genuine.") try: result = self._execute(card) - except cryptnoxpy.exceptions.InitializationException as error: + except cryptnox_sdk_py.exceptions.InitializationException as error: print("\n" + tabulate([[str(error).upper()]], tablefmt="rst")) print(f"To initialize card run : init\n" f"To initialize card in {security.EASY_MODE_TEXT} run : init -e") result = -1 - except cryptnoxpy.exceptions.SeedException: + except cryptnox_sdk_py.exceptions.SeedException: print("The seed is not generated\nRun seed command to generate seed") result = -1 - except cryptnoxpy.exceptions.GenericException as error: + except cryptnox_sdk_py.exceptions.GenericException as error: print(f"Generic exception with status code: 0x{error.status.hex().upper()}") return -2 - except (cryptnoxpy.exceptions.CryptnoxException, NotImplementedError) as error: + except (cryptnox_sdk_py.exceptions.CryptnoxException, NotImplementedError) as error: print(error) result = -1 except ui.ExitException: @@ -112,7 +112,7 @@ def _execute(self, card) -> int: """ Method that will be executed in executed in execute method. - :param connection cryptnoxpy.Connection: Connection to the card + :param connection cryptnox_sdk_py.Connection: Connection to the card :return: Execution status """ diff --git a/cryptnoxpro/command/config.py b/cryptnox_cli/command/config.py similarity index 100% rename from cryptnoxpro/command/config.py rename to cryptnox_cli/command/config.py diff --git a/cryptnoxpro/command/decrypt.py b/cryptnox_cli/command/decrypt.py similarity index 94% rename from cryptnoxpro/command/decrypt.py rename to cryptnox_cli/command/decrypt.py index 7759dc4..9008eea 100644 --- a/cryptnoxpro/command/decrypt.py +++ b/cryptnox_cli/command/decrypt.py @@ -3,10 +3,10 @@ Module containing command for decrypting data using ECIES """ try: - import cryptnoxpy + import cryptnox_sdk_py except ImportError: - # Handle case where cryptnoxpy is not available - cryptnoxpy = None + # Handle case where cryptnox_sdk_py is not available + cryptnox_sdk_py = None from argparse import Namespace @@ -28,15 +28,15 @@ def _execute(self, card) -> int: :rtype: int """ # Basic validation - if cryptnoxpy is None: - print("Error: cryptnoxpy library is not available") + if cryptnox_sdk_py is None: + print("Error: cryptnox_sdk_py library is not available") return -1 if not hasattr(card, 'decrypt'): print("Error: Card does not support decrypt functionality") return -1 - print("=== CryptnoxPro Decrypt Command ===") + print("=== Cryptnox CLI Decrypt Command ===") print(f"Card SN: {card.serial_number}") print(f"Initialized: {card.initialized}") print(f"Valid Key: {card.valid_key}") @@ -179,19 +179,19 @@ def _execute(self, card) -> int: print("\nDecrypt command completed successfully!") return 0 - except cryptnoxpy.exceptions.SeedException: + except cryptnox_sdk_py.exceptions.SeedException: print("Error: No seed/key loaded") print("Please load a seed first: cryptnox seed") return -1 - except cryptnoxpy.exceptions.PinException: + except cryptnox_sdk_py.exceptions.PinException: print("Error: PIN is not correct") print("Please provide the correct PIN") return -1 - except cryptnoxpy.exceptions.DataValidationException as e: + except cryptnox_sdk_py.exceptions.DataValidationException as e: print(f"Error: Data validation failed - {e}") print("Please check your input parameters") return -1 - except cryptnoxpy.exceptions.SecureChannelException: + except cryptnox_sdk_py.exceptions.SecureChannelException: print("Error: Secure channel communication failed") print("Please ensure the card is properly connected and authenticated") return -1 diff --git a/cryptnoxpro/command/erc_token/__init__.py b/cryptnox_cli/command/erc_token/__init__.py similarity index 100% rename from cryptnoxpro/command/erc_token/__init__.py rename to cryptnox_cli/command/erc_token/__init__.py diff --git a/cryptnoxpro/command/erc_token/contract.py b/cryptnox_cli/command/erc_token/contract.py similarity index 96% rename from cryptnoxpro/command/erc_token/contract.py rename to cryptnox_cli/command/erc_token/contract.py index 16e743e..ced31a5 100644 --- a/cryptnoxpro/command/erc_token/contract.py +++ b/cryptnox_cli/command/erc_token/contract.py @@ -11,7 +11,7 @@ from pathlib import Path from typing import Tuple, Union -import cryptnoxpy +import cryptnox_sdk_py import requests import web3 from tabulate import tabulate @@ -64,7 +64,7 @@ def gas(gas_price: int, set_price: int, set_limit: int, def transfer(card, endpoint, network, api_key, contract_address: str, to: str, amount: float, price: int, limit: int, - derivation: cryptnoxpy.Derivation = cryptnoxpy.Derivation.CURRENT_KEY) -> int: + derivation: cryptnox_sdk_py.Derivation = cryptnox_sdk_py.Derivation.CURRENT_KEY) -> int: try: endpoint = wallet.Api(endpoint, network, api_key) @@ -81,7 +81,7 @@ def transfer(card, endpoint, network, api_key, contract_address: str, to: str, a print(error.args[0]) return -1 - path = wallet.Api.PATH if derivation != cryptnoxpy.Derivation.CURRENT_KEY else "" + path = wallet.Api.PATH if derivation != cryptnox_sdk_py.Derivation.CURRENT_KEY else "" public_key = card.get_public_key(derivation, path=path, compressed=False) address = wallet.checksum_address(public_key) diff --git a/cryptnoxpro/command/erc_token/info.py b/cryptnox_cli/command/erc_token/info.py similarity index 94% rename from cryptnoxpro/command/erc_token/info.py rename to cryptnox_cli/command/erc_token/info.py index d7ab224..204dd2b 100644 --- a/cryptnoxpro/command/erc_token/info.py +++ b/cryptnox_cli/command/erc_token/info.py @@ -10,7 +10,7 @@ import secrets from pathlib import Path -import cryptnoxpy +import cryptnox_sdk_py import cryptography.exceptions from argparse import Namespace from cryptography.hazmat.primitives import hashes @@ -32,9 +32,9 @@ from wallet import eth _SEED_SOURCE_TRANSLATION = { - cryptnoxpy.SeedSource.NO_SEED: "No seed", - cryptnoxpy.SeedSource.INTERNAL: "Single card", - cryptnoxpy.SeedSource.DUAL: "Dual card", + cryptnox_sdk_py.SeedSource.NO_SEED: "No seed", + cryptnox_sdk_py.SeedSource.INTERNAL: "Single card", + cryptnox_sdk_py.SeedSource.DUAL: "Dual card", } _ERC_PATH = Path(__file__).parent.parent.parent.joinpath("contract_abi") @@ -55,7 +55,7 @@ def __init__(self, data: Namespace, cards: CardManager = None): self._cards = cards or CardManager(self.data.verbose if "verbose" in self.data else False) self.serial_number = None - def execute(self, card: cryptnoxpy.Card) -> int: + def execute(self, card: cryptnox_sdk_py.Card) -> int: slots = [] for i in range(0, 4): slots.append(gzip.decompress(card.user_data[i])) @@ -90,16 +90,16 @@ def execute(self, card: cryptnoxpy.Card) -> int: Info._owner(endpoint, slot0['contract_address'], abi, address, slot0['token_id']) print("----------------------------------------------\n\n") - if seed_source == cryptnoxpy.SeedSource.DUAL: + if seed_source == cryptnox_sdk_py.SeedSource.DUAL: index = card.connection.index serial_number = card.serial_number del self._cards[index] input("Please, insert card pair that was used for dual initialization and press ENTER.") card = self._cards[index] while True: - if not isinstance(card, cryptnoxpy.card.Nft): + if not isinstance(card, cryptnox_sdk_py.card.Nft): print("This card is not an NFT card") - elif card.seed_source != cryptnoxpy.SeedSource.DUAL: + elif card.seed_source != cryptnox_sdk_py.SeedSource.DUAL: print("This card is not dual initialized") elif card.serial_number == serial_number: print("This is the same card as the first check was done on.") @@ -165,7 +165,7 @@ def _balance(endpoint, address): print(f"Error getting balance: {error}") @staticmethod - def _history_counter(card: cryptnoxpy.Card): + def _history_counter(card: cryptnox_sdk_py.Card): print("Checking signature counter and history...") signature_counter = card.signing_counter history = [] @@ -182,7 +182,7 @@ def _history_counter(card: cryptnoxpy.Card): print("No history entries.") @staticmethod - def _private_key_check(card: cryptnoxpy.Card, public_key: bytes): + def _private_key_check(card: cryptnox_sdk_py.Card, public_key: bytes): print("Checking private key on the card...") nonce = secrets.token_bytes(nbytes=16) diff --git a/cryptnoxpro/command/erc_token/initialize.py b/cryptnox_cli/command/erc_token/initialize.py similarity index 94% rename from cryptnoxpro/command/erc_token/initialize.py rename to cryptnox_cli/command/erc_token/initialize.py index 5999d51..e2089bb 100644 --- a/cryptnoxpro/command/erc_token/initialize.py +++ b/cryptnox_cli/command/erc_token/initialize.py @@ -12,7 +12,7 @@ from typing import List from urllib import parse -import cryptnoxpy +import cryptnox_sdk_py import requests from ..helper import ui @@ -30,7 +30,7 @@ def __init__(self, data: Namespace, cards: CardManager = None): self._cards = cards or CardManager(self.data.verbose if "verbose" in self.data else False) self.serial_number = None - def execute(self, card: cryptnoxpy.Card) -> int: + def execute(self, card: cryptnox_sdk_py.Card) -> int: if card.initialized: print("Card already initialized.") return 1 @@ -92,7 +92,7 @@ def execute(self, card: cryptnoxpy.Card) -> int: return 0 - def _dual_seed(self, card: cryptnoxpy.Card, init_data, nfc_sign, slots: List[str]): + def _dual_seed(self, card: cryptnox_sdk_py.Card, init_data, nfc_sign, slots: List[str]): serial_number = card.serial_number card.verify_pin(init_data.pin) first_pair = card.dual_seed_public_key(init_data.pin) @@ -101,13 +101,13 @@ def _dual_seed(self, card: cryptnoxpy.Card, init_data, nfc_sign, slots: List[str input("Please, insert card pair that will be used for dual initialization and press ENTER.") dual_card = self._cards[index] while True: - if not isinstance(dual_card, cryptnoxpy.card.Nft): + if not isinstance(dual_card, cryptnox_sdk_py.card.Nft): print("This card is not an NFT card") elif dual_card.serial_number == serial_number: print("This is the same card as the first check was done on.") elif dual_card.initialized: print("This card is already initialized.") - elif dual_card.seed_source != cryptnoxpy.SeedSource.NO_SEED: + elif dual_card.seed_source != cryptnox_sdk_py.SeedSource.NO_SEED: print("This card has a seed.") else: break @@ -133,7 +133,7 @@ def _dual_seed(self, card: cryptnoxpy.Card, init_data, nfc_sign, slots: List[str if self.data.easy_mode: print("Card is in easy mode.\n\nPress enter for all pin and puk prompts.\n") - def _init_card(self, card: cryptnoxpy.Card, init_data: ui.InitData, nfc_sign: bool, + def _init_card(self, card: cryptnox_sdk_py.Card, init_data: ui.InitData, nfc_sign: bool, slots: List[str]): print("\nInitializing the applet\n") card.init(init_data.name, init_data.email, init_data.pin, init_data.puk, nfc_sign=nfc_sign) @@ -171,7 +171,7 @@ def _nft_slots() -> List[str]: ] @staticmethod - def _seed(card: cryptnoxpy.Card, pin_code: str) -> None: + def _seed(card: cryptnox_sdk_py.Card, pin_code: str) -> None: print("Generating seed...") card.generate_seed(pin_code) print("Seed generated") diff --git a/cryptnoxpro/command/eth.py b/cryptnox_cli/command/eth.py similarity index 98% rename from cryptnoxpro/command/eth.py rename to cryptnox_cli/command/eth.py index 4db6ad5..3e2673b 100644 --- a/cryptnoxpro/command/eth.py +++ b/cryptnox_cli/command/eth.py @@ -8,7 +8,7 @@ from decimal import Decimal from typing import Dict, Any, List -import cryptnoxpy +import cryptnox_sdk_py import requests import web3 from argparse import Namespace @@ -412,7 +412,7 @@ def _transact(self, card): return 2 try: - derivation = cryptnoxpy.Derivation[config["eth"]["derivation"]] + derivation = cryptnox_sdk_py.Derivation[config["eth"]["derivation"]] except LookupError: print("Derivation value not valid") return 1 @@ -446,7 +446,7 @@ def _transact(self, card): price, limit = contract.gas(endpoint.gas_price, self.data.price, self.data.limit, contract.LIMIT["contract"]) - path = b"" if derivation == cryptnoxpy.Derivation.CURRENT_KEY else wallet.Api.PATH + path = b"" if derivation == cryptnox_sdk_py.Derivation.CURRENT_KEY else wallet.Api.PATH public_key = card.get_public_key(derivation, path=path, compressed=False) nonce = endpoint.get_transaction_count(wallet.checksum_address(public_key)) @@ -554,7 +554,7 @@ def _send(self, card) -> int: config = get_configuration(card)["eth"] try: - derivation = cryptnoxpy.Derivation[config["derivation"]] + derivation = cryptnox_sdk_py.Derivation[config["derivation"]] except KeyError: print("Derivation is invalid") return 1 @@ -587,7 +587,7 @@ def _send(self, card) -> int: @staticmethod def _send_funds(card, derivation, endpoint, address, amount, price, limit): - path = b"" if derivation == cryptnoxpy.Derivation.CURRENT_KEY else wallet.Api.PATH + path = b"" if derivation == cryptnox_sdk_py.Derivation.CURRENT_KEY else wallet.Api.PATH public_key = card.get_public_key(derivation, path=path, compressed=False) card.derive(path=wallet.Api.PATH) @@ -637,7 +637,7 @@ def _send_funds(card, derivation, endpoint, address, amount, price, limit): def _send_token(self, card): config = get_configuration(card)["eth"] try: - derivation = cryptnoxpy.Derivation[config["derivation"]] + derivation = cryptnox_sdk_py.Derivation[config["derivation"]] except LookupError: print("Derivation value not valid") return 1 diff --git a/cryptnoxpro/command/factory.py b/cryptnox_cli/command/factory.py similarity index 100% rename from cryptnoxpro/command/factory.py rename to cryptnox_cli/command/factory.py diff --git a/cryptnoxpro/command/get_clearpubkey.py b/cryptnox_cli/command/get_clearpubkey.py similarity index 93% rename from cryptnoxpro/command/get_clearpubkey.py rename to cryptnox_cli/command/get_clearpubkey.py index 9a570cf..1f08b29 100644 --- a/cryptnoxpro/command/get_clearpubkey.py +++ b/cryptnox_cli/command/get_clearpubkey.py @@ -2,7 +2,7 @@ """ Module containing command for getting clear public key from the card """ -import cryptnoxpy +import cryptnox_sdk_py from argparse import Namespace from .command import Command @@ -18,7 +18,7 @@ class GetClearpubkey(Command): def _resolve_key_type(self, key_type_value): try: if isinstance(key_type_value, str): - return cryptnoxpy.KeyType[key_type_value.upper()] + return cryptnox_sdk_py.KeyType[key_type_value.upper()] return key_type_value except Exception as error: raise ValueError(f"Invalid key type: {key_type_value}") from error @@ -68,7 +68,7 @@ def _execute(self, card) -> int: print("Getting clear public key from card...") print(f"Key type: {key_type}") - print(f"Path: {path if path else cryptnoxpy.Derivation.CURRENT_KEY}") + print(f"Path: {path if path else cryptnox_sdk_py.Derivation.CURRENT_KEY}") print(f"Compressed: {compressed}") # Enable clear pubkey reading capability if PUK provided @@ -77,7 +77,7 @@ def _execute(self, card) -> int: try: card.set_clearpubkey(True, puk) print("Clear pubkey reading capability enabled") - except cryptnoxpy.exceptions.PukException as error: + except cryptnox_sdk_py.exceptions.PukException as error: print(f"Error: Invalid PUK code - {error}") return -1 except Exception as error: @@ -87,7 +87,7 @@ def _execute(self, card) -> int: # Calculate derivation parameter # For K1: derivation = 0x00 (current key) # For R1: derivation = 0x10 (current key R1) - derivation = 0x00 if key_type == cryptnoxpy.KeyType.K1 else 0x10 + derivation = 0x00 if key_type == cryptnox_sdk_py.KeyType.K1 else 0x10 try: # Get clear public key using get_public_key_clear @@ -106,7 +106,7 @@ def _execute(self, card) -> int: print("This feature requires a compatible card firmware version") return -1 - except cryptnoxpy.exceptions.ReadPublicKeyException as error: + except cryptnox_sdk_py.exceptions.ReadPublicKeyException as error: if "6A88" in str(error): print("Error: Clear pubkey reading capability not enabled") print("Please enable it first with: cryptnox get_clearpubkey --puk 'your_puk'") @@ -126,7 +126,7 @@ def _execute(self, card) -> int: return 0 - except cryptnoxpy.exceptions.SeedException: + except cryptnox_sdk_py.exceptions.SeedException: print("Error: No seed exists on the card. Please initialize the card first.") print("Run: cryptnox init") return -1 diff --git a/cryptnoxpro/command/get_xpub.py b/cryptnox_cli/command/get_xpub.py similarity index 93% rename from cryptnoxpro/command/get_xpub.py rename to cryptnox_cli/command/get_xpub.py index 0acebf9..bddbd99 100644 --- a/cryptnoxpro/command/get_xpub.py +++ b/cryptnox_cli/command/get_xpub.py @@ -4,7 +4,7 @@ """ import binascii import hashlib -import cryptnoxpy +import cryptnox_sdk_py from argparse import Namespace from .command import Command @@ -31,7 +31,7 @@ def _ripemd160(data: bytes) -> bytes: return hashlib.new('ripemd160', data).digest() except ValueError: try: - from cryptnoxpy.cryptos.ripemd import ripemd160 + from cryptnox_sdk_py.cryptos.ripemd import ripemd160 return ripemd160(data) except ImportError: raise RuntimeError("RIPEMD-160 not available") @@ -103,7 +103,7 @@ class GetXpub(Command): def _resolve_key_type(self, key_type_value): try: if isinstance(key_type_value, str): - return cryptnoxpy.KeyType[key_type_value.upper()] + return cryptnox_sdk_py.KeyType[key_type_value.upper()] return key_type_value except Exception as error: raise ValueError(f"Invalid key type: {key_type_value}") from error @@ -115,7 +115,7 @@ def _print_xpub(self, key_type, xpub_hex): :param key_type: The key type (K1 or R1) :param xpub_hex: The extended public key in hex format from the card (106 bytes) """ - print("K1 Extended Public Key" if key_type == cryptnoxpy.KeyType.K1 else "Extended Public Key") + print("K1 Extended Public Key" if key_type == cryptnox_sdk_py.KeyType.K1 else "Extended Public Key") # Convert Cryptnox 106-byte format to standard Base58 xpub success, message, xpub = extended_to_xpub(xpub_hex) @@ -145,7 +145,7 @@ def _execute(self, card) -> int: # Get PUK from command line arguments if provided puk = getattr(self.data, 'puk', '') - if key_type == cryptnoxpy.KeyType.R1: + if key_type == cryptnox_sdk_py.KeyType.R1: print("Cannot get extended public key for R1 key.") else: # For K1 keys, use clear export for xpub (if enabled or PUK provided) @@ -162,10 +162,10 @@ def _execute(self, card) -> int: return 0 - except cryptnoxpy.exceptions.SeedException: + except cryptnox_sdk_py.exceptions.SeedException: print("Error: No seed exists on the card. Please initialize the card first.") return -1 - except cryptnoxpy.exceptions.ReadPublicKeyException as e: + except cryptnox_sdk_py.exceptions.ReadPublicKeyException as e: print(f"Error reading public key: {e}") return -1 except Exception as error: diff --git a/cryptnoxpro/command/helper/__init__.py b/cryptnox_cli/command/helper/__init__.py similarity index 100% rename from cryptnoxpro/command/helper/__init__.py rename to cryptnox_cli/command/helper/__init__.py diff --git a/cryptnoxpro/command/helper/backup.py b/cryptnox_cli/command/helper/backup.py similarity index 100% rename from cryptnoxpro/command/helper/backup.py rename to cryptnox_cli/command/helper/backup.py diff --git a/cryptnoxpro/command/helper/cards.py b/cryptnox_cli/command/helper/cards.py similarity index 89% rename from cryptnoxpro/command/helper/cards.py rename to cryptnox_cli/command/helper/cards.py index 8330c75..f048b50 100644 --- a/cryptnoxpro/command/helper/cards.py +++ b/cryptnox_cli/command/helper/cards.py @@ -16,7 +16,7 @@ ValuesView ) -import cryptnoxpy +import cryptnox_sdk_py from tabulate import tabulate from . import security @@ -27,7 +27,7 @@ import config # Global connection cache to preserve connections across CardManager instances -_GLOBAL_CONNECTIONS: Dict[int, cryptnoxpy.Connection] = {} +_GLOBAL_CONNECTIONS: Dict[int, cryptnox_sdk_py.Connection] = {} class ExitException(Exception): @@ -44,8 +44,8 @@ class TimeoutException(Exception): class CardManager: def __init__(self, debug: bool = False): - self._cards: Dict[int, cryptnoxpy.Card] = {} - self._cards_by_index: Dict[int, cryptnoxpy.Card] = {} + self._cards: Dict[int, cryptnox_sdk_py.Card] = {} + self._cards_by_index: Dict[int, cryptnox_sdk_py.Card] = {} self.debug = debug def __contains__(self, key: int) -> bool: @@ -54,7 +54,7 @@ def __contains__(self, key: int) -> bool: def __delitem__(self, key: int) -> None: self._remove_card(key) - def __getitem__(self, key: int) -> cryptnoxpy.Card: + def __getitem__(self, key: int) -> cryptnox_sdk_py.Card: global _GLOBAL_CONNECTIONS # noqa: F824 if key is None: @@ -110,9 +110,9 @@ def refresh(self, remote: bool = False) -> None: try: self._open_card(index, remote) - except cryptnoxpy.exceptions.ReaderException: + except cryptnox_sdk_py.exceptions.ReaderException: break - except cryptnoxpy.exceptions.CryptnoxException: + except cryptnox_sdk_py.exceptions.CryptnoxException: pass index += 1 @@ -169,12 +169,12 @@ def print_card_list(self, show_warnings: bool = False, print(f"To initialize card run : init\n" f"To initialize card in {security.EASY_MODE_TEXT} run : init -e") - def select_card(self) -> cryptnoxpy.Card: + def select_card(self) -> cryptnox_sdk_py.Card: self.refresh() self.print_card_list(print_with_one_card=True) return self._select_card - def values(self) -> ValuesView[cryptnoxpy.Card]: + def values(self) -> ValuesView[cryptnox_sdk_py.Card]: return self._cards.values() def _index(self, serial_number: int) -> int: @@ -183,7 +183,7 @@ def _index(self, serial_number: int) -> int: return index raise ValueError - def _open_card(self, index: int, remote: bool = False) -> cryptnoxpy.Card: + def _open_card(self, index: int, remote: bool = False) -> cryptnox_sdk_py.Card: global _GLOBAL_CONNECTIONS # noqa: F824 @@ -194,17 +194,17 @@ def _open_card(self, index: int, remote: bool = False) -> cryptnoxpy.Card: if test_response: if index in self._cards_by_index: return self._cards_by_index[index] - except (BaseException, cryptnoxpy.exceptions.ConnectionException): + except (BaseException, cryptnox_sdk_py.exceptions.ConnectionException): # Connection is stale, remove it and create new one del _GLOBAL_CONNECTIONS[index] if index in self._cards_by_index: self._remove_card(self._cards_by_index[index].serial_number) # Create new connection only if needed - connection = cryptnoxpy.Connection(index, self.debug, config.REMOTE_CONNECTIONS, remote) + connection = cryptnox_sdk_py.Connection(index, self.debug, config.REMOTE_CONNECTIONS, remote) _GLOBAL_CONNECTIONS[index] = connection # Cache globally - card = cryptnoxpy.factory.get_card(connection, self.debug) + card = cryptnox_sdk_py.factory.get_card(connection, self.debug) self._cards[card.serial_number] = self._cards_by_index[index] = card return card @@ -230,7 +230,7 @@ def _remove_card(self, key: int) -> None: del _GLOBAL_CONNECTIONS[index] @staticmethod - def printable_flags(card: cryptnoxpy.Card) -> List[str]: + def printable_flags(card: cryptnox_sdk_py.Card) -> List[str]: flags = [] if card.initialized: @@ -249,7 +249,7 @@ def printable_flags(card: cryptnoxpy.Card) -> List[str]: flags.append("extended public key") keys = [] - for slot_index in cryptnoxpy.SlotIndex: + for slot_index in cryptnox_sdk_py.SlotIndex: try: if card.user_key_enabled(slot_index): keys.append(slot_index.name.lower()) @@ -261,9 +261,9 @@ def printable_flags(card: cryptnoxpy.Card) -> List[str]: return flags @property - def _select_card(self) -> cryptnoxpy.Card: + def _select_card(self) -> cryptnox_sdk_py.Card: if not self._cards: - raise cryptnoxpy.exceptions.CardException("No Cryptnox cards have been found") + raise cryptnox_sdk_py.exceptions.CardException("No Cryptnox cards have been found") if len(self._cards) == 1: return list(self._cards_by_index.values())[0] @@ -281,7 +281,7 @@ def _select_card(self) -> cryptnoxpy.Card: return card - def _wait_for_card(self, card_id: int, timeout: int = 30) -> cryptnoxpy.Card: + def _wait_for_card(self, card_id: int, timeout: int = 30) -> cryptnox_sdk_py.Card: description = f"into reader with index {card_id}" if card_id < 100 else \ f"with serial number {card_id}" print(f"Insert card {description} or press CTRL+C to exit") diff --git a/cryptnoxpro/command/helper/config.py b/cryptnox_cli/command/helper/config.py similarity index 87% rename from cryptnoxpro/command/helper/config.py rename to cryptnox_cli/command/helper/config.py index b1e09f8..8dbf6cf 100644 --- a/cryptnoxpro/command/helper/config.py +++ b/cryptnox_cli/command/helper/config.py @@ -6,7 +6,7 @@ from typing import Union -import cryptnoxpy +import cryptnox_sdk_py try: from config import ( @@ -46,12 +46,12 @@ def add_config_sub_parser(sub_parser, crypto_currency: str) -> None: "and key") -def create_config_method(card: cryptnoxpy.Card, key: Union[str, None], value: Union[str, None], +def create_config_method(card: cryptnox_sdk_py.Card, key: Union[str, None], value: Union[str, None], currency_name: str) -> int: """ Create config method for specific cryptocurrency - :param cryptnoxpy.Card card: Card to use for the operation + :param cryptnox_sdk_py.Card card: Card to use for the operation :param key: Key of the configuration dictionary to be edited :param value: Value to be inserted into configuration or None :param currency_name: Name of the crypto for which to create @@ -68,11 +68,11 @@ def create_config_method(card: cryptnoxpy.Card, key: Union[str, None], value: Un return print_section_config(card, currency_name) -def print_config(card: cryptnoxpy.Card, exclude=None) -> None: +def print_config(card: cryptnox_sdk_py.Card, exclude=None) -> None: """ Prints contents of config. - :param cryptnoxpy.Card card: Card to use for the operation + :param cryptnox_sdk_py.Card card: Card to use for the operation :param Dict exclude: Exclude section from printing """ exclude = exclude or ["hidden"] @@ -86,11 +86,11 @@ def print_config(card: cryptnoxpy.Card, exclude=None) -> None: print(f"{key}: {value}" + find_endpoint(section, key, value, " - Read only")) -def print_section_config(card: cryptnoxpy.Card, section: str) -> int: +def print_section_config(card: cryptnox_sdk_py.Card, section: str) -> int: """ Prints contents of a section from configuration. - :param cryptnoxpy.Card card: Card to use for the operation + :param cryptnox_sdk_py.Card card: Card to use for the operation :param section: Section of the configuration file wanted printed :return: Execution status @@ -109,11 +109,11 @@ def print_section_config(card: cryptnoxpy.Card, section: str) -> int: return 0 -def print_key_config(card: cryptnoxpy.Card, section: str, key: str) -> int: +def print_key_config(card: cryptnox_sdk_py.Card, section: str, key: str) -> int: """ Prints key and value from section in config. - :param cryptnoxpy.Card card: Card to use for the operation + :param cryptnox_sdk_py.Card card: Card to use for the operation :param section: Section of the configuration file wanted printed :param key: Name of the parameter we want to change @@ -145,11 +145,11 @@ def find_endpoint(section: str, key: str, value: str, append: str = "") -> str: return "" -def write_config(card: cryptnoxpy.Card, section: str, key: str, value: str) -> int: +def write_config(card: cryptnox_sdk_py.Card, section: str, key: str, value: str) -> int: """ Writes new value at chosen section and key. - :param cryptnoxpy.Card card: Card to use for the operation + :param cryptnox_sdk_py.Card card: Card to use for the operation :param section: Section of the config file to write to :param key: Name of the parameter we want to change :param value: Value we want to insert into the configuration file diff --git a/cryptnoxpro/command/helper/download_folder.py b/cryptnox_cli/command/helper/download_folder.py similarity index 100% rename from cryptnoxpro/command/helper/download_folder.py rename to cryptnox_cli/command/helper/download_folder.py diff --git a/cryptnoxpro/command/helper/helper_methods.py b/cryptnox_cli/command/helper/helper_methods.py similarity index 88% rename from cryptnoxpro/command/helper/helper_methods.py rename to cryptnox_cli/command/helper/helper_methods.py index 64d6caa..576e1ce 100644 --- a/cryptnoxpro/command/helper/helper_methods.py +++ b/cryptnox_cli/command/helper/helper_methods.py @@ -9,7 +9,7 @@ from typing import Any import argparse -import cryptnoxpy +import cryptnox_sdk_py from . import security from .. import user_keys @@ -58,17 +58,17 @@ def exception(self): return argparse.ArgumentTypeError("Must be an integer") -def sign(card: cryptnoxpy.Card, message: bytes, - derivation: cryptnoxpy.Derivation = cryptnoxpy.Derivation.CURRENT_KEY, - key_type: cryptnoxpy.KeyType = cryptnoxpy.KeyType.K1, path: str = "", +def sign(card: cryptnox_sdk_py.Card, message: bytes, + derivation: cryptnox_sdk_py.Derivation = cryptnox_sdk_py.Derivation.CURRENT_KEY, + key_type: cryptnox_sdk_py.KeyType = cryptnox_sdk_py.KeyType.K1, path: str = "", filter_eos: bool = False, pin_code: str = "") -> bytes: """ Open the card with a user key or PIN code and sign the given message in the given card :param crypnoxpy.Card card: Card to use for signature :param bytes message: Message to sign with the card - :param cryptnoxpy.Derivation derivation: Derivation to use when signing - :param cryptnoxpy.KeyType key_type: Key type to use when signing + :param cryptnox_sdk_py.Derivation derivation: Derivation to use when signing + :param cryptnox_sdk_py.KeyType key_type: Key type to use when signing :param str path: Path to use for signature generation :param bool filter_eos: Filter signature to be compatible with eos requirements :param str pin_code: If PIN code is given use it instead of asking for it diff --git a/cryptnoxpro/command/helper/notification.py b/cryptnox_cli/command/helper/notification.py similarity index 100% rename from cryptnoxpro/command/helper/notification.py rename to cryptnox_cli/command/helper/notification.py diff --git a/cryptnoxpro/command/helper/security.py b/cryptnox_cli/command/helper/security.py similarity index 91% rename from cryptnoxpro/command/helper/security.py rename to cryptnox_cli/command/helper/security.py index 2bc6995..b0d65b8 100644 --- a/cryptnoxpro/command/helper/security.py +++ b/cryptnox_cli/command/helper/security.py @@ -5,7 +5,7 @@ import typing from typing import List, Dict -import cryptnoxpy +import cryptnox_sdk_py from .. import user_keys @@ -61,7 +61,7 @@ def check(card, check_seed: bool = True) -> bool: card.check_init() if not card.valid_key and check_seed: - raise cryptnoxpy.exceptions.SeedException("The key is not generated") + raise cryptnox_sdk_py.exceptions.SeedException("The key is not generated") result = False try: @@ -105,7 +105,7 @@ def check_pin_code(card, text: str = "Cryptnox PIN code: ") -> str: try: authorized = _check_pin_code(card, pin_code, not easy_mode) - except cryptnoxpy.exceptions.PinException: + except cryptnox_sdk_py.exceptions.PinException: if easy_mode: print(f"{EASY_MODE_TEXT} PIN doesn't work. Try other PIN code.\n") easy_mode = False @@ -115,7 +115,7 @@ def check_pin_code(card, text: str = "Cryptnox PIN code: ") -> str: return pin_code -def get_pin_code(card: cryptnoxpy.Card, text: str = "Enter PIN code:", +def get_pin_code(card: cryptnox_sdk_py.Card, text: str = "Enter PIN code:", allowed_values: List[str] = None) -> str: """ Get PIN code from the user according to the rules. @@ -138,7 +138,7 @@ def is_easy_mode(card_info: Dict): def process_command_with_puk( - card: cryptnoxpy.Card, + card: cryptnox_sdk_py.Card, function: typing.Callable, *args, **kwargs) -> bool: @@ -155,7 +155,7 @@ def process_command_with_puk( try: result = function(*args, **kwargs, puk=puk_code) - except cryptnoxpy.exceptions.PukException as error: + except cryptnox_sdk_py.exceptions.PukException as error: if easy_mode: print(f"{EASY_MODE_TEXT} PUK doesn't work. Try other PUK code.\n") easy_mode = False @@ -174,7 +174,7 @@ def process_command_with_puk( def _check_pin_code(card, pin_code, handle_exception: bool = True) -> bool: try: card.verify_pin(str(pin_code)) - except cryptnoxpy.exceptions.PinException as error: + except cryptnox_sdk_py.exceptions.PinException as error: if not handle_exception: raise error number_of_retries = error.number_of_retries @@ -188,7 +188,7 @@ def _check_pin_code(card, pin_code, handle_exception: bool = True) -> bool: return True -def get_puk_code(card: cryptnoxpy.Card, text: str = "", allowed_values: List = None) -> str: +def get_puk_code(card: cryptnox_sdk_py.Card, text: str = "", allowed_values: List = None) -> str: """ Get user input for puk code and check if it is valid. @@ -216,7 +216,7 @@ def _get_code( while True: try: validation_method(code) - except cryptnoxpy.exceptions.DataValidationException as error: + except cryptnox_sdk_py.exceptions.DataValidationException as error: print(error, "\n") code = _secret_with_exit(text, required=("" not in allowed_values)) diff --git a/cryptnoxpro/command/helper/seed_backup.py b/cryptnox_cli/command/helper/seed_backup.py similarity index 100% rename from cryptnoxpro/command/helper/seed_backup.py rename to cryptnox_cli/command/helper/seed_backup.py diff --git a/cryptnoxpro/command/helper/ui.py b/cryptnox_cli/command/helper/ui.py similarity index 96% rename from cryptnoxpro/command/helper/ui.py rename to cryptnox_cli/command/helper/ui.py index 8d40aa5..09bc040 100644 --- a/cryptnoxpro/command/helper/ui.py +++ b/cryptnox_cli/command/helper/ui.py @@ -9,12 +9,12 @@ from collections import namedtuple from typing import List, Union, Dict -import cryptnoxpy +import cryptnox_sdk_py from stdiomask import getpass from tabulate import tabulate from . import security -from cryptnoxpro.constants import MAX_PASSPHRASE_LENGTH +from cryptnox_cli.constants import MAX_PASSPHRASE_LENGTH InitData = namedtuple("InitData", ["name", "email", "pin", "puk"]) @@ -80,7 +80,7 @@ def input_type(text, required=True, type_of_input=str): pass -def get_init_data(card: cryptnoxpy.card, easy_mode: bool = False) -> InitData: +def get_init_data(card: cryptnox_sdk_py.card, easy_mode: bool = False) -> InitData: if easy_mode and not confirm("Do you wish to proceed?", f"WARNING: THIS WILL INITIALIZE THE CARD " f"IN {security.EASY_MODE_TEXT.upper()}"): @@ -156,12 +156,12 @@ def _get_name() -> str: "20 chars.") -def _get_pin_code(card: cryptnoxpy.Card) -> str: +def _get_pin_code(card: cryptnox_sdk_py.Card) -> str: return _verify_input(card, security.get_pin_code, f"Set card PIN code ({card.pin_rule}): ", f" Repeat PIN code ({card.pin_rule}): ") -def _get_puk_code(card: cryptnoxpy.Card) -> str: +def _get_puk_code(card: cryptnox_sdk_py.Card) -> str: print(f"For the PUK code: 1) Input your own {card.puk_rule} PUK") print(" 2) Generate a random one ") puk_choice = input_with_exit("> ") @@ -190,7 +190,7 @@ def _get_valid_input(text: str, valid, error: str = "Invalid value") -> str: return user_input -def _verify_input(card: cryptnoxpy.Card, method, text, verify_text, +def _verify_input(card: cryptnox_sdk_py.Card, method, text, verify_text, error: str = "The given values are not the same.") -> str: while True: value = method(card, text) diff --git a/cryptnoxpro/command/history.py b/cryptnox_cli/command/history.py similarity index 100% rename from cryptnoxpro/command/history.py rename to cryptnox_cli/command/history.py diff --git a/cryptnoxpro/command/info.py b/cryptnox_cli/command/info.py similarity index 100% rename from cryptnoxpro/command/info.py rename to cryptnox_cli/command/info.py diff --git a/cryptnoxpro/command/initialize.py b/cryptnox_cli/command/initialize.py similarity index 100% rename from cryptnoxpro/command/initialize.py rename to cryptnox_cli/command/initialize.py diff --git a/cryptnoxpro/command/options/__init__.py b/cryptnox_cli/command/options/__init__.py similarity index 100% rename from cryptnoxpro/command/options/__init__.py rename to cryptnox_cli/command/options/__init__.py diff --git a/cryptnoxpro/command/options/common.py b/cryptnox_cli/command/options/common.py similarity index 100% rename from cryptnoxpro/command/options/common.py rename to cryptnox_cli/command/options/common.py diff --git a/cryptnoxpro/command/options/eth.py b/cryptnox_cli/command/options/eth.py similarity index 100% rename from cryptnoxpro/command/options/eth.py rename to cryptnox_cli/command/options/eth.py diff --git a/cryptnoxpro/command/options/options.py b/cryptnox_cli/command/options/options.py similarity index 99% rename from cryptnoxpro/command/options/options.py rename to cryptnox_cli/command/options/options.py index 047ca41..28fce5e 100644 --- a/cryptnoxpro/command/options/options.py +++ b/cryptnox_cli/command/options/options.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ Module for defining command-line argument parsers and subcommands -for various CryptnoxPro operations including Bitcoin, Ethereum, +for various Cryptnox CLI operations including Bitcoin, Ethereum, and card management commands. """ diff --git a/cryptnoxpro/command/reset.py b/cryptnox_cli/command/reset.py similarity index 90% rename from cryptnoxpro/command/reset.py rename to cryptnox_cli/command/reset.py index f0ac39f..edccd44 100644 --- a/cryptnoxpro/command/reset.py +++ b/cryptnox_cli/command/reset.py @@ -2,7 +2,7 @@ """ Module containing command for resetting content of card to factory default """ -import cryptnoxpy +import cryptnox_sdk_py from .helper import security from .command import Command @@ -22,7 +22,7 @@ class Reset(Command): """ _name = enums.Command.RESET.value - def _execute(self, card: cryptnoxpy.Card) -> int: + def _execute(self, card: cryptnox_sdk_py.Card) -> int: if not card.initialized: print("Card is not initialized. Already cleared.") return 0 diff --git a/cryptnoxpro/command/seed.py b/cryptnox_cli/command/seed.py similarity index 95% rename from cryptnoxpro/command/seed.py rename to cryptnox_cli/command/seed.py index 975046c..4843848 100644 --- a/cryptnoxpro/command/seed.py +++ b/cryptnox_cli/command/seed.py @@ -8,7 +8,7 @@ from pathlib import Path from typing import Union, Tuple -import cryptnoxpy +import cryptnox_sdk_py from tabulate import tabulate from . import user_keys @@ -66,7 +66,7 @@ def _execute(self, card) -> int: return result @staticmethod - def _backup(card: cryptnoxpy.Card, pin_code: str = None, seed: bytes = None, + def _backup(card: cryptnox_sdk_py.Card, pin_code: str = None, seed: bytes = None, passphrase: str = '') -> int: """ Backup seed to AWS KMS and load onto card with optional BIP39 passphrase. @@ -182,7 +182,7 @@ def _backup_service(access_key_id: str = '', secret_access_key: str = '') -> Uni return service @staticmethod - def _chip(card: cryptnoxpy.Card) -> int: + def _chip(card: cryptnox_sdk_py.Card) -> int: """ Generate seed directly in the card's secure chip. @@ -226,7 +226,7 @@ def _credentials(credential_file: Path = None) -> Tuple[str, str]: return access_key_id, secret_access_key - def _dual_seed(self, card: cryptnoxpy.Card) -> int: + def _dual_seed(self, card: cryptnox_sdk_py.Card) -> int: """ Generate the same seed on two cards using secure dual-card generation. @@ -243,7 +243,7 @@ def _dual_seed(self, card: cryptnoxpy.Card) -> int: except NotImplementedError as error: print(error) return -1 - except cryptnoxpy.exceptions.DataValidationException: + except cryptnox_sdk_py.exceptions.DataValidationException: pass print("Dual seed generation process starting...") @@ -295,7 +295,7 @@ def _dual_seed(self, card: cryptnoxpy.Card) -> int: return 0 @staticmethod - def _get_pin_code(card: cryptnoxpy.Card) -> str: + def _get_pin_code(card: cryptnox_sdk_py.Card) -> str: card.check_init() pin_code = "" @@ -305,12 +305,12 @@ def _get_pin_code(card: cryptnoxpy.Card) -> str: pin_code = security.check_pin_code(card) except NotImplementedError: pin_code = security.check_pin_code(card) - elif card.auth_type == cryptnoxpy.AuthType.PIN: + elif card.auth_type == cryptnox_sdk_py.AuthType.PIN: pin_code = security.check_pin_code(card) return pin_code - def _get_second_card(self, index: int, first_card_serial_number: int) -> cryptnoxpy.Card: + def _get_second_card(self, index: int, first_card_serial_number: int) -> cryptnox_sdk_py.Card: while True: card = self._cards[index] if not card.initialized: @@ -331,7 +331,7 @@ def _get_second_card(self, index: int, first_card_serial_number: int) -> cryptno print(f"Second card, {card.serial_number} doesn't have this functionality. " f"Insert another card") input("Press ENTER to continue.") - except cryptnoxpy.exceptions.DataValidationException: + except cryptnox_sdk_py.exceptions.DataValidationException: break else: break @@ -339,7 +339,7 @@ def _get_second_card(self, index: int, first_card_serial_number: int) -> cryptno return card @staticmethod - def _load_mnemonic(card: cryptnoxpy.Card, mnemonic: str, pin_code: str, + def _load_mnemonic(card: cryptnox_sdk_py.Card, mnemonic: str, pin_code: str, passphrase: str = '') -> None: """ Load mnemonic onto card with optional BIP39 passphrase. @@ -355,7 +355,7 @@ def _load_mnemonic(card: cryptnoxpy.Card, mnemonic: str, pin_code: str, card.load_seed(seed, pin_code) @staticmethod - def _recover(card: cryptnoxpy.Card) -> int: + def _recover(card: cryptnox_sdk_py.Card) -> int: """ Recover wallet from BIP39 mnemonic phrase with optional passphrase. @@ -406,7 +406,7 @@ def _remove_credentials(credentials_file: Path, service: backup.AWS) -> None: print('Your credential file and credentials have been deleted.') @staticmethod - def _restore(card: cryptnoxpy.Card) -> int: + def _restore(card: cryptnox_sdk_py.Card) -> int: """ Restore seed from AWS KMS backup with optional BIP39 passphrase. @@ -462,7 +462,7 @@ def _restore(card: cryptnoxpy.Card) -> int: return 0 @staticmethod - def _upload(card: cryptnoxpy.Card) -> int: + def _upload(card: cryptnox_sdk_py.Card) -> int: """ Generate new seed, optionally with BIP39 passphrase, and upload to card. diff --git a/cryptnoxpro/command/server.py b/cryptnox_cli/command/server.py similarity index 95% rename from cryptnoxpro/command/server.py rename to cryptnox_cli/command/server.py index 8967245..0a12a70 100644 --- a/cryptnoxpro/command/server.py +++ b/cryptnox_cli/command/server.py @@ -7,7 +7,7 @@ import types import socket -import cryptnoxpy +import cryptnox_sdk_py from .command import Command @@ -22,7 +22,7 @@ class Server(Command): _HEADER_SIZE = 64 _ENCODING = 'utf-8' - def _execute(self, card: cryptnoxpy) -> int: + def _execute(self, card: cryptnox_sdk_py.Card) -> int: self.sel = selectors.DefaultSelector() self.card = card self._start(self.data.host, self.data.port) @@ -107,7 +107,7 @@ def _process_in_card(self, pickled_data: str) -> bytes: try: response = self.card.connection._reader.send(command) - except cryptnoxpy.exceptions.CryptnoxException as error: + except cryptnox_sdk_py.exceptions.CryptnoxException as error: print(f'Error with card: {error}') return b'' diff --git a/cryptnoxpro/command/transfer.py b/cryptnox_cli/command/transfer.py similarity index 100% rename from cryptnoxpro/command/transfer.py rename to cryptnox_cli/command/transfer.py diff --git a/cryptnoxpro/command/unknown.py b/cryptnox_cli/command/unknown.py similarity index 100% rename from cryptnoxpro/command/unknown.py rename to cryptnox_cli/command/unknown.py diff --git a/cryptnoxpro/command/unlock_pin.py b/cryptnox_cli/command/unlock_pin.py similarity index 100% rename from cryptnoxpro/command/unlock_pin.py rename to cryptnox_cli/command/unlock_pin.py diff --git a/cryptnoxpro/command/user_key.py b/cryptnox_cli/command/user_key.py similarity index 89% rename from cryptnoxpro/command/user_key.py rename to cryptnox_cli/command/user_key.py index 0672310..d9896b1 100644 --- a/cryptnoxpro/command/user_key.py +++ b/cryptnox_cli/command/user_key.py @@ -5,7 +5,7 @@ """ import shutil -import cryptnoxpy +import cryptnox_sdk_py from tabulate import tabulate from . import user_keys @@ -27,7 +27,7 @@ class UserKey(Command): """ _name = enums.Command.USER_KEY.value - def _execute(self, card: cryptnoxpy.Card) -> int: + def _execute(self, card: cryptnox_sdk_py.Card) -> int: if card.type != ord("B"): print("Method not supported with this card type.") return -2 @@ -50,7 +50,7 @@ def _execute(self, card: cryptnoxpy.Card) -> int: return -1 @staticmethod - def _add(card: cryptnoxpy.Card, auth_type: str, description: str = "") -> int: + def _add(card: cryptnox_sdk_py.Card, auth_type: str, description: str = "") -> int: result = -1 if card.user_key_enabled(user_keys.get()[auth_type]): print("Card has already key of this type.") @@ -63,7 +63,7 @@ def _add(card: cryptnoxpy.Card, auth_type: str, description: str = "") -> int: return result @staticmethod - def _delete(card: cryptnoxpy.Card, auth_type: str) -> int: + def _delete(card: cryptnox_sdk_py.Card, auth_type: str) -> int: result = -1 if not card.user_key_enabled(user_keys.get()[auth_type]): print("Target key not found.") @@ -75,7 +75,7 @@ def _delete(card: cryptnoxpy.Card, auth_type: str) -> int: return result - def _list(self, card: cryptnoxpy.Card) -> int: + def _list(self, card: cryptnox_sdk_py.Card) -> int: slots = user_keys.get(card) data = [[name] for name, slot in slots.items() if card.user_key_enabled(slot)] diff --git a/cryptnoxpro/command/user_keys/__init__.py b/cryptnox_cli/command/user_keys/__init__.py similarity index 100% rename from cryptnoxpro/command/user_keys/__init__.py rename to cryptnox_cli/command/user_keys/__init__.py diff --git a/cryptnoxpro/command/user_keys/authentication.py b/cryptnox_cli/command/user_keys/authentication.py similarity index 90% rename from cryptnoxpro/command/user_keys/authentication.py rename to cryptnox_cli/command/user_keys/authentication.py index 69f731a..63f2f6b 100644 --- a/cryptnoxpro/command/user_keys/authentication.py +++ b/cryptnox_cli/command/user_keys/authentication.py @@ -8,7 +8,7 @@ Type ) -import cryptnoxpy +import cryptnox_sdk_py from . import user_key_base @@ -17,7 +17,7 @@ importlib.import_module("." + path.name, package=__package__) -def add(name: str, card: cryptnoxpy.Card, description: str, puk: str) -> bool: +def add(name: str, card: cryptnox_sdk_py.Card, description: str, puk: str) -> bool: """ Add user key defined by name to the card @@ -72,11 +72,11 @@ def add(name: str, card: cryptnoxpy.Card, description: str, puk: str) -> bool: return True -def authenticate(card: cryptnoxpy.Card, message: bytes = b"") -> bool: +def authenticate(card: cryptnox_sdk_py.Card, message: bytes = b"") -> bool: """ Authenticate the card by using a signature from third party - :param cryptnoxpy.Card card: Card to use to authenticate + :param cryptnox_sdk_py.Card card: Card to use to authenticate :param bytes message: Message to sign to open the card, if left empty, challenge-response authentication will be used @@ -117,12 +117,12 @@ def authenticate(card: cryptnoxpy.Card, message: bytes = b"") -> bool: return result -def delete(name: str, card: cryptnoxpy.Card, puk: str) -> bool: +def delete(name: str, card: cryptnox_sdk_py.Card, puk: str) -> bool: """ Delete the key from the card :param str name: Name of the service which to delete - :param cryptnoxpy.Card card: Card to use + :param cryptnox_sdk_py.Card card: Card to use :param str puk: PUK code of card """ try: @@ -150,12 +150,12 @@ def delete(name: str, card: cryptnoxpy.Card, puk: str) -> bool: return True -def get(card: cryptnoxpy.Card = None) -> Dict[str, cryptnoxpy.SlotIndex]: +def get(card: cryptnox_sdk_py.Card = None) -> Dict[str, cryptnox_sdk_py.SlotIndex]: """ Get all user key module names and the slot index they are connected to on the card :return: A dictionary containing names of services with the slot they take on card - :rtype: Dict[str, cryptnoxpy.SlotIndex] + :rtype: Dict[str, cryptnox_sdk_py.SlotIndex] """ user_keys = {} diff --git a/cryptnoxpro/command/user_keys/aws_kms/__init__.py b/cryptnox_cli/command/user_keys/aws_kms/__init__.py similarity index 100% rename from cryptnoxpro/command/user_keys/aws_kms/__init__.py rename to cryptnox_cli/command/user_keys/aws_kms/__init__.py diff --git a/cryptnoxpro/command/user_keys/aws_kms/aws_kms.py b/cryptnox_cli/command/user_keys/aws_kms/aws_kms.py similarity index 98% rename from cryptnoxpro/command/user_keys/aws_kms/aws_kms.py rename to cryptnox_cli/command/user_keys/aws_kms/aws_kms.py index 8dd9a72..56dbe44 100644 --- a/cryptnoxpro/command/user_keys/aws_kms/aws_kms.py +++ b/cryptnox_cli/command/user_keys/aws_kms/aws_kms.py @@ -8,7 +8,7 @@ from typing import Tuple import boto3 -import cryptnoxpy +import cryptnox_sdk_py from botocore.client import BaseClient as AwsClient from botocore.exceptions import ClientError from cryptography.hazmat.backends import default_backend @@ -30,7 +30,7 @@ class AwsKms(UserKey): name = 'aws_kms' description = 'AWS KMS' priority = 200 - slot_index = cryptnoxpy.SlotIndex.EC256R1 + slot_index = cryptnox_sdk_py.SlotIndex.EC256R1 custom_bit = 1 KEY_ID = 'cryptnox_card_open' diff --git a/cryptnoxpro/command/user_keys/hello/__init__.py b/cryptnox_cli/command/user_keys/hello/__init__.py similarity index 100% rename from cryptnoxpro/command/user_keys/hello/__init__.py rename to cryptnox_cli/command/user_keys/hello/__init__.py diff --git a/cryptnoxpro/command/user_keys/hello/exceptions.py b/cryptnox_cli/command/user_keys/hello/exceptions.py similarity index 100% rename from cryptnoxpro/command/user_keys/hello/exceptions.py rename to cryptnox_cli/command/user_keys/hello/exceptions.py diff --git a/cryptnoxpro/command/user_keys/hello/hello.py b/cryptnox_cli/command/user_keys/hello/hello.py similarity index 97% rename from cryptnoxpro/command/user_keys/hello/hello.py rename to cryptnox_cli/command/user_keys/hello/hello.py index 5a5dd03..0e19539 100644 --- a/cryptnoxpro/command/user_keys/hello/hello.py +++ b/cryptnox_cli/command/user_keys/hello/hello.py @@ -11,7 +11,7 @@ import concurrent.futures import sys -import cryptnoxpy +import cryptnox_sdk_py from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization @@ -26,7 +26,7 @@ class Hello(user_key_base.UserKey): name = "hello" description = "Windows Hello" priority = 100 - slot_index = cryptnoxpy.SlotIndex.RSA + slot_index = cryptnox_sdk_py.SlotIndex.RSA custom_bit = 2 def __init__(self, target: str = ""): diff --git a/cryptnoxpro/command/user_keys/hello/windows_hello.py b/cryptnox_cli/command/user_keys/hello/windows_hello.py similarity index 100% rename from cryptnoxpro/command/user_keys/hello/windows_hello.py rename to cryptnox_cli/command/user_keys/hello/windows_hello.py diff --git a/cryptnoxpro/command/user_keys/piv/__init__.py b/cryptnox_cli/command/user_keys/piv/__init__.py similarity index 100% rename from cryptnoxpro/command/user_keys/piv/__init__.py rename to cryptnox_cli/command/user_keys/piv/__init__.py diff --git a/cryptnoxpro/command/user_keys/piv/piv.py b/cryptnox_cli/command/user_keys/piv/piv.py similarity index 97% rename from cryptnoxpro/command/user_keys/piv/piv.py rename to cryptnox_cli/command/user_keys/piv/piv.py index d61cc17..06b00cb 100644 --- a/cryptnoxpro/command/user_keys/piv/piv.py +++ b/cryptnox_cli/command/user_keys/piv/piv.py @@ -4,7 +4,7 @@ """ from hashlib import sha256 -import cryptnoxpy +import cryptnox_sdk_py from cryptography import x509 from cryptography.hazmat.primitives.serialization import PublicFormat, Encoding from stdiomask import getpass @@ -19,7 +19,7 @@ class Piv(user_key_base.UserKey): """ name = "piv" description = "PIV applet" - slot_index = cryptnoxpy.SlotIndex.EC256R1 + slot_index = cryptnox_sdk_py.SlotIndex.EC256R1 custom_bit = 0 def delete(self): diff --git a/cryptnoxpro/command/user_keys/piv/piv_card.py b/cryptnox_cli/command/user_keys/piv/piv_card.py similarity index 100% rename from cryptnoxpro/command/user_keys/piv/piv_card.py rename to cryptnox_cli/command/user_keys/piv/piv_card.py diff --git a/cryptnoxpro/command/user_keys/user_key_base.py b/cryptnox_cli/command/user_keys/user_key_base.py similarity index 91% rename from cryptnoxpro/command/user_keys/user_key_base.py rename to cryptnox_cli/command/user_keys/user_key_base.py index 108f31f..ed9f143 100644 --- a/cryptnoxpro/command/user_keys/user_key_base.py +++ b/cryptnox_cli/command/user_keys/user_key_base.py @@ -4,7 +4,7 @@ """ import abc -import cryptnoxpy +import cryptnox_sdk_py class UserKeyException(Exception): @@ -89,10 +89,10 @@ def sign(self, message: bytes) -> bytes: @property @abc.abstractmethod - def slot_index(self) -> cryptnoxpy.SlotIndex: + def slot_index(self) -> cryptnox_sdk_py.SlotIndex: """ :return: Compatible slot index on the card - :rtype: cryptnoxpy.SlotIndex + :rtype: cryptnox_sdk_py.SlotIndex """ @property @@ -121,11 +121,11 @@ def __subclasshook__(cls, c): return NotImplemented @classmethod - def enabled(cls, card: cryptnoxpy.Card) -> bool: + def enabled(cls, card: cryptnox_sdk_py.Card) -> bool: return card.user_key_enabled(cls.slot_index) and cls._custom_bit_enabled(card) @classmethod - def _custom_bit_enabled(cls, card: cryptnoxpy.Card) -> bool: + def _custom_bit_enabled(cls, card: cryptnox_sdk_py.Card) -> bool: try: return cls.custom_bit == -1 or card.custom_bits[cls.custom_bit] except IndexError: diff --git a/cryptnoxpro/config.py b/cryptnox_cli/config.py similarity index 81% rename from cryptnoxpro/config.py rename to cryptnox_cli/config.py index 63323ac..254d122 100644 --- a/cryptnoxpro/config.py +++ b/cryptnox_cli/config.py @@ -9,7 +9,7 @@ Dict ) -import cryptnoxpy +import cryptnox_sdk_py try: from command.helper import helper_methods @@ -48,11 +48,11 @@ def get_default_configuration() -> Dict: return config -def get_configuration(card: cryptnoxpy.Card) -> Dict: +def get_configuration(card: cryptnox_sdk_py.Card) -> Dict: """ Get the configuration. - :param cryptnoxpy.Card card: Serial number of the card used + :param cryptnox_sdk_py.Card card: Serial number of the card used :return: Configuration from file or default configuration if not found :rtype: dict @@ -67,11 +67,11 @@ def get_configuration(card: cryptnoxpy.Card) -> Dict: return config -def save_to_config(card: cryptnoxpy.Card, config: Dict[str, Any]) -> None: +def save_to_config(card: cryptnox_sdk_py.Card, config: Dict[str, Any]) -> None: """ Save given configuration to file. - :param cryptnoxpy.Card card: Serial number of the card used + :param cryptnox_sdk_py.Card card: Serial number of the card used :param Dict[str, Any] config: Configuration to save """ _CONFIGURATION[card.serial_number] = config @@ -79,11 +79,11 @@ def save_to_config(card: cryptnoxpy.Card, config: Dict[str, Any]) -> None: card.user_data[0] = gzip.compress(bytes(json.dumps(config), "UTF-8")) -def read_card_config(card: cryptnoxpy.Card) -> Dict: +def read_card_config(card: cryptnox_sdk_py.Card) -> Dict: """ Reads the configuration. - :param cryptnoxpy.Card card: Serial number of the card used + :param cryptnox_sdk_py.Card card: Serial number of the card used :return: Configuration read from the file :rtype: dict diff --git a/cryptnox_cli/constants.py b/cryptnox_cli/constants.py new file mode 100644 index 0000000..0719a60 --- /dev/null +++ b/cryptnox_cli/constants.py @@ -0,0 +1,5 @@ +""" +Centralized constants for the Cryptnox CLI. +""" + +MAX_PASSPHRASE_LENGTH = 100 diff --git a/cryptnoxpro/contract_abi/erc1155.json b/cryptnox_cli/contract_abi/erc1155.json similarity index 100% rename from cryptnoxpro/contract_abi/erc1155.json rename to cryptnox_cli/contract_abi/erc1155.json diff --git a/cryptnoxpro/contract_abi/erc20.json b/cryptnox_cli/contract_abi/erc20.json similarity index 100% rename from cryptnoxpro/contract_abi/erc20.json rename to cryptnox_cli/contract_abi/erc20.json diff --git a/cryptnoxpro/contract_abi/erc721.json b/cryptnox_cli/contract_abi/erc721.json similarity index 100% rename from cryptnoxpro/contract_abi/erc721.json rename to cryptnox_cli/contract_abi/erc721.json diff --git a/cryptnoxpro/enums.py b/cryptnox_cli/enums.py similarity index 100% rename from cryptnoxpro/enums.py rename to cryptnox_cli/enums.py diff --git a/cryptnoxpro/interactive_cli.py b/cryptnox_cli/interactive_cli.py similarity index 97% rename from cryptnoxpro/interactive_cli.py rename to cryptnox_cli/interactive_cli.py index ff281af..bafec0f 100644 --- a/cryptnoxpro/interactive_cli.py +++ b/cryptnox_cli/interactive_cli.py @@ -9,7 +9,7 @@ from typing import List import argparse -import cryptnoxpy +import cryptnox_sdk_py try: import config @@ -358,7 +358,7 @@ def _use(self, serial_index): self._card_info = self._cards.select_card().info else: self._card_info = self._cards[serial_index - 1].info - except (cryptnoxpy.exceptions.CryptnoxException, ExitException, TimeoutException) as error: + except (cryptnox_sdk_py.exceptions.CryptnoxException, ExitException, TimeoutException) as error: print(error) return @@ -380,7 +380,7 @@ def _prompt(self) -> str: except TypeError: serial = "" - card = "cryptnoxpro" if large_screen else "cryptnox" + card = "cryptnox_cli" if large_screen else "cryptnox" try: commands = [f"{subcommand} > " for subcommand in self.subcommand] @@ -417,7 +417,7 @@ def _run_command(self, args: argparse.Namespace, to_always_run: List = None) -> self._card_info = self._cards[command.serial_number].info except KeyError: pass - except (cryptnoxpy.exceptions.CryptnoxException, ExitException, TimeoutException) as error: + except (cryptnox_sdk_py.exceptions.CryptnoxException, ExitException, TimeoutException) as error: print(error) print("\n") @@ -425,7 +425,7 @@ def _run_command(self, args: argparse.Namespace, to_always_run: List = None) -> def _prepare_parser(self) -> None: self.parser = UsageParser(description="Cryptnox command line interface") self.parser.add_argument(" version", action="version", - version=f"Cryptnox Pro {self.version}", + version=f"Cryptnox CLI {self.version}", help="Show program's version number") options.add(self.parser, True) diff --git a/cryptnoxpro/lib/__init__.py b/cryptnox_cli/lib/__init__.py similarity index 100% rename from cryptnoxpro/lib/__init__.py rename to cryptnox_cli/lib/__init__.py diff --git a/cryptnoxpro/lib/cryptos/__init__.py b/cryptnox_cli/lib/cryptos/__init__.py similarity index 100% rename from cryptnoxpro/lib/cryptos/__init__.py rename to cryptnox_cli/lib/cryptos/__init__.py diff --git a/cryptnoxpro/lib/cryptos/blocks.py b/cryptnox_cli/lib/cryptos/blocks.py similarity index 100% rename from cryptnoxpro/lib/cryptos/blocks.py rename to cryptnox_cli/lib/cryptos/blocks.py diff --git a/cryptnoxpro/lib/cryptos/coins/__init__.py b/cryptnox_cli/lib/cryptos/coins/__init__.py similarity index 100% rename from cryptnoxpro/lib/cryptos/coins/__init__.py rename to cryptnox_cli/lib/cryptos/coins/__init__.py diff --git a/cryptnoxpro/lib/cryptos/coins/base.py b/cryptnox_cli/lib/cryptos/coins/base.py similarity index 100% rename from cryptnoxpro/lib/cryptos/coins/base.py rename to cryptnox_cli/lib/cryptos/coins/base.py diff --git a/cryptnoxpro/lib/cryptos/coins/bitcoin.py b/cryptnox_cli/lib/cryptos/coins/bitcoin.py similarity index 100% rename from cryptnoxpro/lib/cryptos/coins/bitcoin.py rename to cryptnox_cli/lib/cryptos/coins/bitcoin.py diff --git a/cryptnoxpro/lib/cryptos/composite.py b/cryptnox_cli/lib/cryptos/composite.py similarity index 100% rename from cryptnoxpro/lib/cryptos/composite.py rename to cryptnox_cli/lib/cryptos/composite.py diff --git a/cryptnoxpro/lib/cryptos/constants.py b/cryptnox_cli/lib/cryptos/constants.py similarity index 100% rename from cryptnoxpro/lib/cryptos/constants.py rename to cryptnox_cli/lib/cryptos/constants.py diff --git a/cryptnoxpro/lib/cryptos/deterministic.py b/cryptnox_cli/lib/cryptos/deterministic.py similarity index 100% rename from cryptnoxpro/lib/cryptos/deterministic.py rename to cryptnox_cli/lib/cryptos/deterministic.py diff --git a/cryptnoxpro/lib/cryptos/english.txt b/cryptnox_cli/lib/cryptos/english.txt similarity index 100% rename from cryptnoxpro/lib/cryptos/english.txt rename to cryptnox_cli/lib/cryptos/english.txt diff --git a/cryptnoxpro/lib/cryptos/keystore.py b/cryptnox_cli/lib/cryptos/keystore.py similarity index 100% rename from cryptnoxpro/lib/cryptos/keystore.py rename to cryptnox_cli/lib/cryptos/keystore.py diff --git a/cryptnoxpro/lib/cryptos/main.py b/cryptnox_cli/lib/cryptos/main.py similarity index 100% rename from cryptnoxpro/lib/cryptos/main.py rename to cryptnox_cli/lib/cryptos/main.py diff --git a/cryptnoxpro/lib/cryptos/mnemonic.py b/cryptnox_cli/lib/cryptos/mnemonic.py similarity index 100% rename from cryptnoxpro/lib/cryptos/mnemonic.py rename to cryptnox_cli/lib/cryptos/mnemonic.py diff --git a/cryptnoxpro/lib/cryptos/pbkdf2.py b/cryptnox_cli/lib/cryptos/pbkdf2.py similarity index 100% rename from cryptnoxpro/lib/cryptos/pbkdf2.py rename to cryptnox_cli/lib/cryptos/pbkdf2.py diff --git a/cryptnoxpro/lib/cryptos/ripemd.py b/cryptnox_cli/lib/cryptos/ripemd.py similarity index 100% rename from cryptnoxpro/lib/cryptos/ripemd.py rename to cryptnox_cli/lib/cryptos/ripemd.py diff --git a/cryptnoxpro/lib/cryptos/segwit_addr.py b/cryptnox_cli/lib/cryptos/segwit_addr.py similarity index 100% rename from cryptnoxpro/lib/cryptos/segwit_addr.py rename to cryptnox_cli/lib/cryptos/segwit_addr.py diff --git a/cryptnoxpro/lib/cryptos/specials.py b/cryptnox_cli/lib/cryptos/specials.py similarity index 100% rename from cryptnoxpro/lib/cryptos/specials.py rename to cryptnox_cli/lib/cryptos/specials.py diff --git a/cryptnoxpro/lib/cryptos/stealth.py b/cryptnox_cli/lib/cryptos/stealth.py similarity index 100% rename from cryptnoxpro/lib/cryptos/stealth.py rename to cryptnox_cli/lib/cryptos/stealth.py diff --git a/cryptnoxpro/lib/cryptos/transaction.py b/cryptnox_cli/lib/cryptos/transaction.py similarity index 100% rename from cryptnoxpro/lib/cryptos/transaction.py rename to cryptnox_cli/lib/cryptos/transaction.py diff --git a/cryptnoxpro/lib/cryptos/wallet.py b/cryptnox_cli/lib/cryptos/wallet.py similarity index 100% rename from cryptnoxpro/lib/cryptos/wallet.py rename to cryptnox_cli/lib/cryptos/wallet.py diff --git a/cryptnoxpro/lib/cryptos/wallet_utils.py b/cryptnox_cli/lib/cryptos/wallet_utils.py similarity index 100% rename from cryptnoxpro/lib/cryptos/wallet_utils.py rename to cryptnox_cli/lib/cryptos/wallet_utils.py diff --git a/cryptnoxpro/main.py b/cryptnox_cli/main.py similarity index 94% rename from cryptnoxpro/main.py rename to cryptnox_cli/main.py index 8a8f2f1..3cd0c2c 100644 --- a/cryptnoxpro/main.py +++ b/cryptnox_cli/main.py @@ -27,14 +27,14 @@ options ) -cryptnoxpy = lazy_import.lazy_module("cryptnoxpy") +cryptnox_sdk_py = lazy_import.lazy_module("cryptnox_sdk_py") json = lazy_import.lazy_module("json") re = lazy_import.lazy_module("re") tabulate = lazy_import.lazy_callable("tabulate.tabulate") requests = lazy_import.lazy_module("requests") web3 = lazy_import.lazy_module("web3") -APPLICATION_NAME = "Cryptnox Pro" +APPLICATION_NAME = "Cryptnox CLI" def get_parser() -> argparse.ArgumentParser: @@ -46,7 +46,7 @@ def get_parser() -> argparse.ArgumentParser: """ parser = interactive_cli.ErrorParser(description="Cryptnox command line interface.") - parser.add_argument("-v", "--version", action="version", version=f"Cryptnox Pro {__version__}") + parser.add_argument("-v", "--version", action="version", version=f"Cryptnox CLI {__version__}") parser.add_argument("--verbose", action="store_true", help="Turn on logging") parser.add_argument('--port', nargs='?', type=int, default=None, help='Define port to enable remote feature') @@ -88,7 +88,7 @@ def main() -> int: print("This is something we haven't foreseen. Please, help us in making the application " "better by reporting this issue.") traceback.print_exc() - path = Path(user_log_dir('cryptnoxpro', 'cryptnox')) + path = Path(user_log_dir('cryptnox-cli', 'cryptnox')) makedirs(path, exist_ok=True) error_file = path.joinpath("error.log") try: diff --git a/cryptnoxpro/wallet/__init__.py b/cryptnox_cli/wallet/__init__.py similarity index 100% rename from cryptnoxpro/wallet/__init__.py rename to cryptnox_cli/wallet/__init__.py diff --git a/cryptnoxpro/wallet/btc.py b/cryptnox_cli/wallet/btc.py similarity index 99% rename from cryptnoxpro/wallet/btc.py rename to cryptnox_cli/wallet/btc.py index 0814329..2e671c4 100644 --- a/cryptnoxpro/wallet/btc.py +++ b/cryptnox_cli/wallet/btc.py @@ -10,7 +10,7 @@ from enum import Enum from typing import Union, List, Dict -from cryptnoxpy import Derivation +from cryptnox_sdk_py import Derivation from tabulate import tabulate from .validators import EnumValidator, IntValidator diff --git a/cryptnoxpro/wallet/eth/__init__.py b/cryptnox_cli/wallet/eth/__init__.py similarity index 100% rename from cryptnoxpro/wallet/eth/__init__.py rename to cryptnox_cli/wallet/eth/__init__.py diff --git a/cryptnoxpro/wallet/eth/api.py b/cryptnox_cli/wallet/eth/api.py similarity index 99% rename from cryptnoxpro/wallet/eth/api.py rename to cryptnox_cli/wallet/eth/api.py index 8fc1eee..631d3ca 100644 --- a/cryptnoxpro/wallet/eth/api.py +++ b/cryptnox_cli/wallet/eth/api.py @@ -8,7 +8,7 @@ ) import ecdsa -from cryptnoxpy import Derivation +from cryptnox_sdk_py import Derivation from eth_account._utils.legacy_transactions import ( encode_transaction, serializable_unsigned_transaction_from_dict diff --git a/cryptnoxpro/wallet/eth/endpoint.py b/cryptnox_cli/wallet/eth/endpoint.py similarity index 100% rename from cryptnoxpro/wallet/eth/endpoint.py rename to cryptnox_cli/wallet/eth/endpoint.py diff --git a/cryptnoxpro/wallet/validators.py b/cryptnox_cli/wallet/validators.py similarity index 100% rename from cryptnoxpro/wallet/validators.py rename to cryptnox_cli/wallet/validators.py diff --git a/cryptnoxpro/constants.py b/cryptnoxpro/constants.py deleted file mode 100644 index e8d9894..0000000 --- a/cryptnoxpro/constants.py +++ /dev/null @@ -1,5 +0,0 @@ -""" -Centralized constants for the Cryptnox Pro CLI. -""" - -MAX_PASSPHRASE_LENGTH = 100 diff --git a/dev-requirements.txt b/dev-requirements.txt index b905ff0455cf3edd49de9e326006811c7a8326d6..5283d093aabf94581391bc32a04ba10d7988cc8d 100644 GIT binary patch delta 40 scmZp$>$2OB#w)GMP|T3Rkjk delta 30 hcmeCOYp~mp#w%FBP|08mghmW{45lEwxskV15CC=#2Jrv@ diff --git a/docs/cli.rst b/docs/cli.rst index 2029365..992e6ef 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -6,11 +6,11 @@ The ``cryptnox`` command provides a comprehensive CLI for managing Cryptnox card Installation ------------ -After installing the cryptnoxpro package, the ``cryptnox`` command becomes available in your system: +After installing the cryptnox-cli package, the ``cryptnox`` command becomes available in your system: .. code-block:: bash - pip install cryptnoxpro + pip install cryptnox-cli Basic Usage ----------- @@ -547,7 +547,7 @@ In interactive mode, you can: .. code-block:: text $ cryptnox - Cryptnox Pro 2.9.1 + Cryptnox CLI 2.9.1 > list [Shows available cards] @@ -619,7 +619,7 @@ Error Handling When errors occur: - Detailed error messages are displayed - - Errors are logged to: ``~/.local/share/cryptnoxpro/error.log`` (Linux/macOS) or ``%LOCALAPPDATA%\\cryptnox\\cryptnoxpro\\error.log`` (Windows) + - Errors are logged to: ``~/.local/share/cryptnox-cli/error.log`` (Linux/macOS) or ``%LOCALAPPDATA%\\cryptnox\\cryptnox-cli\\error.log`` (Windows) - You can report errors to help improve the application Examples @@ -670,8 +670,8 @@ Examples See Also -------- -- :doc:`overview` - Overview of CryptnoxPro -- :mod:`cryptnoxpro.command.seed` - Seed command implementation details -- :doc:`cryptnoxpro.command` - All command implementations +- :doc:`overview` - Overview of Cryptnox CLI +- :mod:`cryptnox_cli.command.seed` - Seed command implementation details +- :doc:`cryptnox_cli.command` - All command implementations - :doc:`modules` - Complete API Reference diff --git a/docs/conf.py b/docs/conf.py index 0dfd197..f3aac51 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,10 +11,10 @@ sys.path.insert(0, os.path.abspath("..")) -project = 'cryptnoxpro' +project = 'cryptnox-cli' copyright = '2025, Cryptnox' author = 'Cryptnox' -release = '2.9.1' +release = '1.0.0' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -35,8 +35,8 @@ # autodoc_mock_imports - Sphinx will create mock imports for these modules # This is safer than manual sys.modules mocking and prevents hangs autodoc_mock_imports = [ - # Cryptnox - 'cryptnoxpy', + # Cryptnox SDK (PyPI package: cryptnox-sdk-py) + 'cryptnox_sdk_py', # Input/Output 'stdiomask', 'tabulate', diff --git a/docs/cryptnox_cli.command.card.rst b/docs/cryptnox_cli.command.card.rst new file mode 100644 index 0000000..69e1e5b --- /dev/null +++ b/docs/cryptnox_cli.command.card.rst @@ -0,0 +1,44 @@ +cryptnox_cli.command.card package +================================= + +Submodules +---------- + +cryptnox_cli.command.card.info module +------------------------------------ + +.. automodule:: cryptnox_cli.command.card.info + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.command.card.initialize module +------------------------------------------ + +.. automodule:: cryptnox_cli.command.card.initialize + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnox_cli.command.card + :members: + :undoc-members: + :show-inheritance: + +The ``cryptnox_cli.command.card`` package provides card management functionality and exports: + +.. py:currentmodule:: cryptnox_cli.command.card + +.. py:class:: Info + :no-index: + + Command class for displaying card information. See :class:`cryptnox_cli.command.card.info.Info` for details. + +.. py:class:: Initialize + :no-index: + + Command class for initializing cards. See :class:`cryptnox_cli.command.card.initialize.Initialize` for details. + diff --git a/docs/cryptnoxpro.command.erc_token.rst b/docs/cryptnox_cli.command.erc_token.rst similarity index 50% rename from docs/cryptnoxpro.command.erc_token.rst rename to docs/cryptnox_cli.command.erc_token.rst index 1717487..7318428 100644 --- a/docs/cryptnoxpro.command.erc_token.rst +++ b/docs/cryptnox_cli.command.erc_token.rst @@ -1,29 +1,29 @@ -cryptnoxpro.command.erc\_token package +cryptnox_cli.command.erc\_token package ====================================== Submodules ---------- -cryptnoxpro.command.erc\_token.contract module +cryptnox_cli.command.erc\_token.contract module ---------------------------------------------- -.. automodule:: cryptnoxpro.command.erc_token.contract +.. automodule:: cryptnox_cli.command.erc_token.contract :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.erc\_token.info module +cryptnox_cli.command.erc\_token.info module ------------------------------------------ -.. automodule:: cryptnoxpro.command.erc_token.info +.. automodule:: cryptnox_cli.command.erc_token.info :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.erc\_token.initialize module +cryptnox_cli.command.erc\_token.initialize module ------------------------------------------------ -.. automodule:: cryptnoxpro.command.erc_token.initialize +.. automodule:: cryptnox_cli.command.erc_token.initialize :members: :undoc-members: :show-inheritance: @@ -31,22 +31,22 @@ cryptnoxpro.command.erc\_token.initialize module Module contents --------------- -.. automodule:: cryptnoxpro.command.erc_token +.. automodule:: cryptnox_cli.command.erc_token :members: :undoc-members: :show-inheritance: -The ``cryptnoxpro.command.erc_token`` package provides ERC token management and exports: +The ``cryptnox_cli.command.erc_token`` package provides ERC token management and exports: -.. py:currentmodule:: cryptnoxpro.command.erc_token +.. py:currentmodule:: cryptnox_cli.command.erc_token .. py:class:: Info :no-index: - Command class for displaying ERC token information. See :class:`cryptnoxpro.command.erc_token.info.Info` for details. + Command class for displaying ERC token information. See :class:`cryptnox_cli.command.erc_token.info.Info` for details. .. py:class:: Initialize :no-index: - Command class for initializing ERC tokens. See :class:`cryptnoxpro.command.erc_token.initialize.Initialize` for details. + Command class for initializing ERC tokens. See :class:`cryptnox_cli.command.erc_token.initialize.Initialize` for details. diff --git a/docs/cryptnoxpro.command.helper.rst b/docs/cryptnox_cli.command.helper.rst similarity index 52% rename from docs/cryptnoxpro.command.helper.rst rename to docs/cryptnox_cli.command.helper.rst index f0434e5..41d083c 100644 --- a/docs/cryptnoxpro.command.helper.rst +++ b/docs/cryptnox_cli.command.helper.rst @@ -1,77 +1,77 @@ -cryptnoxpro.command.helper package +cryptnox_cli.command.helper package =================================== Submodules ---------- -cryptnoxpro.command.helper.backup module +cryptnox_cli.command.helper.backup module ---------------------------------------- -.. automodule:: cryptnoxpro.command.helper.backup +.. automodule:: cryptnox_cli.command.helper.backup :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.cards module +cryptnox_cli.command.helper.cards module --------------------------------------- -.. automodule:: cryptnoxpro.command.helper.cards +.. automodule:: cryptnox_cli.command.helper.cards :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.config module +cryptnox_cli.command.helper.config module ---------------------------------------- -.. automodule:: cryptnoxpro.command.helper.config +.. automodule:: cryptnox_cli.command.helper.config :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.download\_folder module +cryptnox_cli.command.helper.download\_folder module -------------------------------------------------- -.. automodule:: cryptnoxpro.command.helper.download_folder +.. automodule:: cryptnox_cli.command.helper.download_folder :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.helper\_methods module +cryptnox_cli.command.helper.helper\_methods module ------------------------------------------------- -.. automodule:: cryptnoxpro.command.helper.helper_methods +.. automodule:: cryptnox_cli.command.helper.helper_methods :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.notification module +cryptnox_cli.command.helper.notification module ---------------------------------------------- -.. automodule:: cryptnoxpro.command.helper.notification +.. automodule:: cryptnox_cli.command.helper.notification :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.security module +cryptnox_cli.command.helper.security module ------------------------------------------ -.. automodule:: cryptnoxpro.command.helper.security +.. automodule:: cryptnox_cli.command.helper.security :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.seed\_backup module +cryptnox_cli.command.helper.seed\_backup module ---------------------------------------------- -.. automodule:: cryptnoxpro.command.helper.seed_backup +.. automodule:: cryptnox_cli.command.helper.seed_backup :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.ui module +cryptnox_cli.command.helper.ui module ------------------------------------ -.. automodule:: cryptnoxpro.command.helper.ui +.. automodule:: cryptnox_cli.command.helper.ui :members: :undoc-members: :show-inheritance: @@ -79,12 +79,12 @@ cryptnoxpro.command.helper.ui module Module contents --------------- -.. automodule:: cryptnoxpro.command.helper +.. automodule:: cryptnox_cli.command.helper :members: :undoc-members: :show-inheritance: -The ``cryptnoxpro.command.helper`` package provides utility functions and helper modules for command implementations. +The ``cryptnox_cli.command.helper`` package provides utility functions and helper modules for command implementations. This package contains shared functionality used across multiple commands, including user interface components, security helpers, configuration management, and backup utilities. diff --git a/docs/cryptnoxpro.command.options.rst b/docs/cryptnox_cli.command.options.rst similarity index 50% rename from docs/cryptnoxpro.command.options.rst rename to docs/cryptnox_cli.command.options.rst index 232bcfb..c74db58 100644 --- a/docs/cryptnoxpro.command.options.rst +++ b/docs/cryptnox_cli.command.options.rst @@ -1,29 +1,29 @@ -cryptnoxpro.command.options package +cryptnox_cli.command.options package ==================================== Submodules ---------- -cryptnoxpro.command.options.common module +cryptnox_cli.command.options.common module ----------------------------------------- -.. automodule:: cryptnoxpro.command.options.common +.. automodule:: cryptnox_cli.command.options.common :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.options.eth module +cryptnox_cli.command.options.eth module -------------------------------------- -.. automodule:: cryptnoxpro.command.options.eth +.. automodule:: cryptnox_cli.command.options.eth :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.options.options module +cryptnox_cli.command.options.options module ------------------------------------------ -.. automodule:: cryptnoxpro.command.options.options +.. automodule:: cryptnox_cli.command.options.options :members: :undoc-members: :show-inheritance: @@ -31,17 +31,17 @@ cryptnoxpro.command.options.options module Module contents --------------- -.. automodule:: cryptnoxpro.command.options +.. automodule:: cryptnox_cli.command.options :members: :undoc-members: :show-inheritance: -The ``cryptnoxpro.command.options`` package provides command-line argument parsing and exports: +The ``cryptnox_cli.command.options`` package provides command-line argument parsing and exports: -.. py:currentmodule:: cryptnoxpro.command.options +.. py:currentmodule:: cryptnox_cli.command.options .. py:function:: add(subparsers, command_class) :no-index: - Add command-line options for a command class. See :func:`cryptnoxpro.command.options.options.add` for details. + Add command-line options for a command class. See :func:`cryptnox_cli.command.options.options.add` for details. diff --git a/docs/cryptnoxpro.command.rst b/docs/cryptnox_cli.command.rst similarity index 51% rename from docs/cryptnoxpro.command.rst rename to docs/cryptnox_cli.command.rst index f04e52f..d8ce5f7 100644 --- a/docs/cryptnoxpro.command.rst +++ b/docs/cryptnox_cli.command.rst @@ -1,4 +1,4 @@ -cryptnoxpro.command package +cryptnox_cli.command package ============================ Subpackages @@ -7,187 +7,187 @@ Subpackages .. toctree:: :maxdepth: 4 - cryptnoxpro.command.card - cryptnoxpro.command.erc_token - cryptnoxpro.command.helper - cryptnoxpro.command.options - cryptnoxpro.command.user_keys + cryptnox_cli.command.card + cryptnox_cli.command.erc_token + cryptnox_cli.command.helper + cryptnox_cli.command.options + cryptnox_cli.command.user_keys Submodules ---------- -cryptnoxpro.command.btc module +cryptnox_cli.command.btc module ------------------------------ -.. automodule:: cryptnoxpro.command.btc +.. automodule:: cryptnox_cli.command.btc :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.card\_configuration module +cryptnox_cli.command.card\_configuration module ---------------------------------------------- -.. automodule:: cryptnoxpro.command.card_configuration +.. automodule:: cryptnox_cli.command.card_configuration :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.cards module +cryptnox_cli.command.cards module -------------------------------- -.. automodule:: cryptnoxpro.command.cards +.. automodule:: cryptnox_cli.command.cards :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.change\_pin module +cryptnox_cli.command.change\_pin module -------------------------------------- -.. automodule:: cryptnoxpro.command.change_pin +.. automodule:: cryptnox_cli.command.change_pin :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.change\_puk module +cryptnox_cli.command.change\_puk module -------------------------------------- -.. automodule:: cryptnoxpro.command.change_puk +.. automodule:: cryptnox_cli.command.change_puk :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.command module +cryptnox_cli.command.command module ---------------------------------- -.. automodule:: cryptnoxpro.command.command +.. automodule:: cryptnox_cli.command.command :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.config module +cryptnox_cli.command.config module --------------------------------- -.. automodule:: cryptnoxpro.command.config +.. automodule:: cryptnox_cli.command.config :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.decrypt module +cryptnox_cli.command.decrypt module ---------------------------------- -.. automodule:: cryptnoxpro.command.decrypt +.. automodule:: cryptnox_cli.command.decrypt :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.eth module +cryptnox_cli.command.eth module ------------------------------ -.. automodule:: cryptnoxpro.command.eth +.. automodule:: cryptnox_cli.command.eth :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.factory module +cryptnox_cli.command.factory module ---------------------------------- -.. automodule:: cryptnoxpro.command.factory +.. automodule:: cryptnox_cli.command.factory :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.get\_clearpubkey module +cryptnox_cli.command.get\_clearpubkey module ------------------------------------------- -.. automodule:: cryptnoxpro.command.get_clearpubkey +.. automodule:: cryptnox_cli.command.get_clearpubkey :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.get\_xpub module +cryptnox_cli.command.get\_xpub module ------------------------------------ -.. automodule:: cryptnoxpro.command.get_xpub +.. automodule:: cryptnox_cli.command.get_xpub :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.history module +cryptnox_cli.command.history module ---------------------------------- -.. automodule:: cryptnoxpro.command.history +.. automodule:: cryptnox_cli.command.history :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.info module +cryptnox_cli.command.info module ------------------------------- -.. automodule:: cryptnoxpro.command.info +.. automodule:: cryptnox_cli.command.info :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.initialize module +cryptnox_cli.command.initialize module ------------------------------------- -.. automodule:: cryptnoxpro.command.initialize +.. automodule:: cryptnox_cli.command.initialize :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.reset module +cryptnox_cli.command.reset module -------------------------------- -.. automodule:: cryptnoxpro.command.reset +.. automodule:: cryptnox_cli.command.reset :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.seed module +cryptnox_cli.command.seed module ------------------------------- -.. automodule:: cryptnoxpro.command.seed +.. automodule:: cryptnox_cli.command.seed :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.server module +cryptnox_cli.command.server module --------------------------------- -.. automodule:: cryptnoxpro.command.server +.. automodule:: cryptnox_cli.command.server :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.transfer module +cryptnox_cli.command.transfer module ----------------------------------- -.. automodule:: cryptnoxpro.command.transfer +.. automodule:: cryptnox_cli.command.transfer :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.unknown module +cryptnox_cli.command.unknown module ---------------------------------- -.. automodule:: cryptnoxpro.command.unknown +.. automodule:: cryptnox_cli.command.unknown :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.unlock\_pin module +cryptnox_cli.command.unlock\_pin module -------------------------------------- -.. automodule:: cryptnoxpro.command.unlock_pin +.. automodule:: cryptnox_cli.command.unlock_pin :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.user\_key module +cryptnox_cli.command.user\_key module ------------------------------------ -.. automodule:: cryptnoxpro.command.user_key +.. automodule:: cryptnox_cli.command.user_key :members: :undoc-members: :show-inheritance: @@ -195,11 +195,11 @@ cryptnoxpro.command.user\_key module Module contents --------------- -.. automodule:: cryptnoxpro.command +.. automodule:: cryptnox_cli.command :members: :undoc-members: :show-inheritance: -The ``cryptnoxpro.command`` package provides command-line interface commands for interacting with Cryptnox cards. +The ``cryptnox_cli.command`` package provides command-line interface commands for interacting with Cryptnox cards. This package contains all command implementations that can be executed from the CLI. diff --git a/docs/cryptnoxpro.command.user_keys.aws_kms.rst b/docs/cryptnox_cli.command.user_keys.aws_kms.rst similarity index 54% rename from docs/cryptnoxpro.command.user_keys.aws_kms.rst rename to docs/cryptnox_cli.command.user_keys.aws_kms.rst index 2c339c5..06b0bfc 100644 --- a/docs/cryptnoxpro.command.user_keys.aws_kms.rst +++ b/docs/cryptnox_cli.command.user_keys.aws_kms.rst @@ -1,13 +1,13 @@ -cryptnoxpro.command.user\_keys.aws\_kms package +cryptnox_cli.command.user\_keys.aws\_kms package ================================================ Submodules ---------- -cryptnoxpro.command.user\_keys.aws\_kms.aws\_kms module +cryptnox_cli.command.user\_keys.aws\_kms.aws\_kms module ------------------------------------------------------- -.. automodule:: cryptnoxpro.command.user_keys.aws_kms.aws_kms +.. automodule:: cryptnox_cli.command.user_keys.aws_kms.aws_kms :members: :undoc-members: :show-inheritance: @@ -15,7 +15,7 @@ cryptnoxpro.command.user\_keys.aws\_kms.aws\_kms module Module contents --------------- -.. automodule:: cryptnoxpro.command.user_keys.aws_kms +.. automodule:: cryptnox_cli.command.user_keys.aws_kms :members: :undoc-members: :show-inheritance: diff --git a/docs/cryptnoxpro.command.user_keys.hello.rst b/docs/cryptnox_cli.command.user_keys.hello.rst similarity index 51% rename from docs/cryptnoxpro.command.user_keys.hello.rst rename to docs/cryptnox_cli.command.user_keys.hello.rst index 7ce2e4e..81759ff 100644 --- a/docs/cryptnoxpro.command.user_keys.hello.rst +++ b/docs/cryptnox_cli.command.user_keys.hello.rst @@ -1,29 +1,29 @@ -cryptnoxpro.command.user\_keys.hello package +cryptnox_cli.command.user\_keys.hello package ============================================= Submodules ---------- -cryptnoxpro.command.user\_keys.hello.exceptions module +cryptnox_cli.command.user\_keys.hello.exceptions module ------------------------------------------------------ -.. automodule:: cryptnoxpro.command.user_keys.hello.exceptions +.. automodule:: cryptnox_cli.command.user_keys.hello.exceptions :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.user\_keys.hello.hello module +cryptnox_cli.command.user\_keys.hello.hello module ------------------------------------------------- -.. automodule:: cryptnoxpro.command.user_keys.hello.hello +.. automodule:: cryptnox_cli.command.user_keys.hello.hello :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.user\_keys.hello.windows\_hello module +cryptnox_cli.command.user\_keys.hello.windows\_hello module ---------------------------------------------------------- -.. automodule:: cryptnoxpro.command.user_keys.hello.windows_hello +.. automodule:: cryptnox_cli.command.user_keys.hello.windows_hello :members: :undoc-members: :show-inheritance: @@ -31,7 +31,7 @@ cryptnoxpro.command.user\_keys.hello.windows\_hello module Module contents --------------- -.. automodule:: cryptnoxpro.command.user_keys.hello +.. automodule:: cryptnox_cli.command.user_keys.hello :members: :undoc-members: :show-inheritance: diff --git a/docs/cryptnoxpro.command.user_keys.piv.rst b/docs/cryptnox_cli.command.user_keys.piv.rst similarity index 54% rename from docs/cryptnoxpro.command.user_keys.piv.rst rename to docs/cryptnox_cli.command.user_keys.piv.rst index 3c0f5f7..44953e0 100644 --- a/docs/cryptnoxpro.command.user_keys.piv.rst +++ b/docs/cryptnox_cli.command.user_keys.piv.rst @@ -1,21 +1,21 @@ -cryptnoxpro.command.user\_keys.piv package +cryptnox_cli.command.user\_keys.piv package =========================================== Submodules ---------- -cryptnoxpro.command.user\_keys.piv.piv module +cryptnox_cli.command.user\_keys.piv.piv module --------------------------------------------- -.. automodule:: cryptnoxpro.command.user_keys.piv.piv +.. automodule:: cryptnox_cli.command.user_keys.piv.piv :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.user\_keys.piv.piv\_card module +cryptnox_cli.command.user\_keys.piv.piv\_card module --------------------------------------------------- -.. automodule:: cryptnoxpro.command.user_keys.piv.piv_card +.. automodule:: cryptnox_cli.command.user_keys.piv.piv_card :members: :undoc-members: :show-inheritance: @@ -23,7 +23,7 @@ cryptnoxpro.command.user\_keys.piv.piv\_card module Module contents --------------- -.. automodule:: cryptnoxpro.command.user_keys.piv +.. automodule:: cryptnox_cli.command.user_keys.piv :members: :undoc-members: :show-inheritance: diff --git a/docs/cryptnox_cli.command.user_keys.rst b/docs/cryptnox_cli.command.user_keys.rst new file mode 100644 index 0000000..b28edd9 --- /dev/null +++ b/docs/cryptnox_cli.command.user_keys.rst @@ -0,0 +1,64 @@ +cryptnox_cli.command.user\_keys package +======================================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + cryptnox_cli.command.user_keys.aws_kms + cryptnox_cli.command.user_keys.hello + cryptnox_cli.command.user_keys.piv + +Submodules +---------- + +cryptnox_cli.command.user\_keys.authentication module +---------------------------------------------------- + +.. automodule:: cryptnox_cli.command.user_keys.authentication + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.command.user\_keys.user\_key\_base module +----------------------------------------------------- + +.. automodule:: cryptnox_cli.command.user_keys.user_key_base + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnox_cli.command.user_keys + :members: + :undoc-members: + :show-inheritance: + +The ``cryptnox_cli.command.user_keys`` package provides authentication functionality and exports: + +.. py:currentmodule:: cryptnox_cli.command.user_keys + +.. py:function:: add(data) + :no-index: + + Add a new authentication method. See :func:`cryptnox_cli.command.user_keys.authentication.add` for details. + +.. py:function:: authenticate(data) + :no-index: + + Authenticate using a configured method. See :func:`cryptnox_cli.command.user_keys.authentication.authenticate` for details. + +.. py:function:: delete(data) + :no-index: + + Delete an authentication method. See :func:`cryptnox_cli.command.user_keys.authentication.delete` for details. + +.. py:function:: get(data) + :no-index: + + Get information about authentication methods. See :func:`cryptnox_cli.command.user_keys.authentication.get` for details. + diff --git a/docs/cryptnox_cli.lib.cryptos.coins.rst b/docs/cryptnox_cli.lib.cryptos.coins.rst new file mode 100644 index 0000000..d3e54a6 --- /dev/null +++ b/docs/cryptnox_cli.lib.cryptos.coins.rst @@ -0,0 +1,39 @@ +cryptnox_cli.lib.cryptos.coins package +====================================== + +Submodules +---------- + +cryptnox_cli.lib.cryptos.coins.base module +----------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.coins.base + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.coins.bitcoin module +-------------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.coins.bitcoin + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnox_cli.lib.cryptos.coins + :members: + :undoc-members: + :show-inheritance: + +The ``cryptnox_cli.lib.cryptos.coins`` package provides cryptocurrency coin implementations and exports: + +.. py:currentmodule:: cryptnox_cli.lib.cryptos.coins + +.. py:class:: Bitcoin + :no-index: + + Bitcoin cryptocurrency implementation. See :class:`cryptnox_cli.lib.cryptos.coins.bitcoin.Bitcoin` for details. + diff --git a/docs/cryptnox_cli.lib.cryptos.rst b/docs/cryptnox_cli.lib.cryptos.rst new file mode 100644 index 0000000..84b5f5b --- /dev/null +++ b/docs/cryptnox_cli.lib.cryptos.rst @@ -0,0 +1,158 @@ +cryptnox_cli.lib.cryptos package +================================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + cryptnox_cli.lib.cryptos.coins + +Submodules +---------- + +cryptnox_cli.lib.cryptos.blocks module +------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.blocks + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.composite module +---------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.composite + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.constants module +---------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.constants + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.deterministic module +-------------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.deterministic + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.keystore module +--------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.keystore + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.main module +----------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.main + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.mnemonic module +--------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.mnemonic + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.pbkdf2 module +------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.pbkdf2 + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.ripemd module +------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.ripemd + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.segwit\_addr module +------------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.segwit_addr + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.specials module +--------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.specials + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.stealth module +-------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.stealth + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.transaction module +------------------------------------------ + +.. automodule:: cryptnox_cli.lib.cryptos.transaction + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.wallet module +------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.wallet + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.wallet\_utils module +-------------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.wallet_utils + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnox_cli.lib.cryptos + :members: + :undoc-members: + :show-inheritance: + +The ``cryptnox_cli.lib.cryptos`` package provides cryptocurrency utilities and re-exports functionality from: + +* :mod:`cryptnox_cli.lib.cryptos.blocks` - Block-related utilities +* :mod:`cryptnox_cli.lib.cryptos.composite` - Composite key handling +* :mod:`cryptnox_cli.lib.cryptos.deterministic` - Deterministic wallet functions +* :mod:`cryptnox_cli.lib.cryptos.main` - Main crypto operations +* :mod:`cryptnox_cli.lib.cryptos.mnemonic` - Mnemonic phrase handling +* :mod:`cryptnox_cli.lib.cryptos.specials` - Special cryptocurrency operations +* :mod:`cryptnox_cli.lib.cryptos.stealth` - Stealth address support +* :mod:`cryptnox_cli.lib.cryptos.transaction` - Transaction handling +* :mod:`cryptnox_cli.lib.cryptos.coins` - Coin implementations +* :mod:`cryptnox_cli.lib.cryptos.keystore` - Key storage utilities +* :mod:`cryptnox_cli.lib.cryptos.wallet` - Wallet functionality + +All public members from these modules are available directly from ``cryptnox_cli.lib.cryptos``. + diff --git a/docs/cryptnox_cli.lib.rst b/docs/cryptnox_cli.lib.rst new file mode 100644 index 0000000..6ae6a24 --- /dev/null +++ b/docs/cryptnox_cli.lib.rst @@ -0,0 +1,22 @@ +cryptnox_cli.lib package +======================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + cryptnox_cli.lib.cryptos + +Module contents +--------------- + +.. automodule:: cryptnox_cli.lib + :members: + :undoc-members: + :show-inheritance: + +The ``cryptnox_cli.lib`` package provides library functionality for cryptocurrency operations. +The main subpackage is :mod:`cryptnox_cli.lib.cryptos` which contains comprehensive cryptocurrency utilities. + diff --git a/docs/cryptnoxpro.rst b/docs/cryptnox_cli.rst similarity index 51% rename from docs/cryptnoxpro.rst rename to docs/cryptnox_cli.rst index 4d48527..6ee2810 100644 --- a/docs/cryptnoxpro.rst +++ b/docs/cryptnox_cli.rst @@ -1,5 +1,5 @@ -cryptnoxpro package -=================== +cryptnox_cli package (Cryptnox CLI) +=================================== Subpackages ----------- @@ -7,49 +7,49 @@ Subpackages .. toctree:: :maxdepth: 4 - cryptnoxpro.command - cryptnoxpro.lib - cryptnoxpro.wallet + cryptnox_cli.command + cryptnox_cli.lib + cryptnox_cli.wallet Submodules ---------- -cryptnoxpro.config module +cryptnox_cli.config module ------------------------- -.. automodule:: cryptnoxpro.config +.. automodule:: cryptnox_cli.config :members: :undoc-members: :show-inheritance: -cryptnoxpro.enums module +cryptnox_cli.enums module ------------------------ -.. automodule:: cryptnoxpro.enums +.. automodule:: cryptnox_cli.enums :members: :undoc-members: :show-inheritance: -cryptnoxpro.constants module +cryptnox_cli.constants module ---------------------------- -.. automodule:: cryptnoxpro.constants +.. automodule:: cryptnox_cli.constants :members: :undoc-members: :show-inheritance: -cryptnoxpro.interactive\_cli module +cryptnox_cli.interactive\_cli module ----------------------------------- -.. automodule:: cryptnoxpro.interactive_cli +.. automodule:: cryptnox_cli.interactive_cli :members: :undoc-members: :show-inheritance: -cryptnoxpro.main module +cryptnox_cli.main module ----------------------- -.. automodule:: cryptnoxpro.main +.. automodule:: cryptnox_cli.main :members: :undoc-members: :show-inheritance: @@ -57,16 +57,16 @@ cryptnoxpro.main module Module contents --------------- -.. automodule:: cryptnoxpro +.. automodule:: cryptnox_cli :members: :undoc-members: :show-inheritance: -The main ``cryptnoxpro`` package exports: +The main ``cryptnox_cli`` package (Cryptnox CLI) exports: .. py:data:: __version__ :type: str :value: "2.9.1" - Current version of the CryptnoxPro package. + Current version of the Cryptnox CLI package. diff --git a/docs/cryptnoxpro.wallet.eth.rst b/docs/cryptnox_cli.wallet.eth.rst similarity index 54% rename from docs/cryptnoxpro.wallet.eth.rst rename to docs/cryptnox_cli.wallet.eth.rst index 7537fed..6cb05fc 100644 --- a/docs/cryptnoxpro.wallet.eth.rst +++ b/docs/cryptnox_cli.wallet.eth.rst @@ -1,21 +1,21 @@ -cryptnoxpro.wallet.eth package +cryptnox_cli.wallet.eth package =============================== Submodules ---------- -cryptnoxpro.wallet.eth.api module +cryptnox_cli.wallet.eth.api module ---------------------------------- -.. automodule:: cryptnoxpro.wallet.eth.api +.. automodule:: cryptnox_cli.wallet.eth.api :members: :undoc-members: :show-inheritance: -cryptnoxpro.wallet.eth.endpoint module +cryptnox_cli.wallet.eth.endpoint module --------------------------------------- -.. automodule:: cryptnoxpro.wallet.eth.endpoint +.. automodule:: cryptnox_cli.wallet.eth.endpoint :members: :undoc-members: :show-inheritance: @@ -23,32 +23,32 @@ cryptnoxpro.wallet.eth.endpoint module Module contents --------------- -.. automodule:: cryptnoxpro.wallet.eth +.. automodule:: cryptnox_cli.wallet.eth :members: :undoc-members: :show-inheritance: -The ``cryptnoxpro.wallet.eth`` package provides Ethereum wallet utilities and exports: +The ``cryptnox_cli.wallet.eth`` package provides Ethereum wallet utilities and exports: -.. py:currentmodule:: cryptnoxpro.wallet.eth +.. py:currentmodule:: cryptnox_cli.wallet.eth .. py:function:: address(public_key) :no-index: - Generate an Ethereum address from a public key. See :func:`cryptnoxpro.wallet.eth.api.address` for details. + Generate an Ethereum address from a public key. See :func:`cryptnox_cli.wallet.eth.api.address` for details. .. py:class:: Api :no-index: - Ethereum API interface. See :class:`cryptnoxpro.wallet.eth.api.Api` for details. + Ethereum API interface. See :class:`cryptnox_cli.wallet.eth.api.Api` for details. .. py:function:: checksum_address(address_str) :no-index: - Convert an address to checksummed format. See :func:`cryptnoxpro.wallet.eth.api.checksum_address` for details. + Convert an address to checksummed format. See :func:`cryptnox_cli.wallet.eth.api.checksum_address` for details. .. py:class:: EthValidator :no-index: - Ethereum address and transaction validator. See :class:`cryptnoxpro.wallet.eth.api.EthValidator` for details. + Ethereum address and transaction validator. See :class:`cryptnox_cli.wallet.eth.api.EthValidator` for details. diff --git a/docs/cryptnoxpro.wallet.rst b/docs/cryptnox_cli.wallet.rst similarity index 57% rename from docs/cryptnoxpro.wallet.rst rename to docs/cryptnox_cli.wallet.rst index 843535b..aa4cb84 100644 --- a/docs/cryptnoxpro.wallet.rst +++ b/docs/cryptnox_cli.wallet.rst @@ -1,4 +1,4 @@ -cryptnoxpro.wallet package +cryptnox_cli.wallet package =========================== Subpackages @@ -7,23 +7,23 @@ Subpackages .. toctree:: :maxdepth: 4 - cryptnoxpro.wallet.eth + cryptnox_cli.wallet.eth Submodules ---------- -cryptnoxpro.wallet.btc module +cryptnox_cli.wallet.btc module ------------------------------ -.. automodule:: cryptnoxpro.wallet.btc +.. automodule:: cryptnox_cli.wallet.btc :members: :undoc-members: :show-inheritance: -cryptnoxpro.wallet.validators module +cryptnox_cli.wallet.validators module ------------------------------------- -.. automodule:: cryptnoxpro.wallet.validators +.. automodule:: cryptnox_cli.wallet.validators :members: :undoc-members: :show-inheritance: @@ -31,11 +31,11 @@ cryptnoxpro.wallet.validators module Module contents --------------- -.. automodule:: cryptnoxpro.wallet +.. automodule:: cryptnox_cli.wallet :members: :undoc-members: :show-inheritance: -The ``cryptnoxpro.wallet`` package provides wallet functionality for various cryptocurrencies. +The ``cryptnox_cli.wallet`` package provides wallet functionality for various cryptocurrencies. It includes Bitcoin wallet operations, Ethereum wallet utilities, and validation functions. diff --git a/docs/cryptnoxpro.command.card.rst b/docs/cryptnoxpro.command.card.rst deleted file mode 100644 index 2084c6d..0000000 --- a/docs/cryptnoxpro.command.card.rst +++ /dev/null @@ -1,44 +0,0 @@ -cryptnoxpro.command.card package -================================= - -Submodules ----------- - -cryptnoxpro.command.card.info module ------------------------------------- - -.. automodule:: cryptnoxpro.command.card.info - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.command.card.initialize module ------------------------------------------- - -.. automodule:: cryptnoxpro.command.card.initialize - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: cryptnoxpro.command.card - :members: - :undoc-members: - :show-inheritance: - -The ``cryptnoxpro.command.card`` package provides card management functionality and exports: - -.. py:currentmodule:: cryptnoxpro.command.card - -.. py:class:: Info - :no-index: - - Command class for displaying card information. See :class:`cryptnoxpro.command.card.info.Info` for details. - -.. py:class:: Initialize - :no-index: - - Command class for initializing cards. See :class:`cryptnoxpro.command.card.initialize.Initialize` for details. - diff --git a/docs/cryptnoxpro.command.user_keys.rst b/docs/cryptnoxpro.command.user_keys.rst deleted file mode 100644 index 94133ff..0000000 --- a/docs/cryptnoxpro.command.user_keys.rst +++ /dev/null @@ -1,64 +0,0 @@ -cryptnoxpro.command.user\_keys package -======================================= - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - cryptnoxpro.command.user_keys.aws_kms - cryptnoxpro.command.user_keys.hello - cryptnoxpro.command.user_keys.piv - -Submodules ----------- - -cryptnoxpro.command.user\_keys.authentication module ----------------------------------------------------- - -.. automodule:: cryptnoxpro.command.user_keys.authentication - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.command.user\_keys.user\_key\_base module ------------------------------------------------------ - -.. automodule:: cryptnoxpro.command.user_keys.user_key_base - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: cryptnoxpro.command.user_keys - :members: - :undoc-members: - :show-inheritance: - -The ``cryptnoxpro.command.user_keys`` package provides authentication functionality and exports: - -.. py:currentmodule:: cryptnoxpro.command.user_keys - -.. py:function:: add(data) - :no-index: - - Add a new authentication method. See :func:`cryptnoxpro.command.user_keys.authentication.add` for details. - -.. py:function:: authenticate(data) - :no-index: - - Authenticate using a configured method. See :func:`cryptnoxpro.command.user_keys.authentication.authenticate` for details. - -.. py:function:: delete(data) - :no-index: - - Delete an authentication method. See :func:`cryptnoxpro.command.user_keys.authentication.delete` for details. - -.. py:function:: get(data) - :no-index: - - Get information about authentication methods. See :func:`cryptnoxpro.command.user_keys.authentication.get` for details. - diff --git a/docs/cryptnoxpro.lib.cryptos.coins.rst b/docs/cryptnoxpro.lib.cryptos.coins.rst deleted file mode 100644 index a19a6b9..0000000 --- a/docs/cryptnoxpro.lib.cryptos.coins.rst +++ /dev/null @@ -1,39 +0,0 @@ -cryptnoxpro.lib.cryptos.coins package -====================================== - -Submodules ----------- - -cryptnoxpro.lib.cryptos.coins.base module ------------------------------------------ - -.. automodule:: cryptnoxpro.lib.cryptos.coins.base - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.coins.bitcoin module --------------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.coins.bitcoin - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: cryptnoxpro.lib.cryptos.coins - :members: - :undoc-members: - :show-inheritance: - -The ``cryptnoxpro.lib.cryptos.coins`` package provides cryptocurrency coin implementations and exports: - -.. py:currentmodule:: cryptnoxpro.lib.cryptos.coins - -.. py:class:: Bitcoin - :no-index: - - Bitcoin cryptocurrency implementation. See :class:`cryptnoxpro.lib.cryptos.coins.bitcoin.Bitcoin` for details. - diff --git a/docs/cryptnoxpro.lib.cryptos.rst b/docs/cryptnoxpro.lib.cryptos.rst deleted file mode 100644 index b7a8289..0000000 --- a/docs/cryptnoxpro.lib.cryptos.rst +++ /dev/null @@ -1,158 +0,0 @@ -cryptnoxpro.lib.cryptos package -================================ - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - cryptnoxpro.lib.cryptos.coins - -Submodules ----------- - -cryptnoxpro.lib.cryptos.blocks module -------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.blocks - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.composite module ----------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.composite - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.constants module ----------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.constants - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.deterministic module --------------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.deterministic - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.keystore module ---------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.keystore - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.main module ------------------------------------ - -.. automodule:: cryptnoxpro.lib.cryptos.main - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.mnemonic module ---------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.mnemonic - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.pbkdf2 module -------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.pbkdf2 - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.ripemd module -------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.ripemd - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.segwit\_addr module -------------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.segwit_addr - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.specials module ---------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.specials - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.stealth module --------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.stealth - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.transaction module ------------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.transaction - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.wallet module -------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.wallet - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.wallet\_utils module --------------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.wallet_utils - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: cryptnoxpro.lib.cryptos - :members: - :undoc-members: - :show-inheritance: - -The ``cryptnoxpro.lib.cryptos`` package provides cryptocurrency utilities and re-exports functionality from: - -* :mod:`cryptnoxpro.lib.cryptos.blocks` - Block-related utilities -* :mod:`cryptnoxpro.lib.cryptos.composite` - Composite key handling -* :mod:`cryptnoxpro.lib.cryptos.deterministic` - Deterministic wallet functions -* :mod:`cryptnoxpro.lib.cryptos.main` - Main crypto operations -* :mod:`cryptnoxpro.lib.cryptos.mnemonic` - Mnemonic phrase handling -* :mod:`cryptnoxpro.lib.cryptos.specials` - Special cryptocurrency operations -* :mod:`cryptnoxpro.lib.cryptos.stealth` - Stealth address support -* :mod:`cryptnoxpro.lib.cryptos.transaction` - Transaction handling -* :mod:`cryptnoxpro.lib.cryptos.coins` - Coin implementations -* :mod:`cryptnoxpro.lib.cryptos.keystore` - Key storage utilities -* :mod:`cryptnoxpro.lib.cryptos.wallet` - Wallet functionality - -All public members from these modules are available directly from ``cryptnoxpro.lib.cryptos``. - diff --git a/docs/cryptnoxpro.lib.rst b/docs/cryptnoxpro.lib.rst deleted file mode 100644 index 541ae76..0000000 --- a/docs/cryptnoxpro.lib.rst +++ /dev/null @@ -1,22 +0,0 @@ -cryptnoxpro.lib package -======================= - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - cryptnoxpro.lib.cryptos - -Module contents ---------------- - -.. automodule:: cryptnoxpro.lib - :members: - :undoc-members: - :show-inheritance: - -The ``cryptnoxpro.lib`` package provides library functionality for cryptocurrency operations. -The main subpackage is :mod:`cryptnoxpro.lib.cryptos` which contains comprehensive cryptocurrency utilities. - diff --git a/docs/index.rst b/docs/index.rst index ea6d915..e62e9c3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,7 +1,7 @@ -Cryptnoxpro Documentation -========================= +Cryptnox CLI Documentation +========================== -Welcome to the technical documentation of Cryptnoxpro. +Welcome to the technical documentation of Cryptnox CLI. .. toctree:: :maxdepth: 2 diff --git a/docs/modules.rst b/docs/modules.rst index 68e5b1b..c240d48 100644 --- a/docs/modules.rst +++ b/docs/modules.rst @@ -4,5 +4,4 @@ API Reference .. toctree:: :maxdepth: 4 - cryptnoxpro - + cryptnox_cli diff --git a/docs/overview.rst b/docs/overview.rst index 027224f..ff82135 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -1,5 +1,5 @@ -Cryptnoxpro Overview -==================== +Cryptnox CLI Overview +===================== .. include:: ../README.rst diff --git a/requirements.txt b/requirements.txt index 3450bb166df91bccf9b23a13494267fac204fb95..67bb9f4294cd5f2618260a90cbdaddc236814e0e 100644 GIT binary patch delta 332 zcmWlSze@rE9L2wPda0*(>YYD8$|Rye@XQ7Y!6hOZ#N;>*5r?R#A+WeCQkq00L?U}2 z5fM${5ai_4&?Nl<4*dbq&?F8G2GPmm1CRF}yhi*+xlXoMciQ)Ad!%85*+!QM=@X3=CLcxH3>V|D13JbIQABGz({r(HUvDjiVT)CwuIY?8o>b!&dw8C0QTDpQG$ z=$vA7LVM;uW@Z({g)~%d9k*N&Kim!qGkr+58alQX7VVE1*qcxtb$mE#DDs#1;u|PA zbqt(!WL%r*xEcrxDhy!>cY=nI5XG#h!4Opp#3;t5ABz$S?hLx_9478Jym~@5e)>+Q zNLXczJ!?pMbzFHhe43=BD*93$9{B-1c>zONWqAB@bC@_3ocR6SI82T@u O1~ha7EhK{(mZyKocW?** delta 450 zcmX}o&r1SP5C`zLzcO9l`dbeY5fNd5TY*W%(xpp>5Rr%o5%FLUWn@tn9wJI2BB>ENML^jCz32#M&}Utr%ch-E(vGmrOX<~Dj^)@CJs6U%{m3Vg3hTv$>T-b=&q zSsH;IDFGugc_>q+E+^rayap|09o{JgsHg{F&KxYqw%9StGYj7gi?S*F(~OI2H8J*A z-(w}V%l6q0E3hL(rT?=roQ;XBZi;zr33ryYGsI=3.11,<=3.13.7 packages = find: -packages_dir = cryptnoxpro +packages_dir = cryptnox_cli zip_safe = False include_package_data = True install_requires = @@ -45,7 +45,7 @@ install_requires = boto3 ecdsa colander - cryptnoxpy>=2.0.0 + cryptnox-sdk-py>=1.0.0 lazy-import pytz requests @@ -56,7 +56,7 @@ install_requires = [options.entry_points] console_scripts = - cryptnox = cryptnoxpro.main:main + cryptnox = cryptnox_cli.main:main [options.packages.find] exclude = diff --git a/setup.py b/setup.py index cef5ece..0221e17 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ """ -Configuration for setting up CryptnoxPro CLI application +Configuration for setting up Cryptnox CLI application """ import pathlib diff --git a/setup.spec b/setup.spec index a0d86eb..0fcee10 100644 --- a/setup.spec +++ b/setup.spec @@ -2,12 +2,11 @@ a = Analysis( - ['cryptnoxpro\\main.py'], + ['cryptnox_cli\\main.py'], pathex=[], binaries=[], datas=[ - ('cryptnoxpro', 'cryptnoxpro'), - ('venv/lib/site-packages/lazy_import/VERSION', 'lazy_import/') + ('cryptnox_cli', 'cryptnox_cli') ], hiddenimports=[ 'lazy_import', @@ -44,12 +43,12 @@ exe = EXE( a.binaries, a.datas, [], - name='CryptnoxPro-2.9.1-setup', + name='CryptnoxCLI-1.0.0-setup', icon='cryptnox.ico', debug=False, bootloader_ignore_signals=False, strip=False, - upx=True, + upx=False, upx_exclude=[], runtime_tmpdir=None, console=True, @@ -58,4 +57,5 @@ exe = EXE( target_arch=None, codesign_identity=None, entitlements_file=None, + onefile=False, ) From cf748fe33551de69697f3c471385d80b4c2c0261 Mon Sep 17 00:00:00 2001 From: YanNaingWinn Date: Wed, 19 Nov 2025 00:45:51 +0700 Subject: [PATCH 2/4] Renamed package --- .github/workflows/docs.yml | 18 +- .gitignore | 2 - CHANGELOG.rst | 274 ++---------------- MANIFEST.in | 6 +- Pipfile | 2 +- README.md | 22 +- {cryptnoxpro => cryptnox_cli}/__init__.py | 2 +- .../command/__init__.py | 0 {cryptnoxpro => cryptnox_cli}/command/btc.py | 12 +- .../command/card/__init__.py | 0 .../command/card/info.py | 10 +- .../command/card/initialize.py | 0 .../command/card_configuration.py | 24 +- .../command/cards.py | 0 .../command/change_pin.py | 6 +- .../command/change_puk.py | 4 +- .../command/command.py | 18 +- .../command/config.py | 0 .../command/decrypt.py | 20 +- .../command/erc_token/__init__.py | 0 .../command/erc_token/contract.py | 6 +- .../command/erc_token/info.py | 20 +- .../command/erc_token/initialize.py | 14 +- {cryptnoxpro => cryptnox_cli}/command/eth.py | 12 +- .../command/factory.py | 0 .../command/get_clearpubkey.py | 14 +- .../command/get_xpub.py | 14 +- .../command/helper/__init__.py | 0 .../command/helper/backup.py | 0 .../command/helper/cards.py | 36 +-- .../command/helper/config.py | 22 +- .../command/helper/download_folder.py | 0 .../command/helper/helper_methods.py | 12 +- .../command/helper/notification.py | 0 .../command/helper/security.py | 18 +- .../command/helper/seed_backup.py | 0 .../command/helper/ui.py | 12 +- .../command/history.py | 0 {cryptnoxpro => cryptnox_cli}/command/info.py | 0 .../command/initialize.py | 0 .../command/options/__init__.py | 0 .../command/options/common.py | 0 .../command/options/eth.py | 0 .../command/options/options.py | 2 +- .../command/reset.py | 4 +- {cryptnoxpro => cryptnox_cli}/command/seed.py | 26 +- .../command/server.py | 6 +- .../command/transfer.py | 0 .../command/unknown.py | 0 .../command/unlock_pin.py | 0 .../command/user_key.py | 10 +- .../command/user_keys/__init__.py | 0 .../command/user_keys/authentication.py | 16 +- .../command/user_keys/aws_kms/__init__.py | 0 .../command/user_keys/aws_kms/aws_kms.py | 4 +- .../command/user_keys/hello/__init__.py | 0 .../command/user_keys/hello/exceptions.py | 0 .../command/user_keys/hello/hello.py | 4 +- .../command/user_keys/hello/windows_hello.py | 0 .../command/user_keys/piv/__init__.py | 0 .../command/user_keys/piv/piv.py | 4 +- .../command/user_keys/piv/piv_card.py | 0 .../command/user_keys/user_key_base.py | 10 +- {cryptnoxpro => cryptnox_cli}/config.py | 14 +- cryptnox_cli/constants.py | 5 + .../contract_abi/erc1155.json | 0 .../contract_abi/erc20.json | 0 .../contract_abi/erc721.json | 0 {cryptnoxpro => cryptnox_cli}/enums.py | 0 .../interactive_cli.py | 10 +- {cryptnoxpro => cryptnox_cli}/lib/__init__.py | 0 .../lib/cryptos/__init__.py | 0 .../lib/cryptos/blocks.py | 0 .../lib/cryptos/coins/__init__.py | 0 .../lib/cryptos/coins/base.py | 0 .../lib/cryptos/coins/bitcoin.py | 0 .../lib/cryptos/composite.py | 0 .../lib/cryptos/constants.py | 0 .../lib/cryptos/deterministic.py | 0 .../lib/cryptos/english.txt | 0 .../lib/cryptos/keystore.py | 0 .../lib/cryptos/main.py | 0 .../lib/cryptos/mnemonic.py | 0 .../lib/cryptos/pbkdf2.py | 0 .../lib/cryptos/ripemd.py | 0 .../lib/cryptos/segwit_addr.py | 0 .../lib/cryptos/specials.py | 0 .../lib/cryptos/stealth.py | 0 .../lib/cryptos/transaction.py | 0 .../lib/cryptos/wallet.py | 0 .../lib/cryptos/wallet_utils.py | 0 {cryptnoxpro => cryptnox_cli}/main.py | 8 +- .../wallet/__init__.py | 0 {cryptnoxpro => cryptnox_cli}/wallet/btc.py | 2 +- .../wallet/eth/__init__.py | 0 .../wallet/eth/api.py | 2 +- .../wallet/eth/endpoint.py | 0 .../wallet/validators.py | 0 cryptnoxpro/constants.py | 5 - dev-requirements.txt | Bin 7936 -> 7946 bytes docs/cli.rst | 14 +- docs/conf.py | 8 +- docs/cryptnox_cli.command.card.rst | 44 +++ ...rst => cryptnox_cli.command.erc_token.rst} | 24 +- ...er.rst => cryptnox_cli.command.helper.rst} | 42 +-- ...s.rst => cryptnox_cli.command.options.rst} | 22 +- ...o.command.rst => cryptnox_cli.command.rst} | 104 +++---- ...ryptnox_cli.command.user_keys.aws_kms.rst} | 8 +- ... cryptnox_cli.command.user_keys.hello.rst} | 16 +- ...=> cryptnox_cli.command.user_keys.piv.rst} | 12 +- docs/cryptnox_cli.command.user_keys.rst | 64 ++++ docs/cryptnox_cli.lib.cryptos.coins.rst | 39 +++ docs/cryptnox_cli.lib.cryptos.rst | 158 ++++++++++ docs/cryptnox_cli.lib.rst | 22 ++ docs/{cryptnoxpro.rst => cryptnox_cli.rst} | 36 +-- ...et.eth.rst => cryptnox_cli.wallet.eth.rst} | 24 +- ...pro.wallet.rst => cryptnox_cli.wallet.rst} | 16 +- docs/cryptnoxpro.command.card.rst | 44 --- docs/cryptnoxpro.command.user_keys.rst | 64 ---- docs/cryptnoxpro.lib.cryptos.coins.rst | 39 --- docs/cryptnoxpro.lib.cryptos.rst | 158 ---------- docs/cryptnoxpro.lib.rst | 22 -- docs/index.rst | 6 +- docs/modules.rst | 3 +- docs/overview.rst | 4 +- requirements.txt | Bin 6022 -> 5906 bytes setup.cfg | 12 +- setup.py | 2 +- setup.spec | 10 +- 129 files changed, 755 insertions(+), 994 deletions(-) rename {cryptnoxpro => cryptnox_cli}/__init__.py (53%) rename {cryptnoxpro => cryptnox_cli}/command/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/btc.py (86%) rename {cryptnoxpro => cryptnox_cli}/command/card/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/card/info.py (92%) rename {cryptnoxpro => cryptnox_cli}/command/card/initialize.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/card_configuration.py (80%) rename {cryptnoxpro => cryptnox_cli}/command/cards.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/change_pin.py (87%) rename {cryptnoxpro => cryptnox_cli}/command/change_puk.py (94%) rename {cryptnoxpro => cryptnox_cli}/command/command.py (86%) rename {cryptnoxpro => cryptnox_cli}/command/config.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/decrypt.py (94%) rename {cryptnoxpro => cryptnox_cli}/command/erc_token/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/erc_token/contract.py (96%) rename {cryptnoxpro => cryptnox_cli}/command/erc_token/info.py (94%) rename {cryptnoxpro => cryptnox_cli}/command/erc_token/initialize.py (94%) rename {cryptnoxpro => cryptnox_cli}/command/eth.py (98%) rename {cryptnoxpro => cryptnox_cli}/command/factory.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/get_clearpubkey.py (93%) rename {cryptnoxpro => cryptnox_cli}/command/get_xpub.py (93%) rename {cryptnoxpro => cryptnox_cli}/command/helper/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/helper/backup.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/helper/cards.py (89%) rename {cryptnoxpro => cryptnox_cli}/command/helper/config.py (87%) rename {cryptnoxpro => cryptnox_cli}/command/helper/download_folder.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/helper/helper_methods.py (88%) rename {cryptnoxpro => cryptnox_cli}/command/helper/notification.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/helper/security.py (91%) rename {cryptnoxpro => cryptnox_cli}/command/helper/seed_backup.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/helper/ui.py (96%) rename {cryptnoxpro => cryptnox_cli}/command/history.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/info.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/initialize.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/options/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/options/common.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/options/eth.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/options/options.py (99%) rename {cryptnoxpro => cryptnox_cli}/command/reset.py (90%) rename {cryptnoxpro => cryptnox_cli}/command/seed.py (95%) rename {cryptnoxpro => cryptnox_cli}/command/server.py (95%) rename {cryptnoxpro => cryptnox_cli}/command/transfer.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/unknown.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/unlock_pin.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_key.py (89%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/authentication.py (90%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/aws_kms/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/aws_kms/aws_kms.py (98%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/hello/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/hello/exceptions.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/hello/hello.py (97%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/hello/windows_hello.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/piv/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/piv/piv.py (97%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/piv/piv_card.py (100%) rename {cryptnoxpro => cryptnox_cli}/command/user_keys/user_key_base.py (91%) rename {cryptnoxpro => cryptnox_cli}/config.py (81%) create mode 100644 cryptnox_cli/constants.py rename {cryptnoxpro => cryptnox_cli}/contract_abi/erc1155.json (100%) rename {cryptnoxpro => cryptnox_cli}/contract_abi/erc20.json (100%) rename {cryptnoxpro => cryptnox_cli}/contract_abi/erc721.json (100%) rename {cryptnoxpro => cryptnox_cli}/enums.py (100%) rename {cryptnoxpro => cryptnox_cli}/interactive_cli.py (97%) rename {cryptnoxpro => cryptnox_cli}/lib/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/blocks.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/coins/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/coins/base.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/coins/bitcoin.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/composite.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/constants.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/deterministic.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/english.txt (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/keystore.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/main.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/mnemonic.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/pbkdf2.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/ripemd.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/segwit_addr.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/specials.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/stealth.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/transaction.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/wallet.py (100%) rename {cryptnoxpro => cryptnox_cli}/lib/cryptos/wallet_utils.py (100%) rename {cryptnoxpro => cryptnox_cli}/main.py (94%) rename {cryptnoxpro => cryptnox_cli}/wallet/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/wallet/btc.py (99%) rename {cryptnoxpro => cryptnox_cli}/wallet/eth/__init__.py (100%) rename {cryptnoxpro => cryptnox_cli}/wallet/eth/api.py (99%) rename {cryptnoxpro => cryptnox_cli}/wallet/eth/endpoint.py (100%) rename {cryptnoxpro => cryptnox_cli}/wallet/validators.py (100%) delete mode 100644 cryptnoxpro/constants.py create mode 100644 docs/cryptnox_cli.command.card.rst rename docs/{cryptnoxpro.command.erc_token.rst => cryptnox_cli.command.erc_token.rst} (50%) rename docs/{cryptnoxpro.command.helper.rst => cryptnox_cli.command.helper.rst} (52%) rename docs/{cryptnoxpro.command.options.rst => cryptnox_cli.command.options.rst} (50%) rename docs/{cryptnoxpro.command.rst => cryptnox_cli.command.rst} (51%) rename docs/{cryptnoxpro.command.user_keys.aws_kms.rst => cryptnox_cli.command.user_keys.aws_kms.rst} (54%) rename docs/{cryptnoxpro.command.user_keys.hello.rst => cryptnox_cli.command.user_keys.hello.rst} (51%) rename docs/{cryptnoxpro.command.user_keys.piv.rst => cryptnox_cli.command.user_keys.piv.rst} (54%) create mode 100644 docs/cryptnox_cli.command.user_keys.rst create mode 100644 docs/cryptnox_cli.lib.cryptos.coins.rst create mode 100644 docs/cryptnox_cli.lib.cryptos.rst create mode 100644 docs/cryptnox_cli.lib.rst rename docs/{cryptnoxpro.rst => cryptnox_cli.rst} (51%) rename docs/{cryptnoxpro.wallet.eth.rst => cryptnox_cli.wallet.eth.rst} (54%) rename docs/{cryptnoxpro.wallet.rst => cryptnox_cli.wallet.rst} (57%) delete mode 100644 docs/cryptnoxpro.command.card.rst delete mode 100644 docs/cryptnoxpro.command.user_keys.rst delete mode 100644 docs/cryptnoxpro.lib.cryptos.coins.rst delete mode 100644 docs/cryptnoxpro.lib.cryptos.rst delete mode 100644 docs/cryptnoxpro.lib.rst diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6663636..6bf0182 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout cryptnoxpro repository + - name: Checkout cryptnox-cli repository uses: actions/checkout@v4 with: - path: cryptnoxpro + path: cryptnox-cli - name: Set up Python uses: actions/setup-python@v5 @@ -25,12 +25,12 @@ jobs: - name: Install dependencies run: | - cd cryptnoxpro + cd cryptnox-cli pip install sphinx sphinx-rtd-theme - name: Build Sphinx documentation run: | - cd cryptnoxpro + cd cryptnox-cli sphinx-build -b html docs docs/_build/html - name: Checkout documentation repository @@ -42,14 +42,14 @@ jobs: - name: Update documentation run: | - # Remove old cryptnoxpro folder if it exists - rm -rf docs-repo/cryptnoxpro + # Remove old cryptnox-cli folder if it exists + rm -rf docs-repo/cryptnox-cli # Copy new documentation - cp -r cryptnoxpro/docs/_build/html docs-repo/cryptnoxpro + cp -r cryptnox-cli/docs/_build/html docs-repo/cryptnox-cli # Add a timestamp file for tracking - echo "Last updated: $(date)" > docs-repo/cryptnoxpro/last-updated.txt + echo "Last updated: $(date)" > docs-repo/cryptnox-cli/last-updated.txt - name: Commit and push changes run: | @@ -57,5 +57,5 @@ jobs: git config --local user.email "yann@oinsm.ch" git config --local user.name "YanNaingWinn" git add . - git commit -m "Update cryptnoxpro documentation from cryptnoxpro@${{ github.sha }}" || exit 0 + git commit -m "Update cryptnox-cli documentation from cryptnox-cli@${{ github.sha }}" || exit 0 git push diff --git a/.gitignore b/.gitignore index 66fe372..0e0f597 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,3 @@ signature.sig cardpub.pub docs/_build/ - -cryptnoxpro.egg-info diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 79eaef4..b0edd76 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,274 +2,38 @@ Changelog ========= -All notable changes to this project will be documented in this file. - -The format is based on `Keep a Changelog `_\ , -and this project adheres to `Semantic Versioning `_. - -`Unreleased `_ --------------------------------------------------------------------------------------- - -`2.8.0 `_ - 2022-01-31 +`1.0.0 `_ ------------------------------------------------------------------------------------------------ Added ^^^^^ - -- Option to start a server and access the card remotely - -`2.7.0 `_ - 2022-11-28 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -- Card can be opened with AWS KMS key instead of PIN code -- Option to backup to cloud when seed is uploaded or recovered - -`2.6.0 `_ - 2022-09-30 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -- ERC1155 contract ABI to system for selection for use - -Fixed -^^^^^ - -- `eosio` command `get` subcommand help not shown - -`2.5.0 `_ - 2022-08-11 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -- Default servers for AWS backup and restore -- Default randomized alias for AWS backup -- Use `rootkey.csv` file from download folder for AWS backup and restore, delete credentials after operation +- Package renamed from ``cryptnoxpro`` to ``cryptnox_cli`` + - Install using: ``pip install cryptnox-cli`` +- BIP39 passphrase support for seed generation and recovery +- BIP39 passphrase length limitation and validation +- Sphinx documentation framework for comprehensive CLI documentation +- GitHub Actions workflows for automated documentation deployment +- Constants file for centralized configuration management +- Flake8 code quality checks in CI/CD workflow Changed ^^^^^^^ -- In case of exception write the error log into user folder instead of installation folder +- Updated README with improved documentation and examples +- Modified documentation configuration and deployment process +- Reconfigured documentation deployment workflow +- Updated setup configuration (setup.cfg) for better package management +- Improved code organization with constants file Fixed ^^^^^ -- Missing word for retrying PIN code -- Seed phrase of length other than 12 or 24 words is accepted by the system - -`2.4.0 `_ - 2022-07-19 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -- Python 3.10 support -- For NFT cards abi url parsing +- Resolved runtime import errors +- Fixed flake8 code style errors throughout the codebase +- Fixed PUK retries persistence issue Removed ^^^^^^^ -- Python 3.6 support - -Fixed -^^^^^ - -- Application crashing when using current key with derivation path - -`2.3.0 `_ - 2022-06-07 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -- Remote mode for connecting over a port - -Changed -^^^^^^^ - -- Installation instructions added missing instructions - -`2.2.2 `_ - 2022-03-17 ------------------------------------------------------------------------------------------------- - -Fixed -^^^^^ - -* Init not finished with NFT card when ABI is large - -`2.2.1 `_ - 2022-03-14 ------------------------------------------------------------------------------------------------- - -Fixed -^^^^^ - -* Application crashes when initializing NFT card -* Help not show on some commands -* List of cards is doubled when executing list command -* Seed backup to KMS name of backup error message not clear enough -* Card not reloaded after dual seed generation -* Application crashes during dual seed generation while waiting for second card - -`2.2.0 `_ - 2022-01-31 ------------------------------------------------------------------------------------------------- - -Changed -^^^^^^^ - -* Combined two scripts into one -* Demo mode renamed to easy mode -* Application name changed to Cryptnox Pro - -Fixed -^^^^^ - -* Error handling while waiting for card when timeout is exceeded -* Error handling when a user enters value for mnemonic that is invalid for BIP39 -* Input for user key description to allow numbers and letters -* Crash when showing seed backup options for AWS server - -`2.1.0 `_ - 2022-01-04 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -* Separate CLI for working with NFT cards -* eht command contract parameter to send ERC20 tokens - -Fixed -^^^^^ - -* Exception handling in multiple places. - -`2.0.0 `_ - 2021-10-13 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -* Dynamic fee calculation for Bitcoin and Ethereum networks - -Changed -^^^^^^^ - -* Recovering seed from mnemonic compliant with BIP39 -* Derivation paths to be compliant with BIP44 - -Fixed -^^^^^ - -* Send/transfer memo for EOSIO -* Signing multi-input transaction for BTC with user key -* Precision of amounts for sending -* AWS backup wrong credentials crash the application -* verbose option is not doing anything -* EOS transfer doesn't use sender but behaves as send command - - -`1.3.2 `_ - 2021-10-13 ------------------------------------------------------------------------------------------------- - -Changed -^^^^^^^ - -* Ethereum endpoint through cryptnox node updated to use different domains on standard ports -* With ``info`` command for balance show the issue instead of "--" - -Fixed -^^^^^ - -* ``exit`` keyword when input is requested from user, like PIN or PUK code -* Bitcoin sending with multiple inputs is rejected by the node - -`1.3.1 `_ - 2021-10-07 ------------------------------------------------------------------------------------------------- - -Fixed -^^^^^ - -* Crash when calling config under currencies - -`1.3.0 `_ - 2021-10-06 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -* card_config can update the status of PIN-less path and PIN authentication. - -Changed -^^^^^^^ - -* Configuration is saved into the card instead of a file. - -Fixed -^^^^^ - -* When waiting for card after card is detected the application crashes. -* Ethereum network name conversion - -`1.2.0 `_ - 2021-09-16 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -* New endpoint for Ethereum network used by default. User can still the infura network with a project key - -Changed -^^^^^^^ - -* Ordering in config command to BTC, ETH, EOS. -* When changing PIN or PUK code message made clear that the card is not initialized. -* Resetting uninitialized card message updated. -* User key check if card is initialized before continuing. -* In change_puk check current PUK before asking for new one. -* Show warning on command if card origin is unknown or fake instead of exiting command. - -Fixed -^^^^^ - -* In demo mode when asked for PUK code, entering anything will go into loop asking for the code. -* There is no message when adding piv, but piv is not present - -`1.1.0 `_ - 2021-09-16 ------------------------------------------------------------------------------------------------- - -Added -^^^^^ - -* Backup and restore of entropy for seed generation to KMS in HSM. - - -`1.0.2 `_ - 2021-09-09 ------------------------------------------------------------------------------------------------- - -Changed -^^^^^^^ - -* Improve setup process. - - -`1.0.1 `_ - 2021-08-20 ------------------------------------------------------------------------------------------------- - -Fixed -^^^^^ - -* Update package on PiPI. - -`1.0.0 `_ - 2021-08-20 ---------------------------------------------------------------------------------------------- - -Added -^^^^^ - -* Command line interface with commands for interacting with Cryptnox cards. -* Interactive mode. -* Pipfile and requirements for setting up environment. -* Setup file to install the library. +- Removed cleos dependency +- Removed Ropsten testnet support (deprecated network) diff --git a/MANIFEST.in b/MANIFEST.in index 0233014..4d9522c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include LICENSE include CHANGELOG.rst -include README.rst -include cryptnoxpro/contract_abi/*.json -include cryptnoxpro/lib/cryptos/english.txt +include README.md +include cryptnox_cli/contract_abi/*.json +include cryptnox_cli/lib/cryptos/english.txt diff --git a/Pipfile b/Pipfile index b7c1bb5..bf80be1 100644 --- a/Pipfile +++ b/Pipfile @@ -17,7 +17,7 @@ base58 = "*" boto3 = "*" ecdsa = "*" colander = "*" -cryptnoxpy = ">=2.0.0" +cryptnox-sdk-py >= "1.0.0" lazy-import = "*" pytz = "*" requests = "*" diff --git a/README.md b/README.md index 5ab8f7e..242589a 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,19 @@

-

Cryptnox Pro — Smartcard CLI

+

Cryptnox CLI — Smartcard CLI


-[![PyPI](https://img.shields.io/pypi/v/cryptnoxpro.svg)](https://pypi.org/project/cryptnoxpro/) -[![Python versions](https://img.shields.io/pypi/pyversions/cryptnoxpro.svg)](https://pypi.org/project/cryptnoxpro/) -[![Documentation status](https://img.shields.io/badge/docs-latest-blue)](https://cryptnox-software.github.io/cryptnoxpro) +[![PyPI](https://img.shields.io/pypi/v/cryptnox-cli.svg)](https://pypi.org/project/cryptnox-cli/) +[![Python versions](https://img.shields.io/pypi/pyversions/cryptnox-cli.svg)](https://pypi.org/project/cryptnox-cli/) +[![Documentation status](https://img.shields.io/badge/docs-latest-blue)](https://cryptnox-software.github.io/cryptnox-cli) [![License: GPLv3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ## About -`cryptnoxpro` is a command-line interface for managing **Cryptnox Smartcards**, enabling secure seed initialization and cryptographic signing for **Bitcoin** and **Ethereum**. +`cryptnox-cli` is a command-line interface for managing **Cryptnox Smartcards**, enabling secure seed initialization and cryptographic signing for **Bitcoin** and **Ethereum**. ## Supported hardware @@ -26,24 +26,24 @@ Get your card and readers here: [shop.cryptnox.com](https://shop.cryptnox.com) ## Installation -> 💡 This is only a minimal setup. Additional packages may be required depending on your operating system. See [Installation and Requirements](https://cryptnox-software.github.io/cryptnoxpro/overview.html#installation-and-requirements). +> 💡 This is only a minimal setup. Additional packages may be required depending on your operating system. See [Installation and Requirements](https://cryptnox-software.github.io/cryptnox-cli/overview.html#installation-and-requirements). ### From PyPI ```bash -pip install cryptnoxpro +pip install cryptnox-cli ``` ### From source ```bash -git clone https://github.com/cryptnox-software/cryptnoxpro.git -cd cryptnoxpro +git clone https://github.com/cryptnox-software/cryptnox-cli.git +cd cryptnox-cli pip install . ``` This installs the package and makes the `cryptnox` command available (if your Python installation is in your system `PATH`). ## Quick usage examples -> 💡 The examples below are only a subset of available commands. The complete list of commands and detailed usage instructions is described in the [official documentation](https://cryptnox-software.github.io/cryptnoxpro). +> 💡 The examples below are only a subset of available commands. The complete list of commands and detailed usage instructions is described in the [official documentation](https://cryptnox-software.github.io/cryptnox-cli). ### 1. Dual initialization 1. Factory reset each card: @@ -82,7 +82,7 @@ This installs the package and makes the `cryptnox` command available (if your Py ## Documentation -The full **User & Developer documentation** is available at the [CryptnoxPro Documentation](https://cryptnox-software.github.io/cryptnoxpro). It covers installation and setup, usage guides and examples, CLI command reference, and developer notes with API details. +The full **User & Developer documentation** is available at the [Cryptnox CLI Documentation](https://cryptnox-software.github.io/cryptnox-cli). It covers installation and setup, usage guides and examples, CLI command reference, and developer notes with API details. ## License diff --git a/cryptnoxpro/__init__.py b/cryptnox_cli/__init__.py similarity index 53% rename from cryptnoxpro/__init__.py rename to cryptnox_cli/__init__.py index b1197e4..650d6c1 100644 --- a/cryptnoxpro/__init__.py +++ b/cryptnox_cli/__init__.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -__version__ = "2.9.1" +__version__ = "1.0.0" diff --git a/cryptnoxpro/command/__init__.py b/cryptnox_cli/command/__init__.py similarity index 100% rename from cryptnoxpro/command/__init__.py rename to cryptnox_cli/command/__init__.py diff --git a/cryptnoxpro/command/btc.py b/cryptnox_cli/command/btc.py similarity index 86% rename from cryptnoxpro/command/btc.py rename to cryptnox_cli/command/btc.py index 11a4d2e..bf85502 100644 --- a/cryptnoxpro/command/btc.py +++ b/cryptnox_cli/command/btc.py @@ -4,7 +4,7 @@ """ from typing import List -import cryptnoxpy +import cryptnox_sdk_py from .command import Command from .helper.config import create_config_method @@ -41,19 +41,19 @@ def _execute(self, card) -> int: return 0 - def _send(self, card: cryptnoxpy.Card) -> None: + def _send(self, card: cryptnox_sdk_py.Card) -> None: config = get_configuration(card)["btc"] network = self.data.network or config.get("network", "testnet") try: - derivation = cryptnoxpy.Derivation[config["derivation"]] + derivation = cryptnox_sdk_py.Derivation[config["derivation"]] except KeyError: print("Derivation is invalid") return endpoint = BlkHubApi(network) - path = b"" if derivation == cryptnoxpy.Derivation.CURRENT_KEY else BTCwallet.PATH + path = b"" if derivation == cryptnox_sdk_py.Derivation.CURRENT_KEY else BTCwallet.PATH pubkey = card.get_public_key(derivation, path=path) wallet = BTCwallet(pubkey, network, endpoint, card) @@ -80,10 +80,10 @@ def _send(self, card: cryptnoxpy.Card) -> None: print(f"\nTransaction id: {message[13:]}\nBalance might take 30 s to be refreshed") @staticmethod - def _sign(card: cryptnoxpy.Card, derivation: cryptnoxpy.Derivation, + def _sign(card: cryptnox_sdk_py.Card, derivation: cryptnox_sdk_py.Derivation, data_hashes: List[bytes]) -> List[bytes]: signatures = [] - if card.auth_type == cryptnoxpy.AuthType.PIN and len(data_hashes) > 1: + if card.auth_type == cryptnox_sdk_py.AuthType.PIN and len(data_hashes) > 1: pin_code = check_pin_code(card) else: pin_code = "" diff --git a/cryptnoxpro/command/card/__init__.py b/cryptnox_cli/command/card/__init__.py similarity index 100% rename from cryptnoxpro/command/card/__init__.py rename to cryptnox_cli/command/card/__init__.py diff --git a/cryptnoxpro/command/card/info.py b/cryptnox_cli/command/card/info.py similarity index 92% rename from cryptnoxpro/command/card/info.py rename to cryptnox_cli/command/card/info.py index 240149c..352e5c6 100644 --- a/cryptnoxpro/command/card/info.py +++ b/cryptnox_cli/command/card/info.py @@ -4,7 +4,7 @@ """ from typing import List, Dict -import cryptnoxpy +import cryptnox_sdk_py import web3 from argparse import Namespace from tabulate import tabulate @@ -59,13 +59,13 @@ def execute(card) -> int: def _get_btc_info(card) -> dict: config = get_configuration(card)["btc"] try: - derivation = cryptnoxpy.Derivation[config["derivation"]].value + derivation = cryptnox_sdk_py.Derivation[config["derivation"]].value except KeyError: return {"name": "Bad derivation type"} network = config.get("network", "testnet").lower() endpoint = BlkHubApi(network) - path = b"" if derivation == cryptnoxpy.Derivation.CURRENT_KEY else BTCwallet.PATH + path = b"" if derivation == cryptnox_sdk_py.Derivation.CURRENT_KEY else BTCwallet.PATH pubkey = card.get_public_key(derivation, path=path) wallet = BTCwallet(pubkey, network, endpoint, card) @@ -90,7 +90,7 @@ def _get_eth_info(card) -> dict: config = get_configuration(card)["eth"] network = enums.EthNetwork[config.get("network", "infura").upper()] try: - derivation = cryptnoxpy.Derivation[config["derivation"]].value + derivation = cryptnox_sdk_py.Derivation[config["derivation"]].value except KeyError: return {"name": "Bad derivation type"} try: @@ -99,7 +99,7 @@ def _get_eth_info(card) -> dict: print(error) return {} - path = "" if derivation == cryptnoxpy.Derivation.CURRENT_KEY else eth.Api.PATH + path = "" if derivation == cryptnox_sdk_py.Derivation.CURRENT_KEY else eth.Api.PATH public_key = card.get_public_key(derivation, path=path, compressed=False) address = eth.checksum_address(public_key) diff --git a/cryptnoxpro/command/card/initialize.py b/cryptnox_cli/command/card/initialize.py similarity index 100% rename from cryptnoxpro/command/card/initialize.py rename to cryptnox_cli/command/card/initialize.py diff --git a/cryptnoxpro/command/card_configuration.py b/cryptnox_cli/command/card_configuration.py similarity index 80% rename from cryptnoxpro/command/card_configuration.py rename to cryptnox_cli/command/card_configuration.py index 5b52945..df46806 100644 --- a/cryptnoxpro/command/card_configuration.py +++ b/cryptnox_cli/command/card_configuration.py @@ -2,7 +2,7 @@ """ Module containing the class for printing card configuration """ -import cryptnoxpy +import cryptnox_sdk_py from tabulate import tabulate from .command import Command @@ -19,16 +19,16 @@ class CardConfiguration(Command): Command for printing card configuraton """ _SEED_SOURCE_TO_STRING = { - cryptnoxpy.SeedSource.NO_SEED: "No seed", - cryptnoxpy.SeedSource.SINGLE: "Single 256K1 EC pair", - cryptnoxpy.SeedSource.EXTENDED: "Extended 256K1 EC pair BIP32 node", - cryptnoxpy.SeedSource.EXTERNAL: "Externally generated", - cryptnoxpy.SeedSource.INTERNAL: "Internally generated", - cryptnoxpy.SeedSource.DUAL: "Dual initialized" + cryptnox_sdk_py.SeedSource.NO_SEED: "No seed", + cryptnox_sdk_py.SeedSource.SINGLE: "Single 256K1 EC pair", + cryptnox_sdk_py.SeedSource.EXTENDED: "Extended 256K1 EC pair BIP32 node", + cryptnox_sdk_py.SeedSource.EXTERNAL: "Externally generated", + cryptnox_sdk_py.SeedSource.INTERNAL: "Internally generated", + cryptnox_sdk_py.SeedSource.DUAL: "Dual initialized" } _name = enums.Command.CARD_CONFIGURATION.value - def _execute(self, card: cryptnoxpy.Card) -> int: + def _execute(self, card: cryptnox_sdk_py.Card) -> int: if self.data.value: if self.data.key == "pinless": path = "m/43'/60'/1581'" if CardConfiguration._str_to_bool(self.data.value) else "" @@ -53,7 +53,7 @@ def _execute(self, card: cryptnoxpy.Card) -> int: return CardConfiguration.show(card) @staticmethod - def show(card: cryptnoxpy.Card) -> int: + def show(card: cryptnox_sdk_py.Card) -> int: data = [ ["Card initialisation", CardConfiguration._bool_to_str(card.initialized)] ] @@ -69,10 +69,10 @@ def show(card: cryptnoxpy.Card) -> int: ] try: data += [ - ["RSA 2048 user key", CardConfiguration._bool_to_str(card.user_key_enabled(cryptnoxpy.SlotIndex.RSA))], + ["RSA 2048 user key", CardConfiguration._bool_to_str(card.user_key_enabled(cryptnox_sdk_py.SlotIndex.RSA))], ["ECC 256 user key", - CardConfiguration._bool_to_str(card.user_key_enabled(cryptnoxpy.SlotIndex.EC256R1))], - ["FIDO2 user key", CardConfiguration._bool_to_str(card.user_key_enabled(cryptnoxpy.SlotIndex.FIDO))] + CardConfiguration._bool_to_str(card.user_key_enabled(cryptnox_sdk_py.SlotIndex.EC256R1))], + ["FIDO2 user key", CardConfiguration._bool_to_str(card.user_key_enabled(cryptnox_sdk_py.SlotIndex.FIDO))] ] except NotImplementedError: data += [["User keys", "Not available"]] diff --git a/cryptnoxpro/command/cards.py b/cryptnox_cli/command/cards.py similarity index 100% rename from cryptnoxpro/command/cards.py rename to cryptnox_cli/command/cards.py diff --git a/cryptnoxpro/command/change_pin.py b/cryptnox_cli/command/change_pin.py similarity index 87% rename from cryptnoxpro/command/change_pin.py rename to cryptnox_cli/command/change_pin.py index daf8cb3..0cd2a98 100644 --- a/cryptnoxpro/command/change_pin.py +++ b/cryptnox_cli/command/change_pin.py @@ -2,7 +2,7 @@ """ Module containing command for changing PIN code of the card """ -import cryptnoxpy +import cryptnox_sdk_py from .command import Command from .helper import ( @@ -22,14 +22,14 @@ class ChangePin(Command): """ _name = enums.Command.CHANGE_PIN.value - def _execute(self, card: cryptnoxpy.Card) -> int: + def _execute(self, card: cryptnox_sdk_py.Card) -> int: if not card.initialized: ui.print_warning("Card is not initialized") print("To initialize card run : init\nTo initialize card in easy mode run : init -e") return -1 - if card.auth_type != cryptnoxpy.AuthType.PIN: + if card.auth_type != cryptnox_sdk_py.AuthType.PIN: security.check_pin_code(card) if security.is_easy_mode(card.info): diff --git a/cryptnoxpro/command/change_puk.py b/cryptnox_cli/command/change_puk.py similarity index 94% rename from cryptnoxpro/command/change_puk.py rename to cryptnox_cli/command/change_puk.py index 98ce242..c3e3d8d 100644 --- a/cryptnoxpro/command/change_puk.py +++ b/cryptnox_cli/command/change_puk.py @@ -2,7 +2,7 @@ """ Module containing command for changing PIN code of the card """ -import cryptnoxpy +import cryptnox_sdk_py from .command import Command from .helper import ( @@ -22,7 +22,7 @@ class ChangePuk(Command): """ _name = enums.Command.CHANGE_PUK.value - def _execute(self, card: cryptnoxpy.Card) -> int: + def _execute(self, card: cryptnox_sdk_py.Card) -> int: if not card.initialized: ui.print_warning("Card is not initialized") print("To initialize card run : init\nTo initialize card in easy mode run : init -e") diff --git a/cryptnoxpro/command/command.py b/cryptnox_cli/command/command.py similarity index 86% rename from cryptnoxpro/command/command.py rename to cryptnox_cli/command/command.py index 2bba79d..1e531ea 100644 --- a/cryptnoxpro/command/command.py +++ b/cryptnox_cli/command/command.py @@ -4,7 +4,7 @@ """ import abc -import cryptnoxpy +import cryptnox_sdk_py import requests.exceptions from argparse import Namespace from tabulate import tabulate @@ -58,7 +58,7 @@ def _handle_execution(self, serial_number: int = None) -> int: pass try: card = self._cards[self.serial_number] - except (ExitException, TimeoutException, cryptnoxpy.exceptions.CryptnoxException) as error: + except (ExitException, TimeoutException, cryptnox_sdk_py.exceptions.CryptnoxException) as error: print(error) return -1 except requests.exceptions.RequestException as error: @@ -70,26 +70,26 @@ def _handle_execution(self, serial_number: int = None) -> int: def run_execute(self, card) -> int: print(f"Using card with serial number {card.serial_number}") origin = card.origin - if origin == cryptnoxpy.enums.Origin.UNKNOWN: + if origin == cryptnox_sdk_py.enums.Origin.UNKNOWN: ui.print_warning("Origin of card can't be checked. Check your internet connection.") - elif origin == cryptnoxpy.enums.Origin.FAKE: + elif origin == cryptnox_sdk_py.enums.Origin.FAKE: ui.print_warning(f"Card with serial number {card.serial_number} is not genuine.") try: result = self._execute(card) - except cryptnoxpy.exceptions.InitializationException as error: + except cryptnox_sdk_py.exceptions.InitializationException as error: print("\n" + tabulate([[str(error).upper()]], tablefmt="rst")) print(f"To initialize card run : init\n" f"To initialize card in {security.EASY_MODE_TEXT} run : init -e") result = -1 - except cryptnoxpy.exceptions.SeedException: + except cryptnox_sdk_py.exceptions.SeedException: print("The seed is not generated\nRun seed command to generate seed") result = -1 - except cryptnoxpy.exceptions.GenericException as error: + except cryptnox_sdk_py.exceptions.GenericException as error: print(f"Generic exception with status code: 0x{error.status.hex().upper()}") return -2 - except (cryptnoxpy.exceptions.CryptnoxException, NotImplementedError) as error: + except (cryptnox_sdk_py.exceptions.CryptnoxException, NotImplementedError) as error: print(error) result = -1 except ui.ExitException: @@ -112,7 +112,7 @@ def _execute(self, card) -> int: """ Method that will be executed in executed in execute method. - :param connection cryptnoxpy.Connection: Connection to the card + :param connection cryptnox_sdk_py.Connection: Connection to the card :return: Execution status """ diff --git a/cryptnoxpro/command/config.py b/cryptnox_cli/command/config.py similarity index 100% rename from cryptnoxpro/command/config.py rename to cryptnox_cli/command/config.py diff --git a/cryptnoxpro/command/decrypt.py b/cryptnox_cli/command/decrypt.py similarity index 94% rename from cryptnoxpro/command/decrypt.py rename to cryptnox_cli/command/decrypt.py index 7759dc4..9008eea 100644 --- a/cryptnoxpro/command/decrypt.py +++ b/cryptnox_cli/command/decrypt.py @@ -3,10 +3,10 @@ Module containing command for decrypting data using ECIES """ try: - import cryptnoxpy + import cryptnox_sdk_py except ImportError: - # Handle case where cryptnoxpy is not available - cryptnoxpy = None + # Handle case where cryptnox_sdk_py is not available + cryptnox_sdk_py = None from argparse import Namespace @@ -28,15 +28,15 @@ def _execute(self, card) -> int: :rtype: int """ # Basic validation - if cryptnoxpy is None: - print("Error: cryptnoxpy library is not available") + if cryptnox_sdk_py is None: + print("Error: cryptnox_sdk_py library is not available") return -1 if not hasattr(card, 'decrypt'): print("Error: Card does not support decrypt functionality") return -1 - print("=== CryptnoxPro Decrypt Command ===") + print("=== Cryptnox CLI Decrypt Command ===") print(f"Card SN: {card.serial_number}") print(f"Initialized: {card.initialized}") print(f"Valid Key: {card.valid_key}") @@ -179,19 +179,19 @@ def _execute(self, card) -> int: print("\nDecrypt command completed successfully!") return 0 - except cryptnoxpy.exceptions.SeedException: + except cryptnox_sdk_py.exceptions.SeedException: print("Error: No seed/key loaded") print("Please load a seed first: cryptnox seed") return -1 - except cryptnoxpy.exceptions.PinException: + except cryptnox_sdk_py.exceptions.PinException: print("Error: PIN is not correct") print("Please provide the correct PIN") return -1 - except cryptnoxpy.exceptions.DataValidationException as e: + except cryptnox_sdk_py.exceptions.DataValidationException as e: print(f"Error: Data validation failed - {e}") print("Please check your input parameters") return -1 - except cryptnoxpy.exceptions.SecureChannelException: + except cryptnox_sdk_py.exceptions.SecureChannelException: print("Error: Secure channel communication failed") print("Please ensure the card is properly connected and authenticated") return -1 diff --git a/cryptnoxpro/command/erc_token/__init__.py b/cryptnox_cli/command/erc_token/__init__.py similarity index 100% rename from cryptnoxpro/command/erc_token/__init__.py rename to cryptnox_cli/command/erc_token/__init__.py diff --git a/cryptnoxpro/command/erc_token/contract.py b/cryptnox_cli/command/erc_token/contract.py similarity index 96% rename from cryptnoxpro/command/erc_token/contract.py rename to cryptnox_cli/command/erc_token/contract.py index 16e743e..ced31a5 100644 --- a/cryptnoxpro/command/erc_token/contract.py +++ b/cryptnox_cli/command/erc_token/contract.py @@ -11,7 +11,7 @@ from pathlib import Path from typing import Tuple, Union -import cryptnoxpy +import cryptnox_sdk_py import requests import web3 from tabulate import tabulate @@ -64,7 +64,7 @@ def gas(gas_price: int, set_price: int, set_limit: int, def transfer(card, endpoint, network, api_key, contract_address: str, to: str, amount: float, price: int, limit: int, - derivation: cryptnoxpy.Derivation = cryptnoxpy.Derivation.CURRENT_KEY) -> int: + derivation: cryptnox_sdk_py.Derivation = cryptnox_sdk_py.Derivation.CURRENT_KEY) -> int: try: endpoint = wallet.Api(endpoint, network, api_key) @@ -81,7 +81,7 @@ def transfer(card, endpoint, network, api_key, contract_address: str, to: str, a print(error.args[0]) return -1 - path = wallet.Api.PATH if derivation != cryptnoxpy.Derivation.CURRENT_KEY else "" + path = wallet.Api.PATH if derivation != cryptnox_sdk_py.Derivation.CURRENT_KEY else "" public_key = card.get_public_key(derivation, path=path, compressed=False) address = wallet.checksum_address(public_key) diff --git a/cryptnoxpro/command/erc_token/info.py b/cryptnox_cli/command/erc_token/info.py similarity index 94% rename from cryptnoxpro/command/erc_token/info.py rename to cryptnox_cli/command/erc_token/info.py index d7ab224..204dd2b 100644 --- a/cryptnoxpro/command/erc_token/info.py +++ b/cryptnox_cli/command/erc_token/info.py @@ -10,7 +10,7 @@ import secrets from pathlib import Path -import cryptnoxpy +import cryptnox_sdk_py import cryptography.exceptions from argparse import Namespace from cryptography.hazmat.primitives import hashes @@ -32,9 +32,9 @@ from wallet import eth _SEED_SOURCE_TRANSLATION = { - cryptnoxpy.SeedSource.NO_SEED: "No seed", - cryptnoxpy.SeedSource.INTERNAL: "Single card", - cryptnoxpy.SeedSource.DUAL: "Dual card", + cryptnox_sdk_py.SeedSource.NO_SEED: "No seed", + cryptnox_sdk_py.SeedSource.INTERNAL: "Single card", + cryptnox_sdk_py.SeedSource.DUAL: "Dual card", } _ERC_PATH = Path(__file__).parent.parent.parent.joinpath("contract_abi") @@ -55,7 +55,7 @@ def __init__(self, data: Namespace, cards: CardManager = None): self._cards = cards or CardManager(self.data.verbose if "verbose" in self.data else False) self.serial_number = None - def execute(self, card: cryptnoxpy.Card) -> int: + def execute(self, card: cryptnox_sdk_py.Card) -> int: slots = [] for i in range(0, 4): slots.append(gzip.decompress(card.user_data[i])) @@ -90,16 +90,16 @@ def execute(self, card: cryptnoxpy.Card) -> int: Info._owner(endpoint, slot0['contract_address'], abi, address, slot0['token_id']) print("----------------------------------------------\n\n") - if seed_source == cryptnoxpy.SeedSource.DUAL: + if seed_source == cryptnox_sdk_py.SeedSource.DUAL: index = card.connection.index serial_number = card.serial_number del self._cards[index] input("Please, insert card pair that was used for dual initialization and press ENTER.") card = self._cards[index] while True: - if not isinstance(card, cryptnoxpy.card.Nft): + if not isinstance(card, cryptnox_sdk_py.card.Nft): print("This card is not an NFT card") - elif card.seed_source != cryptnoxpy.SeedSource.DUAL: + elif card.seed_source != cryptnox_sdk_py.SeedSource.DUAL: print("This card is not dual initialized") elif card.serial_number == serial_number: print("This is the same card as the first check was done on.") @@ -165,7 +165,7 @@ def _balance(endpoint, address): print(f"Error getting balance: {error}") @staticmethod - def _history_counter(card: cryptnoxpy.Card): + def _history_counter(card: cryptnox_sdk_py.Card): print("Checking signature counter and history...") signature_counter = card.signing_counter history = [] @@ -182,7 +182,7 @@ def _history_counter(card: cryptnoxpy.Card): print("No history entries.") @staticmethod - def _private_key_check(card: cryptnoxpy.Card, public_key: bytes): + def _private_key_check(card: cryptnox_sdk_py.Card, public_key: bytes): print("Checking private key on the card...") nonce = secrets.token_bytes(nbytes=16) diff --git a/cryptnoxpro/command/erc_token/initialize.py b/cryptnox_cli/command/erc_token/initialize.py similarity index 94% rename from cryptnoxpro/command/erc_token/initialize.py rename to cryptnox_cli/command/erc_token/initialize.py index 5999d51..e2089bb 100644 --- a/cryptnoxpro/command/erc_token/initialize.py +++ b/cryptnox_cli/command/erc_token/initialize.py @@ -12,7 +12,7 @@ from typing import List from urllib import parse -import cryptnoxpy +import cryptnox_sdk_py import requests from ..helper import ui @@ -30,7 +30,7 @@ def __init__(self, data: Namespace, cards: CardManager = None): self._cards = cards or CardManager(self.data.verbose if "verbose" in self.data else False) self.serial_number = None - def execute(self, card: cryptnoxpy.Card) -> int: + def execute(self, card: cryptnox_sdk_py.Card) -> int: if card.initialized: print("Card already initialized.") return 1 @@ -92,7 +92,7 @@ def execute(self, card: cryptnoxpy.Card) -> int: return 0 - def _dual_seed(self, card: cryptnoxpy.Card, init_data, nfc_sign, slots: List[str]): + def _dual_seed(self, card: cryptnox_sdk_py.Card, init_data, nfc_sign, slots: List[str]): serial_number = card.serial_number card.verify_pin(init_data.pin) first_pair = card.dual_seed_public_key(init_data.pin) @@ -101,13 +101,13 @@ def _dual_seed(self, card: cryptnoxpy.Card, init_data, nfc_sign, slots: List[str input("Please, insert card pair that will be used for dual initialization and press ENTER.") dual_card = self._cards[index] while True: - if not isinstance(dual_card, cryptnoxpy.card.Nft): + if not isinstance(dual_card, cryptnox_sdk_py.card.Nft): print("This card is not an NFT card") elif dual_card.serial_number == serial_number: print("This is the same card as the first check was done on.") elif dual_card.initialized: print("This card is already initialized.") - elif dual_card.seed_source != cryptnoxpy.SeedSource.NO_SEED: + elif dual_card.seed_source != cryptnox_sdk_py.SeedSource.NO_SEED: print("This card has a seed.") else: break @@ -133,7 +133,7 @@ def _dual_seed(self, card: cryptnoxpy.Card, init_data, nfc_sign, slots: List[str if self.data.easy_mode: print("Card is in easy mode.\n\nPress enter for all pin and puk prompts.\n") - def _init_card(self, card: cryptnoxpy.Card, init_data: ui.InitData, nfc_sign: bool, + def _init_card(self, card: cryptnox_sdk_py.Card, init_data: ui.InitData, nfc_sign: bool, slots: List[str]): print("\nInitializing the applet\n") card.init(init_data.name, init_data.email, init_data.pin, init_data.puk, nfc_sign=nfc_sign) @@ -171,7 +171,7 @@ def _nft_slots() -> List[str]: ] @staticmethod - def _seed(card: cryptnoxpy.Card, pin_code: str) -> None: + def _seed(card: cryptnox_sdk_py.Card, pin_code: str) -> None: print("Generating seed...") card.generate_seed(pin_code) print("Seed generated") diff --git a/cryptnoxpro/command/eth.py b/cryptnox_cli/command/eth.py similarity index 98% rename from cryptnoxpro/command/eth.py rename to cryptnox_cli/command/eth.py index 4db6ad5..3e2673b 100644 --- a/cryptnoxpro/command/eth.py +++ b/cryptnox_cli/command/eth.py @@ -8,7 +8,7 @@ from decimal import Decimal from typing import Dict, Any, List -import cryptnoxpy +import cryptnox_sdk_py import requests import web3 from argparse import Namespace @@ -412,7 +412,7 @@ def _transact(self, card): return 2 try: - derivation = cryptnoxpy.Derivation[config["eth"]["derivation"]] + derivation = cryptnox_sdk_py.Derivation[config["eth"]["derivation"]] except LookupError: print("Derivation value not valid") return 1 @@ -446,7 +446,7 @@ def _transact(self, card): price, limit = contract.gas(endpoint.gas_price, self.data.price, self.data.limit, contract.LIMIT["contract"]) - path = b"" if derivation == cryptnoxpy.Derivation.CURRENT_KEY else wallet.Api.PATH + path = b"" if derivation == cryptnox_sdk_py.Derivation.CURRENT_KEY else wallet.Api.PATH public_key = card.get_public_key(derivation, path=path, compressed=False) nonce = endpoint.get_transaction_count(wallet.checksum_address(public_key)) @@ -554,7 +554,7 @@ def _send(self, card) -> int: config = get_configuration(card)["eth"] try: - derivation = cryptnoxpy.Derivation[config["derivation"]] + derivation = cryptnox_sdk_py.Derivation[config["derivation"]] except KeyError: print("Derivation is invalid") return 1 @@ -587,7 +587,7 @@ def _send(self, card) -> int: @staticmethod def _send_funds(card, derivation, endpoint, address, amount, price, limit): - path = b"" if derivation == cryptnoxpy.Derivation.CURRENT_KEY else wallet.Api.PATH + path = b"" if derivation == cryptnox_sdk_py.Derivation.CURRENT_KEY else wallet.Api.PATH public_key = card.get_public_key(derivation, path=path, compressed=False) card.derive(path=wallet.Api.PATH) @@ -637,7 +637,7 @@ def _send_funds(card, derivation, endpoint, address, amount, price, limit): def _send_token(self, card): config = get_configuration(card)["eth"] try: - derivation = cryptnoxpy.Derivation[config["derivation"]] + derivation = cryptnox_sdk_py.Derivation[config["derivation"]] except LookupError: print("Derivation value not valid") return 1 diff --git a/cryptnoxpro/command/factory.py b/cryptnox_cli/command/factory.py similarity index 100% rename from cryptnoxpro/command/factory.py rename to cryptnox_cli/command/factory.py diff --git a/cryptnoxpro/command/get_clearpubkey.py b/cryptnox_cli/command/get_clearpubkey.py similarity index 93% rename from cryptnoxpro/command/get_clearpubkey.py rename to cryptnox_cli/command/get_clearpubkey.py index 9a570cf..1f08b29 100644 --- a/cryptnoxpro/command/get_clearpubkey.py +++ b/cryptnox_cli/command/get_clearpubkey.py @@ -2,7 +2,7 @@ """ Module containing command for getting clear public key from the card """ -import cryptnoxpy +import cryptnox_sdk_py from argparse import Namespace from .command import Command @@ -18,7 +18,7 @@ class GetClearpubkey(Command): def _resolve_key_type(self, key_type_value): try: if isinstance(key_type_value, str): - return cryptnoxpy.KeyType[key_type_value.upper()] + return cryptnox_sdk_py.KeyType[key_type_value.upper()] return key_type_value except Exception as error: raise ValueError(f"Invalid key type: {key_type_value}") from error @@ -68,7 +68,7 @@ def _execute(self, card) -> int: print("Getting clear public key from card...") print(f"Key type: {key_type}") - print(f"Path: {path if path else cryptnoxpy.Derivation.CURRENT_KEY}") + print(f"Path: {path if path else cryptnox_sdk_py.Derivation.CURRENT_KEY}") print(f"Compressed: {compressed}") # Enable clear pubkey reading capability if PUK provided @@ -77,7 +77,7 @@ def _execute(self, card) -> int: try: card.set_clearpubkey(True, puk) print("Clear pubkey reading capability enabled") - except cryptnoxpy.exceptions.PukException as error: + except cryptnox_sdk_py.exceptions.PukException as error: print(f"Error: Invalid PUK code - {error}") return -1 except Exception as error: @@ -87,7 +87,7 @@ def _execute(self, card) -> int: # Calculate derivation parameter # For K1: derivation = 0x00 (current key) # For R1: derivation = 0x10 (current key R1) - derivation = 0x00 if key_type == cryptnoxpy.KeyType.K1 else 0x10 + derivation = 0x00 if key_type == cryptnox_sdk_py.KeyType.K1 else 0x10 try: # Get clear public key using get_public_key_clear @@ -106,7 +106,7 @@ def _execute(self, card) -> int: print("This feature requires a compatible card firmware version") return -1 - except cryptnoxpy.exceptions.ReadPublicKeyException as error: + except cryptnox_sdk_py.exceptions.ReadPublicKeyException as error: if "6A88" in str(error): print("Error: Clear pubkey reading capability not enabled") print("Please enable it first with: cryptnox get_clearpubkey --puk 'your_puk'") @@ -126,7 +126,7 @@ def _execute(self, card) -> int: return 0 - except cryptnoxpy.exceptions.SeedException: + except cryptnox_sdk_py.exceptions.SeedException: print("Error: No seed exists on the card. Please initialize the card first.") print("Run: cryptnox init") return -1 diff --git a/cryptnoxpro/command/get_xpub.py b/cryptnox_cli/command/get_xpub.py similarity index 93% rename from cryptnoxpro/command/get_xpub.py rename to cryptnox_cli/command/get_xpub.py index 0acebf9..bddbd99 100644 --- a/cryptnoxpro/command/get_xpub.py +++ b/cryptnox_cli/command/get_xpub.py @@ -4,7 +4,7 @@ """ import binascii import hashlib -import cryptnoxpy +import cryptnox_sdk_py from argparse import Namespace from .command import Command @@ -31,7 +31,7 @@ def _ripemd160(data: bytes) -> bytes: return hashlib.new('ripemd160', data).digest() except ValueError: try: - from cryptnoxpy.cryptos.ripemd import ripemd160 + from cryptnox_sdk_py.cryptos.ripemd import ripemd160 return ripemd160(data) except ImportError: raise RuntimeError("RIPEMD-160 not available") @@ -103,7 +103,7 @@ class GetXpub(Command): def _resolve_key_type(self, key_type_value): try: if isinstance(key_type_value, str): - return cryptnoxpy.KeyType[key_type_value.upper()] + return cryptnox_sdk_py.KeyType[key_type_value.upper()] return key_type_value except Exception as error: raise ValueError(f"Invalid key type: {key_type_value}") from error @@ -115,7 +115,7 @@ def _print_xpub(self, key_type, xpub_hex): :param key_type: The key type (K1 or R1) :param xpub_hex: The extended public key in hex format from the card (106 bytes) """ - print("K1 Extended Public Key" if key_type == cryptnoxpy.KeyType.K1 else "Extended Public Key") + print("K1 Extended Public Key" if key_type == cryptnox_sdk_py.KeyType.K1 else "Extended Public Key") # Convert Cryptnox 106-byte format to standard Base58 xpub success, message, xpub = extended_to_xpub(xpub_hex) @@ -145,7 +145,7 @@ def _execute(self, card) -> int: # Get PUK from command line arguments if provided puk = getattr(self.data, 'puk', '') - if key_type == cryptnoxpy.KeyType.R1: + if key_type == cryptnox_sdk_py.KeyType.R1: print("Cannot get extended public key for R1 key.") else: # For K1 keys, use clear export for xpub (if enabled or PUK provided) @@ -162,10 +162,10 @@ def _execute(self, card) -> int: return 0 - except cryptnoxpy.exceptions.SeedException: + except cryptnox_sdk_py.exceptions.SeedException: print("Error: No seed exists on the card. Please initialize the card first.") return -1 - except cryptnoxpy.exceptions.ReadPublicKeyException as e: + except cryptnox_sdk_py.exceptions.ReadPublicKeyException as e: print(f"Error reading public key: {e}") return -1 except Exception as error: diff --git a/cryptnoxpro/command/helper/__init__.py b/cryptnox_cli/command/helper/__init__.py similarity index 100% rename from cryptnoxpro/command/helper/__init__.py rename to cryptnox_cli/command/helper/__init__.py diff --git a/cryptnoxpro/command/helper/backup.py b/cryptnox_cli/command/helper/backup.py similarity index 100% rename from cryptnoxpro/command/helper/backup.py rename to cryptnox_cli/command/helper/backup.py diff --git a/cryptnoxpro/command/helper/cards.py b/cryptnox_cli/command/helper/cards.py similarity index 89% rename from cryptnoxpro/command/helper/cards.py rename to cryptnox_cli/command/helper/cards.py index 8330c75..f048b50 100644 --- a/cryptnoxpro/command/helper/cards.py +++ b/cryptnox_cli/command/helper/cards.py @@ -16,7 +16,7 @@ ValuesView ) -import cryptnoxpy +import cryptnox_sdk_py from tabulate import tabulate from . import security @@ -27,7 +27,7 @@ import config # Global connection cache to preserve connections across CardManager instances -_GLOBAL_CONNECTIONS: Dict[int, cryptnoxpy.Connection] = {} +_GLOBAL_CONNECTIONS: Dict[int, cryptnox_sdk_py.Connection] = {} class ExitException(Exception): @@ -44,8 +44,8 @@ class TimeoutException(Exception): class CardManager: def __init__(self, debug: bool = False): - self._cards: Dict[int, cryptnoxpy.Card] = {} - self._cards_by_index: Dict[int, cryptnoxpy.Card] = {} + self._cards: Dict[int, cryptnox_sdk_py.Card] = {} + self._cards_by_index: Dict[int, cryptnox_sdk_py.Card] = {} self.debug = debug def __contains__(self, key: int) -> bool: @@ -54,7 +54,7 @@ def __contains__(self, key: int) -> bool: def __delitem__(self, key: int) -> None: self._remove_card(key) - def __getitem__(self, key: int) -> cryptnoxpy.Card: + def __getitem__(self, key: int) -> cryptnox_sdk_py.Card: global _GLOBAL_CONNECTIONS # noqa: F824 if key is None: @@ -110,9 +110,9 @@ def refresh(self, remote: bool = False) -> None: try: self._open_card(index, remote) - except cryptnoxpy.exceptions.ReaderException: + except cryptnox_sdk_py.exceptions.ReaderException: break - except cryptnoxpy.exceptions.CryptnoxException: + except cryptnox_sdk_py.exceptions.CryptnoxException: pass index += 1 @@ -169,12 +169,12 @@ def print_card_list(self, show_warnings: bool = False, print(f"To initialize card run : init\n" f"To initialize card in {security.EASY_MODE_TEXT} run : init -e") - def select_card(self) -> cryptnoxpy.Card: + def select_card(self) -> cryptnox_sdk_py.Card: self.refresh() self.print_card_list(print_with_one_card=True) return self._select_card - def values(self) -> ValuesView[cryptnoxpy.Card]: + def values(self) -> ValuesView[cryptnox_sdk_py.Card]: return self._cards.values() def _index(self, serial_number: int) -> int: @@ -183,7 +183,7 @@ def _index(self, serial_number: int) -> int: return index raise ValueError - def _open_card(self, index: int, remote: bool = False) -> cryptnoxpy.Card: + def _open_card(self, index: int, remote: bool = False) -> cryptnox_sdk_py.Card: global _GLOBAL_CONNECTIONS # noqa: F824 @@ -194,17 +194,17 @@ def _open_card(self, index: int, remote: bool = False) -> cryptnoxpy.Card: if test_response: if index in self._cards_by_index: return self._cards_by_index[index] - except (BaseException, cryptnoxpy.exceptions.ConnectionException): + except (BaseException, cryptnox_sdk_py.exceptions.ConnectionException): # Connection is stale, remove it and create new one del _GLOBAL_CONNECTIONS[index] if index in self._cards_by_index: self._remove_card(self._cards_by_index[index].serial_number) # Create new connection only if needed - connection = cryptnoxpy.Connection(index, self.debug, config.REMOTE_CONNECTIONS, remote) + connection = cryptnox_sdk_py.Connection(index, self.debug, config.REMOTE_CONNECTIONS, remote) _GLOBAL_CONNECTIONS[index] = connection # Cache globally - card = cryptnoxpy.factory.get_card(connection, self.debug) + card = cryptnox_sdk_py.factory.get_card(connection, self.debug) self._cards[card.serial_number] = self._cards_by_index[index] = card return card @@ -230,7 +230,7 @@ def _remove_card(self, key: int) -> None: del _GLOBAL_CONNECTIONS[index] @staticmethod - def printable_flags(card: cryptnoxpy.Card) -> List[str]: + def printable_flags(card: cryptnox_sdk_py.Card) -> List[str]: flags = [] if card.initialized: @@ -249,7 +249,7 @@ def printable_flags(card: cryptnoxpy.Card) -> List[str]: flags.append("extended public key") keys = [] - for slot_index in cryptnoxpy.SlotIndex: + for slot_index in cryptnox_sdk_py.SlotIndex: try: if card.user_key_enabled(slot_index): keys.append(slot_index.name.lower()) @@ -261,9 +261,9 @@ def printable_flags(card: cryptnoxpy.Card) -> List[str]: return flags @property - def _select_card(self) -> cryptnoxpy.Card: + def _select_card(self) -> cryptnox_sdk_py.Card: if not self._cards: - raise cryptnoxpy.exceptions.CardException("No Cryptnox cards have been found") + raise cryptnox_sdk_py.exceptions.CardException("No Cryptnox cards have been found") if len(self._cards) == 1: return list(self._cards_by_index.values())[0] @@ -281,7 +281,7 @@ def _select_card(self) -> cryptnoxpy.Card: return card - def _wait_for_card(self, card_id: int, timeout: int = 30) -> cryptnoxpy.Card: + def _wait_for_card(self, card_id: int, timeout: int = 30) -> cryptnox_sdk_py.Card: description = f"into reader with index {card_id}" if card_id < 100 else \ f"with serial number {card_id}" print(f"Insert card {description} or press CTRL+C to exit") diff --git a/cryptnoxpro/command/helper/config.py b/cryptnox_cli/command/helper/config.py similarity index 87% rename from cryptnoxpro/command/helper/config.py rename to cryptnox_cli/command/helper/config.py index b1e09f8..8dbf6cf 100644 --- a/cryptnoxpro/command/helper/config.py +++ b/cryptnox_cli/command/helper/config.py @@ -6,7 +6,7 @@ from typing import Union -import cryptnoxpy +import cryptnox_sdk_py try: from config import ( @@ -46,12 +46,12 @@ def add_config_sub_parser(sub_parser, crypto_currency: str) -> None: "and key") -def create_config_method(card: cryptnoxpy.Card, key: Union[str, None], value: Union[str, None], +def create_config_method(card: cryptnox_sdk_py.Card, key: Union[str, None], value: Union[str, None], currency_name: str) -> int: """ Create config method for specific cryptocurrency - :param cryptnoxpy.Card card: Card to use for the operation + :param cryptnox_sdk_py.Card card: Card to use for the operation :param key: Key of the configuration dictionary to be edited :param value: Value to be inserted into configuration or None :param currency_name: Name of the crypto for which to create @@ -68,11 +68,11 @@ def create_config_method(card: cryptnoxpy.Card, key: Union[str, None], value: Un return print_section_config(card, currency_name) -def print_config(card: cryptnoxpy.Card, exclude=None) -> None: +def print_config(card: cryptnox_sdk_py.Card, exclude=None) -> None: """ Prints contents of config. - :param cryptnoxpy.Card card: Card to use for the operation + :param cryptnox_sdk_py.Card card: Card to use for the operation :param Dict exclude: Exclude section from printing """ exclude = exclude or ["hidden"] @@ -86,11 +86,11 @@ def print_config(card: cryptnoxpy.Card, exclude=None) -> None: print(f"{key}: {value}" + find_endpoint(section, key, value, " - Read only")) -def print_section_config(card: cryptnoxpy.Card, section: str) -> int: +def print_section_config(card: cryptnox_sdk_py.Card, section: str) -> int: """ Prints contents of a section from configuration. - :param cryptnoxpy.Card card: Card to use for the operation + :param cryptnox_sdk_py.Card card: Card to use for the operation :param section: Section of the configuration file wanted printed :return: Execution status @@ -109,11 +109,11 @@ def print_section_config(card: cryptnoxpy.Card, section: str) -> int: return 0 -def print_key_config(card: cryptnoxpy.Card, section: str, key: str) -> int: +def print_key_config(card: cryptnox_sdk_py.Card, section: str, key: str) -> int: """ Prints key and value from section in config. - :param cryptnoxpy.Card card: Card to use for the operation + :param cryptnox_sdk_py.Card card: Card to use for the operation :param section: Section of the configuration file wanted printed :param key: Name of the parameter we want to change @@ -145,11 +145,11 @@ def find_endpoint(section: str, key: str, value: str, append: str = "") -> str: return "" -def write_config(card: cryptnoxpy.Card, section: str, key: str, value: str) -> int: +def write_config(card: cryptnox_sdk_py.Card, section: str, key: str, value: str) -> int: """ Writes new value at chosen section and key. - :param cryptnoxpy.Card card: Card to use for the operation + :param cryptnox_sdk_py.Card card: Card to use for the operation :param section: Section of the config file to write to :param key: Name of the parameter we want to change :param value: Value we want to insert into the configuration file diff --git a/cryptnoxpro/command/helper/download_folder.py b/cryptnox_cli/command/helper/download_folder.py similarity index 100% rename from cryptnoxpro/command/helper/download_folder.py rename to cryptnox_cli/command/helper/download_folder.py diff --git a/cryptnoxpro/command/helper/helper_methods.py b/cryptnox_cli/command/helper/helper_methods.py similarity index 88% rename from cryptnoxpro/command/helper/helper_methods.py rename to cryptnox_cli/command/helper/helper_methods.py index 64d6caa..576e1ce 100644 --- a/cryptnoxpro/command/helper/helper_methods.py +++ b/cryptnox_cli/command/helper/helper_methods.py @@ -9,7 +9,7 @@ from typing import Any import argparse -import cryptnoxpy +import cryptnox_sdk_py from . import security from .. import user_keys @@ -58,17 +58,17 @@ def exception(self): return argparse.ArgumentTypeError("Must be an integer") -def sign(card: cryptnoxpy.Card, message: bytes, - derivation: cryptnoxpy.Derivation = cryptnoxpy.Derivation.CURRENT_KEY, - key_type: cryptnoxpy.KeyType = cryptnoxpy.KeyType.K1, path: str = "", +def sign(card: cryptnox_sdk_py.Card, message: bytes, + derivation: cryptnox_sdk_py.Derivation = cryptnox_sdk_py.Derivation.CURRENT_KEY, + key_type: cryptnox_sdk_py.KeyType = cryptnox_sdk_py.KeyType.K1, path: str = "", filter_eos: bool = False, pin_code: str = "") -> bytes: """ Open the card with a user key or PIN code and sign the given message in the given card :param crypnoxpy.Card card: Card to use for signature :param bytes message: Message to sign with the card - :param cryptnoxpy.Derivation derivation: Derivation to use when signing - :param cryptnoxpy.KeyType key_type: Key type to use when signing + :param cryptnox_sdk_py.Derivation derivation: Derivation to use when signing + :param cryptnox_sdk_py.KeyType key_type: Key type to use when signing :param str path: Path to use for signature generation :param bool filter_eos: Filter signature to be compatible with eos requirements :param str pin_code: If PIN code is given use it instead of asking for it diff --git a/cryptnoxpro/command/helper/notification.py b/cryptnox_cli/command/helper/notification.py similarity index 100% rename from cryptnoxpro/command/helper/notification.py rename to cryptnox_cli/command/helper/notification.py diff --git a/cryptnoxpro/command/helper/security.py b/cryptnox_cli/command/helper/security.py similarity index 91% rename from cryptnoxpro/command/helper/security.py rename to cryptnox_cli/command/helper/security.py index 2bc6995..b0d65b8 100644 --- a/cryptnoxpro/command/helper/security.py +++ b/cryptnox_cli/command/helper/security.py @@ -5,7 +5,7 @@ import typing from typing import List, Dict -import cryptnoxpy +import cryptnox_sdk_py from .. import user_keys @@ -61,7 +61,7 @@ def check(card, check_seed: bool = True) -> bool: card.check_init() if not card.valid_key and check_seed: - raise cryptnoxpy.exceptions.SeedException("The key is not generated") + raise cryptnox_sdk_py.exceptions.SeedException("The key is not generated") result = False try: @@ -105,7 +105,7 @@ def check_pin_code(card, text: str = "Cryptnox PIN code: ") -> str: try: authorized = _check_pin_code(card, pin_code, not easy_mode) - except cryptnoxpy.exceptions.PinException: + except cryptnox_sdk_py.exceptions.PinException: if easy_mode: print(f"{EASY_MODE_TEXT} PIN doesn't work. Try other PIN code.\n") easy_mode = False @@ -115,7 +115,7 @@ def check_pin_code(card, text: str = "Cryptnox PIN code: ") -> str: return pin_code -def get_pin_code(card: cryptnoxpy.Card, text: str = "Enter PIN code:", +def get_pin_code(card: cryptnox_sdk_py.Card, text: str = "Enter PIN code:", allowed_values: List[str] = None) -> str: """ Get PIN code from the user according to the rules. @@ -138,7 +138,7 @@ def is_easy_mode(card_info: Dict): def process_command_with_puk( - card: cryptnoxpy.Card, + card: cryptnox_sdk_py.Card, function: typing.Callable, *args, **kwargs) -> bool: @@ -155,7 +155,7 @@ def process_command_with_puk( try: result = function(*args, **kwargs, puk=puk_code) - except cryptnoxpy.exceptions.PukException as error: + except cryptnox_sdk_py.exceptions.PukException as error: if easy_mode: print(f"{EASY_MODE_TEXT} PUK doesn't work. Try other PUK code.\n") easy_mode = False @@ -174,7 +174,7 @@ def process_command_with_puk( def _check_pin_code(card, pin_code, handle_exception: bool = True) -> bool: try: card.verify_pin(str(pin_code)) - except cryptnoxpy.exceptions.PinException as error: + except cryptnox_sdk_py.exceptions.PinException as error: if not handle_exception: raise error number_of_retries = error.number_of_retries @@ -188,7 +188,7 @@ def _check_pin_code(card, pin_code, handle_exception: bool = True) -> bool: return True -def get_puk_code(card: cryptnoxpy.Card, text: str = "", allowed_values: List = None) -> str: +def get_puk_code(card: cryptnox_sdk_py.Card, text: str = "", allowed_values: List = None) -> str: """ Get user input for puk code and check if it is valid. @@ -216,7 +216,7 @@ def _get_code( while True: try: validation_method(code) - except cryptnoxpy.exceptions.DataValidationException as error: + except cryptnox_sdk_py.exceptions.DataValidationException as error: print(error, "\n") code = _secret_with_exit(text, required=("" not in allowed_values)) diff --git a/cryptnoxpro/command/helper/seed_backup.py b/cryptnox_cli/command/helper/seed_backup.py similarity index 100% rename from cryptnoxpro/command/helper/seed_backup.py rename to cryptnox_cli/command/helper/seed_backup.py diff --git a/cryptnoxpro/command/helper/ui.py b/cryptnox_cli/command/helper/ui.py similarity index 96% rename from cryptnoxpro/command/helper/ui.py rename to cryptnox_cli/command/helper/ui.py index 8d40aa5..09bc040 100644 --- a/cryptnoxpro/command/helper/ui.py +++ b/cryptnox_cli/command/helper/ui.py @@ -9,12 +9,12 @@ from collections import namedtuple from typing import List, Union, Dict -import cryptnoxpy +import cryptnox_sdk_py from stdiomask import getpass from tabulate import tabulate from . import security -from cryptnoxpro.constants import MAX_PASSPHRASE_LENGTH +from cryptnox_cli.constants import MAX_PASSPHRASE_LENGTH InitData = namedtuple("InitData", ["name", "email", "pin", "puk"]) @@ -80,7 +80,7 @@ def input_type(text, required=True, type_of_input=str): pass -def get_init_data(card: cryptnoxpy.card, easy_mode: bool = False) -> InitData: +def get_init_data(card: cryptnox_sdk_py.card, easy_mode: bool = False) -> InitData: if easy_mode and not confirm("Do you wish to proceed?", f"WARNING: THIS WILL INITIALIZE THE CARD " f"IN {security.EASY_MODE_TEXT.upper()}"): @@ -156,12 +156,12 @@ def _get_name() -> str: "20 chars.") -def _get_pin_code(card: cryptnoxpy.Card) -> str: +def _get_pin_code(card: cryptnox_sdk_py.Card) -> str: return _verify_input(card, security.get_pin_code, f"Set card PIN code ({card.pin_rule}): ", f" Repeat PIN code ({card.pin_rule}): ") -def _get_puk_code(card: cryptnoxpy.Card) -> str: +def _get_puk_code(card: cryptnox_sdk_py.Card) -> str: print(f"For the PUK code: 1) Input your own {card.puk_rule} PUK") print(" 2) Generate a random one ") puk_choice = input_with_exit("> ") @@ -190,7 +190,7 @@ def _get_valid_input(text: str, valid, error: str = "Invalid value") -> str: return user_input -def _verify_input(card: cryptnoxpy.Card, method, text, verify_text, +def _verify_input(card: cryptnox_sdk_py.Card, method, text, verify_text, error: str = "The given values are not the same.") -> str: while True: value = method(card, text) diff --git a/cryptnoxpro/command/history.py b/cryptnox_cli/command/history.py similarity index 100% rename from cryptnoxpro/command/history.py rename to cryptnox_cli/command/history.py diff --git a/cryptnoxpro/command/info.py b/cryptnox_cli/command/info.py similarity index 100% rename from cryptnoxpro/command/info.py rename to cryptnox_cli/command/info.py diff --git a/cryptnoxpro/command/initialize.py b/cryptnox_cli/command/initialize.py similarity index 100% rename from cryptnoxpro/command/initialize.py rename to cryptnox_cli/command/initialize.py diff --git a/cryptnoxpro/command/options/__init__.py b/cryptnox_cli/command/options/__init__.py similarity index 100% rename from cryptnoxpro/command/options/__init__.py rename to cryptnox_cli/command/options/__init__.py diff --git a/cryptnoxpro/command/options/common.py b/cryptnox_cli/command/options/common.py similarity index 100% rename from cryptnoxpro/command/options/common.py rename to cryptnox_cli/command/options/common.py diff --git a/cryptnoxpro/command/options/eth.py b/cryptnox_cli/command/options/eth.py similarity index 100% rename from cryptnoxpro/command/options/eth.py rename to cryptnox_cli/command/options/eth.py diff --git a/cryptnoxpro/command/options/options.py b/cryptnox_cli/command/options/options.py similarity index 99% rename from cryptnoxpro/command/options/options.py rename to cryptnox_cli/command/options/options.py index 047ca41..28fce5e 100644 --- a/cryptnoxpro/command/options/options.py +++ b/cryptnox_cli/command/options/options.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ Module for defining command-line argument parsers and subcommands -for various CryptnoxPro operations including Bitcoin, Ethereum, +for various Cryptnox CLI operations including Bitcoin, Ethereum, and card management commands. """ diff --git a/cryptnoxpro/command/reset.py b/cryptnox_cli/command/reset.py similarity index 90% rename from cryptnoxpro/command/reset.py rename to cryptnox_cli/command/reset.py index f0ac39f..edccd44 100644 --- a/cryptnoxpro/command/reset.py +++ b/cryptnox_cli/command/reset.py @@ -2,7 +2,7 @@ """ Module containing command for resetting content of card to factory default """ -import cryptnoxpy +import cryptnox_sdk_py from .helper import security from .command import Command @@ -22,7 +22,7 @@ class Reset(Command): """ _name = enums.Command.RESET.value - def _execute(self, card: cryptnoxpy.Card) -> int: + def _execute(self, card: cryptnox_sdk_py.Card) -> int: if not card.initialized: print("Card is not initialized. Already cleared.") return 0 diff --git a/cryptnoxpro/command/seed.py b/cryptnox_cli/command/seed.py similarity index 95% rename from cryptnoxpro/command/seed.py rename to cryptnox_cli/command/seed.py index 975046c..4843848 100644 --- a/cryptnoxpro/command/seed.py +++ b/cryptnox_cli/command/seed.py @@ -8,7 +8,7 @@ from pathlib import Path from typing import Union, Tuple -import cryptnoxpy +import cryptnox_sdk_py from tabulate import tabulate from . import user_keys @@ -66,7 +66,7 @@ def _execute(self, card) -> int: return result @staticmethod - def _backup(card: cryptnoxpy.Card, pin_code: str = None, seed: bytes = None, + def _backup(card: cryptnox_sdk_py.Card, pin_code: str = None, seed: bytes = None, passphrase: str = '') -> int: """ Backup seed to AWS KMS and load onto card with optional BIP39 passphrase. @@ -182,7 +182,7 @@ def _backup_service(access_key_id: str = '', secret_access_key: str = '') -> Uni return service @staticmethod - def _chip(card: cryptnoxpy.Card) -> int: + def _chip(card: cryptnox_sdk_py.Card) -> int: """ Generate seed directly in the card's secure chip. @@ -226,7 +226,7 @@ def _credentials(credential_file: Path = None) -> Tuple[str, str]: return access_key_id, secret_access_key - def _dual_seed(self, card: cryptnoxpy.Card) -> int: + def _dual_seed(self, card: cryptnox_sdk_py.Card) -> int: """ Generate the same seed on two cards using secure dual-card generation. @@ -243,7 +243,7 @@ def _dual_seed(self, card: cryptnoxpy.Card) -> int: except NotImplementedError as error: print(error) return -1 - except cryptnoxpy.exceptions.DataValidationException: + except cryptnox_sdk_py.exceptions.DataValidationException: pass print("Dual seed generation process starting...") @@ -295,7 +295,7 @@ def _dual_seed(self, card: cryptnoxpy.Card) -> int: return 0 @staticmethod - def _get_pin_code(card: cryptnoxpy.Card) -> str: + def _get_pin_code(card: cryptnox_sdk_py.Card) -> str: card.check_init() pin_code = "" @@ -305,12 +305,12 @@ def _get_pin_code(card: cryptnoxpy.Card) -> str: pin_code = security.check_pin_code(card) except NotImplementedError: pin_code = security.check_pin_code(card) - elif card.auth_type == cryptnoxpy.AuthType.PIN: + elif card.auth_type == cryptnox_sdk_py.AuthType.PIN: pin_code = security.check_pin_code(card) return pin_code - def _get_second_card(self, index: int, first_card_serial_number: int) -> cryptnoxpy.Card: + def _get_second_card(self, index: int, first_card_serial_number: int) -> cryptnox_sdk_py.Card: while True: card = self._cards[index] if not card.initialized: @@ -331,7 +331,7 @@ def _get_second_card(self, index: int, first_card_serial_number: int) -> cryptno print(f"Second card, {card.serial_number} doesn't have this functionality. " f"Insert another card") input("Press ENTER to continue.") - except cryptnoxpy.exceptions.DataValidationException: + except cryptnox_sdk_py.exceptions.DataValidationException: break else: break @@ -339,7 +339,7 @@ def _get_second_card(self, index: int, first_card_serial_number: int) -> cryptno return card @staticmethod - def _load_mnemonic(card: cryptnoxpy.Card, mnemonic: str, pin_code: str, + def _load_mnemonic(card: cryptnox_sdk_py.Card, mnemonic: str, pin_code: str, passphrase: str = '') -> None: """ Load mnemonic onto card with optional BIP39 passphrase. @@ -355,7 +355,7 @@ def _load_mnemonic(card: cryptnoxpy.Card, mnemonic: str, pin_code: str, card.load_seed(seed, pin_code) @staticmethod - def _recover(card: cryptnoxpy.Card) -> int: + def _recover(card: cryptnox_sdk_py.Card) -> int: """ Recover wallet from BIP39 mnemonic phrase with optional passphrase. @@ -406,7 +406,7 @@ def _remove_credentials(credentials_file: Path, service: backup.AWS) -> None: print('Your credential file and credentials have been deleted.') @staticmethod - def _restore(card: cryptnoxpy.Card) -> int: + def _restore(card: cryptnox_sdk_py.Card) -> int: """ Restore seed from AWS KMS backup with optional BIP39 passphrase. @@ -462,7 +462,7 @@ def _restore(card: cryptnoxpy.Card) -> int: return 0 @staticmethod - def _upload(card: cryptnoxpy.Card) -> int: + def _upload(card: cryptnox_sdk_py.Card) -> int: """ Generate new seed, optionally with BIP39 passphrase, and upload to card. diff --git a/cryptnoxpro/command/server.py b/cryptnox_cli/command/server.py similarity index 95% rename from cryptnoxpro/command/server.py rename to cryptnox_cli/command/server.py index 8967245..0a12a70 100644 --- a/cryptnoxpro/command/server.py +++ b/cryptnox_cli/command/server.py @@ -7,7 +7,7 @@ import types import socket -import cryptnoxpy +import cryptnox_sdk_py from .command import Command @@ -22,7 +22,7 @@ class Server(Command): _HEADER_SIZE = 64 _ENCODING = 'utf-8' - def _execute(self, card: cryptnoxpy) -> int: + def _execute(self, card: cryptnox_sdk_py.Card) -> int: self.sel = selectors.DefaultSelector() self.card = card self._start(self.data.host, self.data.port) @@ -107,7 +107,7 @@ def _process_in_card(self, pickled_data: str) -> bytes: try: response = self.card.connection._reader.send(command) - except cryptnoxpy.exceptions.CryptnoxException as error: + except cryptnox_sdk_py.exceptions.CryptnoxException as error: print(f'Error with card: {error}') return b'' diff --git a/cryptnoxpro/command/transfer.py b/cryptnox_cli/command/transfer.py similarity index 100% rename from cryptnoxpro/command/transfer.py rename to cryptnox_cli/command/transfer.py diff --git a/cryptnoxpro/command/unknown.py b/cryptnox_cli/command/unknown.py similarity index 100% rename from cryptnoxpro/command/unknown.py rename to cryptnox_cli/command/unknown.py diff --git a/cryptnoxpro/command/unlock_pin.py b/cryptnox_cli/command/unlock_pin.py similarity index 100% rename from cryptnoxpro/command/unlock_pin.py rename to cryptnox_cli/command/unlock_pin.py diff --git a/cryptnoxpro/command/user_key.py b/cryptnox_cli/command/user_key.py similarity index 89% rename from cryptnoxpro/command/user_key.py rename to cryptnox_cli/command/user_key.py index 0672310..d9896b1 100644 --- a/cryptnoxpro/command/user_key.py +++ b/cryptnox_cli/command/user_key.py @@ -5,7 +5,7 @@ """ import shutil -import cryptnoxpy +import cryptnox_sdk_py from tabulate import tabulate from . import user_keys @@ -27,7 +27,7 @@ class UserKey(Command): """ _name = enums.Command.USER_KEY.value - def _execute(self, card: cryptnoxpy.Card) -> int: + def _execute(self, card: cryptnox_sdk_py.Card) -> int: if card.type != ord("B"): print("Method not supported with this card type.") return -2 @@ -50,7 +50,7 @@ def _execute(self, card: cryptnoxpy.Card) -> int: return -1 @staticmethod - def _add(card: cryptnoxpy.Card, auth_type: str, description: str = "") -> int: + def _add(card: cryptnox_sdk_py.Card, auth_type: str, description: str = "") -> int: result = -1 if card.user_key_enabled(user_keys.get()[auth_type]): print("Card has already key of this type.") @@ -63,7 +63,7 @@ def _add(card: cryptnoxpy.Card, auth_type: str, description: str = "") -> int: return result @staticmethod - def _delete(card: cryptnoxpy.Card, auth_type: str) -> int: + def _delete(card: cryptnox_sdk_py.Card, auth_type: str) -> int: result = -1 if not card.user_key_enabled(user_keys.get()[auth_type]): print("Target key not found.") @@ -75,7 +75,7 @@ def _delete(card: cryptnoxpy.Card, auth_type: str) -> int: return result - def _list(self, card: cryptnoxpy.Card) -> int: + def _list(self, card: cryptnox_sdk_py.Card) -> int: slots = user_keys.get(card) data = [[name] for name, slot in slots.items() if card.user_key_enabled(slot)] diff --git a/cryptnoxpro/command/user_keys/__init__.py b/cryptnox_cli/command/user_keys/__init__.py similarity index 100% rename from cryptnoxpro/command/user_keys/__init__.py rename to cryptnox_cli/command/user_keys/__init__.py diff --git a/cryptnoxpro/command/user_keys/authentication.py b/cryptnox_cli/command/user_keys/authentication.py similarity index 90% rename from cryptnoxpro/command/user_keys/authentication.py rename to cryptnox_cli/command/user_keys/authentication.py index 69f731a..63f2f6b 100644 --- a/cryptnoxpro/command/user_keys/authentication.py +++ b/cryptnox_cli/command/user_keys/authentication.py @@ -8,7 +8,7 @@ Type ) -import cryptnoxpy +import cryptnox_sdk_py from . import user_key_base @@ -17,7 +17,7 @@ importlib.import_module("." + path.name, package=__package__) -def add(name: str, card: cryptnoxpy.Card, description: str, puk: str) -> bool: +def add(name: str, card: cryptnox_sdk_py.Card, description: str, puk: str) -> bool: """ Add user key defined by name to the card @@ -72,11 +72,11 @@ def add(name: str, card: cryptnoxpy.Card, description: str, puk: str) -> bool: return True -def authenticate(card: cryptnoxpy.Card, message: bytes = b"") -> bool: +def authenticate(card: cryptnox_sdk_py.Card, message: bytes = b"") -> bool: """ Authenticate the card by using a signature from third party - :param cryptnoxpy.Card card: Card to use to authenticate + :param cryptnox_sdk_py.Card card: Card to use to authenticate :param bytes message: Message to sign to open the card, if left empty, challenge-response authentication will be used @@ -117,12 +117,12 @@ def authenticate(card: cryptnoxpy.Card, message: bytes = b"") -> bool: return result -def delete(name: str, card: cryptnoxpy.Card, puk: str) -> bool: +def delete(name: str, card: cryptnox_sdk_py.Card, puk: str) -> bool: """ Delete the key from the card :param str name: Name of the service which to delete - :param cryptnoxpy.Card card: Card to use + :param cryptnox_sdk_py.Card card: Card to use :param str puk: PUK code of card """ try: @@ -150,12 +150,12 @@ def delete(name: str, card: cryptnoxpy.Card, puk: str) -> bool: return True -def get(card: cryptnoxpy.Card = None) -> Dict[str, cryptnoxpy.SlotIndex]: +def get(card: cryptnox_sdk_py.Card = None) -> Dict[str, cryptnox_sdk_py.SlotIndex]: """ Get all user key module names and the slot index they are connected to on the card :return: A dictionary containing names of services with the slot they take on card - :rtype: Dict[str, cryptnoxpy.SlotIndex] + :rtype: Dict[str, cryptnox_sdk_py.SlotIndex] """ user_keys = {} diff --git a/cryptnoxpro/command/user_keys/aws_kms/__init__.py b/cryptnox_cli/command/user_keys/aws_kms/__init__.py similarity index 100% rename from cryptnoxpro/command/user_keys/aws_kms/__init__.py rename to cryptnox_cli/command/user_keys/aws_kms/__init__.py diff --git a/cryptnoxpro/command/user_keys/aws_kms/aws_kms.py b/cryptnox_cli/command/user_keys/aws_kms/aws_kms.py similarity index 98% rename from cryptnoxpro/command/user_keys/aws_kms/aws_kms.py rename to cryptnox_cli/command/user_keys/aws_kms/aws_kms.py index 8dd9a72..56dbe44 100644 --- a/cryptnoxpro/command/user_keys/aws_kms/aws_kms.py +++ b/cryptnox_cli/command/user_keys/aws_kms/aws_kms.py @@ -8,7 +8,7 @@ from typing import Tuple import boto3 -import cryptnoxpy +import cryptnox_sdk_py from botocore.client import BaseClient as AwsClient from botocore.exceptions import ClientError from cryptography.hazmat.backends import default_backend @@ -30,7 +30,7 @@ class AwsKms(UserKey): name = 'aws_kms' description = 'AWS KMS' priority = 200 - slot_index = cryptnoxpy.SlotIndex.EC256R1 + slot_index = cryptnox_sdk_py.SlotIndex.EC256R1 custom_bit = 1 KEY_ID = 'cryptnox_card_open' diff --git a/cryptnoxpro/command/user_keys/hello/__init__.py b/cryptnox_cli/command/user_keys/hello/__init__.py similarity index 100% rename from cryptnoxpro/command/user_keys/hello/__init__.py rename to cryptnox_cli/command/user_keys/hello/__init__.py diff --git a/cryptnoxpro/command/user_keys/hello/exceptions.py b/cryptnox_cli/command/user_keys/hello/exceptions.py similarity index 100% rename from cryptnoxpro/command/user_keys/hello/exceptions.py rename to cryptnox_cli/command/user_keys/hello/exceptions.py diff --git a/cryptnoxpro/command/user_keys/hello/hello.py b/cryptnox_cli/command/user_keys/hello/hello.py similarity index 97% rename from cryptnoxpro/command/user_keys/hello/hello.py rename to cryptnox_cli/command/user_keys/hello/hello.py index 5a5dd03..0e19539 100644 --- a/cryptnoxpro/command/user_keys/hello/hello.py +++ b/cryptnox_cli/command/user_keys/hello/hello.py @@ -11,7 +11,7 @@ import concurrent.futures import sys -import cryptnoxpy +import cryptnox_sdk_py from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization @@ -26,7 +26,7 @@ class Hello(user_key_base.UserKey): name = "hello" description = "Windows Hello" priority = 100 - slot_index = cryptnoxpy.SlotIndex.RSA + slot_index = cryptnox_sdk_py.SlotIndex.RSA custom_bit = 2 def __init__(self, target: str = ""): diff --git a/cryptnoxpro/command/user_keys/hello/windows_hello.py b/cryptnox_cli/command/user_keys/hello/windows_hello.py similarity index 100% rename from cryptnoxpro/command/user_keys/hello/windows_hello.py rename to cryptnox_cli/command/user_keys/hello/windows_hello.py diff --git a/cryptnoxpro/command/user_keys/piv/__init__.py b/cryptnox_cli/command/user_keys/piv/__init__.py similarity index 100% rename from cryptnoxpro/command/user_keys/piv/__init__.py rename to cryptnox_cli/command/user_keys/piv/__init__.py diff --git a/cryptnoxpro/command/user_keys/piv/piv.py b/cryptnox_cli/command/user_keys/piv/piv.py similarity index 97% rename from cryptnoxpro/command/user_keys/piv/piv.py rename to cryptnox_cli/command/user_keys/piv/piv.py index d61cc17..06b00cb 100644 --- a/cryptnoxpro/command/user_keys/piv/piv.py +++ b/cryptnox_cli/command/user_keys/piv/piv.py @@ -4,7 +4,7 @@ """ from hashlib import sha256 -import cryptnoxpy +import cryptnox_sdk_py from cryptography import x509 from cryptography.hazmat.primitives.serialization import PublicFormat, Encoding from stdiomask import getpass @@ -19,7 +19,7 @@ class Piv(user_key_base.UserKey): """ name = "piv" description = "PIV applet" - slot_index = cryptnoxpy.SlotIndex.EC256R1 + slot_index = cryptnox_sdk_py.SlotIndex.EC256R1 custom_bit = 0 def delete(self): diff --git a/cryptnoxpro/command/user_keys/piv/piv_card.py b/cryptnox_cli/command/user_keys/piv/piv_card.py similarity index 100% rename from cryptnoxpro/command/user_keys/piv/piv_card.py rename to cryptnox_cli/command/user_keys/piv/piv_card.py diff --git a/cryptnoxpro/command/user_keys/user_key_base.py b/cryptnox_cli/command/user_keys/user_key_base.py similarity index 91% rename from cryptnoxpro/command/user_keys/user_key_base.py rename to cryptnox_cli/command/user_keys/user_key_base.py index 108f31f..ed9f143 100644 --- a/cryptnoxpro/command/user_keys/user_key_base.py +++ b/cryptnox_cli/command/user_keys/user_key_base.py @@ -4,7 +4,7 @@ """ import abc -import cryptnoxpy +import cryptnox_sdk_py class UserKeyException(Exception): @@ -89,10 +89,10 @@ def sign(self, message: bytes) -> bytes: @property @abc.abstractmethod - def slot_index(self) -> cryptnoxpy.SlotIndex: + def slot_index(self) -> cryptnox_sdk_py.SlotIndex: """ :return: Compatible slot index on the card - :rtype: cryptnoxpy.SlotIndex + :rtype: cryptnox_sdk_py.SlotIndex """ @property @@ -121,11 +121,11 @@ def __subclasshook__(cls, c): return NotImplemented @classmethod - def enabled(cls, card: cryptnoxpy.Card) -> bool: + def enabled(cls, card: cryptnox_sdk_py.Card) -> bool: return card.user_key_enabled(cls.slot_index) and cls._custom_bit_enabled(card) @classmethod - def _custom_bit_enabled(cls, card: cryptnoxpy.Card) -> bool: + def _custom_bit_enabled(cls, card: cryptnox_sdk_py.Card) -> bool: try: return cls.custom_bit == -1 or card.custom_bits[cls.custom_bit] except IndexError: diff --git a/cryptnoxpro/config.py b/cryptnox_cli/config.py similarity index 81% rename from cryptnoxpro/config.py rename to cryptnox_cli/config.py index 63323ac..254d122 100644 --- a/cryptnoxpro/config.py +++ b/cryptnox_cli/config.py @@ -9,7 +9,7 @@ Dict ) -import cryptnoxpy +import cryptnox_sdk_py try: from command.helper import helper_methods @@ -48,11 +48,11 @@ def get_default_configuration() -> Dict: return config -def get_configuration(card: cryptnoxpy.Card) -> Dict: +def get_configuration(card: cryptnox_sdk_py.Card) -> Dict: """ Get the configuration. - :param cryptnoxpy.Card card: Serial number of the card used + :param cryptnox_sdk_py.Card card: Serial number of the card used :return: Configuration from file or default configuration if not found :rtype: dict @@ -67,11 +67,11 @@ def get_configuration(card: cryptnoxpy.Card) -> Dict: return config -def save_to_config(card: cryptnoxpy.Card, config: Dict[str, Any]) -> None: +def save_to_config(card: cryptnox_sdk_py.Card, config: Dict[str, Any]) -> None: """ Save given configuration to file. - :param cryptnoxpy.Card card: Serial number of the card used + :param cryptnox_sdk_py.Card card: Serial number of the card used :param Dict[str, Any] config: Configuration to save """ _CONFIGURATION[card.serial_number] = config @@ -79,11 +79,11 @@ def save_to_config(card: cryptnoxpy.Card, config: Dict[str, Any]) -> None: card.user_data[0] = gzip.compress(bytes(json.dumps(config), "UTF-8")) -def read_card_config(card: cryptnoxpy.Card) -> Dict: +def read_card_config(card: cryptnox_sdk_py.Card) -> Dict: """ Reads the configuration. - :param cryptnoxpy.Card card: Serial number of the card used + :param cryptnox_sdk_py.Card card: Serial number of the card used :return: Configuration read from the file :rtype: dict diff --git a/cryptnox_cli/constants.py b/cryptnox_cli/constants.py new file mode 100644 index 0000000..0719a60 --- /dev/null +++ b/cryptnox_cli/constants.py @@ -0,0 +1,5 @@ +""" +Centralized constants for the Cryptnox CLI. +""" + +MAX_PASSPHRASE_LENGTH = 100 diff --git a/cryptnoxpro/contract_abi/erc1155.json b/cryptnox_cli/contract_abi/erc1155.json similarity index 100% rename from cryptnoxpro/contract_abi/erc1155.json rename to cryptnox_cli/contract_abi/erc1155.json diff --git a/cryptnoxpro/contract_abi/erc20.json b/cryptnox_cli/contract_abi/erc20.json similarity index 100% rename from cryptnoxpro/contract_abi/erc20.json rename to cryptnox_cli/contract_abi/erc20.json diff --git a/cryptnoxpro/contract_abi/erc721.json b/cryptnox_cli/contract_abi/erc721.json similarity index 100% rename from cryptnoxpro/contract_abi/erc721.json rename to cryptnox_cli/contract_abi/erc721.json diff --git a/cryptnoxpro/enums.py b/cryptnox_cli/enums.py similarity index 100% rename from cryptnoxpro/enums.py rename to cryptnox_cli/enums.py diff --git a/cryptnoxpro/interactive_cli.py b/cryptnox_cli/interactive_cli.py similarity index 97% rename from cryptnoxpro/interactive_cli.py rename to cryptnox_cli/interactive_cli.py index ff281af..bafec0f 100644 --- a/cryptnoxpro/interactive_cli.py +++ b/cryptnox_cli/interactive_cli.py @@ -9,7 +9,7 @@ from typing import List import argparse -import cryptnoxpy +import cryptnox_sdk_py try: import config @@ -358,7 +358,7 @@ def _use(self, serial_index): self._card_info = self._cards.select_card().info else: self._card_info = self._cards[serial_index - 1].info - except (cryptnoxpy.exceptions.CryptnoxException, ExitException, TimeoutException) as error: + except (cryptnox_sdk_py.exceptions.CryptnoxException, ExitException, TimeoutException) as error: print(error) return @@ -380,7 +380,7 @@ def _prompt(self) -> str: except TypeError: serial = "" - card = "cryptnoxpro" if large_screen else "cryptnox" + card = "cryptnox_cli" if large_screen else "cryptnox" try: commands = [f"{subcommand} > " for subcommand in self.subcommand] @@ -417,7 +417,7 @@ def _run_command(self, args: argparse.Namespace, to_always_run: List = None) -> self._card_info = self._cards[command.serial_number].info except KeyError: pass - except (cryptnoxpy.exceptions.CryptnoxException, ExitException, TimeoutException) as error: + except (cryptnox_sdk_py.exceptions.CryptnoxException, ExitException, TimeoutException) as error: print(error) print("\n") @@ -425,7 +425,7 @@ def _run_command(self, args: argparse.Namespace, to_always_run: List = None) -> def _prepare_parser(self) -> None: self.parser = UsageParser(description="Cryptnox command line interface") self.parser.add_argument(" version", action="version", - version=f"Cryptnox Pro {self.version}", + version=f"Cryptnox CLI {self.version}", help="Show program's version number") options.add(self.parser, True) diff --git a/cryptnoxpro/lib/__init__.py b/cryptnox_cli/lib/__init__.py similarity index 100% rename from cryptnoxpro/lib/__init__.py rename to cryptnox_cli/lib/__init__.py diff --git a/cryptnoxpro/lib/cryptos/__init__.py b/cryptnox_cli/lib/cryptos/__init__.py similarity index 100% rename from cryptnoxpro/lib/cryptos/__init__.py rename to cryptnox_cli/lib/cryptos/__init__.py diff --git a/cryptnoxpro/lib/cryptos/blocks.py b/cryptnox_cli/lib/cryptos/blocks.py similarity index 100% rename from cryptnoxpro/lib/cryptos/blocks.py rename to cryptnox_cli/lib/cryptos/blocks.py diff --git a/cryptnoxpro/lib/cryptos/coins/__init__.py b/cryptnox_cli/lib/cryptos/coins/__init__.py similarity index 100% rename from cryptnoxpro/lib/cryptos/coins/__init__.py rename to cryptnox_cli/lib/cryptos/coins/__init__.py diff --git a/cryptnoxpro/lib/cryptos/coins/base.py b/cryptnox_cli/lib/cryptos/coins/base.py similarity index 100% rename from cryptnoxpro/lib/cryptos/coins/base.py rename to cryptnox_cli/lib/cryptos/coins/base.py diff --git a/cryptnoxpro/lib/cryptos/coins/bitcoin.py b/cryptnox_cli/lib/cryptos/coins/bitcoin.py similarity index 100% rename from cryptnoxpro/lib/cryptos/coins/bitcoin.py rename to cryptnox_cli/lib/cryptos/coins/bitcoin.py diff --git a/cryptnoxpro/lib/cryptos/composite.py b/cryptnox_cli/lib/cryptos/composite.py similarity index 100% rename from cryptnoxpro/lib/cryptos/composite.py rename to cryptnox_cli/lib/cryptos/composite.py diff --git a/cryptnoxpro/lib/cryptos/constants.py b/cryptnox_cli/lib/cryptos/constants.py similarity index 100% rename from cryptnoxpro/lib/cryptos/constants.py rename to cryptnox_cli/lib/cryptos/constants.py diff --git a/cryptnoxpro/lib/cryptos/deterministic.py b/cryptnox_cli/lib/cryptos/deterministic.py similarity index 100% rename from cryptnoxpro/lib/cryptos/deterministic.py rename to cryptnox_cli/lib/cryptos/deterministic.py diff --git a/cryptnoxpro/lib/cryptos/english.txt b/cryptnox_cli/lib/cryptos/english.txt similarity index 100% rename from cryptnoxpro/lib/cryptos/english.txt rename to cryptnox_cli/lib/cryptos/english.txt diff --git a/cryptnoxpro/lib/cryptos/keystore.py b/cryptnox_cli/lib/cryptos/keystore.py similarity index 100% rename from cryptnoxpro/lib/cryptos/keystore.py rename to cryptnox_cli/lib/cryptos/keystore.py diff --git a/cryptnoxpro/lib/cryptos/main.py b/cryptnox_cli/lib/cryptos/main.py similarity index 100% rename from cryptnoxpro/lib/cryptos/main.py rename to cryptnox_cli/lib/cryptos/main.py diff --git a/cryptnoxpro/lib/cryptos/mnemonic.py b/cryptnox_cli/lib/cryptos/mnemonic.py similarity index 100% rename from cryptnoxpro/lib/cryptos/mnemonic.py rename to cryptnox_cli/lib/cryptos/mnemonic.py diff --git a/cryptnoxpro/lib/cryptos/pbkdf2.py b/cryptnox_cli/lib/cryptos/pbkdf2.py similarity index 100% rename from cryptnoxpro/lib/cryptos/pbkdf2.py rename to cryptnox_cli/lib/cryptos/pbkdf2.py diff --git a/cryptnoxpro/lib/cryptos/ripemd.py b/cryptnox_cli/lib/cryptos/ripemd.py similarity index 100% rename from cryptnoxpro/lib/cryptos/ripemd.py rename to cryptnox_cli/lib/cryptos/ripemd.py diff --git a/cryptnoxpro/lib/cryptos/segwit_addr.py b/cryptnox_cli/lib/cryptos/segwit_addr.py similarity index 100% rename from cryptnoxpro/lib/cryptos/segwit_addr.py rename to cryptnox_cli/lib/cryptos/segwit_addr.py diff --git a/cryptnoxpro/lib/cryptos/specials.py b/cryptnox_cli/lib/cryptos/specials.py similarity index 100% rename from cryptnoxpro/lib/cryptos/specials.py rename to cryptnox_cli/lib/cryptos/specials.py diff --git a/cryptnoxpro/lib/cryptos/stealth.py b/cryptnox_cli/lib/cryptos/stealth.py similarity index 100% rename from cryptnoxpro/lib/cryptos/stealth.py rename to cryptnox_cli/lib/cryptos/stealth.py diff --git a/cryptnoxpro/lib/cryptos/transaction.py b/cryptnox_cli/lib/cryptos/transaction.py similarity index 100% rename from cryptnoxpro/lib/cryptos/transaction.py rename to cryptnox_cli/lib/cryptos/transaction.py diff --git a/cryptnoxpro/lib/cryptos/wallet.py b/cryptnox_cli/lib/cryptos/wallet.py similarity index 100% rename from cryptnoxpro/lib/cryptos/wallet.py rename to cryptnox_cli/lib/cryptos/wallet.py diff --git a/cryptnoxpro/lib/cryptos/wallet_utils.py b/cryptnox_cli/lib/cryptos/wallet_utils.py similarity index 100% rename from cryptnoxpro/lib/cryptos/wallet_utils.py rename to cryptnox_cli/lib/cryptos/wallet_utils.py diff --git a/cryptnoxpro/main.py b/cryptnox_cli/main.py similarity index 94% rename from cryptnoxpro/main.py rename to cryptnox_cli/main.py index 8a8f2f1..3cd0c2c 100644 --- a/cryptnoxpro/main.py +++ b/cryptnox_cli/main.py @@ -27,14 +27,14 @@ options ) -cryptnoxpy = lazy_import.lazy_module("cryptnoxpy") +cryptnox_sdk_py = lazy_import.lazy_module("cryptnox_sdk_py") json = lazy_import.lazy_module("json") re = lazy_import.lazy_module("re") tabulate = lazy_import.lazy_callable("tabulate.tabulate") requests = lazy_import.lazy_module("requests") web3 = lazy_import.lazy_module("web3") -APPLICATION_NAME = "Cryptnox Pro" +APPLICATION_NAME = "Cryptnox CLI" def get_parser() -> argparse.ArgumentParser: @@ -46,7 +46,7 @@ def get_parser() -> argparse.ArgumentParser: """ parser = interactive_cli.ErrorParser(description="Cryptnox command line interface.") - parser.add_argument("-v", "--version", action="version", version=f"Cryptnox Pro {__version__}") + parser.add_argument("-v", "--version", action="version", version=f"Cryptnox CLI {__version__}") parser.add_argument("--verbose", action="store_true", help="Turn on logging") parser.add_argument('--port', nargs='?', type=int, default=None, help='Define port to enable remote feature') @@ -88,7 +88,7 @@ def main() -> int: print("This is something we haven't foreseen. Please, help us in making the application " "better by reporting this issue.") traceback.print_exc() - path = Path(user_log_dir('cryptnoxpro', 'cryptnox')) + path = Path(user_log_dir('cryptnox-cli', 'cryptnox')) makedirs(path, exist_ok=True) error_file = path.joinpath("error.log") try: diff --git a/cryptnoxpro/wallet/__init__.py b/cryptnox_cli/wallet/__init__.py similarity index 100% rename from cryptnoxpro/wallet/__init__.py rename to cryptnox_cli/wallet/__init__.py diff --git a/cryptnoxpro/wallet/btc.py b/cryptnox_cli/wallet/btc.py similarity index 99% rename from cryptnoxpro/wallet/btc.py rename to cryptnox_cli/wallet/btc.py index 0814329..2e671c4 100644 --- a/cryptnoxpro/wallet/btc.py +++ b/cryptnox_cli/wallet/btc.py @@ -10,7 +10,7 @@ from enum import Enum from typing import Union, List, Dict -from cryptnoxpy import Derivation +from cryptnox_sdk_py import Derivation from tabulate import tabulate from .validators import EnumValidator, IntValidator diff --git a/cryptnoxpro/wallet/eth/__init__.py b/cryptnox_cli/wallet/eth/__init__.py similarity index 100% rename from cryptnoxpro/wallet/eth/__init__.py rename to cryptnox_cli/wallet/eth/__init__.py diff --git a/cryptnoxpro/wallet/eth/api.py b/cryptnox_cli/wallet/eth/api.py similarity index 99% rename from cryptnoxpro/wallet/eth/api.py rename to cryptnox_cli/wallet/eth/api.py index 8fc1eee..631d3ca 100644 --- a/cryptnoxpro/wallet/eth/api.py +++ b/cryptnox_cli/wallet/eth/api.py @@ -8,7 +8,7 @@ ) import ecdsa -from cryptnoxpy import Derivation +from cryptnox_sdk_py import Derivation from eth_account._utils.legacy_transactions import ( encode_transaction, serializable_unsigned_transaction_from_dict diff --git a/cryptnoxpro/wallet/eth/endpoint.py b/cryptnox_cli/wallet/eth/endpoint.py similarity index 100% rename from cryptnoxpro/wallet/eth/endpoint.py rename to cryptnox_cli/wallet/eth/endpoint.py diff --git a/cryptnoxpro/wallet/validators.py b/cryptnox_cli/wallet/validators.py similarity index 100% rename from cryptnoxpro/wallet/validators.py rename to cryptnox_cli/wallet/validators.py diff --git a/cryptnoxpro/constants.py b/cryptnoxpro/constants.py deleted file mode 100644 index e8d9894..0000000 --- a/cryptnoxpro/constants.py +++ /dev/null @@ -1,5 +0,0 @@ -""" -Centralized constants for the Cryptnox Pro CLI. -""" - -MAX_PASSPHRASE_LENGTH = 100 diff --git a/dev-requirements.txt b/dev-requirements.txt index b905ff0455cf3edd49de9e326006811c7a8326d6..5283d093aabf94581391bc32a04ba10d7988cc8d 100644 GIT binary patch delta 40 scmZp$>$2OB#w)GMP|T3Rkjk delta 30 hcmeCOYp~mp#w%FBP|08mghmW{45lEwxskV15CC=#2Jrv@ diff --git a/docs/cli.rst b/docs/cli.rst index 2029365..992e6ef 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -6,11 +6,11 @@ The ``cryptnox`` command provides a comprehensive CLI for managing Cryptnox card Installation ------------ -After installing the cryptnoxpro package, the ``cryptnox`` command becomes available in your system: +After installing the cryptnox-cli package, the ``cryptnox`` command becomes available in your system: .. code-block:: bash - pip install cryptnoxpro + pip install cryptnox-cli Basic Usage ----------- @@ -547,7 +547,7 @@ In interactive mode, you can: .. code-block:: text $ cryptnox - Cryptnox Pro 2.9.1 + Cryptnox CLI 2.9.1 > list [Shows available cards] @@ -619,7 +619,7 @@ Error Handling When errors occur: - Detailed error messages are displayed - - Errors are logged to: ``~/.local/share/cryptnoxpro/error.log`` (Linux/macOS) or ``%LOCALAPPDATA%\\cryptnox\\cryptnoxpro\\error.log`` (Windows) + - Errors are logged to: ``~/.local/share/cryptnox-cli/error.log`` (Linux/macOS) or ``%LOCALAPPDATA%\\cryptnox\\cryptnox-cli\\error.log`` (Windows) - You can report errors to help improve the application Examples @@ -670,8 +670,8 @@ Examples See Also -------- -- :doc:`overview` - Overview of CryptnoxPro -- :mod:`cryptnoxpro.command.seed` - Seed command implementation details -- :doc:`cryptnoxpro.command` - All command implementations +- :doc:`overview` - Overview of Cryptnox CLI +- :mod:`cryptnox_cli.command.seed` - Seed command implementation details +- :doc:`cryptnox_cli.command` - All command implementations - :doc:`modules` - Complete API Reference diff --git a/docs/conf.py b/docs/conf.py index 0dfd197..f3aac51 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,10 +11,10 @@ sys.path.insert(0, os.path.abspath("..")) -project = 'cryptnoxpro' +project = 'cryptnox-cli' copyright = '2025, Cryptnox' author = 'Cryptnox' -release = '2.9.1' +release = '1.0.0' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -35,8 +35,8 @@ # autodoc_mock_imports - Sphinx will create mock imports for these modules # This is safer than manual sys.modules mocking and prevents hangs autodoc_mock_imports = [ - # Cryptnox - 'cryptnoxpy', + # Cryptnox SDK (PyPI package: cryptnox-sdk-py) + 'cryptnox_sdk_py', # Input/Output 'stdiomask', 'tabulate', diff --git a/docs/cryptnox_cli.command.card.rst b/docs/cryptnox_cli.command.card.rst new file mode 100644 index 0000000..69e1e5b --- /dev/null +++ b/docs/cryptnox_cli.command.card.rst @@ -0,0 +1,44 @@ +cryptnox_cli.command.card package +================================= + +Submodules +---------- + +cryptnox_cli.command.card.info module +------------------------------------ + +.. automodule:: cryptnox_cli.command.card.info + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.command.card.initialize module +------------------------------------------ + +.. automodule:: cryptnox_cli.command.card.initialize + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnox_cli.command.card + :members: + :undoc-members: + :show-inheritance: + +The ``cryptnox_cli.command.card`` package provides card management functionality and exports: + +.. py:currentmodule:: cryptnox_cli.command.card + +.. py:class:: Info + :no-index: + + Command class for displaying card information. See :class:`cryptnox_cli.command.card.info.Info` for details. + +.. py:class:: Initialize + :no-index: + + Command class for initializing cards. See :class:`cryptnox_cli.command.card.initialize.Initialize` for details. + diff --git a/docs/cryptnoxpro.command.erc_token.rst b/docs/cryptnox_cli.command.erc_token.rst similarity index 50% rename from docs/cryptnoxpro.command.erc_token.rst rename to docs/cryptnox_cli.command.erc_token.rst index 1717487..7318428 100644 --- a/docs/cryptnoxpro.command.erc_token.rst +++ b/docs/cryptnox_cli.command.erc_token.rst @@ -1,29 +1,29 @@ -cryptnoxpro.command.erc\_token package +cryptnox_cli.command.erc\_token package ====================================== Submodules ---------- -cryptnoxpro.command.erc\_token.contract module +cryptnox_cli.command.erc\_token.contract module ---------------------------------------------- -.. automodule:: cryptnoxpro.command.erc_token.contract +.. automodule:: cryptnox_cli.command.erc_token.contract :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.erc\_token.info module +cryptnox_cli.command.erc\_token.info module ------------------------------------------ -.. automodule:: cryptnoxpro.command.erc_token.info +.. automodule:: cryptnox_cli.command.erc_token.info :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.erc\_token.initialize module +cryptnox_cli.command.erc\_token.initialize module ------------------------------------------------ -.. automodule:: cryptnoxpro.command.erc_token.initialize +.. automodule:: cryptnox_cli.command.erc_token.initialize :members: :undoc-members: :show-inheritance: @@ -31,22 +31,22 @@ cryptnoxpro.command.erc\_token.initialize module Module contents --------------- -.. automodule:: cryptnoxpro.command.erc_token +.. automodule:: cryptnox_cli.command.erc_token :members: :undoc-members: :show-inheritance: -The ``cryptnoxpro.command.erc_token`` package provides ERC token management and exports: +The ``cryptnox_cli.command.erc_token`` package provides ERC token management and exports: -.. py:currentmodule:: cryptnoxpro.command.erc_token +.. py:currentmodule:: cryptnox_cli.command.erc_token .. py:class:: Info :no-index: - Command class for displaying ERC token information. See :class:`cryptnoxpro.command.erc_token.info.Info` for details. + Command class for displaying ERC token information. See :class:`cryptnox_cli.command.erc_token.info.Info` for details. .. py:class:: Initialize :no-index: - Command class for initializing ERC tokens. See :class:`cryptnoxpro.command.erc_token.initialize.Initialize` for details. + Command class for initializing ERC tokens. See :class:`cryptnox_cli.command.erc_token.initialize.Initialize` for details. diff --git a/docs/cryptnoxpro.command.helper.rst b/docs/cryptnox_cli.command.helper.rst similarity index 52% rename from docs/cryptnoxpro.command.helper.rst rename to docs/cryptnox_cli.command.helper.rst index f0434e5..41d083c 100644 --- a/docs/cryptnoxpro.command.helper.rst +++ b/docs/cryptnox_cli.command.helper.rst @@ -1,77 +1,77 @@ -cryptnoxpro.command.helper package +cryptnox_cli.command.helper package =================================== Submodules ---------- -cryptnoxpro.command.helper.backup module +cryptnox_cli.command.helper.backup module ---------------------------------------- -.. automodule:: cryptnoxpro.command.helper.backup +.. automodule:: cryptnox_cli.command.helper.backup :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.cards module +cryptnox_cli.command.helper.cards module --------------------------------------- -.. automodule:: cryptnoxpro.command.helper.cards +.. automodule:: cryptnox_cli.command.helper.cards :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.config module +cryptnox_cli.command.helper.config module ---------------------------------------- -.. automodule:: cryptnoxpro.command.helper.config +.. automodule:: cryptnox_cli.command.helper.config :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.download\_folder module +cryptnox_cli.command.helper.download\_folder module -------------------------------------------------- -.. automodule:: cryptnoxpro.command.helper.download_folder +.. automodule:: cryptnox_cli.command.helper.download_folder :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.helper\_methods module +cryptnox_cli.command.helper.helper\_methods module ------------------------------------------------- -.. automodule:: cryptnoxpro.command.helper.helper_methods +.. automodule:: cryptnox_cli.command.helper.helper_methods :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.notification module +cryptnox_cli.command.helper.notification module ---------------------------------------------- -.. automodule:: cryptnoxpro.command.helper.notification +.. automodule:: cryptnox_cli.command.helper.notification :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.security module +cryptnox_cli.command.helper.security module ------------------------------------------ -.. automodule:: cryptnoxpro.command.helper.security +.. automodule:: cryptnox_cli.command.helper.security :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.seed\_backup module +cryptnox_cli.command.helper.seed\_backup module ---------------------------------------------- -.. automodule:: cryptnoxpro.command.helper.seed_backup +.. automodule:: cryptnox_cli.command.helper.seed_backup :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.helper.ui module +cryptnox_cli.command.helper.ui module ------------------------------------ -.. automodule:: cryptnoxpro.command.helper.ui +.. automodule:: cryptnox_cli.command.helper.ui :members: :undoc-members: :show-inheritance: @@ -79,12 +79,12 @@ cryptnoxpro.command.helper.ui module Module contents --------------- -.. automodule:: cryptnoxpro.command.helper +.. automodule:: cryptnox_cli.command.helper :members: :undoc-members: :show-inheritance: -The ``cryptnoxpro.command.helper`` package provides utility functions and helper modules for command implementations. +The ``cryptnox_cli.command.helper`` package provides utility functions and helper modules for command implementations. This package contains shared functionality used across multiple commands, including user interface components, security helpers, configuration management, and backup utilities. diff --git a/docs/cryptnoxpro.command.options.rst b/docs/cryptnox_cli.command.options.rst similarity index 50% rename from docs/cryptnoxpro.command.options.rst rename to docs/cryptnox_cli.command.options.rst index 232bcfb..c74db58 100644 --- a/docs/cryptnoxpro.command.options.rst +++ b/docs/cryptnox_cli.command.options.rst @@ -1,29 +1,29 @@ -cryptnoxpro.command.options package +cryptnox_cli.command.options package ==================================== Submodules ---------- -cryptnoxpro.command.options.common module +cryptnox_cli.command.options.common module ----------------------------------------- -.. automodule:: cryptnoxpro.command.options.common +.. automodule:: cryptnox_cli.command.options.common :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.options.eth module +cryptnox_cli.command.options.eth module -------------------------------------- -.. automodule:: cryptnoxpro.command.options.eth +.. automodule:: cryptnox_cli.command.options.eth :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.options.options module +cryptnox_cli.command.options.options module ------------------------------------------ -.. automodule:: cryptnoxpro.command.options.options +.. automodule:: cryptnox_cli.command.options.options :members: :undoc-members: :show-inheritance: @@ -31,17 +31,17 @@ cryptnoxpro.command.options.options module Module contents --------------- -.. automodule:: cryptnoxpro.command.options +.. automodule:: cryptnox_cli.command.options :members: :undoc-members: :show-inheritance: -The ``cryptnoxpro.command.options`` package provides command-line argument parsing and exports: +The ``cryptnox_cli.command.options`` package provides command-line argument parsing and exports: -.. py:currentmodule:: cryptnoxpro.command.options +.. py:currentmodule:: cryptnox_cli.command.options .. py:function:: add(subparsers, command_class) :no-index: - Add command-line options for a command class. See :func:`cryptnoxpro.command.options.options.add` for details. + Add command-line options for a command class. See :func:`cryptnox_cli.command.options.options.add` for details. diff --git a/docs/cryptnoxpro.command.rst b/docs/cryptnox_cli.command.rst similarity index 51% rename from docs/cryptnoxpro.command.rst rename to docs/cryptnox_cli.command.rst index f04e52f..d8ce5f7 100644 --- a/docs/cryptnoxpro.command.rst +++ b/docs/cryptnox_cli.command.rst @@ -1,4 +1,4 @@ -cryptnoxpro.command package +cryptnox_cli.command package ============================ Subpackages @@ -7,187 +7,187 @@ Subpackages .. toctree:: :maxdepth: 4 - cryptnoxpro.command.card - cryptnoxpro.command.erc_token - cryptnoxpro.command.helper - cryptnoxpro.command.options - cryptnoxpro.command.user_keys + cryptnox_cli.command.card + cryptnox_cli.command.erc_token + cryptnox_cli.command.helper + cryptnox_cli.command.options + cryptnox_cli.command.user_keys Submodules ---------- -cryptnoxpro.command.btc module +cryptnox_cli.command.btc module ------------------------------ -.. automodule:: cryptnoxpro.command.btc +.. automodule:: cryptnox_cli.command.btc :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.card\_configuration module +cryptnox_cli.command.card\_configuration module ---------------------------------------------- -.. automodule:: cryptnoxpro.command.card_configuration +.. automodule:: cryptnox_cli.command.card_configuration :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.cards module +cryptnox_cli.command.cards module -------------------------------- -.. automodule:: cryptnoxpro.command.cards +.. automodule:: cryptnox_cli.command.cards :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.change\_pin module +cryptnox_cli.command.change\_pin module -------------------------------------- -.. automodule:: cryptnoxpro.command.change_pin +.. automodule:: cryptnox_cli.command.change_pin :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.change\_puk module +cryptnox_cli.command.change\_puk module -------------------------------------- -.. automodule:: cryptnoxpro.command.change_puk +.. automodule:: cryptnox_cli.command.change_puk :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.command module +cryptnox_cli.command.command module ---------------------------------- -.. automodule:: cryptnoxpro.command.command +.. automodule:: cryptnox_cli.command.command :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.config module +cryptnox_cli.command.config module --------------------------------- -.. automodule:: cryptnoxpro.command.config +.. automodule:: cryptnox_cli.command.config :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.decrypt module +cryptnox_cli.command.decrypt module ---------------------------------- -.. automodule:: cryptnoxpro.command.decrypt +.. automodule:: cryptnox_cli.command.decrypt :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.eth module +cryptnox_cli.command.eth module ------------------------------ -.. automodule:: cryptnoxpro.command.eth +.. automodule:: cryptnox_cli.command.eth :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.factory module +cryptnox_cli.command.factory module ---------------------------------- -.. automodule:: cryptnoxpro.command.factory +.. automodule:: cryptnox_cli.command.factory :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.get\_clearpubkey module +cryptnox_cli.command.get\_clearpubkey module ------------------------------------------- -.. automodule:: cryptnoxpro.command.get_clearpubkey +.. automodule:: cryptnox_cli.command.get_clearpubkey :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.get\_xpub module +cryptnox_cli.command.get\_xpub module ------------------------------------ -.. automodule:: cryptnoxpro.command.get_xpub +.. automodule:: cryptnox_cli.command.get_xpub :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.history module +cryptnox_cli.command.history module ---------------------------------- -.. automodule:: cryptnoxpro.command.history +.. automodule:: cryptnox_cli.command.history :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.info module +cryptnox_cli.command.info module ------------------------------- -.. automodule:: cryptnoxpro.command.info +.. automodule:: cryptnox_cli.command.info :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.initialize module +cryptnox_cli.command.initialize module ------------------------------------- -.. automodule:: cryptnoxpro.command.initialize +.. automodule:: cryptnox_cli.command.initialize :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.reset module +cryptnox_cli.command.reset module -------------------------------- -.. automodule:: cryptnoxpro.command.reset +.. automodule:: cryptnox_cli.command.reset :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.seed module +cryptnox_cli.command.seed module ------------------------------- -.. automodule:: cryptnoxpro.command.seed +.. automodule:: cryptnox_cli.command.seed :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.server module +cryptnox_cli.command.server module --------------------------------- -.. automodule:: cryptnoxpro.command.server +.. automodule:: cryptnox_cli.command.server :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.transfer module +cryptnox_cli.command.transfer module ----------------------------------- -.. automodule:: cryptnoxpro.command.transfer +.. automodule:: cryptnox_cli.command.transfer :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.unknown module +cryptnox_cli.command.unknown module ---------------------------------- -.. automodule:: cryptnoxpro.command.unknown +.. automodule:: cryptnox_cli.command.unknown :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.unlock\_pin module +cryptnox_cli.command.unlock\_pin module -------------------------------------- -.. automodule:: cryptnoxpro.command.unlock_pin +.. automodule:: cryptnox_cli.command.unlock_pin :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.user\_key module +cryptnox_cli.command.user\_key module ------------------------------------ -.. automodule:: cryptnoxpro.command.user_key +.. automodule:: cryptnox_cli.command.user_key :members: :undoc-members: :show-inheritance: @@ -195,11 +195,11 @@ cryptnoxpro.command.user\_key module Module contents --------------- -.. automodule:: cryptnoxpro.command +.. automodule:: cryptnox_cli.command :members: :undoc-members: :show-inheritance: -The ``cryptnoxpro.command`` package provides command-line interface commands for interacting with Cryptnox cards. +The ``cryptnox_cli.command`` package provides command-line interface commands for interacting with Cryptnox cards. This package contains all command implementations that can be executed from the CLI. diff --git a/docs/cryptnoxpro.command.user_keys.aws_kms.rst b/docs/cryptnox_cli.command.user_keys.aws_kms.rst similarity index 54% rename from docs/cryptnoxpro.command.user_keys.aws_kms.rst rename to docs/cryptnox_cli.command.user_keys.aws_kms.rst index 2c339c5..06b0bfc 100644 --- a/docs/cryptnoxpro.command.user_keys.aws_kms.rst +++ b/docs/cryptnox_cli.command.user_keys.aws_kms.rst @@ -1,13 +1,13 @@ -cryptnoxpro.command.user\_keys.aws\_kms package +cryptnox_cli.command.user\_keys.aws\_kms package ================================================ Submodules ---------- -cryptnoxpro.command.user\_keys.aws\_kms.aws\_kms module +cryptnox_cli.command.user\_keys.aws\_kms.aws\_kms module ------------------------------------------------------- -.. automodule:: cryptnoxpro.command.user_keys.aws_kms.aws_kms +.. automodule:: cryptnox_cli.command.user_keys.aws_kms.aws_kms :members: :undoc-members: :show-inheritance: @@ -15,7 +15,7 @@ cryptnoxpro.command.user\_keys.aws\_kms.aws\_kms module Module contents --------------- -.. automodule:: cryptnoxpro.command.user_keys.aws_kms +.. automodule:: cryptnox_cli.command.user_keys.aws_kms :members: :undoc-members: :show-inheritance: diff --git a/docs/cryptnoxpro.command.user_keys.hello.rst b/docs/cryptnox_cli.command.user_keys.hello.rst similarity index 51% rename from docs/cryptnoxpro.command.user_keys.hello.rst rename to docs/cryptnox_cli.command.user_keys.hello.rst index 7ce2e4e..81759ff 100644 --- a/docs/cryptnoxpro.command.user_keys.hello.rst +++ b/docs/cryptnox_cli.command.user_keys.hello.rst @@ -1,29 +1,29 @@ -cryptnoxpro.command.user\_keys.hello package +cryptnox_cli.command.user\_keys.hello package ============================================= Submodules ---------- -cryptnoxpro.command.user\_keys.hello.exceptions module +cryptnox_cli.command.user\_keys.hello.exceptions module ------------------------------------------------------ -.. automodule:: cryptnoxpro.command.user_keys.hello.exceptions +.. automodule:: cryptnox_cli.command.user_keys.hello.exceptions :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.user\_keys.hello.hello module +cryptnox_cli.command.user\_keys.hello.hello module ------------------------------------------------- -.. automodule:: cryptnoxpro.command.user_keys.hello.hello +.. automodule:: cryptnox_cli.command.user_keys.hello.hello :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.user\_keys.hello.windows\_hello module +cryptnox_cli.command.user\_keys.hello.windows\_hello module ---------------------------------------------------------- -.. automodule:: cryptnoxpro.command.user_keys.hello.windows_hello +.. automodule:: cryptnox_cli.command.user_keys.hello.windows_hello :members: :undoc-members: :show-inheritance: @@ -31,7 +31,7 @@ cryptnoxpro.command.user\_keys.hello.windows\_hello module Module contents --------------- -.. automodule:: cryptnoxpro.command.user_keys.hello +.. automodule:: cryptnox_cli.command.user_keys.hello :members: :undoc-members: :show-inheritance: diff --git a/docs/cryptnoxpro.command.user_keys.piv.rst b/docs/cryptnox_cli.command.user_keys.piv.rst similarity index 54% rename from docs/cryptnoxpro.command.user_keys.piv.rst rename to docs/cryptnox_cli.command.user_keys.piv.rst index 3c0f5f7..44953e0 100644 --- a/docs/cryptnoxpro.command.user_keys.piv.rst +++ b/docs/cryptnox_cli.command.user_keys.piv.rst @@ -1,21 +1,21 @@ -cryptnoxpro.command.user\_keys.piv package +cryptnox_cli.command.user\_keys.piv package =========================================== Submodules ---------- -cryptnoxpro.command.user\_keys.piv.piv module +cryptnox_cli.command.user\_keys.piv.piv module --------------------------------------------- -.. automodule:: cryptnoxpro.command.user_keys.piv.piv +.. automodule:: cryptnox_cli.command.user_keys.piv.piv :members: :undoc-members: :show-inheritance: -cryptnoxpro.command.user\_keys.piv.piv\_card module +cryptnox_cli.command.user\_keys.piv.piv\_card module --------------------------------------------------- -.. automodule:: cryptnoxpro.command.user_keys.piv.piv_card +.. automodule:: cryptnox_cli.command.user_keys.piv.piv_card :members: :undoc-members: :show-inheritance: @@ -23,7 +23,7 @@ cryptnoxpro.command.user\_keys.piv.piv\_card module Module contents --------------- -.. automodule:: cryptnoxpro.command.user_keys.piv +.. automodule:: cryptnox_cli.command.user_keys.piv :members: :undoc-members: :show-inheritance: diff --git a/docs/cryptnox_cli.command.user_keys.rst b/docs/cryptnox_cli.command.user_keys.rst new file mode 100644 index 0000000..b28edd9 --- /dev/null +++ b/docs/cryptnox_cli.command.user_keys.rst @@ -0,0 +1,64 @@ +cryptnox_cli.command.user\_keys package +======================================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + cryptnox_cli.command.user_keys.aws_kms + cryptnox_cli.command.user_keys.hello + cryptnox_cli.command.user_keys.piv + +Submodules +---------- + +cryptnox_cli.command.user\_keys.authentication module +---------------------------------------------------- + +.. automodule:: cryptnox_cli.command.user_keys.authentication + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.command.user\_keys.user\_key\_base module +----------------------------------------------------- + +.. automodule:: cryptnox_cli.command.user_keys.user_key_base + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnox_cli.command.user_keys + :members: + :undoc-members: + :show-inheritance: + +The ``cryptnox_cli.command.user_keys`` package provides authentication functionality and exports: + +.. py:currentmodule:: cryptnox_cli.command.user_keys + +.. py:function:: add(data) + :no-index: + + Add a new authentication method. See :func:`cryptnox_cli.command.user_keys.authentication.add` for details. + +.. py:function:: authenticate(data) + :no-index: + + Authenticate using a configured method. See :func:`cryptnox_cli.command.user_keys.authentication.authenticate` for details. + +.. py:function:: delete(data) + :no-index: + + Delete an authentication method. See :func:`cryptnox_cli.command.user_keys.authentication.delete` for details. + +.. py:function:: get(data) + :no-index: + + Get information about authentication methods. See :func:`cryptnox_cli.command.user_keys.authentication.get` for details. + diff --git a/docs/cryptnox_cli.lib.cryptos.coins.rst b/docs/cryptnox_cli.lib.cryptos.coins.rst new file mode 100644 index 0000000..d3e54a6 --- /dev/null +++ b/docs/cryptnox_cli.lib.cryptos.coins.rst @@ -0,0 +1,39 @@ +cryptnox_cli.lib.cryptos.coins package +====================================== + +Submodules +---------- + +cryptnox_cli.lib.cryptos.coins.base module +----------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.coins.base + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.coins.bitcoin module +-------------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.coins.bitcoin + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnox_cli.lib.cryptos.coins + :members: + :undoc-members: + :show-inheritance: + +The ``cryptnox_cli.lib.cryptos.coins`` package provides cryptocurrency coin implementations and exports: + +.. py:currentmodule:: cryptnox_cli.lib.cryptos.coins + +.. py:class:: Bitcoin + :no-index: + + Bitcoin cryptocurrency implementation. See :class:`cryptnox_cli.lib.cryptos.coins.bitcoin.Bitcoin` for details. + diff --git a/docs/cryptnox_cli.lib.cryptos.rst b/docs/cryptnox_cli.lib.cryptos.rst new file mode 100644 index 0000000..84b5f5b --- /dev/null +++ b/docs/cryptnox_cli.lib.cryptos.rst @@ -0,0 +1,158 @@ +cryptnox_cli.lib.cryptos package +================================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + cryptnox_cli.lib.cryptos.coins + +Submodules +---------- + +cryptnox_cli.lib.cryptos.blocks module +------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.blocks + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.composite module +---------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.composite + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.constants module +---------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.constants + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.deterministic module +-------------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.deterministic + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.keystore module +--------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.keystore + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.main module +----------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.main + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.mnemonic module +--------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.mnemonic + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.pbkdf2 module +------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.pbkdf2 + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.ripemd module +------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.ripemd + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.segwit\_addr module +------------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.segwit_addr + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.specials module +--------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.specials + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.stealth module +-------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.stealth + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.transaction module +------------------------------------------ + +.. automodule:: cryptnox_cli.lib.cryptos.transaction + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.wallet module +------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.wallet + :members: + :undoc-members: + :show-inheritance: + +cryptnox_cli.lib.cryptos.wallet\_utils module +-------------------------------------------- + +.. automodule:: cryptnox_cli.lib.cryptos.wallet_utils + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnox_cli.lib.cryptos + :members: + :undoc-members: + :show-inheritance: + +The ``cryptnox_cli.lib.cryptos`` package provides cryptocurrency utilities and re-exports functionality from: + +* :mod:`cryptnox_cli.lib.cryptos.blocks` - Block-related utilities +* :mod:`cryptnox_cli.lib.cryptos.composite` - Composite key handling +* :mod:`cryptnox_cli.lib.cryptos.deterministic` - Deterministic wallet functions +* :mod:`cryptnox_cli.lib.cryptos.main` - Main crypto operations +* :mod:`cryptnox_cli.lib.cryptos.mnemonic` - Mnemonic phrase handling +* :mod:`cryptnox_cli.lib.cryptos.specials` - Special cryptocurrency operations +* :mod:`cryptnox_cli.lib.cryptos.stealth` - Stealth address support +* :mod:`cryptnox_cli.lib.cryptos.transaction` - Transaction handling +* :mod:`cryptnox_cli.lib.cryptos.coins` - Coin implementations +* :mod:`cryptnox_cli.lib.cryptos.keystore` - Key storage utilities +* :mod:`cryptnox_cli.lib.cryptos.wallet` - Wallet functionality + +All public members from these modules are available directly from ``cryptnox_cli.lib.cryptos``. + diff --git a/docs/cryptnox_cli.lib.rst b/docs/cryptnox_cli.lib.rst new file mode 100644 index 0000000..6ae6a24 --- /dev/null +++ b/docs/cryptnox_cli.lib.rst @@ -0,0 +1,22 @@ +cryptnox_cli.lib package +======================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + cryptnox_cli.lib.cryptos + +Module contents +--------------- + +.. automodule:: cryptnox_cli.lib + :members: + :undoc-members: + :show-inheritance: + +The ``cryptnox_cli.lib`` package provides library functionality for cryptocurrency operations. +The main subpackage is :mod:`cryptnox_cli.lib.cryptos` which contains comprehensive cryptocurrency utilities. + diff --git a/docs/cryptnoxpro.rst b/docs/cryptnox_cli.rst similarity index 51% rename from docs/cryptnoxpro.rst rename to docs/cryptnox_cli.rst index 4d48527..6ee2810 100644 --- a/docs/cryptnoxpro.rst +++ b/docs/cryptnox_cli.rst @@ -1,5 +1,5 @@ -cryptnoxpro package -=================== +cryptnox_cli package (Cryptnox CLI) +=================================== Subpackages ----------- @@ -7,49 +7,49 @@ Subpackages .. toctree:: :maxdepth: 4 - cryptnoxpro.command - cryptnoxpro.lib - cryptnoxpro.wallet + cryptnox_cli.command + cryptnox_cli.lib + cryptnox_cli.wallet Submodules ---------- -cryptnoxpro.config module +cryptnox_cli.config module ------------------------- -.. automodule:: cryptnoxpro.config +.. automodule:: cryptnox_cli.config :members: :undoc-members: :show-inheritance: -cryptnoxpro.enums module +cryptnox_cli.enums module ------------------------ -.. automodule:: cryptnoxpro.enums +.. automodule:: cryptnox_cli.enums :members: :undoc-members: :show-inheritance: -cryptnoxpro.constants module +cryptnox_cli.constants module ---------------------------- -.. automodule:: cryptnoxpro.constants +.. automodule:: cryptnox_cli.constants :members: :undoc-members: :show-inheritance: -cryptnoxpro.interactive\_cli module +cryptnox_cli.interactive\_cli module ----------------------------------- -.. automodule:: cryptnoxpro.interactive_cli +.. automodule:: cryptnox_cli.interactive_cli :members: :undoc-members: :show-inheritance: -cryptnoxpro.main module +cryptnox_cli.main module ----------------------- -.. automodule:: cryptnoxpro.main +.. automodule:: cryptnox_cli.main :members: :undoc-members: :show-inheritance: @@ -57,16 +57,16 @@ cryptnoxpro.main module Module contents --------------- -.. automodule:: cryptnoxpro +.. automodule:: cryptnox_cli :members: :undoc-members: :show-inheritance: -The main ``cryptnoxpro`` package exports: +The main ``cryptnox_cli`` package (Cryptnox CLI) exports: .. py:data:: __version__ :type: str :value: "2.9.1" - Current version of the CryptnoxPro package. + Current version of the Cryptnox CLI package. diff --git a/docs/cryptnoxpro.wallet.eth.rst b/docs/cryptnox_cli.wallet.eth.rst similarity index 54% rename from docs/cryptnoxpro.wallet.eth.rst rename to docs/cryptnox_cli.wallet.eth.rst index 7537fed..6cb05fc 100644 --- a/docs/cryptnoxpro.wallet.eth.rst +++ b/docs/cryptnox_cli.wallet.eth.rst @@ -1,21 +1,21 @@ -cryptnoxpro.wallet.eth package +cryptnox_cli.wallet.eth package =============================== Submodules ---------- -cryptnoxpro.wallet.eth.api module +cryptnox_cli.wallet.eth.api module ---------------------------------- -.. automodule:: cryptnoxpro.wallet.eth.api +.. automodule:: cryptnox_cli.wallet.eth.api :members: :undoc-members: :show-inheritance: -cryptnoxpro.wallet.eth.endpoint module +cryptnox_cli.wallet.eth.endpoint module --------------------------------------- -.. automodule:: cryptnoxpro.wallet.eth.endpoint +.. automodule:: cryptnox_cli.wallet.eth.endpoint :members: :undoc-members: :show-inheritance: @@ -23,32 +23,32 @@ cryptnoxpro.wallet.eth.endpoint module Module contents --------------- -.. automodule:: cryptnoxpro.wallet.eth +.. automodule:: cryptnox_cli.wallet.eth :members: :undoc-members: :show-inheritance: -The ``cryptnoxpro.wallet.eth`` package provides Ethereum wallet utilities and exports: +The ``cryptnox_cli.wallet.eth`` package provides Ethereum wallet utilities and exports: -.. py:currentmodule:: cryptnoxpro.wallet.eth +.. py:currentmodule:: cryptnox_cli.wallet.eth .. py:function:: address(public_key) :no-index: - Generate an Ethereum address from a public key. See :func:`cryptnoxpro.wallet.eth.api.address` for details. + Generate an Ethereum address from a public key. See :func:`cryptnox_cli.wallet.eth.api.address` for details. .. py:class:: Api :no-index: - Ethereum API interface. See :class:`cryptnoxpro.wallet.eth.api.Api` for details. + Ethereum API interface. See :class:`cryptnox_cli.wallet.eth.api.Api` for details. .. py:function:: checksum_address(address_str) :no-index: - Convert an address to checksummed format. See :func:`cryptnoxpro.wallet.eth.api.checksum_address` for details. + Convert an address to checksummed format. See :func:`cryptnox_cli.wallet.eth.api.checksum_address` for details. .. py:class:: EthValidator :no-index: - Ethereum address and transaction validator. See :class:`cryptnoxpro.wallet.eth.api.EthValidator` for details. + Ethereum address and transaction validator. See :class:`cryptnox_cli.wallet.eth.api.EthValidator` for details. diff --git a/docs/cryptnoxpro.wallet.rst b/docs/cryptnox_cli.wallet.rst similarity index 57% rename from docs/cryptnoxpro.wallet.rst rename to docs/cryptnox_cli.wallet.rst index 843535b..aa4cb84 100644 --- a/docs/cryptnoxpro.wallet.rst +++ b/docs/cryptnox_cli.wallet.rst @@ -1,4 +1,4 @@ -cryptnoxpro.wallet package +cryptnox_cli.wallet package =========================== Subpackages @@ -7,23 +7,23 @@ Subpackages .. toctree:: :maxdepth: 4 - cryptnoxpro.wallet.eth + cryptnox_cli.wallet.eth Submodules ---------- -cryptnoxpro.wallet.btc module +cryptnox_cli.wallet.btc module ------------------------------ -.. automodule:: cryptnoxpro.wallet.btc +.. automodule:: cryptnox_cli.wallet.btc :members: :undoc-members: :show-inheritance: -cryptnoxpro.wallet.validators module +cryptnox_cli.wallet.validators module ------------------------------------- -.. automodule:: cryptnoxpro.wallet.validators +.. automodule:: cryptnox_cli.wallet.validators :members: :undoc-members: :show-inheritance: @@ -31,11 +31,11 @@ cryptnoxpro.wallet.validators module Module contents --------------- -.. automodule:: cryptnoxpro.wallet +.. automodule:: cryptnox_cli.wallet :members: :undoc-members: :show-inheritance: -The ``cryptnoxpro.wallet`` package provides wallet functionality for various cryptocurrencies. +The ``cryptnox_cli.wallet`` package provides wallet functionality for various cryptocurrencies. It includes Bitcoin wallet operations, Ethereum wallet utilities, and validation functions. diff --git a/docs/cryptnoxpro.command.card.rst b/docs/cryptnoxpro.command.card.rst deleted file mode 100644 index 2084c6d..0000000 --- a/docs/cryptnoxpro.command.card.rst +++ /dev/null @@ -1,44 +0,0 @@ -cryptnoxpro.command.card package -================================= - -Submodules ----------- - -cryptnoxpro.command.card.info module ------------------------------------- - -.. automodule:: cryptnoxpro.command.card.info - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.command.card.initialize module ------------------------------------------- - -.. automodule:: cryptnoxpro.command.card.initialize - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: cryptnoxpro.command.card - :members: - :undoc-members: - :show-inheritance: - -The ``cryptnoxpro.command.card`` package provides card management functionality and exports: - -.. py:currentmodule:: cryptnoxpro.command.card - -.. py:class:: Info - :no-index: - - Command class for displaying card information. See :class:`cryptnoxpro.command.card.info.Info` for details. - -.. py:class:: Initialize - :no-index: - - Command class for initializing cards. See :class:`cryptnoxpro.command.card.initialize.Initialize` for details. - diff --git a/docs/cryptnoxpro.command.user_keys.rst b/docs/cryptnoxpro.command.user_keys.rst deleted file mode 100644 index 94133ff..0000000 --- a/docs/cryptnoxpro.command.user_keys.rst +++ /dev/null @@ -1,64 +0,0 @@ -cryptnoxpro.command.user\_keys package -======================================= - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - cryptnoxpro.command.user_keys.aws_kms - cryptnoxpro.command.user_keys.hello - cryptnoxpro.command.user_keys.piv - -Submodules ----------- - -cryptnoxpro.command.user\_keys.authentication module ----------------------------------------------------- - -.. automodule:: cryptnoxpro.command.user_keys.authentication - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.command.user\_keys.user\_key\_base module ------------------------------------------------------ - -.. automodule:: cryptnoxpro.command.user_keys.user_key_base - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: cryptnoxpro.command.user_keys - :members: - :undoc-members: - :show-inheritance: - -The ``cryptnoxpro.command.user_keys`` package provides authentication functionality and exports: - -.. py:currentmodule:: cryptnoxpro.command.user_keys - -.. py:function:: add(data) - :no-index: - - Add a new authentication method. See :func:`cryptnoxpro.command.user_keys.authentication.add` for details. - -.. py:function:: authenticate(data) - :no-index: - - Authenticate using a configured method. See :func:`cryptnoxpro.command.user_keys.authentication.authenticate` for details. - -.. py:function:: delete(data) - :no-index: - - Delete an authentication method. See :func:`cryptnoxpro.command.user_keys.authentication.delete` for details. - -.. py:function:: get(data) - :no-index: - - Get information about authentication methods. See :func:`cryptnoxpro.command.user_keys.authentication.get` for details. - diff --git a/docs/cryptnoxpro.lib.cryptos.coins.rst b/docs/cryptnoxpro.lib.cryptos.coins.rst deleted file mode 100644 index a19a6b9..0000000 --- a/docs/cryptnoxpro.lib.cryptos.coins.rst +++ /dev/null @@ -1,39 +0,0 @@ -cryptnoxpro.lib.cryptos.coins package -====================================== - -Submodules ----------- - -cryptnoxpro.lib.cryptos.coins.base module ------------------------------------------ - -.. automodule:: cryptnoxpro.lib.cryptos.coins.base - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.coins.bitcoin module --------------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.coins.bitcoin - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: cryptnoxpro.lib.cryptos.coins - :members: - :undoc-members: - :show-inheritance: - -The ``cryptnoxpro.lib.cryptos.coins`` package provides cryptocurrency coin implementations and exports: - -.. py:currentmodule:: cryptnoxpro.lib.cryptos.coins - -.. py:class:: Bitcoin - :no-index: - - Bitcoin cryptocurrency implementation. See :class:`cryptnoxpro.lib.cryptos.coins.bitcoin.Bitcoin` for details. - diff --git a/docs/cryptnoxpro.lib.cryptos.rst b/docs/cryptnoxpro.lib.cryptos.rst deleted file mode 100644 index b7a8289..0000000 --- a/docs/cryptnoxpro.lib.cryptos.rst +++ /dev/null @@ -1,158 +0,0 @@ -cryptnoxpro.lib.cryptos package -================================ - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - cryptnoxpro.lib.cryptos.coins - -Submodules ----------- - -cryptnoxpro.lib.cryptos.blocks module -------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.blocks - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.composite module ----------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.composite - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.constants module ----------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.constants - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.deterministic module --------------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.deterministic - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.keystore module ---------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.keystore - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.main module ------------------------------------ - -.. automodule:: cryptnoxpro.lib.cryptos.main - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.mnemonic module ---------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.mnemonic - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.pbkdf2 module -------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.pbkdf2 - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.ripemd module -------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.ripemd - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.segwit\_addr module -------------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.segwit_addr - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.specials module ---------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.specials - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.stealth module --------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.stealth - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.transaction module ------------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.transaction - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.wallet module -------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.wallet - :members: - :undoc-members: - :show-inheritance: - -cryptnoxpro.lib.cryptos.wallet\_utils module --------------------------------------------- - -.. automodule:: cryptnoxpro.lib.cryptos.wallet_utils - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: cryptnoxpro.lib.cryptos - :members: - :undoc-members: - :show-inheritance: - -The ``cryptnoxpro.lib.cryptos`` package provides cryptocurrency utilities and re-exports functionality from: - -* :mod:`cryptnoxpro.lib.cryptos.blocks` - Block-related utilities -* :mod:`cryptnoxpro.lib.cryptos.composite` - Composite key handling -* :mod:`cryptnoxpro.lib.cryptos.deterministic` - Deterministic wallet functions -* :mod:`cryptnoxpro.lib.cryptos.main` - Main crypto operations -* :mod:`cryptnoxpro.lib.cryptos.mnemonic` - Mnemonic phrase handling -* :mod:`cryptnoxpro.lib.cryptos.specials` - Special cryptocurrency operations -* :mod:`cryptnoxpro.lib.cryptos.stealth` - Stealth address support -* :mod:`cryptnoxpro.lib.cryptos.transaction` - Transaction handling -* :mod:`cryptnoxpro.lib.cryptos.coins` - Coin implementations -* :mod:`cryptnoxpro.lib.cryptos.keystore` - Key storage utilities -* :mod:`cryptnoxpro.lib.cryptos.wallet` - Wallet functionality - -All public members from these modules are available directly from ``cryptnoxpro.lib.cryptos``. - diff --git a/docs/cryptnoxpro.lib.rst b/docs/cryptnoxpro.lib.rst deleted file mode 100644 index 541ae76..0000000 --- a/docs/cryptnoxpro.lib.rst +++ /dev/null @@ -1,22 +0,0 @@ -cryptnoxpro.lib package -======================= - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - cryptnoxpro.lib.cryptos - -Module contents ---------------- - -.. automodule:: cryptnoxpro.lib - :members: - :undoc-members: - :show-inheritance: - -The ``cryptnoxpro.lib`` package provides library functionality for cryptocurrency operations. -The main subpackage is :mod:`cryptnoxpro.lib.cryptos` which contains comprehensive cryptocurrency utilities. - diff --git a/docs/index.rst b/docs/index.rst index ea6d915..e62e9c3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,7 +1,7 @@ -Cryptnoxpro Documentation -========================= +Cryptnox CLI Documentation +========================== -Welcome to the technical documentation of Cryptnoxpro. +Welcome to the technical documentation of Cryptnox CLI. .. toctree:: :maxdepth: 2 diff --git a/docs/modules.rst b/docs/modules.rst index 68e5b1b..c240d48 100644 --- a/docs/modules.rst +++ b/docs/modules.rst @@ -4,5 +4,4 @@ API Reference .. toctree:: :maxdepth: 4 - cryptnoxpro - + cryptnox_cli diff --git a/docs/overview.rst b/docs/overview.rst index 027224f..ff82135 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -1,5 +1,5 @@ -Cryptnoxpro Overview -==================== +Cryptnox CLI Overview +===================== .. include:: ../README.rst diff --git a/requirements.txt b/requirements.txt index 3450bb166df91bccf9b23a13494267fac204fb95..67bb9f4294cd5f2618260a90cbdaddc236814e0e 100644 GIT binary patch delta 332 zcmWlSze@rE9L2wPda0*(>YYD8$|Rye@XQ7Y!6hOZ#N;>*5r?R#A+WeCQkq00L?U}2 z5fM${5ai_4&?Nl<4*dbq&?F8G2GPmm1CRF}yhi*+xlXoMciQ)Ad!%85*+!QM=@X3=CLcxH3>V|D13JbIQABGz({r(HUvDjiVT)CwuIY?8o>b!&dw8C0QTDpQG$ z=$vA7LVM;uW@Z({g)~%d9k*N&Kim!qGkr+58alQX7VVE1*qcxtb$mE#DDs#1;u|PA zbqt(!WL%r*xEcrxDhy!>cY=nI5XG#h!4Opp#3;t5ABz$S?hLx_9478Jym~@5e)>+Q zNLXczJ!?pMbzFHhe43=BD*93$9{B-1c>zONWqAB@bC@_3ocR6SI82T@u O1~ha7EhK{(mZyKocW?** delta 450 zcmX}o&r1SP5C`zLzcO9l`dbeY5fNd5TY*W%(xpp>5Rr%o5%FLUWn@tn9wJI2BB>ENML^jCz32#M&}Utr%ch-E(vGmrOX<~Dj^)@CJs6U%{m3Vg3hTv$>T-b=&q zSsH;IDFGugc_>q+E+^rayap|09o{JgsHg{F&KxYqw%9StGYj7gi?S*F(~OI2H8J*A z-(w}V%l6q0E3hL(rT?=roQ;XBZi;zr33ryYGsI=3.11,<=3.13.7 packages = find: -packages_dir = cryptnoxpro +packages_dir = cryptnox_cli zip_safe = False include_package_data = True install_requires = @@ -45,7 +45,7 @@ install_requires = boto3 ecdsa colander - cryptnoxpy>=2.0.0 + cryptnox-sdk-py>=1.0.0 lazy-import pytz requests @@ -56,7 +56,7 @@ install_requires = [options.entry_points] console_scripts = - cryptnox = cryptnoxpro.main:main + cryptnox = cryptnox_cli.main:main [options.packages.find] exclude = diff --git a/setup.py b/setup.py index cef5ece..0221e17 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ """ -Configuration for setting up CryptnoxPro CLI application +Configuration for setting up Cryptnox CLI application """ import pathlib diff --git a/setup.spec b/setup.spec index a0d86eb..0fcee10 100644 --- a/setup.spec +++ b/setup.spec @@ -2,12 +2,11 @@ a = Analysis( - ['cryptnoxpro\\main.py'], + ['cryptnox_cli\\main.py'], pathex=[], binaries=[], datas=[ - ('cryptnoxpro', 'cryptnoxpro'), - ('venv/lib/site-packages/lazy_import/VERSION', 'lazy_import/') + ('cryptnox_cli', 'cryptnox_cli') ], hiddenimports=[ 'lazy_import', @@ -44,12 +43,12 @@ exe = EXE( a.binaries, a.datas, [], - name='CryptnoxPro-2.9.1-setup', + name='CryptnoxCLI-1.0.0-setup', icon='cryptnox.ico', debug=False, bootloader_ignore_signals=False, strip=False, - upx=True, + upx=False, upx_exclude=[], runtime_tmpdir=None, console=True, @@ -58,4 +57,5 @@ exe = EXE( target_arch=None, codesign_identity=None, entitlements_file=None, + onefile=False, ) From 16d7e1950deafa817795706c48bd83868da88e09 Mon Sep 17 00:00:00 2001 From: YanNaingWinn Date: Wed, 19 Nov 2025 00:50:10 +0700 Subject: [PATCH 3/4] Resolved flake8 error --- cryptnox_cli/command/card_configuration.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cryptnox_cli/command/card_configuration.py b/cryptnox_cli/command/card_configuration.py index df46806..ae3b2b2 100644 --- a/cryptnox_cli/command/card_configuration.py +++ b/cryptnox_cli/command/card_configuration.py @@ -69,10 +69,14 @@ def show(card: cryptnox_sdk_py.Card) -> int: ] try: data += [ - ["RSA 2048 user key", CardConfiguration._bool_to_str(card.user_key_enabled(cryptnox_sdk_py.SlotIndex.RSA))], + ["RSA 2048 user key", + CardConfiguration._bool_to_str( + card.user_key_enabled(cryptnox_sdk_py.SlotIndex.RSA))], ["ECC 256 user key", CardConfiguration._bool_to_str(card.user_key_enabled(cryptnox_sdk_py.SlotIndex.EC256R1))], - ["FIDO2 user key", CardConfiguration._bool_to_str(card.user_key_enabled(cryptnox_sdk_py.SlotIndex.FIDO))] + ["FIDO2 user key", + CardConfiguration._bool_to_str( + card.user_key_enabled(cryptnox_sdk_py.SlotIndex.FIDO))] ] except NotImplementedError: data += [["User keys", "Not available"]] From c37a8b4fe73979ffae6bc9613063dceca047b8da Mon Sep 17 00:00:00 2001 From: YanNaingWinn Date: Wed, 19 Nov 2025 15:36:16 +0700 Subject: [PATCH 4/4] Updated version in documentations --- docs/cli.rst | 2 +- docs/cryptnox_cli.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cli.rst b/docs/cli.rst index 992e6ef..2504271 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -547,7 +547,7 @@ In interactive mode, you can: .. code-block:: text $ cryptnox - Cryptnox CLI 2.9.1 + Cryptnox CLI 1.0.0 > list [Shows available cards] diff --git a/docs/cryptnox_cli.rst b/docs/cryptnox_cli.rst index 6ee2810..27d2aa5 100644 --- a/docs/cryptnox_cli.rst +++ b/docs/cryptnox_cli.rst @@ -66,7 +66,7 @@ The main ``cryptnox_cli`` package (Cryptnox CLI) exports: .. py:data:: __version__ :type: str - :value: "2.9.1" + :value: "1.0.0" Current version of the Cryptnox CLI package.