UNPKG

coc-api

Version:

Yet another Clash of Clans API, but with TS support

15 lines (12 loc) 424 B
/// <reference path="../../types/types.d.ts"/> export default class GoldPass { static readonly path: string = '/goldpass/seasons/current'; static async get(api: IClashOfClansAPI): Promise<IGoldPassSeason> { try { const res = await api.get<undefined, IGoldPassSeason>( this.path ); return res.data; } catch (err: unknown) { throw err as IError; } } }