covalent_class_a

Crates.iocovalent_class_a
lib.rscovalent_class_a
version0.1.3
sourcesrc
created_at2022-05-22 14:31:41.947195
updated_at2022-05-23 09:39:10.156874
descriptionRust wrapper for the Covalent Class A Endpoints https://www.covalenthq.com/docs/api
homepagehttps://github.com/mark-ruddy/covctl/tree/main/covalent_class_a
repositoryhttps://github.com/mark-ruddy/covctl/tree/main/covalent_class_a
max_upload_size
id591155
size36,822
Mark Ruddy (mark-ruddy)

documentation

README

covalent_class_a

Rust wrapper for the Covalent Class A Endpoints: https://www.covalenthq.com/docs/api

Klaytn Client Example

Set your API key as an environment variable: export COVALENT_API_KEY=<YOUR_API_KEY>, or you can use the CovalentClient::new("8217", "<YOUR_API_KEY>") function to pass the API key in as a code parameter

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: https://docs.rs/covalent_class_a/0.1.1/covalent_class_a/struct.CovalentClient.html

CLI Interface

See covctl at https://github.com/mark-ruddy/covctl for the CLI interface to this library

API Coverage

Implemented

  • Balances Endpoints
  • Transaction Endpoints
  • Base Endpoints

Not Implemented

  • NFT Endpoints

Testing

The tests will send actual API calls to the covalent API. They require an API key to be set in the environment variable COVALENT_API_KEY:

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.

Commit count: 0

cargo fmt