@@ -2,7 +2,7 @@ import axios from "axios";
2
2
import jwtDecode from "jwt-decode" ;
3
3
import { getVAPILang , VCurrencies , VItemTypes } from "./misc" ;
4
4
import { btoa } from "react-native-quick-base64" ;
5
- import { IStorefrontV2 } from "../typings/StorefrontV2 " ;
5
+ import { IStorefrontV3 } from "../typings/StorefrontV3 " ;
6
6
import https from "https-browserify" ;
7
7
8
8
axios . interceptors . request . use (
@@ -146,22 +146,22 @@ export async function getShop(
146
146
region : string ,
147
147
userId : string ,
148
148
) {
149
- const res = await axios . get < IStorefrontV2 > (
150
- getUrl ( "storefront" , region , userId ) ,
151
- {
152
- method : "GET" ,
153
- headers : {
154
- Authorization : `Bearer ${ accessToken } ` ,
155
- "X-Riot-Entitlements-JWT" : entitlementsToken ,
156
- ...extraHeaders ,
157
- } ,
149
+ const res = await axios . request < IStorefrontV3 > ( {
150
+ url : getUrl ( "storefront" , region , userId ) ,
151
+ method : "POST" ,
152
+ headers : {
153
+ ...extraHeaders ,
154
+ "Content-Type" : "application/json" ,
155
+ Authorization : `Bearer ${ accessToken } ` ,
156
+ "X-Riot-Entitlements-JWT" : entitlementsToken ,
158
157
} ,
159
- ) ;
158
+ data : { } ,
159
+ } ) ;
160
160
161
- return res ;
161
+ return res . data ;
162
162
}
163
163
164
- export async function parseShop ( shop : IStorefrontV2 ) {
164
+ export async function parseShop ( shop : IStorefrontV3 ) {
165
165
/* NORMAL SHOP */
166
166
let singleItemOffers = shop . SkinsPanelLayout . SingleItemOffers ;
167
167
let main : IShopItem [ ] = [ ] ;
@@ -321,7 +321,7 @@ function getUrl(name: string, region?: string, userId?: string) {
321
321
auth : "https://auth.riotgames.com/api/v1/authorization/" ,
322
322
entitlements : "https://entitlements.auth.riotgames.com/api/token/v1/" ,
323
323
userinfo : "https://auth.riotgames.com/userinfo/" ,
324
- storefront : `https://pd.${ region } .a.pvp.net/store/v2 /storefront/${ userId } ` ,
324
+ storefront : `https://pd.${ region } .a.pvp.net/store/v3 /storefront/${ userId } ` ,
325
325
wallet : `https://pd.${ region } .a.pvp.net/store/v1/wallet/${ userId } ` ,
326
326
playerxp : `https://pd.${ region } .a.pvp.net/account-xp/v1/players/${ userId } ` ,
327
327
weapons : "https://valorant-api.com/v1/weapons/" ,
0 commit comments