# Class: RedeemModule

Class representing the Redeem module for Genshin Impact's Hoyolab API.

# Table of contents

# Constructors

# Properties

# Methods

# Constructors

# constructor

new RedeemModule(request, lang, game, region, uid)

Constructs a new RedeemModule object.

# Parameters

Name Type Description
request Request The Request object used for making HTTP requests.
lang LanguageEnum The language to use for the API response.
game GamesEnum The game to redeem the code for.
region null | string The region of the user's account. If null, the API will use the default region for the game.
uid null | number The user ID of the account. If null, the API will use the user ID associated with the provided auth cookies.

# Defined in

src/modules/redeem/redeem.ts:24 (opens new window)

# Properties

# game

Private game: GamesEnum

The game to redeem the code for.

# Defined in

src/modules/redeem/redeem.ts:27 (opens new window)


# lang

Private lang: LanguageEnum

The language to use for the API response.

# Defined in

src/modules/redeem/redeem.ts:26 (opens new window)


# region

Private region: null | string

The region of the user's account. If null, the API will use the default region for the game.

# Defined in

src/modules/redeem/redeem.ts:28 (opens new window)


# request

Private request: Request

The Request object used for making HTTP requests.

# Defined in

src/modules/redeem/redeem.ts:25 (opens new window)


# uid

Private uid: null | number

The user ID of the account. If null, the API will use the user ID associated with the provided auth cookies.

# Defined in

src/modules/redeem/redeem.ts:29 (opens new window)

# Methods

# claim

claim(code): Promise<IRedeemCode>

Redeems a code for a specific game and account.

Throws

HoyolabError if the API returns an error.

Remarks

This method sends a request to the Genshin Impact API to get the daily note information for a user. The user's region and UID must be set before calling this method, otherwise an error will be thrown.

# Parameters

Name Type Description
code string The code to redeem.

# Returns

Promise<IRedeemCode>

A promise that resolves to an IRedeemCode object containing information about the redemption status.

# Defined in

src/modules/redeem/redeem.ts:42 (opens new window)