mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: code split a lot
This commit is contained in:
1 parent
78e4c82f20
commit
d2668974f7
18 files changed
+155
-133
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import { Region } from '../../constants/regions';
|
||||
import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID';
|
||||
import { AccountInfo } from '../../types/accountInfo';
|
||||
import getWargamingResponse from './getWargamingResponse';
|
||||
|
||||
// BIG TODO: generalize all get wargaming calls
|
||||
export function getAccountInfo(region: Region, id: number) {
|
||||
return getWargamingResponse<AccountInfo>(
|
||||
`https://api.wotblitz.${region}/wotb/account/info/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}`,
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function getClanLogo(emblemId: number) {
|
||||
return `https://wotblitz-gc.gcdn.co/icons/clanEmblems1x/clan-icon-v2-${emblemId}.png`
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Region } from '../../constants/regions';
|
||||
import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID';
|
||||
import { PlayerClanInfo } from '../../types/playerClanData';
|
||||
import getWargamingResponse from './getWargamingResponse';
|
||||
|
||||
export function playerClanInfo(region: Region, id: number) {
|
||||
return getWargamingResponse<PlayerClanInfo>(
|
||||
`https://api.wotblitz.${region}/wotb/clans/accountinfo/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}&extra=clan`,
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user