1 个不稳定版本

0.1.9 2022年5月9日

#139 in #exchange


用于 ecbt

BSD-2-Clause

125KB
3.5K SLoC

此模块提供了与coinbase API通信的功能。此模块提供了与coinbase API通信的功能。

示例

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);
}

依赖项

~9–24MB
~382K SLoC