interface kns-indexer { /// IndexerRequests are used to query discrete information from the indexer /// for example, if you want to know the human readable name for a namehash, /// you would send a NamehashToName request. /// If you want to know the most recent on-chain routing information for a /// human readable name, you would send a NodeInfo request. /// The block parameter specifies the recency of the data: the indexer will /// not respond until it has processed events up to the specified block. variant indexer-request { /// return the human readable name for a namehash /// returns an Option namehash-to-name(namehash-to-name-request), /// return the most recent on-chain routing information for a node name. /// returns an Option /// set block to 0 if you just want to get the current state of the indexer node-info(node-info-request), /// return the entire state of the indexer at the given block /// set block to 0 if you just want to get the current state of the indexer get-state(get-state-request), } variant indexer-response { name(option), node-info(option), get-state(wit-state), } record namehash-to-name-request { hash: string, block: u64, } record node-info-request { name: string, block: u64, } record get-state-request { block: u64, } record wit-kns-update { name: string, public-key: string, ips: list, ports: list>, // map, but wit doesn't support maps routers: list, } record wit-state { chain-id: u64, contract-address: list, // 20-byte ETH address names: list>, // map, but wit doesn't support maps nodes: list>, // map, but wit doesn't support maps last-block: u64, } } world kns-indexer-sys-v0 { import kns-indexer; include process-v1; }