Skip to main content

Class: HonkaiImpact

Class representing the Honkai Impact 3rd game.

Constructors​

constructor​

• new HonkaiImpact(options)

Create a new instance of HonkaiImpact.

Parameters​

NameTypeDescription
optionsIHi3OptionsThe options object used to configure the object.

Defined in​

src/client/hi/hi.ts:82

Properties​

_account​

• Private _account: null | IGame = null

HoyYolab account object

Defined in​

src/client/hi/hi.ts:57


• Readonly cookie: ICookie

The cookie used for authentication.

Defined in​

src/client/hi/hi.ts:45


daily​

• Readonly daily: DailyModule

The Daily module for the Honkai Impact 3rd game.

Defined in​

src/client/hi/hi.ts:25


lang​

• Private lang: LanguageEnum

The language of the Honkai Impact 3rd account.

Defined in​

src/client/hi/hi.ts:75


record​

• Readonly record: HIRecordModule

The HIRecordModule object provides an interface to interact with the user record feature in Honkai Star Rails.

Defined in​

src/client/hi/hi.ts:39


redeem​

• Readonly redeem: RedeemModule

The Redeem module for the Honkai Impact 3rd game.

Defined in​

src/client/hi/hi.ts:33


region​

• Readonly region: null | string

The region of the Honkai Impact 3rd account.

Defined in​

src/client/hi/hi.ts:69


request​

• Private request: HTTPRequest

The request object used to make HTTP requests.

Defined in​

src/client/hi/hi.ts:51


uid​

• Readonly uid: null | number

The UID of the Honkai Impact 3rd account.

Defined in​

src/client/hi/hi.ts:63

Accessors​

account​

• get account(): null | IGame

Getter for the account property.

Returns​

null | IGame

The current value of the account property.

Defined in​

src/client/hi/hi.ts:178

• set account(game): void

Setter for the account property. Prevents from changing the value once set

Parameters​

NameTypeDescription
gamenull | IGameThe game object to set as the account.

Returns​

void

Defined in​

src/client/hi/hi.ts:168

Methods​

dailyClaim​

▸ dailyClaim(): Promise<IDailyClaim>

Claim current reward

Alias

DailyModule.claim

Deprecated

Use through HonkaiImpact.daily.claim() instead

Returns​

Promise<IDailyClaim>

Defined in​

src/client/hi/hi.ts:221


dailyInfo​

▸ dailyInfo(): Promise<IDailyInfo>

Retrieves daily information.

Alias

DailyModule.info

Deprecated

Use through HonkaiImpact.daily.info() instead

Returns​

Promise<IDailyInfo>

Defined in​

src/client/hi/hi.ts:188


dailyReward​

▸ dailyReward(day?): Promise<IDailyReward>

Fetch reward from daily login based on day

Alias

DailyModule.reward

Deprecated

Use through HonkaiImpact.daily.reward() instead

Parameters​

NameTypeDefault valueDescription
daynull | numbernullnumber | null

Returns​

Promise<IDailyReward>

Defined in​

src/client/hi/hi.ts:210


dailyRewards​

▸ dailyRewards(): Promise<IDailyRewards>

Alias

DailyModule.rewards

Deprecated

Use through HonkaiImpact.daily.rewards() instead

Returns​

Promise<IDailyRewards>

Defined in​

src/client/hi/hi.ts:198


redeemCode​

▸ redeemCode(code): Promise<IRedeemCode>

Redeem Code

Alias

RedeemModule.claim

Deprecated

Use through HonkaiImpact.redeem.claim() instead

Parameters​

NameTypeDescription
codestringstring

Returns​

Promise<IRedeemCode>

Defined in​

src/client/hi/hi.ts:233


create​

▸ Static create(options): Promise<HonkaiImpact>

Create a new instance of HonkaiImpact using a Hoyolab account. If uid is not provided in the options, the account with the highest level will be used.

Throws

Error Wnen the CookieTokenV2 is not set.

Remarks

If an object is instantiated from this method but options.cookie.cookieTokenV2 is not set, it will throw an error. This method will access an Endpoint that contains a list of game accounts, which requires the cookieTokenV2 option.

Parameters​

NameTypeDescription
optionsIHi3OptionsThe options object used to configure the object.

Returns​

Promise<HonkaiImpact>

  • A promise that resolves with a new HonkaiImpact instance.

Defined in​

src/client/hi/hi.ts:144