Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Enhancement request. "getProducts()" function call #260

Closed
tuxitor opened this issue Jun 10, 2017 · 2 comments
Closed

Enhancement request. "getProducts()" function call #260

tuxitor opened this issue Jun 10, 2017 · 2 comments

Comments

@tuxitor
Copy link
Contributor

tuxitor commented Jun 10, 2017

This request is a really too small for a PR.
For proper (early) initiatiation of the websocket functions we need one single parameter passed as an option to the
getProducts function on line 22 of the lib/engine.js file, The parameter is s.product_id

    s.product_id = selector_parts[1]
    s.asset = s.product_id.split('-')[0]
    s.currency = s.product_id.split('-')[1]
    var products = s.exchange.getProducts(s.product_id)
    products.forEach(function (product) {
      if (product.asset === s.asset && product.currency === s.currency) {
        s.product = product
      }
    })

In the future it may prove useful to change the name to exchangeInit(params) and make it a callback for exchange spesific information such as API capabilities. Just a thought.

This change is desparately needed for further work on websockets implementation.
(Even the whole s object could have been passed. In that case it probably wold have been the smallest change ever. LOL)

@DeviaVir
Copy link
Owner

@EigilB I don't understand why this is "too small for a PR", nothing is too small for a PR. Could you send in a PR showcasing what you exactly need? I think that code is easier to reason about than words.

@tuxitor
Copy link
Contributor Author

tuxitor commented Jun 12, 2017

Never mind. The change is not necessary. Instead the needed information (product_id) is now generated from the command line params in "argv".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants