Skip to content

Commit

Permalink
feat: add public goods network and pgn sepolia to chainsˆ
Browse files Browse the repository at this point in the history
  • Loading branch information
vacekj committed Jan 6, 2024
1 parent a36d918 commit 669dff0
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 7 deletions.
24 changes: 24 additions & 0 deletions assets/chains.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 24 additions & 7 deletions src/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ pub enum NamedChain {
Scroll = 534352,
ScrollAlphaTestnet = 534353,
#[cfg_attr(
feature = "serde",
serde(alias = "scroll_sepolia", alias = "scroll_sepolia_testnet")
feature = "serde",
serde(alias = "scroll_sepolia", alias = "scroll_sepolia_testnet")
)]
ScrollSepolia = 534351,

Expand Down Expand Up @@ -168,6 +168,9 @@ pub enum NamedChain {
Zora = 7777777,
ZoraGoerli = 999,
ZoraSepolia = 999999999,

Pgn = 424,
PgnSepolia = 58008,
}

// This must be implemented manually so we avoid a conflict with `TryFromPrimitive` where it treats
Expand Down Expand Up @@ -318,7 +321,9 @@ impl NamedChain {
| C::BaseSepolia
| C::Zora
| C::ZoraGoerli
| C::ZoraSepolia => 2_000,
| C::ZoraSepolia
| C::Pgn
| C::PgnSepolia => 2_000,

C::Polygon | C::PolygonMumbai => 2_100,

Expand Down Expand Up @@ -443,7 +448,9 @@ impl NamedChain {
| C::Chiado
| C::Zora
| C::ZoraGoerli
| C::ZoraSepolia => false,
| C::ZoraSepolia
| C::Pgn
| C::PgnSepolia => false,

// Unknown / not applicable, default to false for backwards compatibility.
C::Dev
Expand Down Expand Up @@ -542,7 +549,8 @@ impl NamedChain {
| C::ScrollSepolia
| C::ZkSyncTestnet
| C::ZoraGoerli
| C::ZoraSepolia => true,
| C::ZoraSepolia
| C::PgnSepolia => true,

// Dev chains.
C::Dev | C::AnvilHardhat => true,
Expand Down Expand Up @@ -580,7 +588,8 @@ impl NamedChain {
| C::Linea
| C::ZkSync
| C::Mantle
| C::Zora => false,
| C::Zora
| C::Pgn => false,
}
}

Expand Down Expand Up @@ -804,6 +813,14 @@ impl NamedChain {
("https://sepolia.explorer.zora.energy/api", "https://sepolia.explorer.zora.energy")
}

C::Pgn => {
("https://explorer.publicgoods.network/api", "https://explorer.publicgoods.network")
}

C::PgnSepolia => {
("https://explorer.sepolia.publicgoods.network/api", "https://explorer.sepolia.publicgoods.network")
}

C::AnvilHardhat | C::Dev | C::Morden | C::MoonbeamDev | C::FilecoinMainnet => {
return None;
}
Expand Down Expand Up @@ -869,7 +886,7 @@ impl NamedChain {

C::Moonbeam | C::Moonbase | C::MoonbeamDev | C::Moonriver => "MOONSCAN_API_KEY",

C::Canto | C::CantoTestnet | C::Zora | C::ZoraGoerli | C::ZoraSepolia => {
C::Canto | C::CantoTestnet | C::Zora | C::ZoraGoerli | C::ZoraSepolia | C::Pgn | C::PgnSepolia => {
"BLOCKSCOUT_API_KEY"
}

Expand Down

0 comments on commit 669dff0

Please sign in to comment.