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

feat: add public goods network and pgn sepolia to chainsˆ #25

Merged
merged 3 commits into from
Jan 8, 2024
Merged
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
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.

34 changes: 28 additions & 6 deletions src/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,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 @@ -320,7 +323,9 @@ impl NamedChain {
| C::BaseSepolia
| C::Zora
| C::ZoraGoerli
| C::ZoraSepolia => 2_000,
| C::ZoraSepolia
| C::Pgn
| C::PgnSepolia => 2_000,

C::Viction => 2_000,

Expand Down Expand Up @@ -448,7 +453,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 @@ -547,7 +554,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 @@ -586,6 +594,7 @@ impl NamedChain {
| C::ZkSync
| C::Mantle
| C::Zora
| C::Pgn
| C::Viction => false,
}
}
Expand Down Expand Up @@ -812,6 +821,15 @@ 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 @@ -877,9 +895,13 @@ impl NamedChain {

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

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

C::Boba => "BOBASCAN_API_KEY",

Expand Down