diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..6a34c91 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,61 @@ +name: Build and Deploy Documentation + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout cryptnoxpro repository + uses: actions/checkout@v4 + with: + path: cryptnoxpro + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + cd cryptnoxpro + pip install sphinx sphinx-rtd-theme + + - name: Build Sphinx documentation + run: | + cd cryptnoxpro + sphinx-build -b html docs docs/_build/html + + - name: Checkout documentation repository + uses: actions/checkout@v4 + with: + repository: cryptnox-software/cryptnox-software.github.io + token: ${{ secrets.DOCS_DEPLOY_TOKEN }} + path: docs-repo + + - name: Update documentation + run: | + # Remove old cryptnoxpro folder if it exists + rm -rf docs-repo/cryptnoxpro + + # Copy new documentation + cp -r cryptnoxpro/docs/_build/html docs-repo/cryptnoxpro + + # Add a timestamp file for tracking + echo "Last updated: $(date)" > docs-repo/cryptnoxpro/last-updated.txt + + - name: Commit and push changes + run: | + cd docs-repo + git config --local user.email "yannw.dev@gmail.com" + git config --local user.name "YanNaingWinDev" + git add . + git commit -m "Update cryptnoxpro documentation from cryptnoxpro@${{ github.sha }}" || exit 0 + git push diff --git a/.gitignore b/.gitignore index 7efa8d5..66fe372 100644 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,6 @@ venv signature.sig cardpub.pub -_build -_static -_templates +docs/_build/ cryptnoxpro.egg-info diff --git a/cryptnoxpro/command/card/info.py b/cryptnoxpro/command/card/info.py index 88e270f..240149c 100644 --- a/cryptnoxpro/command/card/info.py +++ b/cryptnoxpro/command/card/info.py @@ -10,27 +10,30 @@ from tabulate import tabulate from ..cards import Cards +from ..helper.cards import CardManager from ..helper.security import ( check, is_easy_mode ) try: - import enums - from config import get_configuration - from wallet import eth - from wallet.btc import BTCwallet, BlkHubApi -except ImportError: from ... import enums from ...config import get_configuration from ...wallet import eth from ...wallet.btc import BTCwallet, BlkHubApi +except ImportError: + import enums + from config import get_configuration + from wallet import eth + from wallet.btc import BTCwallet, BlkHubApi + +__all__ = ['Cards'] class Info: - def __init__(self, data: Namespace, cards: Cards = None): + def __init__(self, data: Namespace, cards: CardManager = None): self.data = data - self._cards = cards or Cards(self.data.verbose if "verbose" in self.data else False) + self._cards = cards or CardManager(self.data.verbose if "verbose" in self.data else False) self.serial_number = None @staticmethod diff --git a/cryptnoxpro/command/card/initialize.py b/cryptnoxpro/command/card/initialize.py index 7f86c03..af70fe1 100644 --- a/cryptnoxpro/command/card/initialize.py +++ b/cryptnoxpro/command/card/initialize.py @@ -9,12 +9,15 @@ from ..cards import Cards from ..helper import ui, security +from ..helper.cards import CardManager + +__all__ = ['Cards'] class Initialize: - def __init__(self, data: Namespace, cards: Cards = None): + def __init__(self, data: Namespace, cards: CardManager = None): self.data = data - self._cards = cards or Cards(self.data.verbose if "verbose" in self.data else False) + self._cards = cards or CardManager(self.data.verbose if "verbose" in self.data else False) self.serial_number = None def execute(self, card) -> int: diff --git a/cryptnoxpro/command/command.py b/cryptnoxpro/command/command.py index 23d4803..2bba79d 100644 --- a/cryptnoxpro/command/command.py +++ b/cryptnoxpro/command/command.py @@ -13,7 +13,7 @@ ui, security ) from .helper.cards import ( - Cards, + CardManager, ExitException, TimeoutException, ) @@ -30,9 +30,9 @@ class Command(metaclass=abc.ABCMeta): :param Namespace data: Command line arguments """ - def __init__(self, data: Namespace, cards: Cards = None): + def __init__(self, data: Namespace, cards: CardManager = None): self.data = data - self._cards = cards or Cards(self.data.verbose if "verbose" in self.data else False) + self._cards = cards or CardManager(self.data.verbose if "verbose" in self.data else False) self.serial_number = None def execute(self, serial_number: int = None) -> int: @@ -40,6 +40,7 @@ def execute(self, serial_number: int = None) -> int: Main execution method of the command. Finds card and establishes connection to it. Executes _execute method. + :param serial_number: Serial number of the wanted card :return: 0 if the command executed without issues. Other number indicating and issue diff --git a/cryptnoxpro/command/erc_token/info.py b/cryptnoxpro/command/erc_token/info.py index 6e6d969..d7ab224 100644 --- a/cryptnoxpro/command/erc_token/info.py +++ b/cryptnoxpro/command/erc_token/info.py @@ -20,13 +20,16 @@ from web3 import Web3 from ..cards import Cards +from ..helper.cards import CardManager + +__all__ = ['Cards'] try: - import enums - from wallet import eth -except ImportError: from ... import enums from ...wallet import eth +except ImportError: + import enums + from wallet import eth _SEED_SOURCE_TRANSLATION = { cryptnoxpy.SeedSource.NO_SEED: "No seed", @@ -47,9 +50,9 @@ class Info: """ _name = enums.Command.INFO.value - def __init__(self, data: Namespace, cards: Cards = None): + def __init__(self, data: Namespace, cards: CardManager = None): self.data = data - self._cards = cards or Cards(self.data.verbose if "verbose" in self.data else False) + 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: diff --git a/cryptnoxpro/command/erc_token/initialize.py b/cryptnoxpro/command/erc_token/initialize.py index 1ce23d5..5999d51 100644 --- a/cryptnoxpro/command/erc_token/initialize.py +++ b/cryptnoxpro/command/erc_token/initialize.py @@ -16,7 +16,7 @@ import requests from ..helper import ui -from ..helper.cards import ExitException, Cards +from ..helper.cards import ExitException, CardManager try: from wallet import eth @@ -25,9 +25,9 @@ class Initialize: - def __init__(self, data: Namespace, cards: Cards = None): + def __init__(self, data: Namespace, cards: CardManager = None): self.data = data - self._cards = cards or Cards(self.data.verbose if "verbose" in self.data else False) + 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: diff --git a/cryptnoxpro/command/factory.py b/cryptnoxpro/command/factory.py index 6c9d084..fc87272 100644 --- a/cryptnoxpro/command/factory.py +++ b/cryptnoxpro/command/factory.py @@ -6,11 +6,11 @@ from argparse import Namespace from .command import Command -from .helper.cards import Cards +from .helper.cards import CardManager from .unknown import Unknown -def command(data: Namespace, cards: Cards = None) -> Command: +def command(data: Namespace, cards: CardManager = None) -> Command: """ Gives back the command that took responsibility for executing the command diff --git a/cryptnoxpro/command/helper/cards.py b/cryptnoxpro/command/helper/cards.py index a2c1f7f..8330c75 100644 --- a/cryptnoxpro/command/helper/cards.py +++ b/cryptnoxpro/command/helper/cards.py @@ -26,7 +26,7 @@ except ImportError: import config -# Global connection cache to preserve connections across Cards instances +# Global connection cache to preserve connections across CardManager instances _GLOBAL_CONNECTIONS: Dict[int, cryptnoxpy.Connection] = {} @@ -42,7 +42,7 @@ class TimeoutException(Exception): """ -class Cards: +class CardManager: def __init__(self, debug: bool = False): self._cards: Dict[int, cryptnoxpy.Card] = {} self._cards_by_index: Dict[int, cryptnoxpy.Card] = {} @@ -70,7 +70,7 @@ def __getitem__(self, key: int) -> cryptnoxpy.Card: card = self._cards_by_index[key] index = key - if index in _GLOBAL_CONNECTIONS: + if index in _GLOBAL_CONNECTIONS and card.alive: return card if card.alive: @@ -150,7 +150,7 @@ def print_card_list(self, show_warnings: bool = False, info["applet_version"], info["name"] + ((" <" + info["email"] + ">") if info["email"] else ""), - ", ".join(Cards.printable_flags(card)) + ", ".join(CardManager.printable_flags(card)) ] uninitialized |= not info["initialized"] @@ -194,8 +194,11 @@ 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: + except (BaseException, cryptnoxpy.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) diff --git a/cryptnoxpro/command/helper/security.py b/cryptnoxpro/command/helper/security.py index 139f942..2bc6995 100644 --- a/cryptnoxpro/command/helper/security.py +++ b/cryptnoxpro/command/helper/security.py @@ -7,10 +7,32 @@ import cryptnoxpy -from . import ui from .. import user_keys +class ExitException(Exception): + """Raised when user has indicated he want's to exit the command""" + + +def _secret_with_exit(text, required=True): + """ + Local implementation of secret_with_exit to avoid circular import. + Replicates the functionality of ui.secret_with_exit. + """ + from stdiomask import getpass + + while True: + value = getpass(text).strip() + if value.lower() == "exit": + raise ExitException + if required and not value: + print("This entry is required") + else: + break + + return value + + class Unauthorized(Exception): """ None of the authorization methods has validated the user. @@ -173,7 +195,7 @@ def get_puk_code(card: cryptnoxpy.Card, text: str = "", allowed_values: List = N :param Card card: Card for use to check PUK code validity :param str text: Text displayed to user for value input. :param List allowed_values: Values other than 15 digits long strings - that can be accepted. + that can be accepted. :return: Entered puk code. :rtype: str """ @@ -186,7 +208,7 @@ def _get_code( text: str = "", allowed_values: List = None) -> str: allowed_values = allowed_values or [] - code = ui.secret_with_exit(text, required=("" not in allowed_values)) + code = _secret_with_exit(text, required=("" not in allowed_values)) if not {code, ""}.isdisjoint(allowed_values): return code @@ -196,7 +218,7 @@ def _get_code( validation_method(code) except cryptnoxpy.exceptions.DataValidationException as error: print(error, "\n") - code = ui.secret_with_exit(text, required=("" not in allowed_values)) + code = _secret_with_exit(text, required=("" not in allowed_values)) if code in allowed_values: break diff --git a/cryptnoxpro/command/helper/seed_backup.py b/cryptnoxpro/command/helper/seed_backup.py index ea9983e..6f423f7 100644 --- a/cryptnoxpro/command/helper/seed_backup.py +++ b/cryptnoxpro/command/helper/seed_backup.py @@ -35,14 +35,15 @@ def create_data_key(session, cmk_id, key_spec="AES_256"): """Generate a data key to use when encrypting and decrypting data :param cmk_id: KMS CMK ID or ARN under which to generate and encrypt the - data key. + data key. :param key_spec: Length of the data encryption key. Supported values: 'AES_128': Generate a 128-bit symmetric key 'AES_256': Generate a 256-bit symmetric key - :return Tuple(EncryptedDataKey, PlaintextDataKey) where: + :return: Tuple(EncryptedDataKey, PlaintextDataKey) where: EncryptedDataKey: Encrypted CiphertextBlob data key as binary string PlaintextDataKey: Plaintext base64-encoded data key as binary string - :return Tuple(None, None) if error""" + :return: Tuple(None, None) if error + """ # Create data key kms_client = session.client("kms") diff --git a/cryptnoxpro/command/unknown.py b/cryptnoxpro/command/unknown.py index 6411ee6..df5d0b9 100644 --- a/cryptnoxpro/command/unknown.py +++ b/cryptnoxpro/command/unknown.py @@ -21,6 +21,7 @@ def execute(self, serial_number: int = None) -> int: Main execution method of the command. Finds card and establishes connection to it. Executes _execute method. + :param serial_number: Serial number of the wanted card :return: 0 if the command executed without issues. Other number indicating and issue diff --git a/cryptnoxpro/command/user_keys/piv/piv_card.py b/cryptnoxpro/command/user_keys/piv/piv_card.py index b69886c..0206438 100644 --- a/cryptnoxpro/command/user_keys/piv/piv_card.py +++ b/cryptnoxpro/command/user_keys/piv/piv_card.py @@ -215,7 +215,7 @@ def is_locked(self, pin_bank: int) -> bool: :param int pin_bank: The PIN bank to check :return: Whether the PIV is locked for pin_bank - :rtype; bool + :rtype: bool """ try: self.verify_pin(pin_bank, "") diff --git a/cryptnoxpro/interactive_cli.py b/cryptnoxpro/interactive_cli.py index 3ccf63d..ff281af 100644 --- a/cryptnoxpro/interactive_cli.py +++ b/cryptnoxpro/interactive_cli.py @@ -17,7 +17,7 @@ from command.options import options from command.helper import security from command.helper.cards import ( - Cards, + CardManager, ExitException, TimeoutException ) @@ -27,7 +27,7 @@ from .command.options import options from .command.helper import security from .command.helper.cards import ( - Cards, + CardManager, ExitException, TimeoutException ) @@ -223,7 +223,7 @@ def __init__(self, version: str, debug: bool = False, port: int = None): self._reconnect = False self._card_info = None - self._cards = Cards() + self._cards = CardManager() self.subcommand = [] self.parser = None diff --git a/dev-requirements.txt b/dev-requirements.txt index 61b9be4..b905ff0 100644 Binary files a/dev-requirements.txt and b/dev-requirements.txt differ diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..b2e992e --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,21 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + diff --git a/docs/_static/.gitkeep b/docs/_static/.gitkeep new file mode 100644 index 0000000..77ab2f9 --- /dev/null +++ b/docs/_static/.gitkeep @@ -0,0 +1 @@ +# This file ensures the _static directory is preserved in git diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 0000000..2c8600d --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,44 @@ +/* Custom styling for the documentation */ +body { + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} + +/* Style for code blocks */ +.highlight { + background-color: #f8f9fa; + border-left: 4px solid #007bff; + padding: 1rem; + margin: 1rem 0; +} + +/* Custom header styling */ +h1, h2, h3, h4, h5, h6 { + color: #2c3e50; +} + +/* Custom link styling */ +a { + color: #007bff; +} + +a:hover { + color: #0056b3; +} + +/* Custom table styling */ +table { + border-collapse: collapse; + width: 100%; + margin: 1rem 0; +} + +th, td { + border: 1px solid #dee2e6; + padding: 0.75rem; + text-align: left; +} + +th { + background-color: #f8f9fa; + font-weight: bold; +} diff --git a/docs/_static/custom.js b/docs/_static/custom.js new file mode 100644 index 0000000..c6a06f5 --- /dev/null +++ b/docs/_static/custom.js @@ -0,0 +1,51 @@ +// Add smooth scrolling for anchor links +document.addEventListener('DOMContentLoaded', function() { + // Smooth scrolling for internal links + const links = document.querySelectorAll('a[href^="#"]'); + links.forEach(link => { + link.addEventListener('click', function(e) { + e.preventDefault(); + const target = document.querySelector(this.getAttribute('href')); + if (target) { + target.scrollIntoView({ + behavior: 'smooth', + block: 'start' + }); + } + }); + }); + + // Add copy button to code blocks + const codeBlocks = document.querySelectorAll('pre code'); + codeBlocks.forEach(block => { + const button = document.createElement('button'); + button.textContent = 'Copy'; + button.className = 'copy-button'; + button.style.cssText = ` + position: absolute; + top: 0.5rem; + right: 0.5rem; + background: #007bff; + color: white; + border: none; + padding: 0.25rem 0.5rem; + border-radius: 0.25rem; + cursor: pointer; + font-size: 0.8rem; + `; + + button.addEventListener('click', function() { + navigator.clipboard.writeText(block.textContent); + button.textContent = 'Copied!'; + setTimeout(() => { + button.textContent = 'Copy'; + }, 2000); + }); + + const wrapper = document.createElement('div'); + wrapper.style.position = 'relative'; + block.parentNode.parentNode.insertBefore(wrapper, block.parentNode); + wrapper.appendChild(block.parentNode); + wrapper.appendChild(button); + }); +}); diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..950892a --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,96 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +import os +import sys +sys.path.insert(0, os.path.abspath("..")) + +project = 'cryptnoxpro' +copyright = '2025, Cryptnox' +author = 'Cryptnox' +release = '2.9.1' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.napoleon", + "sphinx.ext.viewcode", +] + +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +autodoc_mock_imports = [ + 'winsdk', + 'cryptnoxpy', + 'boto3', + 'botocore', + 'cryptography', + 'stdiomask', + 'tabulate', + 'requests', + 'web3', + 'eth_typing', + 'eth_account', + 'eth_account.transactions', + 'eth_account.account', + 'eth_account._utils', + 'eth_account.datastructures', + 'pydantic', + 'pydantic_core', + 'eth_utils', + 'hexbytes', + 'enums', + 'config' +] + +# Handle ambiguous cross-references +nitpicky = False +nitpick_ignore = [ + ('py:class', 'Command'), + ('py:class', 'Cards'), +] + +# Suppress specific warnings +suppress_warnings = [ + 'ref.python', +] + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "sphinx_rtd_theme" +html_static_path = ['_static'] + +# Custom CSS and JS +html_css_files = [ + 'custom.css', +] + +html_js_files = [ + 'custom.js', +] + +# Theme options +html_theme_options = { + 'analytics_id': '', # Provided by Google Analytics + 'logo_only': False, + 'prev_next_buttons_location': 'bottom', + 'style_external_links': False, + 'vcs_pageview_mode': '', + 'style_nav_header_background': '#2980B9', + # Toc options + 'collapse_navigation': True, + 'sticky_navigation': True, + 'navigation_depth': 4, + 'includehidden': True, + 'titles_only': False +} diff --git a/docs/cryptnoxpro.command.card.rst b/docs/cryptnoxpro.command.card.rst new file mode 100644 index 0000000..678bdf6 --- /dev/null +++ b/docs/cryptnoxpro.command.card.rst @@ -0,0 +1,30 @@ +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: + diff --git a/docs/cryptnoxpro.command.erc_token.rst b/docs/cryptnoxpro.command.erc_token.rst new file mode 100644 index 0000000..b05d892 --- /dev/null +++ b/docs/cryptnoxpro.command.erc_token.rst @@ -0,0 +1,38 @@ +cryptnoxpro.command.erc\_token package +====================================== + +Submodules +---------- + +cryptnoxpro.command.erc\_token.contract module +---------------------------------------------- + +.. automodule:: cryptnoxpro.command.erc_token.contract + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.erc\_token.info module +------------------------------------------ + +.. automodule:: cryptnoxpro.command.erc_token.info + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.erc\_token.initialize module +------------------------------------------------ + +.. automodule:: cryptnoxpro.command.erc_token.initialize + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnoxpro.command.erc_token + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/cryptnoxpro.command.helper.rst b/docs/cryptnoxpro.command.helper.rst new file mode 100644 index 0000000..c8949ba --- /dev/null +++ b/docs/cryptnoxpro.command.helper.rst @@ -0,0 +1,86 @@ +cryptnoxpro.command.helper package +=================================== + +Submodules +---------- + +cryptnoxpro.command.helper.backup module +---------------------------------------- + +.. automodule:: cryptnoxpro.command.helper.backup + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.helper.cards module +--------------------------------------- + +.. automodule:: cryptnoxpro.command.helper.cards + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.helper.config module +---------------------------------------- + +.. automodule:: cryptnoxpro.command.helper.config + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.helper.download\_folder module +-------------------------------------------------- + +.. automodule:: cryptnoxpro.command.helper.download_folder + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.helper.helper\_methods module +------------------------------------------------- + +.. automodule:: cryptnoxpro.command.helper.helper_methods + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.helper.notification module +---------------------------------------------- + +.. automodule:: cryptnoxpro.command.helper.notification + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.helper.security module +------------------------------------------ + +.. automodule:: cryptnoxpro.command.helper.security + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.helper.seed\_backup module +---------------------------------------------- + +.. automodule:: cryptnoxpro.command.helper.seed_backup + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.helper.ui module +------------------------------------ + +.. automodule:: cryptnoxpro.command.helper.ui + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnoxpro.command.helper + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/cryptnoxpro.command.options.rst b/docs/cryptnoxpro.command.options.rst new file mode 100644 index 0000000..af4453c --- /dev/null +++ b/docs/cryptnoxpro.command.options.rst @@ -0,0 +1,38 @@ +cryptnoxpro.command.options package +==================================== + +Submodules +---------- + +cryptnoxpro.command.options.common module +----------------------------------------- + +.. automodule:: cryptnoxpro.command.options.common + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.options.eth module +-------------------------------------- + +.. automodule:: cryptnoxpro.command.options.eth + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.options.options module +------------------------------------------ + +.. automodule:: cryptnoxpro.command.options.options + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnoxpro.command.options + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/cryptnoxpro.command.rst b/docs/cryptnoxpro.command.rst new file mode 100644 index 0000000..42008a3 --- /dev/null +++ b/docs/cryptnoxpro.command.rst @@ -0,0 +1,202 @@ +cryptnoxpro.command package +============================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + cryptnoxpro.command.card + cryptnoxpro.command.erc_token + cryptnoxpro.command.helper + cryptnoxpro.command.options + cryptnoxpro.command.user_keys + +Submodules +---------- + +cryptnoxpro.command.btc module +------------------------------ + +.. automodule:: cryptnoxpro.command.btc + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.card\_configuration module +---------------------------------------------- + +.. automodule:: cryptnoxpro.command.card_configuration + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.cards module +-------------------------------- + +.. automodule:: cryptnoxpro.command.cards + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.change\_pin module +-------------------------------------- + +.. automodule:: cryptnoxpro.command.change_pin + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.change\_puk module +-------------------------------------- + +.. automodule:: cryptnoxpro.command.change_puk + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.command module +---------------------------------- + +.. automodule:: cryptnoxpro.command.command + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.config module +--------------------------------- + +.. automodule:: cryptnoxpro.command.config + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.decrypt module +---------------------------------- + +.. automodule:: cryptnoxpro.command.decrypt + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.eth module +------------------------------ + +.. automodule:: cryptnoxpro.command.eth + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.factory module +---------------------------------- + +.. automodule:: cryptnoxpro.command.factory + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.get\_clearpubkey module +------------------------------------------- + +.. automodule:: cryptnoxpro.command.get_clearpubkey + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.get\_xpub module +------------------------------------ + +.. automodule:: cryptnoxpro.command.get_xpub + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.history module +---------------------------------- + +.. automodule:: cryptnoxpro.command.history + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.info module +------------------------------- + +.. automodule:: cryptnoxpro.command.info + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.initialize module +------------------------------------- + +.. automodule:: cryptnoxpro.command.initialize + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.reset module +-------------------------------- + +.. automodule:: cryptnoxpro.command.reset + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.seed module +------------------------------- + +.. automodule:: cryptnoxpro.command.seed + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.server module +--------------------------------- + +.. automodule:: cryptnoxpro.command.server + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.transfer module +----------------------------------- + +.. automodule:: cryptnoxpro.command.transfer + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.unknown module +---------------------------------- + +.. automodule:: cryptnoxpro.command.unknown + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.unlock\_pin module +-------------------------------------- + +.. automodule:: cryptnoxpro.command.unlock_pin + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.user\_key module +------------------------------------ + +.. automodule:: cryptnoxpro.command.user_key + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnoxpro.command + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/cryptnoxpro.command.user_keys.aws_kms.rst b/docs/cryptnoxpro.command.user_keys.aws_kms.rst new file mode 100644 index 0000000..2c339c5 --- /dev/null +++ b/docs/cryptnoxpro.command.user_keys.aws_kms.rst @@ -0,0 +1,22 @@ +cryptnoxpro.command.user\_keys.aws\_kms package +================================================ + +Submodules +---------- + +cryptnoxpro.command.user\_keys.aws\_kms.aws\_kms module +------------------------------------------------------- + +.. automodule:: cryptnoxpro.command.user_keys.aws_kms.aws_kms + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnoxpro.command.user_keys.aws_kms + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/cryptnoxpro.command.user_keys.hello.rst b/docs/cryptnoxpro.command.user_keys.hello.rst new file mode 100644 index 0000000..7ce2e4e --- /dev/null +++ b/docs/cryptnoxpro.command.user_keys.hello.rst @@ -0,0 +1,38 @@ +cryptnoxpro.command.user\_keys.hello package +============================================= + +Submodules +---------- + +cryptnoxpro.command.user\_keys.hello.exceptions module +------------------------------------------------------ + +.. automodule:: cryptnoxpro.command.user_keys.hello.exceptions + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.user\_keys.hello.hello module +------------------------------------------------- + +.. automodule:: cryptnoxpro.command.user_keys.hello.hello + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.user\_keys.hello.windows\_hello module +---------------------------------------------------------- + +.. automodule:: cryptnoxpro.command.user_keys.hello.windows_hello + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnoxpro.command.user_keys.hello + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/cryptnoxpro.command.user_keys.piv.rst b/docs/cryptnoxpro.command.user_keys.piv.rst new file mode 100644 index 0000000..3c0f5f7 --- /dev/null +++ b/docs/cryptnoxpro.command.user_keys.piv.rst @@ -0,0 +1,30 @@ +cryptnoxpro.command.user\_keys.piv package +=========================================== + +Submodules +---------- + +cryptnoxpro.command.user\_keys.piv.piv module +--------------------------------------------- + +.. automodule:: cryptnoxpro.command.user_keys.piv.piv + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.command.user\_keys.piv.piv\_card module +--------------------------------------------------- + +.. automodule:: cryptnoxpro.command.user_keys.piv.piv_card + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnoxpro.command.user_keys.piv + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/cryptnoxpro.command.user_keys.rst b/docs/cryptnoxpro.command.user_keys.rst new file mode 100644 index 0000000..cc089ce --- /dev/null +++ b/docs/cryptnoxpro.command.user_keys.rst @@ -0,0 +1,40 @@ +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: + diff --git a/docs/cryptnoxpro.lib.cryptos.coins.rst b/docs/cryptnoxpro.lib.cryptos.coins.rst new file mode 100644 index 0000000..6699707 --- /dev/null +++ b/docs/cryptnoxpro.lib.cryptos.coins.rst @@ -0,0 +1,30 @@ +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: + diff --git a/docs/cryptnoxpro.lib.cryptos.rst b/docs/cryptnoxpro.lib.cryptos.rst new file mode 100644 index 0000000..e042543 --- /dev/null +++ b/docs/cryptnoxpro.lib.cryptos.rst @@ -0,0 +1,142 @@ +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: + diff --git a/docs/cryptnoxpro.lib.rst b/docs/cryptnoxpro.lib.rst new file mode 100644 index 0000000..ed15d2d --- /dev/null +++ b/docs/cryptnoxpro.lib.rst @@ -0,0 +1,19 @@ +cryptnoxpro.lib package +======================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + cryptnoxpro.lib.cryptos + +Module contents +--------------- + +.. automodule:: cryptnoxpro.lib + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/cryptnoxpro.rst b/docs/cryptnoxpro.rst new file mode 100644 index 0000000..20f3b56 --- /dev/null +++ b/docs/cryptnoxpro.rst @@ -0,0 +1,56 @@ +cryptnoxpro package +=================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + cryptnoxpro.command + cryptnoxpro.lib + cryptnoxpro.wallet + +Submodules +---------- + +cryptnoxpro.config module +------------------------- + +.. automodule:: cryptnoxpro.config + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.enums module +------------------------ + +.. automodule:: cryptnoxpro.enums + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.interactive\_cli module +----------------------------------- + +.. automodule:: cryptnoxpro.interactive_cli + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.main module +----------------------- + +.. automodule:: cryptnoxpro.main + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnoxpro + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/cryptnoxpro.wallet.eth.rst b/docs/cryptnoxpro.wallet.eth.rst new file mode 100644 index 0000000..51b3c9e --- /dev/null +++ b/docs/cryptnoxpro.wallet.eth.rst @@ -0,0 +1,30 @@ +cryptnoxpro.wallet.eth package +=============================== + +Submodules +---------- + +cryptnoxpro.wallet.eth.api module +---------------------------------- + +.. automodule:: cryptnoxpro.wallet.eth.api + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.wallet.eth.endpoint module +--------------------------------------- + +.. automodule:: cryptnoxpro.wallet.eth.endpoint + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnoxpro.wallet.eth + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/cryptnoxpro.wallet.rst b/docs/cryptnoxpro.wallet.rst new file mode 100644 index 0000000..f930f56 --- /dev/null +++ b/docs/cryptnoxpro.wallet.rst @@ -0,0 +1,38 @@ +cryptnoxpro.wallet package +=========================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + cryptnoxpro.wallet.eth + +Submodules +---------- + +cryptnoxpro.wallet.btc module +------------------------------ + +.. automodule:: cryptnoxpro.wallet.btc + :members: + :undoc-members: + :show-inheritance: + +cryptnoxpro.wallet.validators module +------------------------------------- + +.. automodule:: cryptnoxpro.wallet.validators + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: cryptnoxpro.wallet + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..49fb59a --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,13 @@ +Cryptnoxpro Documentation +========================= + +Welcome to the technical documentation of Cryptnoxpro. + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + overview + modules + license + diff --git a/docs/license.rst b/docs/license.rst new file mode 100644 index 0000000..1794102 --- /dev/null +++ b/docs/license.rst @@ -0,0 +1,11 @@ +License +======= + +The library is available under dual licensing. You can use the library under the +conditions of GNU GENERAL PUBLIC LICENSE 3.0+ or contact us to ask about commercial licensing. + +.. literalinclude:: ../LICENSE + :language: none + + + diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..b82d59d --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,36 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd + diff --git a/docs/modules.rst b/docs/modules.rst new file mode 100644 index 0000000..68e5b1b --- /dev/null +++ b/docs/modules.rst @@ -0,0 +1,8 @@ +API Reference +============= + +.. toctree:: + :maxdepth: 4 + + cryptnoxpro + diff --git a/docs/overview.rst b/docs/overview.rst new file mode 100644 index 0000000..027224f --- /dev/null +++ b/docs/overview.rst @@ -0,0 +1,7 @@ +Cryptnoxpro Overview +==================== + +.. include:: ../README.rst + + +