You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, if I want to implement a client for your API, I have to implement a client for your REST API, i.e., model classes, mappings to JSON and the client class that performs the HTTP requests. While not hard, this is a very tedious task. I need to duplicate most of the code that is already in your project, e.g., EtoroHttpClient and EtoroPosition. I could probably reuse some of your code by depending on the Jar, but that would be very cumbersome, because your code relies on Spring's dependency injection. So I would need to use reflection to construct a EtoroHttpClient instance, e.g.
It would be very handy if you extracted your client into a separate project that could be used as a library and with code akin to:
val client =EtoroHttpClient()
client.login("username", "password")
val positions:List<EtoroPosition> = client.getPositions(TradingMode.REAL)
Your REST API project would then simply depend on that new client library, just as my code.
This client library (or at least parts of it) could even be a Kotlin multiplatform project, i.e. usable not only from JVM languages like Kotlin and Java, but also from JavaScript and other languages.
I would guess that extracting a JVM-only client would not be a lot of work for you. A multiplatform client might be a bit more challenging, but since I have some limited experience with that, I could offer my help.
The text was updated successfully, but these errors were encountered:
Right now, if I want to implement a client for your API, I have to implement a client for your REST API, i.e., model classes, mappings to JSON and the client class that performs the HTTP requests. While not hard, this is a very tedious task. I need to duplicate most of the code that is already in your project, e.g.,
EtoroHttpClient
andEtoroPosition
. I could probably reuse some of your code by depending on the Jar, but that would be very cumbersome, because your code relies on Spring's dependency injection. So I would need to use reflection to construct aEtoroHttpClient
instance, e.g.It would be very handy if you extracted your client into a separate project that could be used as a library and with code akin to:
Your REST API project would then simply depend on that new client library, just as my code.
This client library (or at least parts of it) could even be a Kotlin multiplatform project, i.e. usable not only from JVM languages like Kotlin and Java, but also from JavaScript and other languages.
I would guess that extracting a JVM-only client would not be a lot of work for you. A multiplatform client might be a bit more challenging, but since I have some limited experience with that, I could offer my help.
The text was updated successfully, but these errors were encountered: