public void TestNash() { NashClientConfig config = NashClientConfig.Authenticated( Environment.GetEnvironmentVariable("NASH_API_KEY"), Environment.GetEnvironmentVariable("NASH_API_SECRET"), 0, NashEnvironment.Sandbox, 1000 ); var client = new ExchangeClient(config); TestContext.Progress.WriteLine("Orderbook " + client.Orderbook("btc_usdc")); TestContext.Progress.WriteLine("ReceivePairs " + client.ReceivePairs()); TestContext.Progress.WriteLine("GetAccountBalances " + client.GetAccountBalances()); TestContext.Progress.WriteLine("GetHistoricRates: " + client.GetHistoricTrades(new GetHistoricTradesRequest("btc_usdc"))); TestContext.Progress.WriteLine("GetOrderHistory btc_usdc: " + client.GetOrderHistory(new GetOrderHistoryRequest("btc_usdc"))); client.CancelAllOrders("btc_usdc"); var order = client.LimitSell(LimitOrderRequest.goodTillCancelled("6500.0", "0.01000", "btc_usdc")); TestContext.Progress.WriteLine("Limit sell: " + order); TestContext.Progress.WriteLine("Get order", client.GetOrder(order.id, order.marketPair)); TestContext.Progress.WriteLine("Limit buy: " + client.LimitBuy(LimitOrderRequest.goodTillCancelled("6500.0", "0.01000", "btc_usdc"))); TestContext.Progress.WriteLine("Limit buy fok: " + client.LimitSell(LimitOrderRequest.fillOrKill("6500.0", "0.01000", "btc_usdc"))); TestContext.Progress.WriteLine("Limit buy ioc: " + client.LimitSell(LimitOrderRequest.immediateOrCancel("6500.0", "0.01000", "btc_usdc"))); TestContext.Progress.WriteLine("Market sell: " + client.MarketSell(new MarketOrderRequest("0.01000", "btc_usdc"))); TestContext.Progress.WriteLine("Market sell inverse: " + client.MarketSell(new MarketOrderRequest("20", "usdc_btc"))); client.CancelAllOrders("btc_usdc"); var order2 = client.LimitSell(LimitOrderRequest.goodTillCancelled("8000.0", "1.0000", "btc_usdc")); TestContext.Progress.WriteLine("Limit sell: " + order2); client.CancelOrder(order2.id, order2.marketPair); }
public void TestCoinbase() { CoinbaseClientConfig config = CoinbaseClientConfig.Authenticated( Environment.GetEnvironmentVariable("COINBASE_API_KEY"), Environment.GetEnvironmentVariable("COINBASE_API_SECRET"), Environment.GetEnvironmentVariable("COINBASE_PASSPHRASE"), true ); var client = new ExchangeClient(config); TestContext.Progress.WriteLine("Orderbook " + client.Orderbook("ETH-BTC")); TestContext.Progress.WriteLine("ReceivePairs " + client.ReceivePairs()); TestContext.Progress.WriteLine("GetAccountBalances " + client.GetAccountBalances()); TestContext.Progress.WriteLine("GetOrderHistory ETH-BTC: " + client.GetOrderHistory(new GetOrderHistoryRequest("ETH-BTC"))); client.CancelAllOrders("ETH-BTC"); TestContext.Progress.WriteLine("Limit sell: " + client.LimitSell(LimitOrderRequest.goodTillCancelled("0.001", "1", "ETH-BTC"))); TestContext.Progress.WriteLine("Limit buy: " + client.LimitBuy(LimitOrderRequest.goodTillCancelled("0.001", "1", "ETH-BTC"))); // TestContext.Progress.WriteLine("Limit buy fok: " + client.LimitSell(LimitOrderRequest.fillOrKill("0.001", "1", "ETH-BTC"))); TestContext.Progress.WriteLine("Limit buy ioc: " + client.LimitSell(LimitOrderRequest.immediateOrCancel("0.001", "1", "ETH-BTC"))); client.CancelAllOrders("ETH-BTC"); }