예제 #1
0
 public CancelOrdersResponse CancelAll(TradeLevel tradeLevel)
 {
     return
         this.CallMethod<CancelOrdersResponse>(
             new RequestBuilder(RequestType.POST, "order/cancel/all")
             .AddUrlSegment(tradeLevel));
 }
예제 #2
0
 public CancelOrdersResponse CancelMany(TradeLevel tradeLevel, string[] orderIds)
 {
     return
         this.CallMethod<CancelOrdersResponse>(
             new RequestBuilder(RequestType.POST, "order/cancel/many")
             .AddUrlSegment(tradeLevel)
             .AddUrlSegment(orderIds));
 }
예제 #3
0
 public GetBalanceResponse GetAccountBalance(string symbol, TradeLevel tradeLevel)
 {
     return
         this.CallMethod<GetBalanceResponse>(
             new RequestBuilder(RequestType.GET, "account/balance")
             .AddUrlSegment(symbol)
             .AddUrlSegment(tradeLevel));
 }
예제 #4
0
 private GetSessionTokenResponse GetSessionToken(string hashedSignInKey, TradeLevel tradeLevel)
 {
     return
         this.CallMethod<GetSessionTokenResponse>(
             new RequestBuilder(RequestType.GET, "session/new")
             .AddUrlSegment(tradeLevel)
             .AddQueryStringParameter("hashedSignInKey", hashedSignInKey));
 }
예제 #5
0
 public GetTradeBookResponse Get(string fromCoin, string toCoin, TradeLevel tradeLevel, int count = 50)
 {
     return
         this.CallMethod<GetTradeBookResponse>(
             new RequestBuilder(RequestType.GET, "book")
             .AddUrlSegment(new CoinsPairSegment(fromCoin, toCoin))
             .AddUrlSegment(tradeLevel)
             .AddQueryStringParameter("count", count.ToString()));
     }
예제 #6
0
 public GetOrdersResponse Get(string fromCoin, string toCoin, TradeStatus tradeStatus, TradeLevel tradeLevel)
 {
     return
         this.CallMethod<GetOrdersResponse>(
             new RequestBuilder(RequestType.GET, "trades")
             .AddUrlSegment(new CoinsPairSegment(fromCoin, toCoin))
             .AddUrlSegment(tradeStatus)
             .AddUrlSegment(tradeLevel));
 }
예제 #7
0
 public GetTickerResponse GetTicker(string fromCoin, string toCoin, TradeLevel tradeLevel)
 {
     return
         this.CallMethod<GetTickerResponse>(
             new RequestBuilder(RequestType.GET, "ticker")
             .AddUrlSegment(new CoinsPairSegment(fromCoin, toCoin))
             .AddUrlSegment(tradeLevel));
     
 }
예제 #8
0
 public void SignIn(TradeLevel tradeLevel)
 {
     var getSignInKeyResponse = this.GetSignInKey();
     var result = CryptoHelper.Decrypt(getSignInKeyResponse.Key, apiSecret, false);
     var hasedSignedKey = CryptoHelper.CreateSHA2512Hash(String.Concat(result, this.apiSecondaryKey));
     hasedSignedKey = WebUtility.UrlEncode(hasedSignedKey);
     var getNewSessionResonse = this.GetSessionToken(hasedSignedKey, tradeLevel);
     this.SessionToken = getNewSessionResonse.SessionToken;
 }
예제 #9
0
 public TradeCoinRequest(string fromCoin, string toCoin, TradeType tradeType, TradeSide tradeSide, decimal tradePrice, decimal units, TradeLevel tradeLevel)
 {
     this.FromCoinSymbol = fromCoin;
     this.ToCoinSymbol = toCoin;
     this.TradeType = (int)tradeType;
     this.TradeSide = (int)tradeSide;
     this.TradePrice = tradePrice;
     this.Units = units;
     this.TradeLevel = (int)tradeLevel;
 }
예제 #10
0
 public TradeCoinResponse New(string fromCoin, string toCoin, TradeType tradeType, TradeSide tradeSide, decimal tradePrice, decimal units, TradeLevel tradeLevel)
 {
     return
         this.CallMethod<TradeCoinResponse>(
             new RequestBuilder(RequestType.POST, "order/new")
             .AddUrlSegment(new CoinsPairSegment(fromCoin, toCoin))
             .AddUrlSegment(tradeType)
             .AddUrlSegment(tradeSide)
             .AddUrlSegment(tradePrice)
             .AddUrlSegment(units)
             .AddUrlSegment(tradeLevel));
 }
예제 #11
0
 public GetBalancesResponse GetAccountBalances(TradeLevel tradeLevel)
 {
     return
         this.CallMethod<GetBalancesResponse>(new RequestBuilder(RequestType.GET, "account/balances")
         .AddUrlSegment(tradeLevel));
 }