NewStopOffer SendAddNewStopOfferRequest(string url, NewStopOfferRequest body) { RestClient rc = new RestClient(config.ApiTradingStopUrl + "offer/" + url); rc.AddOwnHeaderToRequest(new AutorizeData(config)); rc.SendPOST(body); return(Tools.TryGetResponse <NewStopOffer>(rc)); }
/// <summary> /// Add new stop offer to user account. For use, must authorize User. /// </summary> /// <param name="currencyPair">Currency pair code.</param> /// <param name="body">New offer body.</param> /// <returns>Offer UUID identificator.</returns> public string AddNewStopOffer(string currencyPair, NewStopOfferRequest body) { if (body == null) { throw new ArgumentException("The body params can not be null!"); } return(SendAddNewStopOfferRequest(currencyPair, body).StopOfferId); }
void AddNewStopOffer() { NewStopOfferRequest body = new NewStopOfferRequest(); body.SetStopLimitOffer("BUY", amount, stopRate, rate); try { offerId = bbClient.PrivateStopTrading.AddNewStopOffer("BTC-PLN", body); } catch (FailResponseException e) { Tools.HandlingErrors(e); return; } }