cbadv-rs, Coinbase Advanced API in Rust
The cbadv-rs project is designed to help me get my feet wet in Rust. By no means should others consider using this in the near future, especially with the hopes of making money. This is entirely for testing purposes and I am not responsible for your losses. As note that this project is a work-in-progress and subject to change with time. Some functions, structs, enums, etc may be renamed to adhere to better styling guidelines or optimized for efficiency. With these disclaimers aside and if you enjoy this project, you can choose to credit me with any gains made.
Contributions are encouraged! The API reference can be seen at Coinbase Advanced API. If you wish to add this to your project, either use cargo add cbadv or add the following line to your dependencies section in Cargo.toml:
[]
= { = "https://github.com/ohkthx/cbadv-rs" }
Features
- Easy-to-use Client.
- Configuration file to hold API Key and API Secret.
- Covers all endpoints currently accessible (20230626).
Documentation
Most of the documentation can be accessed by clicking the following link: docs.rs. That documentation is automatically generated and also accessible from crates.io.
Covered API requests
- Accounts [client.account]
- List Accounts [client.account.get_all]
- Get Account [client.account.get]
- Products [client.product]
- Get Best Bid / Ask [client.product.best_bid_ask]
- Get Product Book [client.product.product_book]
- List Products [client.product.get_all]
- Get Product [client.product.get]
- Get Product Candles [client.product.candles]
- Get Market Trades (Ticker) [client.product.ticker]
- Orders [client.order]
- Create Order
- Market IOC (untested) [client.order.create_market]
- Limit GTC [client.order.create_limit_gtc]
- Limit GTD (untested) [client.order.create_limit_gtd]
- Stop Limit GTC (untested) [client.order.create_stop_limit_gtc]
- Stop Limit GTD (untested) [client.order.create_stop_limit_gtd]
- Cancel Orders [client.order.cancel]
- List Orders [client.order.get_all]
- List Fills (untested) [client.order.fills]
- Get Order [client.order.get]
- Create Order
- Fees [client.fee]
- Get Transaction Summary [client.fee.get]
TODO
Test all endpoints that are currently untested.
Configuration
The default configuration is unusable due to the API requiring a Key and Secret. You can create, modify, and delete API Keys and Secrets with this link.
Copy the config.toml.sample to config.toml and add in your API information. The config.toml file will automatically be read on launch to access your accounts API information. Unlike the depreciated Coinbase Pro API, there's no longer access to Public API endpoints. All access requires authentication. The key and secret is authentication requirements for HTTP requests to be properly signed and accepted by Coinbase.
Examples
Check above in the Covered API requests section for possibly covered examples.
- Account API: account_api_example.rs
- Product API: product_api_example.rs
- Fee API: fee_api_example.rs
- Order API: order_api_example.rs
Tips Appreciated!
Wallet addresses are provided below, or click the badges above!
Bitcoin (BTC): bc1q75w3cgutug8qdxw3jlmqnkjlv9alt3jr7ftha0
Ethereum (ETH): 0x7d75f6a9c021fcc70691fec73368198823fb0f60
Binance (BNB): 0x7d75f6a9c021fcc70691fec73368198823fb0f60