from typing import TypedDict, Optional, Dict, List, Any


class AuthTestResponse(TypedDict):
    status: str
    store_id: int
    mode: str
    credits: str


class CreateOrderInput(TypedDict, total=False):
    order_id: str
    price_amount: str
    price_currency: str
    purchaser_email: Optional[str]
    description: Optional[str]
    title: Optional[str]
    success_url: str
    cancel_url: str


class Order(TypedDict):
    order_id: str
    store_id: int
    status: str
    invoice: Any
    payment_url: str


class OrderStatus(TypedDict):
    order_id: str
    status: str
    invoice: Any


class Blockchain(TypedDict):
    full_name: str
    symbol: str


class Wallet(TypedDict):
    full_name: str
    symbol: str
    blockchains: List[Blockchain]


class WalletsData(TypedDict, total=False):
    reservation_id: Optional[str]
    wallets: Dict[str, Wallet]


class WalletsResponse(TypedDict):
    wallets: WalletsData


class CreateInvoiceInput(TypedDict, total=False):
    amount_usd: float
    wallet_cc: str
    wallet_bc: str
    order_id: str
    store_id: str
    reservation_id: Optional[str]


class PaymentBox(TypedDict):
    crypto_amount: str
    qr_address_amount_url: str
    qr_address_only_url: str
    seen_and_confirmed: bool
    seen_but_not_confirmed: bool
    is_polling_needed: bool


class CurrentReceipt(TypedDict):
    payment_box: PaymentBox


class Invoice(TypedDict, total=False):
    id: str
    fancy_id: Optional[str]
    status: str
    amount_fiat: float
    fiat_ticker: str
    cc_ticker: str
    current_receipt: Optional[CurrentReceipt]


InvoiceStatus = Invoice
