Skip to content

Commit

Permalink
feat: add unichain (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Feb 12, 2025
1 parent a22b2e4 commit 46a1e05
Show file tree
Hide file tree
Showing 2 changed files with 22 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.

14 changes: 10 additions & 4 deletions src/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ pub enum NamedChain {
Zeta = 7000,
Kaia = 8217,

Unichain = 130,
#[strum(to_string = "unichain-sepolia")]
#[cfg_attr(feature = "serde", serde(alias = "unichain-sepolia"))]
UnichainSepolia = 1301,
Expand Down Expand Up @@ -599,6 +600,7 @@ impl NamedChain {
| Odyssey
| World
| WorldSepolia
| Unichain
| UnichainSepolia
| HappychainTestnet
)
Expand Down Expand Up @@ -728,7 +730,7 @@ impl NamedChain {

Sonic => 1_000,

UnichainSepolia => 1_000,
UnichainSepolia | Unichain => 1_000,

BerachainBartio | BerachainArtio | Berachain => 2_000,

Expand Down Expand Up @@ -867,6 +869,7 @@ impl NamedChain {
| Sonic
| World
| WorldSepolia
| Unichain
| UnichainSepolia
| ApeChain
| BerachainBartio
Expand Down Expand Up @@ -963,6 +966,7 @@ impl NamedChain {
| World
| WorldSepolia
| Iotex
| Unichain
| UnichainSepolia
| ApeChain
| Curtis
Expand Down Expand Up @@ -1065,7 +1069,7 @@ impl NamedChain {
| Mode | Viction | Elastos | Degen | OpBNBMainnet | Ronin | Taiko | Flare | Acala
| Karura | Darwinia | Cfx | Crab | Pulsechain | Etherlink | Immutable | World
| Iotex | Core | Merlin | Bitlayer | ApeChain | Vana | Zeta | Kaia | Treasure | Bob
| Soneium | Sonic | Superposition | Berachain => false,
| Soneium | Sonic | Superposition | Berachain | Unichain => false,
}
}

Expand All @@ -1075,8 +1079,8 @@ impl NamedChain {

Some(match self {
Mainnet | Goerli | Holesky | Kovan | Sepolia | Morden | Ropsten | Rinkeby | Scroll
| ScrollSepolia | Taiko | TaikoHekla | UnichainSepolia | SuperpositionTestnet
| Superposition => "ETH",
| ScrollSepolia | Taiko | TaikoHekla | Unichain | UnichainSepolia
| SuperpositionTestnet | Superposition => "ETH",

Mantle | MantleSepolia => "MNT",

Expand Down Expand Up @@ -1469,6 +1473,7 @@ impl NamedChain {
WorldSepolia => {
("https://api-sepolia.worldscan.org/api", "https://sepolia.worldscan.org")
}
Unichain => ("https://api.uniscan.xyz/api", "https://uniscan.xyz"),
UnichainSepolia => {
("https://api-sepolia.uniscan.xyz/api", "https://sepolia.uniscan.xyz")
}
Expand Down Expand Up @@ -1565,6 +1570,7 @@ impl NamedChain {
| ScrollSepolia
| Taiko
| TaikoHekla
| Unichain
| UnichainSepolia
| ApeChain => "ETHERSCAN_API_KEY",

Expand Down

0 comments on commit 46a1e05

Please sign in to comment.