gateio / gateapi-csharp

36 stars 14 forks source link

ListOrders and ListMyTrades variable currencyPair not optional with status "finished" #18

Closed R3LX closed 2 years ago

R3LX commented 2 years ago
    /// <summary>
    /// List personal trading history Spot and margin trades are queried by default. If cross margin trades are needed, &#x60;account&#x60; must be set to &#x60;cross_margin&#x60;  You can also set &#x60;from&#x60; and(or) &#x60;to&#x60; to query by time range Time range parameters are handled as order finish time.
    /// </summary>
    /// <exception cref="Io.Gate.GateApi.Client.ApiException">Thrown when fails to make API call</exception>
    /// <param name="currencyPair">Retrieve results with specified currency pair. **It is required for open orders, but optional for finished ones.**</param>
    /// <param name="limit">Maximum number of records to be returned in a single list (optional, default to 100)</param>
    /// <param name="page">Page number (optional, default to 1)</param>
    /// <param name="orderId">Filter trades with specified order ID. &#x60;currency_pair&#x60; is also required if this field is present (optional)</param>
    /// <param name="account">Specify operation account. Default to spot and margin account if not specified. Set to &#x60;cross_margin&#x60; to operate against margin account (optional)</param>
    /// <param name="from">Start timestamp of the query (optional)</param>
    /// <param name="to">Time range ending, default to current time (optional)</param>
    /// <returns>ApiResponse of List&lt;Trade&gt;</returns>
    public ApiResponse<List<Trade>> ListMyTradesWithHttpInfo (string currencyPair, int? limit = default(int?), int? page = default(int?), string orderId = default(string), string account = default(string), long? from = default(long?), long? to = default(long?))
    {
        // verify the required parameter 'currencyPair' is set
        **if (currencyPair == null)
            throw new ApiException(400, "Missing required parameter 'currencyPair' when calling SpotApi->ListMyTrades");**
revilwang commented 2 years ago

Because in previous version, it is required. To avoid breaking API, it is kept required. You can set it to an empty string.

R3LX commented 2 years ago

@revilwang Thank you, tested and working with empty string.