Skip to content

op-developer/op-api-rust-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

op-api-rust-sdk

MIT License Contributors Issues PRs

Rust SDK for OP REST API

Installation

To be published to crates.io

Usage

See apis crate for all available clients. Example of getting account data:

use op_api_sdk::apis::accounts::Accounts;
use op_api_sdk::options::Options;
use tokio;

#[tokio::main]
async fn main() {
    let mut options = Options::new_dev(String::from("X_API_KEY"));
    options.set_version("v3".to_string());
    let accounts = Accounts::new(options).accounts().await.unwrap();
    println!("{:?}", accounts);
}

See requests for required headers.

For further reading, please see our API documentation

Developing

Few guidelines for developing this library:

  • Follow Rust API Guidelines
  • Keep formatting consistent by using cargo fmt for all changes
  • Use cargo clippy to find possible lint errors and warnings
  • Always add tests to your functionality, prefer TDD. Use /tests/ folder.
  • Always run tests before pushing to remote

Running tests

Tests depend to real sandbox data.

To enable debug logging from the library set up the RUST_LOG environment variable

export RUST_LOG=op_api_sdk=debug

About

Rust SDK for OP REST API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%