from dataclasses import dataclass

from .cell import Cell

@dataclass
class Anycast:
    depth: int
    rewrite_pfx: int

class AddressError(Exception): ...

class Address:
    wc: int
    hash_part: bytes
    is_bounceable: bool
    is_test_only: bool
    anycast: Anycast | None

    def __init__(self, address: tuple[int, bytes] | Address | str) -> None: ...
    def set_anycast(self, depth: int, rewrite_pfx: int) -> None: ...
    def is_hex(self, addr: str) -> bool: ...
    def is_b64(self, addr: str) -> bool: ...
    def to_str(
        self,
        is_user_friendly: bool = ...,
        is_url_safe: bool = ...,
        is_bounceable: bool = ...,
        is_test_only: bool = ...,
    ) -> str: ...
    def to_tl_account_id(self) -> dict[str, int | str]: ...
    def to_cell(self) -> Cell: ...
    def __eq__(self, other: object) -> bool: ...
    def __repr__(self) -> str: ...
    def __hash__(self) -> int: ...

class ExternalAddress:
    external_address: int | None
    len: int

    def __init__(
        self,
        address: int | str | bytes | None,
        length: int | None = ...,
    ) -> None: ...
    def to_cell(self) -> Cell: ...
    def __repr__(self) -> str: ...
    def __eq__(self, other: object) -> bool: ...
