Skip to content

Commit

Permalink
update encoding header
Browse files Browse the repository at this point in the history
  • Loading branch information
feruzm committed Aug 11, 2024
1 parent a4cf14b commit 57e7341
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/server/handlers/wallet-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const echartapi = async (req: express.Request, res: express.Response) =>
const params = req.query;

const url = `${ENGINE_CHART_URL}`;
const headers = { 'Content-type': 'application/json', 'User-Agent': 'Ecency' };
const headers = { 'Content-type': 'application/json', 'User-Agent': 'Ecency', 'Accept-Encoding': '*' };

pipe(baseApiRequest(url, "GET", headers, undefined, params), res);
}
Expand All @@ -57,7 +57,7 @@ export const engineAccountHistory = (req: express.Request, res: express.Response
const params = req.query;

const url = `${ENGINE_ACCOUNT_HISTORY_URL}`;
const headers = { 'Content-type': 'application/json', 'User-Agent': 'Ecency Apps' };
const headers = { 'Content-type': 'application/json', 'User-Agent': 'Ecency', 'Accept-Encoding': '*' };

pipe(baseApiRequest(url, "GET", headers, undefined, params), res);
}
Expand All @@ -66,15 +66,15 @@ export const engineAccountHistory = (req: express.Request, res: express.Response
//raw engine api call
const engineContractsRequest = (data: EngineRequestPayload) => {
const url = `${BASE_ENGINE_URL}/${PATH_CONTRACTS}`;
const headers = { 'Content-type': 'application/json', 'User-Agent': 'Ecency' };
const headers = { 'Content-type': 'application/json', 'User-Agent': 'Ecency', 'Accept-Encoding': '*' };

return baseApiRequest(url, "POST", headers, data)
}

//raw engine rewards api call
const engineRewardsRequest = (username:string, params:any) => {
const url = `${ENGINE_REWARDS_URL}/@${username}`;
const headers = { 'Content-type': 'application/json', 'User-Agent': 'Ecency' };
const headers = { 'Content-type': 'application/json', 'User-Agent': 'Ecency', 'Accept-Encoding': '*' };

return baseApiRequest(url, "GET", headers, undefined, params)
}
Expand Down Expand Up @@ -163,10 +163,10 @@ export const fetchEngineRewards = async (username: string): Promise<TokenStatus[
if (!rawData || rawData.length === 0) {
throw new Error('No rewards data returned');
}

const data = rawData.map(convertRewardsStatus);
const filteredData = data.filter((item) => item && item.pendingToken > 0);

console.log('unclaimed engine rewards data', filteredData);
return filteredData;
} catch (err) {
Expand All @@ -193,7 +193,7 @@ const fetchEngineTokensWithBalance = async (username: string) => {
const promiseMmetrices = fetchEngineMetics(symbols);
const promiseUnclaimed = fetchEngineRewards(username)

const [tokens, metrices, unclaimed] =
const [tokens, metrices, unclaimed] =
await Promise.all([promiseTokens, promiseMmetrices, promiseUnclaimed])

return balances.map((balance: any) => {
Expand Down

0 comments on commit 57e7341

Please sign in to comment.