Skip to content

Commit

Permalink
feat: add soneium minato testnet (#95)
Browse files Browse the repository at this point in the history
Adding Soneium Minato Testnet -
https://docs.soneium.org/docs/builders/overview
  • Loading branch information
ashutoshvarma authored Oct 4, 2024
1 parent f866af8 commit 9c71774
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
12 changes: 12 additions & 0 deletions assets/chains.json

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

23 changes: 19 additions & 4 deletions src/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ pub enum NamedChain {
#[strum(to_string = "immutable-testnet")]
#[cfg_attr(feature = "serde", serde(alias = "immutable-testnet"))]
ImmutableTestnet = 13473,

#[strum(to_string = "soneium-minato-testnet")]
#[cfg_attr(feature = "serde", serde(alias = "soneium-minato-testnet"))]
SoneiumMinatoTestnet = 1946,
}

// This must be implemented manually so we avoid a conflict with `TryFromPrimitive` where it treats
Expand Down Expand Up @@ -497,6 +501,7 @@ impl NamedChain {
| BlastSepolia
| OpBNBMainnet
| OpBNBTestnet
| SoneiumMinatoTestnet
)
}

Expand Down Expand Up @@ -538,7 +543,8 @@ impl NamedChain {

Optimism | OptimismGoerli | OptimismSepolia | Base | BaseGoerli | BaseSepolia
| Blast | BlastSepolia | Fraxtal | FraxtalTestnet | Zora | ZoraGoerli | ZoraSepolia
| Mantle | MantleSepolia | Mode | ModeSepolia | Pgn | PgnSepolia => 2_000,
| Mantle | MantleSepolia | Mode | ModeSepolia | Pgn | PgnSepolia
| SoneiumMinatoTestnet => 2_000,

Alphanet => 1_000,

Expand Down Expand Up @@ -719,7 +725,8 @@ impl NamedChain {
| PulsechainTestnet
| Koi
| Immutable
| ImmutableTestnet => false,
| ImmutableTestnet
| SoneiumMinatoTestnet => false,

// Unknown / not applicable, default to false for backwards compatibility.
Dev | AnvilHardhat | Morden | Ropsten | Rinkeby | Cronos | CronosTestnet | Kovan
Expand Down Expand Up @@ -796,6 +803,7 @@ impl NamedChain {
| Koi
| Immutable
| ImmutableTestnet
| SoneiumMinatoTestnet
)
}

Expand Down Expand Up @@ -865,7 +873,8 @@ impl NamedChain {
| GravityAlphaTestnetSepolia
| XaiSepolia
| Koi
| ImmutableTestnet => true,
| ImmutableTestnet
| SoneiumMinatoTestnet => true,

// Dev chains.
Dev | AnvilHardhat => true,
Expand Down Expand Up @@ -1226,6 +1235,9 @@ impl NamedChain {
"https://explorer.testnet.immutable.com/api",
"https://explorer.testnet.immutable.com",
),
SoneiumMinatoTestnet => {
("https://explorer-testnet.soneium.org/api", "https://explorer-testnet.soneium.org")
}
})
}

Expand Down Expand Up @@ -1304,7 +1316,9 @@ impl NamedChain {
Acala | AcalaMandalaTestnet | AcalaTestnet | Canto | CantoTestnet | Etherlink
| EtherlinkTestnet | Flare | FlareCoston2 | KakarotSepolia | Karura | KaruraTestnet
| Mode | ModeSepolia | Pgn | PgnSepolia | Shimmer | Zora | ZoraGoerli | ZoraSepolia
| Darwinia | Crab | Koi | Immutable | ImmutableTestnet => "BLOCKSCOUT_API_KEY",
| Darwinia | Crab | Koi | Immutable | ImmutableTestnet | SoneiumMinatoTestnet => {
"BLOCKSCOUT_API_KEY"
}

Boba => "BOBASCAN_API_KEY",

Expand Down Expand Up @@ -1466,6 +1480,7 @@ mod tests {
(AutonomysNovaTestnet, &["autonomys-nova-testnet"]),
(Immutable, &["immutable"]),
(ImmutableTestnet, &["immutable-testnet"]),
(SoneiumMinatoTestnet, &["soneium-minato-testnet"]),
];

for &(chain, aliases) in ALIASES {
Expand Down

0 comments on commit 9c71774

Please sign in to comment.