from typing import List, Optional

from agno.tools import Toolkit
from synvya_sdk import NostrClient, Product, Profile, Stall

class MerchantTools(Toolkit):
    _nostr_client: NostrClient
    _profile: Profile
    _stalls: List[Stall]
    _products: List[Product]

    # Initialization

    def __init__(
        self,
        relay: str,
        private_key: str,
        stalls: List[Stall],
        products: List[Product],
    ) -> None: ...
    def get_profile(self) -> str: ...
    def get_relay(self) -> str: ...
    def set_profile(self, profile: Profile) -> str: ...

    # Nostr NIP-15 Marketplace - Seller
    def publish_product(self, product: str) -> str: ...
    def publish_products(
        self, stall: Optional[Stall] = None, products: Optional[List[Product]] = None
    ) -> str: ...
    def publish_stall(self, stall: str) -> str: ...
    def publish_stalls(self, stalls: Optional[List[Stall]] = None) -> str: ...
    def remove_products(
        self, stall: Optional[Stall] = None, products: Optional[List[Product]] = None
    ) -> str: ...
    def remove_stalls(self, stalls: Optional[List[Stall]] = None) -> str: ...

    # Order processing
    def listen_for_orders(self, timeout: int = 5) -> str: ...
    def manual_order_workflow(self, buyer: str, order: str, parameters: str) -> str: ...
    def send_payment_request(
        self, buyer: str, order: str, kind: str, payment_type: str, payment_url: str
    ) -> str: ...
    def send_payment_verification(self, buyer: str, order: str, kind: str) -> str: ...
    def verify_payment(
        self,
        buyer: str,
        order: str,
        kind: str,
        payment_type: str,
        payment_url: str,
    ) -> str: ...
    # Internal database methods
    def get_products(self) -> str: ...
    def get_stalls(self) -> str: ...
    def set_products(self, products: List[Product]) -> str: ...
    def set_stalls(self, stalls: List[Stall]) -> str: ...

    # Internal methods
    def _message_is_order(self, message: str) -> bool: ...
    def _create_payment_request(
        self,
        order_id: str,
        payment_type: str,
        payment_url: str,
    ) -> str: ...
    def _create_payment_verification(
        self,
        order_id: str,
    ) -> str: ...
