3 unstable releases

Uses old Rust 2015

0.2.1 Aug 3, 2018
0.2.0 Aug 2, 2018
0.1.0 Jul 31, 2018

#17 in #coinbase

AGPL-3.0

21KB
485 lines

Coinbase-api

Client library for the Coinbase Pro API. Requests are asynchronous and return futures.

Coinbase API reference

Example

Basic example to list all currency pairs trading on the exchange:

extern crate coinbase_api;
extern crate hyper;

use coinbase_api::*;
use hyper::rt::Future;

fn make_future() -> impl Future<Item=(), Error=()> {
  let client = MarketDataClient::new(SANDBOX).unwrap();
  client.products()
  .map(|products| {
    println!("Pairs available for trading:");
    for p in products {
      println!("{}", p.id);
    }
  })
  .map_err(|err| println!("Error: {:?}", err))
}

fn main() {
  hyper::rt::run(make_future());
}

Progress

Implemented

  • Market Data API (without pagination)
  • Private API:
    • GET requests without pagination

Not implemented yet

  • pagination
  • Private API:
    • POST requests
    • DELETE requests
    • Payment methods
    • Coinbase accounts
    • Reports
  • Websocket Feed
  • FIX API

lib.rs:

Rust client library for Coinbase.

Example

extern crate coinbase_api;
extern crate hyper;

use coinbase_api::*;
use hyper::rt::Future;

fn make_future() -> impl Future<Item=(), Error=()> {
  let client = MarketDataClient::new(SANDBOX).unwrap();
  client.products()
  .map(|products| {
    println!("Pairs available for trading:");
    for p in products {
      println!("{}", p.id);
    }
  })
  .map_err(|err| println!("Error: {:?}", err))
}

fn main() {
  hyper::rt::run(make_future());
}

Dependencies

~7–17MB
~242K SLoC