Skip to main content

EnkaClient

Implements

Index

Constructors

constructor

Properties

readonlycachedAssetsManager

cachedAssetsManager: CachedAssetsManager

The genshin cache data manager of the client

readonlyhoyoType

hoyoType: 0

readonlyoptions

The options the client was instantiated with

Methods

_fetchUser

  • @throws

    Type parameters

    • T: boolean

    Parameters

    • uid: string | number

      In-game UID of the user

    • collapse: T

      Whether to fetch rough user information (Very fast)

    Returns Promise<T extends true ? GenshinUser : DetailedGenshinUser>

    DetailedGenshinUser if collapse is false, GenshinUser if collapse is true

close

  • close(): void
  • Clear all running tasks in the client.


    Returns void

fetchCollapsedUser

  • fetchCollapsedUser(uid: string | number): Promise<GenshinUser>
  • Parameters

    • uid: string | number

      In-game UID of the user

    Returns Promise<GenshinUser>

fetchEnkaGenshinAccount

  • fetchEnkaGenshinAccount(username: string, hash: string): Promise<EnkaGameAccount<EnkaClient>>

  • Parameters

    • username: string

      enka.network username, not in-game nickname

    • hash: string

      EnkaGameAccount hash

    Returns Promise<EnkaGameAccount<EnkaClient>>

    the genshin account with provided hash

fetchEnkaGenshinAccounts

  • fetchEnkaGenshinAccounts(username: string): Promise<EnkaGameAccount<EnkaClient>[]>

  • Parameters

    • username: string

      enka.network username, not in-game nickname

    Returns Promise<EnkaGameAccount<EnkaClient>[]>

    the genshin accounts added to the Enka.Network account

fetchEnkaGenshinBuilds

  • fetchEnkaGenshinBuilds(username: string, hash: string): Promise<{}>

  • Parameters

    • username: string

      enka.network username, not in-game nickname

    • hash: string

      EnkaGameAccount hash

    Returns Promise<{}>

    the genshin character builds including saved builds in Enka.Network account

fetchUser

getAllArtifactSets

getAllArtifacts

  • getAllArtifacts(highestRarityOnly?: boolean): ArtifactData[]

  • Parameters

    • highestRarityOnly: boolean = false

      Whether to return only the rarest of artifacts of the same type

    Returns ArtifactData[]

    all artifact data

getAllCharacters

getAllCostumes

  • getAllCostumes(includeDefaults?: boolean): Costume[]

  • Parameters

    • includeDefaults: boolean = false

      Whether to include default costumes

    Returns Costume[]

    all costume data

getAllMaterials

getAllNameCards

getAllWeapons

  • getAllWeapons(excludeInvalidWeapons?: boolean, filterByCodex?: boolean): WeaponData[]

  • Parameters

    • excludeInvalidWeapons: boolean = true
    • filterByCodex: boolean = true

    Returns WeaponData[]

    all weapon data

getArtifactById

  • Parameters

    • id: string | number

      The id of the artifact

    Returns ArtifactData

getArtifactSetById

  • Parameters

    • id: string | number

      The id of artifact set

    Returns ArtifactSet

getCharacterBuild

getCharacterById

  • getCharacterById(id: string | number, skillDepotId?: string | number): CharacterData
  • Parameters

    • id: string | number

      The id of the character

    • optionalskillDepotId: string | number

      Specifies one or zero elements for Traveler

    Returns CharacterData

getCostumeById

  • getCostumeById(id: string | number): Costume
  • Parameters

    • id: string | number

      The id of the costume

    Returns Costume

getMaterialById

  • getMaterialById(id: string | number): Material
  • Parameters

    • id: string | number

      The id of the material

    Returns Material

getNameCardById

  • getNameCardById(id: string | number): NameCard
  • Parameters

    • id: string | number

      The id of the name card

    Returns NameCard

getUser

getWeaponById

  • Parameters

    • id: string | number

      The id of the weapon

    Returns WeaponData