Skip to content

Golang API wrappers with CLI for cryptocurrency exchanges

Notifications You must be signed in to change notification settings

skycoin/exchange-api

Repository files navigation

Exchange-API

GoDoc Build Status

Exchange-API implements an interface to various cryptocurrency exchanges APIs in Go.

Status

Originally this library tried to unify the interfaces between multiple exchanges. This goal has been abandoned until at least all of the API wrappers are refined. There is a limited amount of common ground across APIs and data structures, although a basic buy, sell and cancel could be unified.

C2CX

API Docs: https://api.c2cx.com

The C2CX API wrapper is nearly complete. A few endpoints are unimplemented. Their documentation is not accurate, corrections are noted in exchange/c2cx/c2cx.go.

Cryptopia

API Docs:

The Cryptopia wrapper has not been reviewed or tested since restructuring this library. If someone wishes to use it, it would need a full review and cleanup of the data types.

Integration Tests

To run the integration tests for the C2CX API:

  1. Obtain a C2CX account and deposit at least 1.2 SKY.
  2. Create an API key
  3. Set the environment variables C2CX_TEST_KEY and C2CX_TEST_SECRET to the key/secret from step 2.
  4. Run make test.

Example:

C2CX_TEST_KEY=ABABABAB-ABAB-ABAB-ABAB-ABABABABABAB C2CX_TEST_SECRET=CDCDCDCD-CDCD-CDCD-CDCD-CDCDCDCDCDCD make test

The tests test (among other things) placing orders, retrieving orders and canceling orders.

The tests will place an order to sell 1.2 SKY at a rate of 0.5 BTC/SKY. Then it will test retrieving the order information. Then it will cancel the order.

Since we probably won't hit 0.5 BTC/SKY anytime soon, there's not much concern about losing any funds. However, if the tests fail halfway, you may need to manually cancel orders in C2CX to run the tests again.