Crates.io | eql_core |
lib.rs | eql_core |
version | 0.1.17 |
source | src |
created_at | 2024-07-11 18:01:40.565281 |
updated_at | 2024-11-01 19:07:24.515868 |
description | EVM Query Language core components |
homepage | |
repository | https://github.com/iankressin/eql |
max_upload_size | |
id | 1299859 |
size | 184,514 |
EVM Query Language core components.
[dependencies]
eql_core = "0.1"
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);
}