Expand description
Coinbase Advanced Trade REST API Client
A comprehensive implementation of the Coinbase Advanced Trade REST API with support for:
- ECDSA (ES256) authentication for Advanced Trade
- HMAC-SHA256 authentication for legacy API
- Order management (place, cancel, modify, get status)
- Account management (balances, fees, portfolios)
- Market data (products, order book, candles, trades)
- Portfolio management (create, list, move funds)
- Transaction history and fills
§Authentication
The client supports both authentication methods:
- ECDSA (Recommended): For Coinbase Advanced Trade API using ES256 JWT tokens
- HMAC-SHA256: For legacy Coinbase Pro API
§Usage
use rusty_ems::exchanges::coinbase::CoinbaseRestClient;
use rusty_common::auth::exchanges::coinbase::CoinbaseAuth;
use std::sync::Arc;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// ECDSA authentication (Advanced Trade)
let auth = Arc::new(CoinbaseAuth::new_ecdsa(
"your_api_key".into(),
"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----".into()
)?);
let client = CoinbaseRestClient::new(auth, false); // false = production
// Get account balances
let accounts = client.get_accounts().await?;
println!("Accounts: {:#?}", accounts);
Ok(())
}Structs§
- Coinbase
Account - Account information
- Coinbase
Account Balance - Account balance information
- Coinbase
Candle - Candles data for market analysis
- Coinbase
FeeStructure - Fee structure
- Coinbase
Fill - Fill information
- Coinbase
Limit Order - Limit order configuration
- Coinbase
Limit Order Gtd - Limit order with Good Till Date
- Coinbase
Market Order - Market order configuration
- Coinbase
Order - Order information from Coinbase
- Coinbase
Order Book - Order book data
- Coinbase
Order Error Response - Error response from order operations
- Coinbase
Order Request - Order request for creating new orders
- Coinbase
Order Response - Response from order operations
- Coinbase
Order Success Response - Successful order response
- Coinbase
Portfolio - Portfolio information
- Coinbase
Price Book - Price book with bids and asks
- Coinbase
Price Level - Price level in order book
- Coinbase
Product - Product information
- Coinbase
Rest Client - Coinbase REST API client
- Coinbase
Stop Limit Order - Stop limit order configuration
- Coinbase
Stop Limit Order Gtd - Stop limit order with Good Till Date
- Coinbase
Trade - Trade data
- Coinbase
Transaction - Transaction summary
Enums§
- Coinbase
Order Configuration - Order configuration for different order types