Skip to main content

Crate coinbase_advanced

Crate coinbase_advanced 

Source
Expand description

§Coinbase Advanced Trade API Client

A Rust client library for the Coinbase Advanced Trade API.

§Features

  • REST API client with JWT authentication
  • Strongly typed request/response models
  • Async/await support with tokio
  • Support for both production and sandbox environments

§Quick Start

use coinbase_advanced::{Credentials, RestClient};

#[tokio::main]
async fn main() -> coinbase_advanced::Result<()> {
    // Create credentials from environment variables
    let credentials = Credentials::from_env()?;

    // Build the client
    let client = RestClient::builder()
        .credentials(credentials)
        .build()?;

    // Make API calls...
    Ok(())
}

§Authentication

The Coinbase Advanced Trade API uses JWT (JSON Web Tokens) for authentication. You’ll need:

  • An API key (in the format organizations/{org_id}/apiKeys/{key_id})
  • An EC private key in PEM format

These can be obtained from the Coinbase Developer Platform.

§Sandbox Mode

For testing, you can use the sandbox environment:

let client = RestClient::builder()
    .credentials(Credentials::from_env().unwrap())
    .sandbox(true)
    .build()
    .unwrap();

Re-exports§

pub use rest::AccountsApi;
pub use rest::ConvertApi;
pub use rest::DataApi;
pub use rest::FeesApi;
pub use rest::FuturesApi;
pub use rest::OrdersApi;
pub use rest::PaymentMethodsApi;
pub use rest::PerpetualsApi;
pub use rest::PortfoliosApi;
pub use rest::ProductsApi;
pub use rest::PublicApi;
pub use rest::ServerTime;

Modules§

consts
models
Data models for the Coinbase Advanced Trade API.
rate_limit
Rate limiting implementation using a token bucket algorithm.
rest
API service modules for the Coinbase Advanced Trade API.
ws
WebSocket client for real-time market data and user updates.

Structs§

Credentials
Credentials for authenticating with the Coinbase API.
RestClient
REST client for the Coinbase Advanced Trade API.
RestClientBuilder
Builder for constructing a RestClient.

Enums§

Error
Error types for the Coinbase client.

Type Aliases§

Result
Result type alias for coinbase-client operations.