Crate ecbt_coinbase

Source
Expand description

This module provides functionality for communicating with the coinbase API. This module provides functionality for communicating with the coinbase API.

§Example

use ecbt_coinbase::{Coinbase, CoinbaseParameters};
use ecbt_exchange::{
    model::{
        market_pair::{Currency, MarketPair},
        OrderBookRequest,
    },
    Exchange, ExchangeMarketData,
};

#[tokio::main]
async fn main() {
    let coinbase = Coinbase::new(CoinbaseParameters::sandbox())
        .await
        .expect("Couldn't create coinbase client");
    let market_pair = MarketPair(Currency::ETH, Currency::BTC);
    let order_book = coinbase
        .order_book(&OrderBookRequest { market_pair })
        .await
        .expect("Couldn't get order book");
    println!("{:?}", order_book);
}

Re-exports§

pub use crate::client::stream::CoinbaseWebsocket;

Modules§

client
This module is used to make calls to api and connect to the websockets
model
This module provides models that are used in the coinbase module
shared

Structs§

Coinbase
CoinbaseContentError
This struct represents the coinbase content errors
CoinbaseCredentials
This struct represents the coinbase credentials
CoinbaseParameters
This struct represents the coinbase parameters