eql_core

Crates.ioeql_core
lib.rseql_core
version0.1.17
sourcesrc
created_at2024-07-11 18:01:40.565281
updated_at2024-11-01 19:07:24.515868
descriptionEVM Query Language core components
homepage
repositoryhttps://github.com/iankressin/eql
max_upload_size
id1299859
size184,514
Ian K. GuimarĂ£es (iankressin)

documentation

README

EQL Core

EVM Query Language core components.

Installation

[dependencies]
eql_core = "0.1"

Usage

EQL queries can be excuted using the eql funtion:

use eql_core::interpreter::eql;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut result = eql("GET balance FROM account vitalik.eth ON eth").await?;
    println!("{:?}", result);
    Ok(())
}

Or by using EQLBuilder:

use eql_core::common::EQLBuilder;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let result = EQLBuilder::new()
        .get(vec![Field::Account(super::types::AccountField::Balance)])
        .from(
            Entity::Account,
            EntityId::Account(NameOrAddress::Name("vitalik.eth".to_string())),
        )
        .on(Chain::Ethereum)
        .run()
        .await?;

    println!("{:?}", result);
}
Commit count: 271

cargo fmt