Skip to content

Commit

Permalink
Add timetravel option to SimpleAdapter and BreakdownAdapter
Browse files Browse the repository at this point in the history
Set timetravel to false in 1inch adapter

Handle empty API_KEY in duneRequest
  • Loading branch information
g1nt0ki committed Feb 7, 2024
1 parent a20a36e commit 927a548
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions adapters/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ export enum ProtocolType {
}

export type SimpleAdapter = {
timetravel?: boolean
adapter: BaseAdapter
protocolType?: ProtocolType;
}

export type BreakdownAdapter = {
timetravel?: boolean
breakdown: {
[version: string]: BaseAdapter
};
Expand Down
1 change: 1 addition & 0 deletions aggregators/1inch-agg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const fetch =
};

const adapter: any = {
timetravel: false,
adapter: {
...Object.values(chainsMap).reduce((acc, chain) => {
return {
Expand Down
4 changes: 2 additions & 2 deletions helpers/duneRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function _fetchURLWithRetry(url: string): Promise<any> {

return await retry(
async (bail, _attempt: number) => {
const api_key = API_KEYS[API_KEY_INDEX];
const api_key = API_KEYS[API_KEY_INDEX] ?? ''
try {
const response = await fetchURL(`${url}?api_key=${api_key}`);
return response;
Expand All @@ -39,7 +39,7 @@ async function _fetchURLWithRetry(url: string): Promise<any> {
}
},
{
retries: 20,
retries: 3 + API_KEYS.length * 2,
factor: 1,
}
);
Expand Down

0 comments on commit 927a548

Please sign in to comment.