Skip to content

Commit

Permalink
(launch) fix: support rpc from envs
Browse files Browse the repository at this point in the history
  • Loading branch information
Atatakai authored and Atatakai committed Aug 28, 2024
1 parent 25a7559 commit bd56274
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions apps/launch/common-util/config/wagmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from 'wagmi/chains';
import { coinbaseWallet, injected, safe, walletConnect } from 'wagmi/connectors';

import { LAUNCH_RPC_URLS } from 'common-util/constants/rpcs';
import { RPC_URLS } from 'libs/util-constants/src';

import { virtualGnosis, virtualMainnet, virtualPolygon } from '../../tenderly.config';

Expand Down Expand Up @@ -56,7 +56,7 @@ export const wagmiConfig = createConfig({
}),
],
transports: SUPPORTED_CHAINS.reduce(
(acc, chain) => Object.assign(acc, { [chain.id]: http(LAUNCH_RPC_URLS[chain.id]) }),
(acc, chain) => Object.assign(acc, { [chain.id]: http(RPC_URLS[chain.id]) }),
{},
),
});
7 changes: 0 additions & 7 deletions apps/launch/common-util/constants/rpcs.ts

This file was deleted.

5 changes: 3 additions & 2 deletions apps/launch/common-util/functions/frontend-library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import {
notifyError,
} from '@autonolas/frontend-library';

import { RPC_URLS } from 'libs/util-constants/src';

import { SUPPORTED_CHAINS } from 'common-util/config/wagmi';
import { LAUNCH_RPC_URLS } from 'common-util/constants/rpcs';

export const getProvider = () => {
const provider = getProviderFn(SUPPORTED_CHAINS, LAUNCH_RPC_URLS);
const provider = getProviderFn(SUPPORTED_CHAINS, RPC_URLS);
// not connected, return fallback URL
if (typeof provider === 'string') return provider;
// coinbase injected multi wallet provider
Expand Down
2 changes: 2 additions & 0 deletions libs/common-middleware/src/lib/cspHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ const ALLOWED_ORIGINS = [
'https://rpc.gnosischain.com/',
'https://mainnet.base.org/',
'https://sepolia.base.org/',
'https://base.llamarpc.com',
'https://mainnet.optimism.io',
'https://optimism.llamarpc.com',
'https://sepolia.optimism.io/',
'https://forno.celo.org',
'https://alfajores-forno.celo-testnet.org',
Expand Down

0 comments on commit bd56274

Please sign in to comment.