Giter Club home page Giter Club logo

openapi.net's People

Contributors

amusleh-spotware-com avatar vijayganeshpk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openapi.net's Issues

Any plans for python examples?

Hi,

I've been testing out the API with python, but I'm having some trouble with getting the initial authorization working. Would it be ok if I share the code here, work on it and once it works, clean it up and put it up as a simple python examples repository for OpenAPI?

Thanks!

GetTrendbars no response in WPF.Sample

There is no longer a response when using GetTrendbars in the APIService.cs (WPF.Sample project). I have had no issues previously. Note that I can still get a trendbar response if I use the winforms sample.

NuGet project link.

Hey, I just want to inform you that the link on NuGet is wrong.
It goes to afhacker instead of this repo. ๐Ÿ‘

Stream get canceled

Hi,

i have the latest npm package and get issue sometimes in Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs:line 65

How fix it?

Exception: OpenAPI.Net.Exceptions.ReceiveException: An exception occurred while reading from stream
---> System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](TIOAdapter adapter)
at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory1 buffer) at OpenAPI.Net.OpenClient.ReadTcp(CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Reactive.AnonymousSafeObserver1.OnError(Exception error) in //Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs:line 65
at System.Reactive.Sink1.ForwardOnError(Exception error) in //Rx.NET/Source/src/System.Reactive/Internal/Sink.cs:line 61 at OpenAPI.Net.OpenClient.OnError(Exception exception) --- End of stack trace from previous location --- at System.Reactive.AnonymousSafeObserver1.OnError(Exception error) in //Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs:line 65
at System.Reactive.Sink1.ForwardOnError(Exception error) in /
/Rx.NET/Source/src/System.Reactive/Internal/Sink.cs:line 61 at OpenAPI.Net.OpenClient.OnError(Exception exception) --- End of stack trace from previous location --- at System.Reactive.AnonymousSafeObserver1.OnError(Exception error) in //Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs:line 65
at System.Reactive.Sink1.ForwardOnError(Exception error) in //Rx.NET/Source/src/System.Reactive/Internal/Sink.cs:line 61 at OpenAPI.Net.OpenClient.OnError(Exception exception) --- End of stack trace from previous location --- at System.Reactive.AnonymousSafeObserver1.OnError(Exception error) in //Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs:line 65
at System.Reactive.Sink`1.ForwardOnError(Exception error) in /
/Rx.NET/Source/src/System.Reactive/Internal/Sink.cs:line 61
at OpenAPI.Net.OpenClient.OnError(Exception exception)

Despite our best efforts, bugs can slip into releases or corner cases forgotten about. We will try our best to remedy the situation
and/or provide workarounds. Note that certain (odd) behaviors are by design and as such are not considered bugs.

Which library version? last release

What are the platform(s), environment(s) and related component version(s)? dotnet

What is the use case or problem? Stream get sometimes canced

What is the expected outcome? transfer data as complete

What is the actual outcome? Stream will be closed

What is the stacktrace of the exception(s) if any?

How can i fix it?

ProtoOAAccountAuthReq hangs when called

I've come across an issue with the library where calling ProtoOAAccountAuthReq does not return any response, no errors or anything, it just waits for a response indefinitely. (The initial request to ProtoOAApplicationAuthReq always succeeded.)

This issue doesn't happen all the time, I feel like it only occurs if there is a deployment ongoing on the Spotware side, I'm not sure. I've seen this happen several times in the past and usually fixes itself after a few hours.

I have figured out the cause of the issue, and it has something to do with the proxy URL returned by ApiInfo.GetInfo(Mode). The GetInfo() method returns "demo.ctraderapi.com" or "live.ctraderapi.com".

however, based on the Proxies/Endpoints documentation (https://help.ctrader.com/open-api/proxies-endpoints/), there are several region-specific servers that should be used, such as "demo-sg.ctraderapi.com" or "live-sg.ctraderapi.com".

Since I started using this library, the examples specify that the way to initialize the SpotwareClient object should be done like this:

OpenClient client = new(ApiInfo.GetHost(Mode.Demo), ApiInfo.Port, TimeSpan.FromSeconds(10));

Which would return the "demo.ctraderapi.com" or "live.ctraderapi.com" URL.

The fix is to not use ApiInfo at all during initialization of the OpenClient object, instead, either retrieve the region-specific URL from your database or hardcode the URL during ctor initialization.

I am currently using v1.4.4 of this library.

Maybe an update to the ApiInfo code should be done to support these region-specific API servers?

Console.Sample using Windows specific method to open authUri

When going through the file samples/Console.Sample/Program.cs came across the following code at line 88:

System.Diagnostics.Process.Start("explorer.exe", $"\"{authUri}\"");

Since this is valid only on Windows, it can be wrapped in an if statement checking

System.OperatingSystem.IsWindows()

For the rest of the operating systems, the final authUri can be printed to the console or appropriate process can be opened (in MacOS it would be open command).

ProtoOaDealListByPositionIdRes is not correctly parsed

I can't create and a branch and create a pull request so the fix is here:
MessageFactory in GetMessage this line is missing

(int)ProtoOAPayloadType.ProtoOaDealListByPositionIdRes => ProtoOADealListByPositionIdRes.Parser.ParseFrom(payload),

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.