Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/07-supported-chains.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Each network has a canonical chain identifier. Endpoint discovery and transport
| BSC | `eip155:56` |
| Avalanche | `eip155:43114` |
| Etherlink | `eip155:42793` |
| Monad | `eip155:143` |
| Tempo | `eip155:4217` |
| Hyperliquid | `eip155:999` |

Expand Down Expand Up @@ -90,6 +91,7 @@ optimism → eip155:10
bsc → eip155:56
avalanche → eip155:43114
etherlink → eip155:42793
monad → eip155:143
tempo → eip155:4217
hyperliquid → eip155:999
solana → solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
Expand Down
21 changes: 21 additions & 0 deletions ows/crates/ows-core/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ pub const KNOWN_CHAINS: &[Chain] = &[
chain_type: ChainType::Evm,
chain_id: "eip155:42793",
},
Chain {
name: "monad",
chain_type: ChainType::Evm,
chain_id: "eip155:143",
},
Chain {
name: "solana",
chain_type: ChainType::Solana,
Expand Down Expand Up @@ -479,6 +484,22 @@ mod tests {
assert_eq!(chain.chain_id, "eip155:42793");
}

#[test]
fn test_parse_chain_monad_alias() {
let chain = parse_chain("monad").unwrap();
assert_eq!(chain.name, "monad");
assert_eq!(chain.chain_type, ChainType::Evm);
assert_eq!(chain.chain_id, "eip155:143");
}

#[test]
fn test_parse_chain_monad_caip2() {
let chain = parse_chain("eip155:143").unwrap();
assert_eq!(chain.name, "monad");
assert_eq!(chain.chain_type, ChainType::Evm);
assert_eq!(chain.chain_id, "eip155:143");
}

#[test]
fn test_parse_chain_caip2() {
let chain = parse_chain("eip155:42161").unwrap();
Expand Down
2 changes: 2 additions & 0 deletions ows/crates/ows-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ impl Config {
"eip155:43114".into(),
"https://api.avax.network/ext/bc/C/rpc".into(),
);
rpc.insert("eip155:143".into(), "https://rpc.monad.xyz".into());
Comment thread
cursor[bot] marked this conversation as resolved.
rpc.insert(
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp".into(),
"https://api.mainnet-beta.solana.com".into(),
Expand Down Expand Up @@ -197,6 +198,7 @@ mod tests {
Some("https://polygon-rpc.com")
);
assert_eq!(config.rpc_url("eip155:9745"), Some("https://rpc.plasma.to"));
assert_eq!(config.rpc_url("eip155:143"), Some("https://rpc.monad.xyz"));
assert_eq!(
config.rpc_url("solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"),
Some("https://api.mainnet-beta.solana.com")
Expand Down
21 changes: 21 additions & 0 deletions ows/crates/ows-pay/src/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@ mod tests {
);
}

#[test]
fn resolve_monad_name() {
assert_eq!(resolve_chain_type("monad"), Some(ChainType::Evm));
}

#[test]
fn resolve_monad_caip2() {
assert_eq!(resolve_chain_type("eip155:143"), Some(ChainType::Evm));
}

#[test]
fn display_monad() {
assert_eq!(display_name("monad"), "monad");
assert_eq!(display_name("eip155:143"), "monad");
}

#[test]
fn caip2_ref_monad() {
assert_eq!(caip2_reference("eip155:143"), Some("143"));
}

#[test]
fn resolve_unknown_caip2_known_namespace() {
// Chain not in KNOWN_CHAINS but namespace is recognized.
Expand Down
Loading