Closed Radimersky closed 1 year ago
Try this
OKXApiAddresses.Default = OKXApiAddresses.Demo;
var api = new OKXRestApiClient(new OKXRestApiClientOptions
{
DemoTradingService = true,
});
I'll release a newer version and you wont need to first line anymore.
Hello, I have OKXRestApiClient instantiated like this: new OKXRestApiClient(new OKXRestApiClientOptions { LogLevel = LogLevel.Debug, DemoTradingService = true, DebugMode = true });
Using this client instance, when calling PublicData.GetInstrumentsAsync(OkxInstrumentType.Swap) returns a response from live API instead of demo trading API even when I have DemoTradingService set to true.
The issue is solved when I either add SignPublicRequests = true to the OKXRestApiClientOptions or set the "signed" parameter in GetInstrumentsAsync to true.
I am not sure if this is a bug or if I am missing something significant but I would expect that when using a client with DemoTradingService set to true then every called API endpoint will use DemoTradingService.