Skip to content

Commit

Permalink
update chains
Browse files Browse the repository at this point in the history
  • Loading branch information
iainnash committed Jan 30, 2024
1 parent f219011 commit ba1d3dd
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,47 +36,54 @@ export const contractNetworks: ContractNetworksConfig = {

const pgn = {
id: 424 as const,
name: 'PGN',
network: 'pgn',
name: "PGN",
network: "pgn",
nativeCurrency: {
decimals: 18,
name: 'Ether',
symbol: 'ETH',
name: "Ether",
symbol: "ETH",
},
rpcUrls: {
default: {
http: ['https://rpc.publicgoods.network'],
webSocket: ['wss://rpc.publicgoods.network'],
http: ["https://rpc.publicgoods.network"],
webSocket: ["wss://rpc.publicgoods.network"],
},
public: {
http: ['https://rpc.publicgoods.network'],
webSocket: ['wss://rpc.publicgoods.network'],
http: ["https://rpc.publicgoods.network"],
webSocket: ["wss://rpc.publicgoods.network"],
},
},
blockExplorers: {
etherscan: { name: 'Explorer', url: 'https://explorer.publicgoods.network' },
default: { name: 'Explorer', url: 'https://explorer.publicgoods.network' },
etherscan: {
name: "Explorer",
url: "https://explorer.publicgoods.network",
},
default: { name: "Explorer", url: "https://explorer.publicgoods.network" },
},
}
};

export const allowedNetworks: { [chainId: number]: chains.Chain }= {
export const allowedNetworks: { [chainId: number]: chains.Chain } = {
[chains.zoraTestnet.id]: chains.zoraTestnet,
[chains.zoraSepolia.id]: chains.zoraSepolia,
[chains.arbitrumGoerli.id]: chains.arbitrumGoerli,
[chains.arbitrumSepolia.id]: chains.arbitrumSepolia,
[chains.arbitrumNova.id]: chains.arbitrumNova,
[chains.arbitrum.id]: chains.arbitrum,
[chains.base.id]: chains.base,
[chains.baseSepolia.id]: chains.baseSepolia,
[chains.sepolia.id]: chains.sepolia,
[chains.optimism.id]: chains.optimism,
[chains.optimismSepolia.id]: chains.optimismSepolia,
};

Object.keys(contractNetworks).map((network) => {
if (allowedNetworks[+network]) {
// if already exists skip
return;
}
const viemChain = Object.values(chains).find((chain) =>
chain.id.toString() === network );
const viemChain = Object.values(chains).find(
(chain) => chain.id.toString() === network
);

if (!viemChain) {
return;
Expand Down

0 comments on commit ba1d3dd

Please sign in to comment.