Expand description
High-level async client for the acuity-index WebSocket API.
use acuity_index_api_rs::{CustomKey, CustomScalarValue, IndexerClient, Key};
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = IndexerClient::connect("ws://127.0.0.1:8172").await?;
let spans = client.status().await?;
println!("indexed spans: {spans:?}");
let events = client
.get_events(
Key::Custom(CustomKey::composite(
"item_revision",
[
CustomScalarValue::Bytes32([0x11; 32].into()),
CustomScalarValue::U32(7),
],
)),
Some(100),
None,
)
.await?;
println!("events: {}", events.events.len());
Ok(())
}Structs§
- Bytes32
- Custom
Key - Decoded
Event - Event
Match - Event
Meta - Event
Notification - Event
Ref - Event
Subscription - Events
Response - Indexer
Client - Pallet
Meta - Server
Error - Span
- Status
Subscription - Status
Update - Stored
Event - U64Text
- U128
Text