Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inv2004/coinbase-pro-rs
Coinbase pro client for Rust
https://github.com/inv2004/coinbase-pro-rs
async coinbase cryptocurrency exchange static sync trading
Last synced: 3 months ago
JSON representation
Coinbase pro client for Rust
- Host: GitHub
- URL: https://github.com/inv2004/coinbase-pro-rs
- Owner: inv2004
- License: apache-2.0
- Created: 2018-08-20T07:26:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-04T03:41:03.000Z (over 1 year ago)
- Last Synced: 2024-10-06T21:03:50.876Z (3 months ago)
- Topics: async, coinbase, cryptocurrency, exchange, static, sync, trading
- Language: Rust
- Homepage:
- Size: 197 KB
- Stars: 145
- Watchers: 8
- Forks: 56
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-cn - coinbase-pro-rs - ci.org/inv2004/coinbase-pro-rs.svg?branch=master">](https://travis-ci.org/inv2004/coinbase-pro-rs) (应用 / Cryptocurrencies)
- awesome-rust - coinbase-pro-rs - ci.org/inv2004/coinbase-pro-rs.svg?branch=master">](https://travis-ci.org/inv2004/coinbase-pro-rs) (Applications / Cryptocurrencies)
- awesome-rust - coinbase-pro-rs
- awesome-rust - coinbase-pro-rs - Coinbase pro client, supports sync/async/websocket (Applications / Blockchain)
- awesome-rust - coinbase-pro-rs - ci.org/inv2004/coinbase-pro-rs.svg?branch=master">](https://travis-ci.org/inv2004/coinbase-pro-rs) (应用 Applications / 加密货币 Cryptocurrencies)
- fucking-awesome-rust - coinbase-pro-rs - Coinbase pro client, supports sync/async/websocket (Applications / Blockchain)
- fucking-awesome-rust - coinbase-pro-rs - Coinbase pro client, supports sync/async/websocket (Applications / Blockchain)
- awesome-rust-zh - coinbase-pro-rs - Rust 中的 Coinbase pro 客户端,支持 sync / async / websocket[<img src="https://api.travis-ci.org/inv2004/coinbase-pro-rs.svg?branch=master">](https://travis-ci.org/inv2004/coinbase-pro-rs) (应用 / 加密货币)
- awesome-rust-cn - coinbase-pro-rs
README
[![Build Status](https://travis-ci.org/inv2004/coinbase-pro-rs.svg?branch=master)](https://travis-ci.org/inv2004/coinbase-pro-rs)
[![Crates.io](https://img.shields.io/crates/v/coinbase-pro-rs.svg)](https://crates.io/crates/coinbase-pro-rs)
[![Docs.rs](https://docs.rs/coinbase-pro-rs/badge.svg)](https://docs.rs/coinbase-pro-rs)# Coinbase pro client for Rust
Supports SYNC/ASYNC/Websocket-feed data support## Features
- private and public API
- sync and async support
- websocket-feed support## Examples
Cargo.toml:
```toml
[dependencies]
coinbase-pro-rs = "0.7.1"
```### Async
```rust
use hyper::rt::Future;
use coinbase_pro_rs::{Public, ASync, SANDBOX_URL};fn main() {
let client: Public = Public::new_with_keep_alive(SANDBOX_URL, false);
// if keep_alive is not disables - tokio::run will hold the connection without exiting the example
let f = client.get_time()
.map_err(|_| ())
.and_then(|time| {
println!("Coinbase.time: {}", time.iso);
Ok(())
});tokio::run(f); // waiting for tokio
}
```
### Sync
```rust
use coinbase_pro_rs::{Public, Sync, SANDBOX_URL};fn main() {
let client: Public = Public::new(SANDBOX_URL);
let time = client.get_time().unwrap();
println!("Coinbase.time: {}", time.iso);
}
```
### Websocket
```rust
use futures::{Future, Stream};
use coinbase_pro_rs::{WSFeed, WS_SANDBOX_URL};
use coinbase_pro_rs::structs::wsfeed::*;fn main() {
let stream = WSFeed::connect(WS_SANDBOX_URL,
&["BTC-USD"], &[ChannelType::Heartbeat])
.await
.unwrap();let f = stream
.take(10)
.for_each(|msg| {
match msg {
Message::Heartbeat {sequence, last_trade_id, time, ..} => println!("{}: seq:{} id{}",
time, sequence, last_trade_id),
Message::Error {message} => println!("Error: {}", message),
Message::InternalError(_) => panic!("internal_error"),
other => println!("{:?}", other)
}
Ok(())
});tokio::run(f.map_err(|_| panic!("stream fail")));
}
```## Api supported:
- [x] SYNC
- [x] ASYNC
- [x] Websocket-Feed## API
- [x] Requests
- [ ] Pagination
- [x] Types
- [x] Private
- [x] Authentication
- [x] Accounts
- [x] Orders
- [x] Fills
- [ ] Deposits
- [x] List
- [ ] Withdrawals
- [x] List
- [ ] Payment Methods
- [ ] Coinbase Accounts
- [x] Fees
- [ ] Reports
- [x] User Account
- [x] Market Data
- [x] Products
- [x] Currencies
- [x] Time
- [x] Websocket Feed
- [x] heartbeat
- [x] ticker
- [x] level2
- [x] user
- [x] matches
- [x] full## FIX API
by request## OrderBook
### Tests
cargo test