forked from reown-com/blockchain-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Base Zora * fix: eip155 * fix: WebSocket caps * chore: test Sepolia, Base, and Zora * chore: Base Zora tests, run unit tests in CI, nightly clippy fmt to match CI
- Loading branch information
1 parent
14f9ce9
commit d364ba4
Showing
28 changed files
with
575 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,55 @@ | ||
use { | ||
super::ProviderConfig, | ||
crate::providers::{Priority, Weight}, | ||
std::collections::HashMap, | ||
}; | ||
|
||
#[derive(Debug)] | ||
pub struct BaseConfig { | ||
pub supported_chains: HashMap<String, (String, Weight)>, | ||
} | ||
|
||
impl Default for BaseConfig { | ||
fn default() -> Self { | ||
Self { | ||
supported_chains: default_supported_chains(), | ||
} | ||
} | ||
} | ||
|
||
impl ProviderConfig for BaseConfig { | ||
fn supported_chains(self) -> HashMap<String, (String, Weight)> { | ||
self.supported_chains | ||
} | ||
|
||
fn supported_ws_chains(self) -> HashMap<String, (String, Weight)> { | ||
HashMap::new() | ||
} | ||
|
||
fn provider_kind(&self) -> crate::providers::ProviderKind { | ||
crate::providers::ProviderKind::Base | ||
} | ||
} | ||
|
||
fn default_supported_chains() -> HashMap<String, (String, Weight)> { | ||
// Keep in-sync with SUPPORTED_CHAINS.md | ||
|
||
HashMap::from([ | ||
// Base Mainnet | ||
( | ||
"eip155:8453".into(), | ||
( | ||
"https://mainnet.base.org".into(), | ||
Weight::new(Priority::Normal).unwrap(), | ||
), | ||
), | ||
// Base Goerli | ||
( | ||
"eip155:84531".into(), | ||
( | ||
"https://goerli.base.org".into(), | ||
Weight::new(Priority::Normal).unwrap(), | ||
), | ||
), | ||
]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,80 @@ | ||
use { | ||
super::ProviderConfig, | ||
crate::providers::{Priority, Weight}, | ||
std::collections::HashMap, | ||
}; | ||
|
||
#[derive(Debug)] | ||
pub struct ZoraConfig { | ||
pub supported_chains: HashMap<String, (String, Weight)>, | ||
pub supported_ws_chains: HashMap<String, (String, Weight)>, | ||
} | ||
|
||
impl Default for ZoraConfig { | ||
fn default() -> Self { | ||
Self { | ||
supported_chains: default_supported_chains(), | ||
supported_ws_chains: default_ws_supported_chains(), | ||
} | ||
} | ||
} | ||
|
||
impl ProviderConfig for ZoraConfig { | ||
fn supported_chains(self) -> HashMap<String, (String, Weight)> { | ||
self.supported_chains | ||
} | ||
|
||
fn supported_ws_chains(self) -> HashMap<String, (String, Weight)> { | ||
self.supported_ws_chains | ||
} | ||
|
||
fn provider_kind(&self) -> crate::providers::ProviderKind { | ||
crate::providers::ProviderKind::Zora | ||
} | ||
} | ||
|
||
fn default_supported_chains() -> HashMap<String, (String, Weight)> { | ||
// Keep in-sync with SUPPORTED_CHAINS.md | ||
|
||
HashMap::from([ | ||
// Zora Mainnet | ||
( | ||
"eip155:7777777".into(), | ||
( | ||
"https://rpc.zora.energy".into(), | ||
Weight::new(Priority::Normal).unwrap(), | ||
), | ||
), | ||
// Zora Goerli | ||
( | ||
"eip155:999".into(), | ||
( | ||
"https://testnet.rpc.zora.energy".into(), | ||
Weight::new(Priority::Normal).unwrap(), | ||
), | ||
), | ||
]) | ||
} | ||
|
||
fn default_ws_supported_chains() -> HashMap<String, (String, Weight)> { | ||
// Keep in-sync with SUPPORTED_CHAINS.md | ||
|
||
HashMap::from([ | ||
// Zora Mainnet | ||
( | ||
"eip155:7777777".into(), | ||
( | ||
"wss://rpc.zora.energy".into(), | ||
Weight::new(Priority::Normal).unwrap(), | ||
), | ||
), | ||
// Zora Goerli | ||
( | ||
"eip155:999".into(), | ||
( | ||
"wss://testnet.rpc.zora.energy".into(), | ||
Weight::new(Priority::Normal).unwrap(), | ||
), | ||
), | ||
]) | ||
} |
Oops, something went wrong.