nectar/kinode/packages/kns_indexer/kns_indexer:sys-api-v0.wit
2024-05-06 11:13:05 -07:00

36 lines
1.4 KiB
Plaintext

interface kns-indexer-sys-api-v0 {
/// 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-requests {
/// return the human readable name for a namehash
/// returns an Option<String>
namehash-to-name(namehash-to-name-requests),
/// return the most recent on-chain routing information for a node name.
/// returns an Option<KnsUpdate>
/// set block to 0 if you just want to get the current state of the indexer
node-info(node-info-requests),
/// 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-requests),
}
record namehash-to-name-request {
hash: string,
block: u64,
}
record node-info-request {
name: string,
block: u64,
}
record get-state-request {
block: u64,
}
}