diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 516f2db3..0a246111 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: uses: PyO3/maturin-action@v1.44.0 with: target: ${{ matrix.platform.target }} - args: --release --out dist + args: --release --out dist --interpreter python3.9 python3.10 python3.11 python3.12 python3.13 sccache: 'true' manylinux: auto before-script-linux: (apt-get update && apt-get install -y apt-utils && apt-get install -y pkg-config libssl-dev) || (yum install openssl openssl-devel -y) @@ -68,7 +68,7 @@ jobs: uses: PyO3/maturin-action@v1.44.0 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out dist --interpreter python3.9 python3.10 python3.11 python3.12 python3.13 sccache: 'true' - name: Upload wheels uses: actions/upload-artifact@v4 diff --git a/CHANGELOG.MD b/CHANGELOG.MD index fdc702ef..a4b720fd 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,5 +1,35 @@ # Changelog +## 3.0.7 /2025-04-03 + +## What's Changed +* Fixes, improvement, refactoring by @roman-opentensor in https://github.com/opentensor/btwallet/pull/124 + +**Full Changelog**: https://github.com/opentensor/btwallet/compare/v3.0.6...v3.0.7 + +## 3.0.6 /2025-04-02 + +## What's Changed +* Improve release workflow by @roman-opentensor in #122 + +**Full Changelog**: https://github.com/opentensor/btwallet/compare/v3.0.5...v3.0.6 + +## 3.0.5 /2025-04-02 + +## What's Changed +* BT Wallet v.3 (python improvement) by @roman-opentensor in #105 +* Test workflow by @igorsyl in #104 +* Add skip-check-rust label check in .github/workflows/check-rust.yml workflow by @roman-opentensor in #110 +* Fix wallet.create_coldkey_from_uri broken by @roman-opentensor in #109 +* Add workflows for run SDK and BTCLI tests if labels are applied by @roman-opentensor in #106 +* Add back srt and repr for Wallet and Keypair by @roman-opentensor in #111 +* Add trigger for check-rust workflow by @roman-opentensor in #113 +* Update readme by @roman-opentensor in #112 +* Update docker image name by @roman-opentensor in #114 +* fix returns for rust and pyi by @roman-opentensor in #119 + +**Full Changelog**: https://github.com/opentensor/btwallet/compare/v3.0.4...v3.0.5 + ## 3.0.4 /2025-02-19 ## What's Changed diff --git a/Cargo.lock b/Cargo.lock index a6c14c75..764f1186 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -401,7 +401,7 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bittensor_wallet" -version = "3.0.6" +version = "3.0.7" dependencies = [ "ansible-vault", "base64 0.22.1", @@ -413,9 +413,7 @@ dependencies = [ "hex", "passwords", "pbkdf2 0.12.2", - "pkcs8", "pyo3", - "rand", "rpassword", "schnorrkel", "scrypt", diff --git a/Cargo.toml b/Cargo.toml index 39b03c80..290bc811 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bittensor_wallet" -version = "3.0.6" +version = "3.0.7" edition = "2021" [lib] @@ -12,7 +12,6 @@ crate-type = ["cdylib", "rlib"] sp-core = "34.0.0" pyo3 = { version = "0.22.4", features = ["gil-refs"] } bip39 = { version = "2.0.0", features = ["rand"] } -rand = "0.8.5" hex = "0.4.3" colored = "2.1.0" serde_json = "1.0.128" @@ -26,7 +25,6 @@ dirs = "5.0.1" serde = { version = "1.0.210", features = ["derive"] } base64 = "0.22.1" scrypt = "0.11.0" -pkcs8 = "0.10.2" schnorrkel = "0.11.4" shellexpand = "3.1.0" rpassword = "7.3.1" diff --git a/bittensor_wallet/__init__.py b/bittensor_wallet/__init__.py index 740dc919..d9f1431c 100644 --- a/bittensor_wallet/__init__.py +++ b/bittensor_wallet/__init__.py @@ -1,3 +1,5 @@ +import importlib.metadata + from bittensor_wallet.bittensor_wallet import ( Config, Keyfile, @@ -25,4 +27,5 @@ utils = utils wallet = wallet -__version__ = "3.0.2" +# bump version in `pyproject.toml` only +__version__ = importlib.metadata.version("bittensor-wallet") diff --git a/bittensor_wallet/__init__.pyi b/bittensor_wallet/__init__.pyi index 997fdc9d..d9b86782 100644 --- a/bittensor_wallet/__init__.pyi +++ b/bittensor_wallet/__init__.pyi @@ -1,320 +1,6 @@ -from typing import Optional, Any, Union -from types import ModuleType +from .config import Config +from .keyfile import Keyfile +from .keypair import Keypair +from .wallet import Wallet -# Submodules -class config: - class Config: - def __init__( - self, - name: Optional[str] = None, - hotkey: Optional[str] = None, - path: Optional[str] = None, - ) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def path(self) -> str: ... - @property - def hotkey(self) -> str: ... - -class errors: - class KeyFileError(Exception): ... - class ConfigurationError(Exception): ... - class PasswordError(Exception): ... - class WalletError(Exception): ... - -class keyfile: - class Keyfile: - def __init__( - self, - path: Optional[str] = None, - name: Optional[str] = None, - should_save_to_env: bool = False, - ) -> None: ... - def __str__(self) -> str: ... - @property - def path(self) -> str: ... - def exists_on_device(self) -> bool: ... - def is_readable(self) -> bool: ... - def is_writable(self) -> bool: ... - def is_encrypted(self) -> bool: ... - def check_and_update_encryption( - self, print_result: bool = True, no_prompt: bool = False - ) -> None: ... - def encrypt(self, password: Optional[str] = None) -> None: ... - def decrypt(self, password: Optional[str] = None) -> None: ... - def env_var_name(self) -> str: ... - def save_password_to_env(self, password: Optional[str] = None) -> None: ... - def remove_password_from_env(self) -> None: ... - @property - def keypair(self) -> "Keypair": ... - def get_keypair(self, password: Optional[str] = None) -> "Keypair": ... - def set_keypair( - self, - keypair: "Keypair", - encrypt: bool = True, - overwrite: bool = False, - password: Optional[str] = None, - ) -> None: ... - @property - def data(self): ... - def make_dirs(self): ... - - def serialized_keypair_to_keyfile_data(keypair: "Keypair") -> bytes: ... - def deserialize_keypair_from_keyfile_data(keyfile_data: bytes) -> "Keypair": ... - def validate_password(password: str) -> bool: ... - def ask_password(validation_required: bool) -> str: ... - def legacy_encrypt_keyfile_data( - keyfile_data: bytes, password: Optional[str] = None - ) -> bytes: ... - def get_password_from_environment(env_var_name: str) -> Optional[str]: ... - def encrypt_keyfile_data( - keyfile_data: bytes, password: Optional[str] = None - ) -> bytes: ... - def decrypt_keyfile_data( - keyfile_data: bytes, - password: Optional[str] = None, - password_env_var: Optional[str] = None, - ) -> bytes: ... - def keyfile_data_is_encrypted_nacl(keyfile_data: bytes) -> bool: ... - def keyfile_data_is_encrypted_ansible(keyfile_data: bytes) -> bool: ... - def keyfile_data_is_encrypted_legacy(keyfile_data: bytes) -> bool: ... - def keyfile_data_is_encrypted(keyfile_data: bytes) -> bool: ... - def keyfile_data_encryption_method(keyfile_data: bytes) -> str: ... - -class keypair: - class Keypair: - def __init__( - self, - ss58_address: Optional[str] = None, - public_key: Optional[Union[bytes, str]] = None, - private_key: Optional[Union[bytes, str]] = None, - ss58_format: int = 42, - seed_hex: Optional[str] = None, - crypto_type: int = 1, - ) -> None: ... - @staticmethod - def generate_mnemonic(n_words: int = 12) -> str: ... - @staticmethod - def create_from_mnemonic(mnemonic: str) -> "Keypair": ... - @staticmethod - def create_from_seed(seed: Union[bytes, str]) -> "Keypair": ... - @staticmethod - def create_from_private_key(private_key: str) -> "Keypair": ... - @staticmethod - def create_from_encrypted_json( - json_data: str, passphrase: str - ) -> "Keypair": ... - @staticmethod - def create_from_uri(uri: str) -> "Keypair": ... - def sign(self, data: Union[str, bytes]) -> bytes: ... - def verify( - self, data: Union[str, bytes], signature: Union[str, bytes] - ) -> bool: ... - @property - def ss58_address(self) -> Optional[str]: ... - @property - def public_key(self) -> Optional[bytes]: ... - @property - def ss58_format(self) -> int: ... - @property - def crypto_type(self) -> int: ... - @crypto_type.setter - def crypto_type(self, value: int) -> None: ... - -class utils: - def is_valid_ss58_address(address: str) -> bool: ... - def get_ss58_format(ss58_address: str) -> int: ... - def is_valid_ed25519_pubkey(public_key: Union[str, bytes]) -> bool: ... - def is_valid_bittensor_address_or_public_key( - address: Union[str, bytes], - ) -> bool: ... - SS58_FORMAT: int - -class wallet: - class Wallet: - def __init__( - self, - name: Optional[str] = None, - hotkey: Optional[str] = None, - path: Optional[str] = None, - config: Optional[Any] = None, - ) -> None: ... - def __str__(self) -> str: ... - @classmethod - def add_args(cls, parser: Any, prefix: Optional[str] = None) -> Any: ... - def to_string(self) -> str: ... - def debug_string(self) -> str: ... - def create_if_non_existent( - self, - coldkey_use_password: Optional[bool] = True, - hotkey_use_password: Optional[bool] = False, - save_coldkey_to_env: Optional[bool] = False, - save_hotkey_to_env: Optional[bool] = False, - coldkey_password: Optional[str] = None, - hotkey_password: Optional[str] = None, - overwrite: Optional[bool] = False, - suppress: Optional[bool] = False, - ) -> "Wallet": ... - def create( - self, - coldkey_use_password: Optional[bool] = True, - hotkey_use_password: Optional[bool] = False, - save_coldkey_to_env: Optional[bool] = False, - save_hotkey_to_env: Optional[bool] = False, - coldkey_password: Optional[str] = None, - hotkey_password: Optional[str] = None, - overwrite: Optional[bool] = False, - suppress: Optional[bool] = False, - ) -> "Wallet": ... - def recreate( - self, - coldkey_use_password: Optional[bool] = True, - hotkey_use_password: Optional[bool] = False, - save_coldkey_to_env: Optional[bool] = False, - save_hotkey_to_env: Optional[bool] = False, - coldkey_password: Optional[str] = None, - hotkey_password: Optional[str] = None, - overwrite: Optional[bool] = False, - suppress: Optional[bool] = False, - ) -> "Wallet": ... - def get_coldkey(self, password: Optional[str] = None) -> "Keypair": ... - def get_coldkeypub(self, password: Optional[str] = None) -> "Keypair": ... - def get_hotkey(self, password: Optional[str] = None) -> "Keypair": ... - def set_coldkey( - self, - keypair: "Keypair", - encrypt: bool = True, - overwrite: bool = False, - save_coldkey_to_env: bool = False, - coldkey_password: Optional[str] = None, - ) -> None: ... - def set_coldkeypub( - self, - keypair: "Keypair", - encrypt: bool = False, - overwrite: bool = False, - ) -> None: ... - def set_hotkey( - self, - keypair: "Keypair", - encrypt: bool = False, - overwrite: bool = False, - save_hotkey_to_env: bool = False, - hotkey_password: Optional[str] = None, - ) -> None: ... - @property - def coldkey(self) -> "Keypair": ... - @property - def coldkeypub(self) -> "Keypair": ... - @property - def hotkey(self) -> "Keypair": ... - @property - def coldkey_file(self) -> "Keyfile": ... - @property - def coldkeypub_file(self) -> "Keyfile": ... - @property - def hotkey_file(self) -> "Keyfile": ... - @property - def name(self) -> str: ... - @property - def path(self) -> str: ... - @property - def hotkey_str(self) -> str: ... - def create_coldkey_from_uri( - self, - uri: str, - use_password: Optional[bool] = True, - overwrite: Optional[bool] = False, - suppress: Optional[bool] = False, - save_coldkey_to_env: Optional[bool] = False, - coldkey_password: Optional[str] = None, - ) -> None: ... - def create_hotkey_from_uri( - self, - uri: str, - use_password: Optional[bool] = True, - overwrite: Optional[bool] = False, - suppress: Optional[bool] = False, - save_hotkey_to_env: Optional[bool] = False, - hotkey_password: Optional[str] = None, - ) -> None: ... - def unlock_coldkey(self) -> "Keypair": ... - def unlock_coldkeypub(self) -> "Keypair": ... - def unlock_hotkey(self) -> "Keypair": ... - def new_coldkey( - self, - n_words: Optional[int] = 12, - use_password: Optional[bool] = True, - overwrite: Optional[bool] = False, - suppress: Optional[bool] = False, - save_coldkey_to_env: Optional[bool] = False, - coldkey_password: Optional[str] = None, - ) -> "Wallet": ... - def create_new_coldkey( - self, - n_words: Optional[int] = 12, - use_password: Optional[bool] = True, - overwrite: Optional[bool] = False, - suppress: Optional[bool] = False, - save_coldkey_to_env: Optional[bool] = False, - coldkey_password: Optional[str] = None, - ) -> "Wallet": ... - def new_hotkey( - self, - n_words: Optional[int] = 12, - use_password: Optional[bool] = True, - overwrite: Optional[bool] = False, - suppress: Optional[bool] = False, - save_hotkey_to_env: Optional[bool] = False, - hotkey_password: Optional[str] = None, - ) -> "Wallet": ... - def create_new_hotkey( - self, - n_words: Optional[int] = 12, - use_password: Optional[bool] = True, - overwrite: Optional[bool] = False, - suppress: Optional[bool] = False, - save_coldkey_to_env: Optional[bool] = False, - coldkey_password: Optional[str] = None, - ) -> "Wallet": ... - def regenerate_coldkey( - self, - mnemonic: Optional[str] = None, - seed: Optional[bytes] = None, - json: Optional[str] = None, - use_password: Optional[bool] = True, - overwrite: Optional[bool] = False, - suppress: Optional[bool] = False, - save_coldkey_to_env: Optional[bool] = False, - coldkey_password: Optional[str] = None, - ) -> "Wallet": ... - def regenerate_coldkeypub( - self, - ss58_address: Optional[str] = None, - public_key: Optional[bytes] = None, - overwrite: Optional[bool] = False, - ) -> "Wallet": ... - def regenerate_hotkey( - self, - mnemonic: Optional[str] = None, - seed: Optional[bytes] = None, - json: Optional[str] = None, - use_password: Optional[bool] = False, - overwrite: Optional[bool] = False, - suppress: Optional[bool] = False, - save_hotkey_to_env: Optional[bool] = False, - hotkey_password: Optional[str] = None, - ) -> "Wallet": ... - -config: ModuleType -keyfile: ModuleType -keypair: ModuleType -utils: ModuleType -wallet: ModuleType - -Config = config.Config -Keyfile = keyfile.Keyfile -Keypair = keypair.Keypair -Wallet = wallet.Wallet +__all__ = ["Config", "Keyfile", "Keypair", "Wallet"] \ No newline at end of file diff --git a/bittensor_wallet/config/__init__.py b/bittensor_wallet/config/__init__.py new file mode 100644 index 00000000..7f27fd2f --- /dev/null +++ b/bittensor_wallet/config/__init__.py @@ -0,0 +1,3 @@ +from bittensor_wallet.bittensor_wallet import config as _ + +Config = _.Config diff --git a/bittensor_wallet/config/__init__.pyi b/bittensor_wallet/config/__init__.pyi new file mode 100644 index 00000000..3d2e0fa2 --- /dev/null +++ b/bittensor_wallet/config/__init__.pyi @@ -0,0 +1,20 @@ +from typing import Optional + +class Config: + def __init__( + self, + name: Optional[str] = None, + hotkey: Optional[str] = None, + path: Optional[str] = None, + ) -> None: ... + + def __str__(self) -> str: ... + + @property + def name(self) -> str: ... + + @property + def path(self) -> str: ... + + @property + def hotkey(self) -> str: ... \ No newline at end of file diff --git a/bittensor_wallet/errors/__init__.py b/bittensor_wallet/errors/__init__.py index 2e86768c..5785549d 100644 --- a/bittensor_wallet/errors/__init__.py +++ b/bittensor_wallet/errors/__init__.py @@ -3,3 +3,4 @@ ConfigurationError = _.ConfigurationError KeyFileError = _.KeyFileError PasswordError = _.PasswordError +WalletError = _.WalletError diff --git a/bittensor_wallet/errors/__init__.pyi b/bittensor_wallet/errors/__init__.pyi new file mode 100644 index 00000000..e1451bf1 --- /dev/null +++ b/bittensor_wallet/errors/__init__.pyi @@ -0,0 +1,7 @@ +class KeyFileError(Exception): ... + +class ConfigurationError(Exception): ... + +class PasswordError(Exception): ... + +class WalletError(Exception): ... \ No newline at end of file diff --git a/bittensor_wallet/keyfile/__init__.pyi b/bittensor_wallet/keyfile/__init__.pyi new file mode 100644 index 00000000..24b46611 --- /dev/null +++ b/bittensor_wallet/keyfile/__init__.pyi @@ -0,0 +1,104 @@ +from typing import Optional + +from ..keypair import Keypair + + +class Keyfile: + def __init__( + self, + path: Optional[str] = None, + name: Optional[str] = None, + should_save_to_env: bool = False, + ) -> None: ... + + def __str__(self) -> str: ... + + @property + def path(self) -> str: ... + + def exists_on_device(self) -> bool: ... + + def is_readable(self) -> bool: ... + + def is_writable(self) -> bool: ... + + def is_encrypted(self) -> bool: ... + + def check_and_update_encryption( + self, print_result: bool = True, no_prompt: bool = False + ) -> None: ... + + def encrypt(self, password: Optional[str] = None) -> None: ... + + def decrypt(self, password: Optional[str] = None) -> None: ... + + def env_var_name(self) -> str: ... + + def save_password_to_env(self, password: Optional[str] = None) -> None: ... + + def remove_password_from_env(self) -> None: ... + + @property + def keypair(self) -> "Keypair": ... + + def get_keypair(self, password: Optional[str] = None) -> "Keypair": ... + + def set_keypair( + self, + keypair: "Keypair", + encrypt: bool = True, + overwrite: bool = False, + password: Optional[str] = None, + ) -> None: ... + + @property + def data(self): ... + + def make_dirs(self): ... + + +def serialized_keypair_to_keyfile_data(keypair: "Keypair") -> bytes: ... + + +def deserialize_keypair_from_keyfile_data(keyfile_data: bytes) -> "Keypair": ... + + +def validate_password(password: str) -> bool: ... + + +def ask_password(validation_required: bool) -> str: ... + + +def legacy_encrypt_keyfile_data( + keyfile_data: bytes, password: Optional[str] = None +) -> bytes: ... + + +def get_password_from_environment(env_var_name: str) -> Optional[str]: ... + + +def encrypt_keyfile_data( + keyfile_data: bytes, password: Optional[str] = None +) -> bytes: ... + + +def decrypt_keyfile_data( + keyfile_data: bytes, + password: Optional[str] = None, + password_env_var: Optional[str] = None, +) -> bytes: ... + + +def keyfile_data_is_encrypted_nacl(keyfile_data: bytes) -> bool: ... + + +def keyfile_data_is_encrypted_ansible(keyfile_data: bytes) -> bool: ... + + +def keyfile_data_is_encrypted_legacy(keyfile_data: bytes) -> bool: ... + + +def keyfile_data_is_encrypted(keyfile_data: bytes) -> bool: ... + + +def keyfile_data_encryption_method(keyfile_data: bytes) -> str: ... \ No newline at end of file diff --git a/bittensor_wallet/keypair/__init__.pyi b/bittensor_wallet/keypair/__init__.pyi new file mode 100644 index 00000000..b2af5705 --- /dev/null +++ b/bittensor_wallet/keypair/__init__.pyi @@ -0,0 +1,54 @@ +from typing import Optional, Union + + +class Keypair: + def __init__( + self, + ss58_address: Optional[str] = None, + public_key: Optional[Union[bytes, str]] = None, + private_key: Optional[Union[bytes, str]] = None, + ss58_format: int = 42, + seed_hex: Optional[str] = None, + crypto_type: int = 1, + ) -> None: ... + + @staticmethod + def generate_mnemonic(n_words: int = 12) -> str: ... + + @staticmethod + def create_from_mnemonic(mnemonic: str) -> "Keypair": ... + + @staticmethod + def create_from_seed(seed: Union[bytes, str]) -> "Keypair": ... + + @staticmethod + def create_from_private_key(private_key: str) -> "Keypair": ... + + @staticmethod + def create_from_encrypted_json( + json_data: str, passphrase: str + ) -> "Keypair": ... + + @staticmethod + def create_from_uri(uri: str) -> "Keypair": ... + + def sign(self, data: Union[str, bytes]) -> bytes: ... + + def verify( + self, data: Union[str, bytes], signature: Union[str, bytes] + ) -> bool: ... + + @property + def ss58_address(self) -> str: ... + + @property + def public_key(self) -> Optional[bytes]: ... + + @property + def ss58_format(self) -> int: ... + + @property + def crypto_type(self) -> int: ... + + @crypto_type.setter + def crypto_type(self, value: int) -> None: ... diff --git a/bittensor_wallet/utils/__init__.pyi b/bittensor_wallet/utils/__init__.pyi new file mode 100644 index 00000000..8c5dc309 --- /dev/null +++ b/bittensor_wallet/utils/__init__.pyi @@ -0,0 +1,12 @@ +from typing import Final, Union + + +SS58_FORMAT: Final[int] + +def is_valid_ss58_address(address: str) -> bool: ... + +def get_ss58_format(ss58_address: str) -> int: ... + +def is_valid_ed25519_pubkey(public_key: Union[str, bytes]) -> bool: ... + +def is_valid_bittensor_address_or_public_key(address: Union[str, bytes]) -> bool: ... diff --git a/bittensor_wallet/wallet/__init__.pyi b/bittensor_wallet/wallet/__init__.pyi new file mode 100644 index 00000000..5308ec36 --- /dev/null +++ b/bittensor_wallet/wallet/__init__.pyi @@ -0,0 +1,214 @@ +from typing import Any, Optional + +from ..keyfile import Keyfile +from ..keypair import Keypair + + +class Wallet: + def __init__( + self, + name: Optional[str] = None, + hotkey: Optional[str] = None, + path: Optional[str] = None, + config: Optional[Any] = None, + ) -> None: ... + + def __str__(self) -> str: ... + + @classmethod + def add_args(cls, parser: Any, prefix: Optional[str] = None) -> Any: ... + + def to_string(self) -> str: ... + + def debug_string(self) -> str: ... + + def create_if_non_existent( + self, + coldkey_use_password: Optional[bool] = True, + hotkey_use_password: Optional[bool] = False, + save_coldkey_to_env: Optional[bool] = False, + save_hotkey_to_env: Optional[bool] = False, + coldkey_password: Optional[str] = None, + hotkey_password: Optional[str] = None, + overwrite: Optional[bool] = False, + suppress: Optional[bool] = False, + ) -> "Wallet": ... + + def create( + self, + coldkey_use_password: Optional[bool] = True, + hotkey_use_password: Optional[bool] = False, + save_coldkey_to_env: Optional[bool] = False, + save_hotkey_to_env: Optional[bool] = False, + coldkey_password: Optional[str] = None, + hotkey_password: Optional[str] = None, + overwrite: Optional[bool] = False, + suppress: Optional[bool] = False, + ) -> "Wallet": ... + + def recreate( + self, + coldkey_use_password: Optional[bool] = True, + hotkey_use_password: Optional[bool] = False, + save_coldkey_to_env: Optional[bool] = False, + save_hotkey_to_env: Optional[bool] = False, + coldkey_password: Optional[str] = None, + hotkey_password: Optional[str] = None, + overwrite: Optional[bool] = False, + suppress: Optional[bool] = False, + ) -> "Wallet": ... + + def get_coldkey(self, password: Optional[str] = None) -> "Keypair": ... + + def get_coldkeypub(self, password: Optional[str] = None) -> "Keypair": ... + + def get_hotkey(self, password: Optional[str] = None) -> "Keypair": ... + + def set_coldkey( + self, + keypair: "Keypair", + encrypt: bool = True, + overwrite: bool = False, + save_coldkey_to_env: bool = False, + coldkey_password: Optional[str] = None, + ) -> None: ... + + def set_coldkeypub( + self, + keypair: "Keypair", + encrypt: bool = False, + overwrite: bool = False, + ) -> None: ... + + def set_hotkey( + self, + keypair: "Keypair", + encrypt: bool = False, + overwrite: bool = False, + save_hotkey_to_env: bool = False, + hotkey_password: Optional[str] = None, + ) -> None: ... + + @property + def coldkey(self) -> "Keypair": ... + + @property + def coldkeypub(self) -> "Keypair": ... + + @property + def hotkey(self) -> "Keypair": ... + + @property + def coldkey_file(self) -> "Keyfile": ... + + @property + def coldkeypub_file(self) -> "Keyfile": ... + + @property + def hotkey_file(self) -> "Keyfile": ... + + @property + def name(self) -> str: ... + + @property + def path(self) -> str: ... + + @property + def hotkey_str(self) -> str: ... + + def create_coldkey_from_uri( + self, + uri: str, + use_password: Optional[bool] = True, + overwrite: Optional[bool] = False, + suppress: Optional[bool] = False, + save_coldkey_to_env: Optional[bool] = False, + coldkey_password: Optional[str] = None, + ) -> None: ... + + def create_hotkey_from_uri( + self, + uri: str, + use_password: Optional[bool] = True, + overwrite: Optional[bool] = False, + suppress: Optional[bool] = False, + save_hotkey_to_env: Optional[bool] = False, + hotkey_password: Optional[str] = None, + ) -> None: ... + + def unlock_coldkey(self) -> "Keypair": ... + + def unlock_coldkeypub(self) -> "Keypair": ... + + def unlock_hotkey(self) -> "Keypair": ... + + def new_coldkey( + self, + n_words: Optional[int] = 12, + use_password: Optional[bool] = True, + overwrite: Optional[bool] = False, + suppress: Optional[bool] = False, + save_coldkey_to_env: Optional[bool] = False, + coldkey_password: Optional[str] = None, + ) -> "Wallet": ... + + def create_new_coldkey( + self, + n_words: Optional[int] = 12, + use_password: Optional[bool] = True, + overwrite: Optional[bool] = False, + suppress: Optional[bool] = False, + save_coldkey_to_env: Optional[bool] = False, + coldkey_password: Optional[str] = None, + ) -> "Wallet": ... + + def new_hotkey( + self, + n_words: Optional[int] = 12, + use_password: Optional[bool] = True, + overwrite: Optional[bool] = False, + suppress: Optional[bool] = False, + save_hotkey_to_env: Optional[bool] = False, + hotkey_password: Optional[str] = None, + ) -> "Wallet": ... + + def create_new_hotkey( + self, + n_words: Optional[int] = 12, + use_password: Optional[bool] = True, + overwrite: Optional[bool] = False, + suppress: Optional[bool] = False, + save_coldkey_to_env: Optional[bool] = False, + coldkey_password: Optional[str] = None, + ) -> "Wallet": ... + + def regenerate_coldkey( + self, + mnemonic: Optional[str] = None, + seed: Optional[bytes] = None, + json: Optional[str] = None, + use_password: Optional[bool] = True, + overwrite: Optional[bool] = False, + suppress: Optional[bool] = False, + save_coldkey_to_env: Optional[bool] = False, + coldkey_password: Optional[str] = None, + ) -> "Wallet": ... + + def regenerate_coldkeypub( + self, + ss58_address: Optional[str] = None, + public_key: Optional[bytes] = None, + overwrite: Optional[bool] = False, + ) -> "Wallet": ... + + def regenerate_hotkey( + self, + mnemonic: Optional[str] = None, + seed: Optional[bytes] = None, + json: Optional[str] = None, + use_password: Optional[bool] = False, + overwrite: Optional[bool] = False, + suppress: Optional[bool] = False, + save_hotkey_to_env: Optional[bool] = False, + hotkey_password: Optional[str] = None, + ) -> "Wallet": ... \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index f0387b0d..f14d742e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "bittensor-wallet" -version = "3.0.6" +version = "3.0.7" description = "" readme = "README.md" license = {file = "LICENSE"}