diff --git a/python/examples/addresses.py b/python/examples/addresses.py index db00c2bea6..0ebe94698c 100644 --- a/python/examples/addresses.py +++ b/python/examples/addresses.py @@ -1,13 +1,12 @@ -from kaspa import ( - PrivateKey, -) +from kaspa import PrivateKey if __name__ == "__main__": - private_key = PrivateKey('b7e151628aed2a6abf7158809cf4f3c762e7160f38b4da56a784d9045190cfef') + private_key = PrivateKey( + 'b7e151628aed2a6abf7158809cf4f3c762e7160f38b4da56a784d9045190cfef') print(f'Private Key: {private_key.to_hex()}') public_key = private_key.to_public_key() print(f'Public Key: {public_key.to_string_impl()}') address = public_key.to_address('mainnet') - print(f'Address: {address.address_to_string()}') \ No newline at end of file + print(f'Address: {address.address_to_string()}') diff --git a/python/kaspa.pyi b/python/kaspa.pyi new file mode 100644 index 0000000000..380dacac28 --- /dev/null +++ b/python/kaspa.pyi @@ -0,0 +1,62 @@ + +class Address: + + def __init__(self, address: str) -> None: ... + + def to_string(self) -> str: ... + + def version(self) -> str: ... + + def set_prefix(self, prefix: str) -> None: ... + + def payload(self) -> str: ... + + @staticmethod + def validate(address: str) -> bool: ... + + +class PrivateKeyGenerator: + + def __init__(self, xprv: str, is_multisig: bool, + account_index: int, cosigner_index: int) -> str: ... + + def receive_key(self, index: int) -> PrivateKey: ... + + def change_key(self, index: int) -> PrivateKey: ... + + +class PrivateKey: + + def __init__(self, secret_key: str) -> None: ... + + def to_string(self) -> str: ... + + def to_public_key(self) -> PublicKey: ... + + def to_address(self, network: str) -> Address: ... + + def to_address_ecdsa(self, network: str) -> Address: ... + + @staticmethod + def try_new(key: str) -> PrivateKey: ... + + +class PublicKey: + def __init__(self, key: str) -> None: ... + + def to_string(self) -> str: ... + + def to_address(self, network: str) -> Address: ... + + def to_address_ecdsa(self, network: str) -> Address: ... + + +class RpcClient: + + def __init__(self, url: str) -> None: ... + + def is_connected(self) -> bool: ... + + def connect(self) -> None: ... + + def disconnect(self) -> None: ... diff --git a/python/pyproject.toml b/python/kaspa.toml similarity index 100% rename from python/pyproject.toml rename to python/kaspa.toml