Skip to content

NullCosmos/CEXIO-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CEXIO-API

A simple .NET interface to CEX.IO API.

If you find this useful, please consider donating:

19qCZUt4WqLCZ3MQ8tZXcd5gx71EdGjPX2

Using

using CEXIO_API;

Initialization

CEXIO.Key = "[API Key]";
CEXIO.Secret = "[API Secret]";
CEXIO.UserName = "[username]";

Usage

//Get balance of all commodities
Balance b = Balance.GetBalance();

//Do we have BTC to sell?
if(b.BTC.available>0)
{
  //Get latest data
  Ticker t = Ticker.GetTicker(CEXIO.Commodity.GHS_BTC);

  //Calculate amount to sell
  Double amount = Floor(b.BTC.available / t.last, 8);
  
  //Place order, retreive Order object (this contains the ID, which can be used to cancel the order later)
  Order o = Order.PlaceNewOrder(CEXIO.Commodity.GHS_BTC, Order.Type.Buy, amount, t.last);
}

Releases

No releases published

Packages

No packages published

Languages