Represents the API client for managing and retrieving information about alliances.

Constructors

  • Constructs a new instance of the AllianceApi class.

    Parameters

    • apiClient: Record<string, any>

      The API client instance for sending requests.

    Returns AllianceApi

Methods

  • Retrieves battle statistics for a given alliance.

    Parameters

    • allianceID: number

      The alliance's identifier.

    Returns Promise<any>

    A promise resolving to the battle statistics of the specified alliance, including elapsed time.

  • Retrieves detailed information about a specific alliance.

    Parameters

    • allianceID: number

      The alliance's identifier.

    • members: boolean = true

      Whether to include the list of alliance members in the response. Defaults to true.

    Returns Promise<any>

    A promise resolving to the details of the specified alliance, including elapsed time.

  • Retrieves a list of open alliances. The result typically includes 30 alliances that are not full, but the response cannot be further filtered.

    Returns Promise<any>

    A promise resolving to the list of open alliances, including elapsed time.

  • Retrieves the alliance ranking, paginated by the specified page and number of entries.

    Parameters

    • page: number = 0

      The page of the ranking to retrieve. Defaults to 0.

    • numEntries: number = 10

      The number of entries to retrieve per page. Defaults to 10. Must be between 10 and 50. If out of range, a warning is logged.

    Returns Promise<any>

    A promise resolving to the alliance ranking, including elapsed time.

  • Searches for alliances by name.

    Parameters

    • name: string

      The name of the alliance to search for.

    • exactResult: boolean = false

      Whether to return only exact matches for the alliance name. Defaults to false.

    Returns Promise<any>

    A promise resolving to the search results, including elapsed time. If exactResult is true, only exact matches are returned. If no matches are found, the result code and message indicate "not found."