Exemplo n.º 1
0
        /// <summary>
        /// Send new order This request creating new order for the specific exchange.
        /// </summary>
        /// <exception cref="CoinAPI.OMS.API.SDK.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="orderNewSingleRequest">OrderNewSingleRequest object.</param>
        /// <returns>ApiResponse of OrderExecutionReport</returns>
        public CoinAPI.OMS.API.SDK.Client.ApiResponse <OrderExecutionReport> V1OrdersPostWithHttpInfo(OrderNewSingleRequest orderNewSingleRequest)
        {
            // verify the required parameter 'orderNewSingleRequest' is set
            if (orderNewSingleRequest == null)
            {
                throw new CoinAPI.OMS.API.SDK.Client.ApiException(400, "Missing required parameter 'orderNewSingleRequest' when calling OrdersApi->V1OrdersPost");
            }

            CoinAPI.OMS.API.SDK.Client.RequestOptions localVarRequestOptions = new CoinAPI.OMS.API.SDK.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json",
                "appliction/json"
            };

            var localVarContentType = CoinAPI.OMS.API.SDK.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = CoinAPI.OMS.API.SDK.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.Data = orderNewSingleRequest;


            // make the HTTP request
            var localVarResponse = this.Client.Post <OrderExecutionReport>("/v1/orders", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("V1OrdersPost", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get balances Get current currency balance from all or single exchange.
        /// </summary>
        /// <exception cref="CoinAPI.OMS.API.SDK.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="exchangeId">Filter the balances to the specific exchange. (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;Balance&gt;)</returns>
        public async System.Threading.Tasks.Task <CoinAPI.OMS.API.SDK.Client.ApiResponse <List <Balance> > > V1BalancesGetWithHttpInfoAsync(string exchangeId = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            CoinAPI.OMS.API.SDK.Client.RequestOptions localVarRequestOptions = new CoinAPI.OMS.API.SDK.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json",
                "appliction/json"
            };


            var localVarContentType = CoinAPI.OMS.API.SDK.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = CoinAPI.OMS.API.SDK.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            if (exchangeId != null)
            {
                localVarRequestOptions.QueryParameters.Add(CoinAPI.OMS.API.SDK.Client.ClientUtils.ParameterToMultiMap("", "exchange_id", exchangeId));
            }


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <List <Balance> >("/v1/balances", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("V1BalancesGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get order execution report Get the last order execution report for the specified order. The requested order does not need to be active or opened.
        /// </summary>
        /// <exception cref="CoinAPI.OMS.API.SDK.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="clientOrderId">The unique identifier of the order assigned by the client.</param>
        /// <returns>ApiResponse of OrderExecutionReport</returns>
        public CoinAPI.OMS.API.SDK.Client.ApiResponse <OrderExecutionReport> V1OrdersStatusClientOrderIdGetWithHttpInfo(string clientOrderId)
        {
            // verify the required parameter 'clientOrderId' is set
            if (clientOrderId == null)
            {
                throw new CoinAPI.OMS.API.SDK.Client.ApiException(400, "Missing required parameter 'clientOrderId' when calling OrdersApi->V1OrdersStatusClientOrderIdGet");
            }

            CoinAPI.OMS.API.SDK.Client.RequestOptions localVarRequestOptions = new CoinAPI.OMS.API.SDK.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = CoinAPI.OMS.API.SDK.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = CoinAPI.OMS.API.SDK.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("client_order_id", CoinAPI.OMS.API.SDK.Client.ClientUtils.ParameterToString(clientOrderId)); // path parameter


            // make the HTTP request
            var localVarResponse = this.Client.Get <OrderExecutionReport>("/v1/orders/status/{client_order_id}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("V1OrdersStatusClientOrderIdGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Send new order This request creating new order for the specific exchange.
        /// </summary>
        /// <exception cref="CoinAPI.OMS.API.SDK.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="orderNewSingleRequest">OrderNewSingleRequest object.</param>
        /// <returns>Task of ApiResponse (OrderExecutionReport)</returns>
        public async System.Threading.Tasks.Task <CoinAPI.OMS.API.SDK.Client.ApiResponse <OrderExecutionReport> > V1OrdersPostAsyncWithHttpInfo(OrderNewSingleRequest orderNewSingleRequest)
        {
            // verify the required parameter 'orderNewSingleRequest' is set
            if (orderNewSingleRequest == null)
            {
                throw new CoinAPI.OMS.API.SDK.Client.ApiException(400, "Missing required parameter 'orderNewSingleRequest' when calling OrdersApi->V1OrdersPost");
            }


            CoinAPI.OMS.API.SDK.Client.RequestOptions localVarRequestOptions = new CoinAPI.OMS.API.SDK.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json",
                "appliction/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            localVarRequestOptions.Data = orderNewSingleRequest;


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <OrderExecutionReport>("/v1/orders", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("V1OrdersPost", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Get open positions Get current open positions across all or single exchange.
        /// </summary>
        /// <exception cref="CoinAPI.OMS.API.SDK.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="exchangeId">Filter the balances to the specific exchange. (optional)</param>
        /// <returns>ApiResponse of List&lt;Position&gt;</returns>
        public CoinAPI.OMS.API.SDK.Client.ApiResponse <List <Position> > V1PositionsGetWithHttpInfo(string exchangeId = default(string))
        {
            CoinAPI.OMS.API.SDK.Client.RequestOptions localVarRequestOptions = new CoinAPI.OMS.API.SDK.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json",
                "appliction/json"
            };

            var localVarContentType = CoinAPI.OMS.API.SDK.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = CoinAPI.OMS.API.SDK.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            if (exchangeId != null)
            {
                localVarRequestOptions.QueryParameters.Add(CoinAPI.OMS.API.SDK.Client.ClientUtils.ParameterToMultiMap("", "exchange_id", exchangeId));
            }


            // make the HTTP request
            var localVarResponse = this.Client.Get <List <Position> >("/v1/positions", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("V1PositionsGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Get open orders Get last execution reports for open orders across all or single exchange.
        /// </summary>
        /// <exception cref="CoinAPI.OMS.API.SDK.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="exchangeId">Filter the open orders to the specific exchange. (optional)</param>
        /// <returns>Task of ApiResponse (List&lt;OrderExecutionReport&gt;)</returns>
        public async System.Threading.Tasks.Task <CoinAPI.OMS.API.SDK.Client.ApiResponse <List <OrderExecutionReport> > > V1OrdersGetAsyncWithHttpInfo(string exchangeId = default(string))
        {
            CoinAPI.OMS.API.SDK.Client.RequestOptions localVarRequestOptions = new CoinAPI.OMS.API.SDK.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json",
                "appliction/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (exchangeId != null)
            {
                localVarRequestOptions.QueryParameters.Add(CoinAPI.OMS.API.SDK.Client.ClientUtils.ParameterToMultiMap("", "exchange_id", exchangeId));
            }


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <List <OrderExecutionReport> >("/v1/orders", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("V1OrdersGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }