Rust wrapper for the Covalent Class A Endpoints: https://www.covalenthq.com/docs/api
Set your API key as an environment variable: export COVALENT_API_KEY=<YOUR_API_KEY>
In the below example a client is created which will use the Klaytn Mainnet(8217) and a unified covalent API call is made to the Get Token Balances endpoint:
let klaytn_client = covalent_class_a::CovalentClient::new_env_api_key("8217").unwrap();
let balances: covalent_class_a::resources::BalancesData = klaytn_client.get_token_balances("0xf4024faad5fafd0755875e3161524c9c4e1a1111", None, None).await.unwrap();
println!("Address: {}", balances.data.address);
For more examples see the docs: TODO
See covctl
at https://github.com/mark-ruddy/covctl for the CLI interface to this library
The tests will send actual API calls to the covalent API. They require an API key to be set in the environment variable COVALENTAPIKEY:
export COVALENT_API_KEY=<YOUR_API_KEY>
cargo test
The tests cover that the API calls for each library method return successfully and in some tests check for specific expected data.