chain-registry-interface 0.0.1

Typed runtime access to Cosmos chain-registry (schemas only; no embedded data).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use chain_registry_interface::Chain;

#[test]
fn parse_chain_fixture() {
    let json = r#"{
        "$schema": "../chain.schema.json",
        "chain_name": "cosmoshub",
        "chain_type": "cosmos",
        "status": "live"
    }"#;

    let parsed: Chain = serde_json::from_str(json).expect("parse chain");
    assert_eq!(parsed.chain_name, "cosmoshub");
    assert_eq!(parsed.chain_type, "cosmos");
    assert_eq!(parsed.status, "live");
}