Skip to content

Commit

Permalink
chore: add zora
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Nov 16, 2023
1 parent dd790f0 commit 64133ee
Showing 1 changed file with 20 additions and 3 deletions.
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

0 comments on commit 64133ee

Please sign in to comment.