Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change fetch cache policy for cow api request #258

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions modules/stonks/utils/fetchCowApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ export const fetchCowApi = async <T extends unknown>({
headers: {
'Content-Type': 'application/json',
},
next: {
revalidate: 0,
},
cache: 'no-store',
body,
} as any)
})

const data = await requested.json()

Expand Down
33 changes: 18 additions & 15 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@ const basePath = process.env.BASE_PATH || ''
const infuraApiKey = process.env.INFURA_API_KEY
const alchemyApiKey = process.env.ALCHEMY_API_KEY

const rpcUrls_1 = (process.env.EL_RPC_URLS_1 &&
process.env.EL_RPC_URLS_1.split(',')) || [
alchemyApiKey && `https://eth-mainnet.alchemyapi.io/v2/${alchemyApiKey}`,
infuraApiKey && `https://mainnet.infura.io/v3/${infuraApiKey}`,
].filter(Boolean);
const rpcUrls_1 =
(process.env.EL_RPC_URLS_1 && process.env.EL_RPC_URLS_1.split(',')) ||
[
alchemyApiKey && `https://eth-mainnet.alchemyapi.io/v2/${alchemyApiKey}`,
infuraApiKey && `https://mainnet.infura.io/v3/${infuraApiKey}`,
].filter(Boolean)

const rpcUrls_5 = (process.env.EL_RPC_URLS_5 &&
process.env.EL_RPC_URLS_5.split(',')) || [
alchemyApiKey && `https://eth-goerli.alchemyapi.io/v2/${alchemyApiKey}`,
infuraApiKey && `https://goerli.infura.io/v3/${infuraApiKey}`,
].filter(Boolean);
const rpcUrls_5 =
(process.env.EL_RPC_URLS_5 && process.env.EL_RPC_URLS_5.split(',')) ||
[
alchemyApiKey && `https://eth-goerli.alchemyapi.io/v2/${alchemyApiKey}`,
infuraApiKey && `https://goerli.infura.io/v3/${infuraApiKey}`,
].filter(Boolean)

const rpcUrls_17000 = (process.env.EL_RPC_URLS_17000 &&
process.env.EL_RPC_URLS_17000.split(',')) || [
alchemyApiKey && `https://eth-goerli.alchemyapi.io/v2/${alchemyApiKey}`,
infuraApiKey && `https://goerli.infura.io/v3/${infuraApiKey}`,
].filter(Boolean);
const rpcUrls_17000 =
(process.env.EL_RPC_URLS_17000 && process.env.EL_RPC_URLS_17000.split(',')) ||
[
alchemyApiKey && `https://eth-goerli.alchemyapi.io/v2/${alchemyApiKey}`,
infuraApiKey && `https://goerli.infura.io/v3/${infuraApiKey}`,
].filter(Boolean)

const defaultChain = process.env.DEFAULT_CHAIN || '1'
const supportedChains = process.env.SUPPORTED_CHAINS || '1,5'
Expand Down
Loading