Skip to content

Commit

Permalink
fix: initial chains
Browse files Browse the repository at this point in the history
  • Loading branch information
Argeare5 committed Jan 6, 2023
1 parent d25866e commit 692ffd1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utils/chainInfoHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ function isExtendedChainInformation(
export const initChainInformationConfig = (chains: {
[chainId: number]: BasicChainInformation | ExtendedChainInformation;
}) => {
const CHAINS = Object.assign(chains, initialChains);

// init urls from chains config
const urls = Object.keys({ ...chains, ...initialChains }).reduce<{
const urls = Object.keys(CHAINS).reduce<{
[chainId: number]: string[];
}>((accumulator, chainId) => {
const validURLs: string[] = chains[Number(chainId)].urls;
Expand All @@ -80,7 +82,7 @@ export const initChainInformationConfig = (chains: {
// init provider instances from chain config
const initalizedProviders: Record<number, StaticJsonRpcBatchProvider> = {};

const providerInstances = Object.keys(chains).reduce<{
const providerInstances = Object.keys(CHAINS).reduce<{
[chainId: number]: {
instance: StaticJsonRpcBatchProvider;
};
Expand Down Expand Up @@ -110,7 +112,7 @@ export const initChainInformationConfig = (chains: {
function getChainParameters(
chainId: number
): AddEthereumChainParameter | number {
const chainInformation = chains[chainId];
const chainInformation = CHAINS[chainId];
if (isExtendedChainInformation(chainInformation)) {
return {
chainId,
Expand Down

0 comments on commit 692ffd1

Please sign in to comment.