saxobank / openapi-clientlib-js Goto Github PK
View Code? Open in Web Editor NEWOpenAPI Client Library
License: Other
OpenAPI Client Library
License: Other
Some suggestions:
If Bearer is not capitalised in the network request then it gets duplicated, making the authentication fail.
We should retry (up to 5 times?) subscribing after a few seconds if the server responds with a gateway timeout (504).
Hi!
I'm currently trying to consume the openapi from NodeJS.
My on this, is that there is a dependency to the browser, and as far as I can see, it is solely caused by a dependency to SignalR library.
I have no experience with SignalR, and I haven't read too much up on it, but would it be possible to abstract the signalR-connection and add the ability to provide "your own" implementation when constructing Streaming
?
I have an implementation in mind:
I will change the signature of the constructor to this:
function Streaming(transport, baseUrl, authProvider, options, signalClientProvider) {}
Then in the init function I will create the connection using the signalClientProvider instead of $.connection()
.
const connection = this.signalClientProvider(this.connectionUrl);
signalClientProvider
will also be responsible for providing connection states:
/**
* maps from the signalR connection state to the ConnectionState Enum
*/
function mapConnectionState(state) {
let connectionState;
switch (state) {
case this.signalClientProvider.states.connecting: connectionState = this.CONNECTION_STATE_CONNECTING; break;
case this.signalClientProvider.states.connected: connectionState = this.CONNECTION_STATE_CONNECTED; break;
case this.signalClientProvider.states.disconnected: connectionState = this.CONNECTION_STATE_DISCONNECTED; break;
case this.signalClientProvider.states.reconnecting: connectionState = this.CONNECTION_STATE_RECONNECTING; break;
default:
log.warn(LOG_AREA, 'unrecognised state', state);
break;
}
return connectionState;
}
Wouldn't this be all that is needed to be able to use the client outside the browser?
.. like expect().toHaveBeenCalledTimes() etc.
If the maxDecimals argument of NumberFormatting.formatNoRounding
is passed as 0, it will be ignored because of the following line:
API returns {seconds: 1634805065 nanos: 23369000} and client converts it to "2021-10-21T08:31:05.023Z".
It should return "2021-10-21T08:31:05.023869000Z"
I admit that "10.2 %" and "10.2%" are both correct at some degree. But I'd like to ask, whether the project will consider switch "10.2 %" to "10.2%". To be honest, the second notation is more frequently seen in life.
Here are some interesting discussion https://english.stackexchange.com/questions/3281/should-there-be-a-space-before-a-percent-sign
When the symbol % is used, there should be no space. When the "percent" word is used, there should be space.
Examples from the Chicago Manual of Style Online:
Fewer than 3 percent of the employees used public transportation.
With 90โ95 percent of the work complete, we can relax.
A 75 percent likelihood of winning is worth the effort.
Her five-year certificate of deposit carries an interest rate of 5.9 percent.
Only 20% of the ants were observed to react to the stimulus.
The treatment resulted in a 20%โ25% increase in reports of night blindness.The manual explicitly advices the following:
Note also that no space appears between the numeral and the symbol %.
Thoughts on publishing this to NPM as a package? I'd like to use this, but cloning doesn't seem like the most efficient (or safe, from versioning standpoint) way to acquire this package.
As a user it isn't possible to use probe messages, or even trigger something when they arrive. This is due to the library picking them up for their "_" control message prefix but having no case for probe messages.
Grunt print-task.js contains reference to not existing task: minitrader
ie.
bold + indent + 'grunt minitrader' + reset + ' ...
'minitrader': [
bold + 'Get to minitrader on this url:' + reset,
'',
bold + indent + sharedConfig.serverBaseURL + 'minitrader' + reset
]
Why do you need visual studio project files? And if they are needed i think they should have different names then SharedJS.
Files in question:
Internally we would like to use the event emitter in projects without a need for the open api client library. As we would need to bundle that emitter in our output, that means we should allow not using the monolithic entry point (publish the es2015 raw source) to avoid duplication.
Any suggested replacements or should we publish the micro emitter?
Visual studio project contains reference to not existing minitrader files.
For example SharedJS.csproj contains:
...
<Content Include="minitrader\Content\css\site.min.css" />
<Content Include="minitrader\Content\fonts\glyphicons-halflings-regular.svg" />
<Content Include="minitrader\Content\img\favicon.ico" />
<Content Include="minitrader\Content\img\mtarchitecture.png" />
<Content Include="minitrader\Content\img\saxo1.png" />
<Content Include="minitrader\Index.html" />
....
There's a floating point issue in the format methods:
numberFormat.shortFormat(10.1, 2)
> "10"
numberFormat.shortFormat(10.11, 2)
> "0.0k"
Will investigate a fix and make a PR.
When formatting infinitesimally small negative values using formatPriceParts method of PriceFormatting class, the output comes as '-0' which makes no sense. It should be '0'.
Hi Guys,
Thanks for the JS API implementation you provide.
I know it's not an issue, rather a comment, but I dont think there's anywhere else I can raise this with saxo as a dev.
What I wanted to ask is, why a JS implementation and not a Python implementation? Is this a fork from what you use at the backend and it's in JS?
JS seems a rather inconvenient choice for algo traders, since I rarely see it used anywhere else in the domain. Say I need to do some data processing, machine learning, integrate with 3rd party backtested/live trading platform, most tools available for this out there are python if we talk higher-level language. JS API library requires extra, hacky integration work/interfaces.
I would love to have an API library from you, particularly for live streaming prices and trading events. I struggle quite a bit to make a stable socket with you in python at the moment, if there was a stable library from you provided for the API in python it would be so great.
Again sorry for not raising an issue, but rather for commenting.
Thank you.
Took me a while to find it..
We could also add the reader file as an article and remove jsdoc generation from grunt..
hi, can someone please tell me if the open api access of 10k daily limit requests. is the request count incremented for every like info price subscription response message or just for the sub/unsub request . I know it is not a request but a stream of responses, I just wonder if it counts as activity or not? and if hopefully not then can I then set the refresh rate for the sub to be 500 mils ?
thank you
What's a purpose of files found in libs directory? Most of them aren't used directly in this project.
Some of them are external dependencies(signalR, jQuery), however documentations suggests to configure external dependencies manually using direct sources.
We are no longer open sourcing this library, though the code and npm package is still available.
Please let us know if you are using this package and would like to see it continue to be supported.
The link to doclets.io is broken, currently https://doclets.io/SaxoBank/openapi-clientlib-js/master
Unsure if this is expected or not. Could you please point to an updated link to the documentatin, if any? Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.