Skip to content

Commit

Permalink
feat:add fraxtal (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
pegahcarter committed Feb 28, 2024
1 parent 8c2d816 commit a895268
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 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.

14 changes: 14 additions & 0 deletions src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,18 @@ impl Chain {
Self::from_named(NamedChain::Base)
}

/// Returns the fraxtal mainnet chain.
#[inline]
pub const fn fraxtal() -> Self {
Self::from_named(NamedChain::Fraxtal)
}

/// Returns the fraxtal testnet chain.
#[inline]
pub const fn fraxtal_testnet() -> Self {
Self::from_named(NamedChain::FraxtalTestnet)
}

/// Returns the blast sepolia chain.
#[inline]
pub const fn blast_sepolia() -> Self {
Expand Down Expand Up @@ -365,6 +377,8 @@ impl Chain {
| NamedChain::Base
| NamedChain::BaseGoerli
| NamedChain::BaseSepolia
| NamedChain::Fraxtal
| NamedChain::FraxtalTestnet
| NamedChain::Mode
| NamedChain::ModeSepolia
| NamedChain::Pgn
Expand Down
24 changes: 24 additions & 0 deletions src/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ pub enum NamedChain {
#[cfg_attr(feature = "serde", serde(alias = "syndr-sepolia"))]
SyndrSepolia = 444444,

#[strum(to_string = "fraxtal")]
#[cfg_attr(feature = "serde", serde(alias = "fraxtal"))]
Fraxtal = 252,
#[strum(to_string = "fraxtal-testnet")]
#[cfg_attr(feature = "serde", serde(alias = "fraxtal-testnet"))]
FraxtalTestnet = 2522,

#[cfg_attr(feature = "serde", serde(alias = "blast-sepolia"))]
BlastSepolia = 168587773,

Expand Down Expand Up @@ -367,6 +374,8 @@ impl NamedChain {
| C::BaseGoerli
| C::BaseSepolia
| C::BlastSepolia
| C::Fraxtal
| C::FraxtalTestnet
| C::Zora
| C::ZoraGoerli
| C::ZoraSepolia
Expand Down Expand Up @@ -484,6 +493,8 @@ impl NamedChain {
| C::BaseGoerli
| C::BaseSepolia
| C::BlastSepolia
| C::Fraxtal
| C::FraxtalTestnet
| C::Optimism
| C::OptimismGoerli
| C::OptimismSepolia
Expand Down Expand Up @@ -555,6 +566,8 @@ impl NamedChain {
| C::BaseGoerli
| C::BaseSepolia
| C::BlastSepolia
| C::Fraxtal
| C::FraxtalTestnet
| C::Gnosis
| C::Chiado
| C::ZoraSepolia
Expand Down Expand Up @@ -605,6 +618,7 @@ impl NamedChain {
| C::EvmosTestnet
| C::FantomTestnet
| C::FilecoinCalibrationTestnet
| C::FraxtalTestnet
| C::LineaGoerli
| C::MantleTestnet
| C::MoonbeamDev
Expand Down Expand Up @@ -656,6 +670,7 @@ impl NamedChain {
| C::Canto
| C::Boba
| C::Base
| C::Fraxtal
| C::Linea
| C::ZkSync
| C::Mantle
Expand Down Expand Up @@ -866,6 +881,11 @@ impl NamedChain {
("https://api-sepolia.basescan.org/api", "https://sepolia.basescan.org")
}

C::Fraxtal => ("https://api.fraxscan.com/api", "https://fraxscan.com"),
C::FraxtalTestnet => {
("https://api-holesky.fraxscan.com/api", "https://holesky.fraxscan.com")
}

C::BlastSepolia => (
"https://api.routescan.io/v2/network/testnet/evm/168587773/etherscan",
"https://testnet.blastscan.io",
Expand Down Expand Up @@ -968,6 +988,8 @@ impl NamedChain {
| C::MantleTestnet
| C::BaseGoerli
| C::BaseSepolia
| C::Fraxtal
| C::FraxtalTestnet
| C::BlastSepolia
| C::Gnosis
| C::Scroll
Expand Down Expand Up @@ -1127,6 +1149,8 @@ mod tests {
(Base, &["base"]),
(BaseGoerli, &["base-goerli"]),
(BaseSepolia, &["base-sepolia"]),
(Fraxtal, &["fraxtal"]),
(FraxtalTestnet, &["fraxtal-testnet"]),
(BlastSepolia, &["blast-sepolia"]),
(SyndrSepolia, &["syndr-sepolia"]),
(LineaGoerli, &["linea-goerli"]),
Expand Down

0 comments on commit a895268

Please sign in to comment.