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

chore: add zora #8

Merged
merged 1 commit into from
Nov 16, 2023
Merged
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
23 changes: 20 additions & 3 deletions src/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ pub enum NamedChain {
#[strum(to_string = "mantle-testnet")]
#[cfg_attr(feature = "serde", serde(alias = "mantle_testnet"))]
MantleTestnet = 5001,

Zora = 7777777,
ZoraGoerli = 999,
ZoraSepolia = 999999999,
}

// This must be implemented manually so we avoid a conflict with `TryFromPrimitive` where it treats
Expand Down Expand Up @@ -288,7 +292,9 @@ impl NamedChain {
Morden | Ropsten | Rinkeby | Goerli | Kovan | Sepolia | Holesky | Moonbase
| MoonbeamDev | OptimismKovan | Poa | Sokol | Rsk | EmeraldTestnet | Boba | Base
| BaseGoerli | ZkSync | ZkSyncTestnet | PolygonZkEvm | PolygonZkEvmTestnet | Metis
| Linea | LineaTestnet | Mantle | MantleTestnet => return None,
| Linea | LineaTestnet | Mantle | MantleTestnet | Zora | ZoraGoerli | ZoraSepolia => {
return None
}
};

Some(Duration::from_millis(ms))
Expand Down Expand Up @@ -354,7 +360,10 @@ impl NamedChain {
| LineaTestnet
| FilecoinCalibrationTestnet
| Gnosis
| Chiado => false,
| Chiado
| Zora
| ZoraGoerli
| ZoraSepolia => false,

// Unknown / not applicable, default to false for backwards compatibility
Dev | AnvilHardhat | Morden | Ropsten | Rinkeby | Cronos | CronosTestnet | Kovan
Expand Down Expand Up @@ -551,6 +560,14 @@ impl NamedChain {
("https://explorer.testnet.mantle.xyz/api", "https://explorer.testnet.mantle.xyz")
}

Zora => ("https://explorer.zora.energy/api", "https://explorer.zora.energy"),
ZoraGoerli => {
("https://testnet.explorer.zora.energy/api", "https://testnet.explorer.zora.energy")
}
ZoraSepolia => {
("https://sepolia.explorer.zora.energy/api", "https://sepolia.explorer.zora.energy")
}

AnvilHardhat | Dev | Morden | MoonbeamDev | FilecoinMainnet => {
// this is explicitly exhaustive so we don't forget to add new urls when adding a
// new chain
Expand Down Expand Up @@ -616,7 +633,7 @@ impl NamedChain {

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

Canto | CantoTestnet => "BLOCKSCOUT_API_KEY",
Canto | CantoTestnet | Zora | ZoraGoerli | ZoraSepolia => "BLOCKSCOUT_API_KEY",

Boba => "BOBASCAN_API_KEY",

Expand Down