Skip to content

Wish Client

WishClient

WishClient(
    cookies: Optional[AnyCookieOrHeader] = None,
    *,
    authkey: Optional[str] = None,
    lang: Lang = "en-us",
    region: Region = OVERSEAS,
    proxy: Optional[str] = None,
    game: Optional[Game] = None,
    uid: Optional[int] = None,
    hoyolab_id: Optional[int] = None,
    device_id: Optional[str] = None,
    device_fp: Optional[str] = None,
    headers: Optional[LooseHeaders] = None,
    cache: Optional[BaseCache] = None,
    debug: bool = False,
    on_cookie_update: Optional[CookieUpdateHook] = None,
)

Wish component.

Methods:

fetch_authkey async

fetch_authkey(
    uid: Optional[int] = None,
    *,
    game: Optional[Game] = None,
    auth_appid: Literal[
        "webview_gacha", "csc"
    ] = "webview_gacha",
) -> str

Generate an authkey for a game account using the cookie token and store it on the client.

Requires cookie_token_v2 (with account_mid_v2 and account_id_v2) cookies. webview_gacha authkeys are used for wish history, csc authkeys for transaction logs.

get_banner_details async

get_banner_details(
    banner_ids: Optional[Sequence[str]] = None,
    *,
    game: Optional[Game] = None,
    lang: Optional[str] = None,
) -> Sequence[BannerDetails]

Get all banner details at once in a batch.

get_banner_ids async

get_banner_ids() -> Sequence[str]

Get a list of banner ids.

Uses the current cn banners.

get_banner_names async

get_banner_names(
    *,
    lang: Optional[str] = None,
    authkey: Optional[str] = None,
) -> Mapping[int, str]

Get a list of banner names.

get_gacha_items async

get_gacha_items(
    *, server: str = "os_asia", lang: Optional[str] = None
) -> Sequence[GachaItem]

Get the list of characters and weapons that can be gotten from the gacha.

get_genshin_banner_ids async

get_genshin_banner_ids() -> Sequence[str]

Get a list of banner ids.

Uses the current cn banners.

get_genshin_banner_names async

get_genshin_banner_names(
    *,
    lang: Optional[str] = None,
    authkey: Optional[str] = None,
) -> Mapping[int, str]

Get a list of banner names.

get_genshin_gacha_items async

get_genshin_gacha_items(
    *, server: str = "os_asia", lang: Optional[str] = None
) -> Sequence[GachaItem]

Get the list of characters and weapons that can be gotten from the gacha.

mw_wish_history

mw_wish_history(
    banner_type: Optional[Union[int, Sequence[int]]] = None,
    *,
    limit: Optional[int] = None,
    lang: Optional[str] = None,
    authkey: Optional[str] = None,
    end_id: int = 0,
) -> Paginator[MWWish]

Get the Miliastra Wonderland wish history of a user.

request_gacha_info async

request_gacha_info(
    endpoint: str,
    *,
    lang: Optional[str] = None,
    game: Optional[Game] = None,
    authkey: Optional[str] = None,
    params: Optional[Mapping[str, Any]] = None,
    short_lang_code: bool = True,
    **kwargs: Any,
) -> Mapping[str, Any]

Make a request towards the gacha info endpoint.

signal_history

signal_history(
    banner_type: Optional[Union[int, Sequence[int]]] = None,
    *,
    limit: Optional[int] = None,
    lang: Optional[str] = None,
    authkey: Optional[str] = None,
    end_id: int = 0,
) -> Paginator[SignalSearch]

Get the signal search history of a user.

warp_history

warp_history(
    banner_type: Optional[Union[int, Sequence[int]]] = None,
    *,
    limit: Optional[int] = None,
    lang: Optional[str] = None,
    authkey: Optional[str] = None,
    end_id: int = 0,
) -> Paginator[Warp]

Get the warp history of a user.

wish_history

wish_history(
    banner_type: Optional[Union[int, Sequence[int]]] = None,
    *,
    limit: Optional[int] = None,
    lang: Optional[str] = None,
    authkey: Optional[str] = None,
    end_id: int = 0,
) -> Paginator[Wish]

Get the wish history of a user.