Skip to content

Commit

Permalink
fix: remove zero api key for goerli
Browse files Browse the repository at this point in the history
  • Loading branch information
jackmellis committed Aug 4, 2023
1 parent c25b584 commit 64c1013
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/trade/src/price/fetch0xQuote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ const fetch0xQuote = async (args: {
throw new Error(`${network} is not a supported network for the 0x API`);
}
const url = `${zeroUrl}/swap/v1/${type}?${query}&affiliateAddress=0xaA29881aAc939A025A3ab58024D7dd46200fB93D`;
const headers: Record<string, string> = {};
const zeroApiKey = getChainConstant(API_KEYS, network);
const response = await fetch(url, {
headers: { '0x-api-key': zeroApiKey },
});
if (zeroApiKey) {
headers['0x-api-key'] = zeroApiKey;
}
const response = await fetch(url, { headers });
if (!response.ok) {
const json = await response.json();
throw { ...json, status: response.status };
Expand Down

0 comments on commit 64c1013

Please sign in to comment.