File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ import { createValorantApiClient } from "@tqman/valorant-api-client" ;
2+
3+ const v = await createValorantApiClient ( { initializer : "local" } ) ;
4+ const { data : help } = await v . local . request ( "/help" )
5+ console . log ( help ) ;
Original file line number Diff line number Diff line change 1+ import { createValorantApiClient } from "@tqman/valorant-api-client" ;
2+ import { z } from "zod/v4" ;
3+
4+ const v = await createValorantApiClient ( { initializer : "local" } ) ;
5+ const { data : updates } = await v . remote . request ( "pd" , "/mmr/v1/players/:puuid/competitiveupdates" , {
6+ schema : z . object ( {
7+ Version : z . number ( ) ,
8+ Subject : z . string ( ) ,
9+ Matches : z . array (
10+ z . object ( {
11+ MatchID : z . string ( ) ,
12+ RankedRatingEarned : z . number ( ) ,
13+ } ) ,
14+ ) ,
15+ } ) ,
16+ } )
17+
18+ const avg = updates . Matches . reduce ( ( a , b ) => a + b . RankedRatingEarned , 0 ) / updates . Matches . length ;
19+ console . log ( `Average RankedRatingEarned Per Match: ${ avg } ` ) ;
20+
You can’t perform that action at this time.
0 commit comments