Skip to content

ProfessorChill/crypto-com-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crypto-com-api

Asynchronous API for crypto.com.

This API is very early in development, please refer to the TODO section below.

Completion Status.

Websocket

Feature Status Reason
public/auth
public/get-instruments
private/set-cancel-on-disconnect
private/get-cancel-on-disconnect
private/get-withdrawal-history ⚠️ Currently untested.
user.order.{instrument_name}
user.trade.{instrument_name}
user.balance ⚠️ Unable to test since it requires the users balance to change and is therefore unsafe to test.
book.{instrument_name}
ticker.{instrument_name}
trade.{instrument_name}
candlestick.{time_frame}.{instrument_name}
otc_book.{instrument_name}
private/get-account-summary
private/create-order ⚠️ Unable to test as it requires creating an order which costs the tester money to do.
private/cancel-order ⚠️ Same as private/create-order.
private/create-order-list ⚠️ Same as private/create-order.
private/cancel-order-list ⚠️ Same as private/create-order.
private/get-order-history
private/get-open-orders
private/get-order-detail ⚠️ Requires a created order to test which costs the tester money. Not tested.
private/get-trades
Sub-account API I do not have sub-accounts to test with so I could not test and add this to the API.
OTC Trading API I have never used the OTC Trading API and do not understand it so adding it would be unreasonable for me to do.

REST

This is a mainly incomplete feature as I saw Websocket to be of more importance. Consider using the REST API to be unsafe.

REST will be completed at a later date as some of the routes are fairly necessary.

Feature Status Reason
public/get-instruments
public/get-book
public/get-candlestick
public/get-ticker
public/get-trades
private/create-withdrawal ⚠️ Requires the tester to pay per test.
private/get-currency-networks ⚠️ Untested.
private/get-withdrawal-history ⚠️ Untested.
private/get-deposit-history ⚠️ Untested.
private/get-deposit-address ⚠️ Untested.
private/get-account-summary ⚠️ Untested.
private/create-order
private/cancel-order
private/create-order-list
private/cancel-order-list
private/cancel-all-orders
private/get-order-history
private/get-open-orders
private/get-order-detail
private/get-trades

Usage

This library is very early in development and should only be used as a proof of concept right now.

With that said, refer to tests to see examples of usage until examples are created.

Testing

Tests will only run websocket_basic without the feature flag test_authorized and a .env file containing:

I highly recommend running tests with the command cargo test -- --test-threads 1 to prevent flooding crypto.com with too many requests as each test runs its own controller and creates a fresh connection.

WEBSOCKET_USER_API_ROOT_V2=wss://stream.crypto.com/v2/user
WEBSOCKET_MARKET_DATA_ROOT_V2=wss://stream.crypto.com/v2/market
API_KEY=YOUR_API_KEY
SECRET_KEY=YOUR_SECRET_KEY

TODO

Merge duplicate tests.

Create the REST routes, add tests, and finalize that section.

Add tests that should panic to data types.

About

Crypto.com API library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages