EnkaClient
class EnkaClient
fetchEnkaProfile
fetchAllEnkaUsers
fetchGenshinEnkaUsers
fetchStarRailEnkaUsers
fetchEnkaUser
fetchEnkaUserBuilds
fetchEnkaUserGenshinBuilds
fetchEnkaUserStarRailBuilds
getAllCharacters
getCharacterById
getAllWeapons
getWeaponById
getAllCostumes
getCostumeById
getAllMaterials
getMaterialById
getAllNameCards
getNameCardById
getAllArtifacts
getArtifactById
getAllArtifactSets
getArtifactSetById
close
constructor
new EnkaClient(options)
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
options | Partial<EnkaClientOptions> | ✔️ | {} | Options for the client |
Properties
options
The options the client was instantiated with
Type: EnkaClientOptions
cachedAssetsManager
The genshin cache data manager of the client
Type: CachedAssetsManager
Methods
fetchUser
Returns: Promise<User | DetailedUser>
- DetailedUser if collapse is false, User if collapse is true
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
uid | number | string | In-game UID of the user | ||
collapse | ✔️ | false | Whether to fetch rough user information (Very fast) |
fetchEnkaProfile
Returns: Promise<EnkaProfile>
- the Enka.Network account
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
username | string | enka.network username, not in-game nickname |
fetchAllEnkaUsers
Returns: Promise<EnkaUser[]>
- the all game accounts added to the Enka.Network account
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
username | string | enka.network username, not in-game nickname | ||
hoyoType | HoyoType | null | ✔️ | null |
fetchGenshinEnkaUsers
Returns: Promise<EnkaUser[]>
- the genshin accounts added to the Enka.Network account
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
username | string | enka.network username, not in-game nickname |
fetchStarRailEnkaUsers
Returns: Promise<EnkaUser[]>
- the starrail accounts added to the Enka.Network account
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
username | string | enka.network username, not in-game nickname |
fetchEnkaUser
Returns: Promise<EnkaUser>
- the game account added to the Enka.Network account
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
username | string | enka.network username, not in-game nickname | ||
hash | string | EnkaUser hash |
fetchEnkaUserBuilds
This requires this instance with starrailClient
.
And the starrailClient
option in EnkaClientOptions must be an instance of StarRail from starrail.js.TSUnknownKeyword
or unknown
type in the return type can be replaced with StarRailCharacterBuild.
Returns: Promise<{[characterId: string]: (GenshinCharacterBuild | TSUnknownKeyword)[]}>
- the genshin and starrail character builds including saved builds in Enka.Network account
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
username | string | enka.network username, not in-game nickname | ||
hash | string | EnkaUser hash |
fetchEnkaUserGenshinBuilds
Returns: Promise<{[characterId: string]: GenshinCharacterBuild[]}>
- the genshin character builds including saved builds in Enka.Network account
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
username | string | enka.network username, not in-game nickname | ||
hash | string | EnkaUser hash |
fetchEnkaUserStarRailBuilds
This requires this instance with starrailClient
.
And the starrailClient
option in EnkaClientOptions must be an instance of StarRail from starrail.js.TSUnknownKeyword
or unknown
type in the return type can be replaced with StarRailCharacterBuild.
Returns: Promise<{[characterId: string]: TSUnknownKeyword[]}>
- the starrail character builds including saved builds in Enka.Network account
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
username | string | enka.network username, not in-game nickname | ||
hash | string | EnkaUser hash |
getAllCharacters
Returns: CharacterData[]
- all playable character data
getCharacterById
Returns: CharacterData
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
id | number | string | The id of the character | ||
skillDepotId | number | string | ✔️ | Specifies one or zero elements for Traveler |
getAllWeapons
Returns: WeaponData[]
- all weapon data
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
excludeInvalidWeapons | ✔️ | true |
getWeaponById
Returns: WeaponData
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
id | number | string | The id of the weapon |
getAllCostumes
Returns: Costume[]
- all costume data
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
includeDefaults | ✔️ | false | Whether to include default costumes |
getCostumeById
Returns: Costume
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
id | number | string | The id of the costume |
getAllMaterials
Returns: Material[]
- all material data
getMaterialById
Returns: Material
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
id | number | string | The id of the material |
getAllNameCards
Returns: NameCard[]
- all name card data
getNameCardById
Returns: NameCard
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
id | number | string | The id of the name card |
getAllArtifacts
Returns: ArtifactData[]
- all artifact data
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
highestRarityOnly | ✔️ | false | Whether to return only the rarest of artifacts of the same type |
getArtifactById
Returns: ArtifactData
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
id | number | string | The id of the artifact |
getAllArtifactSets
Returns: ArtifactSet[]
- all artifact set data
getArtifactSetById
Returns: ArtifactSet
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
id | number | string | The id of artifact set |
close
Clear all running tasks in the client.
Returns: void