CliffS / kraken-exchange

A library to access the Kraken Bitcoin Exchange
GNU General Public License v3.0
11 stars 10 forks source link

npm kraken-exchange module #29

Open Kaexburli opened 3 years ago

Kaexburli commented 3 years ago

hi,

I would like to make some corrections to the npm module but I can't find the branch that forks the project.

I only see the version for coffeScript!

can you tell me where to find the repository for npm?

thank you for your work!

CliffS commented 3 years ago

The coffeescript compiles to javascript which is sent to npm.

You'll need to make the changes in the coffeescript source and compile with npm run build. PRs are very welcome.

Kaexburli commented 3 years ago

I don't know coffescript language.

I am starting to use your module and I have made a small modification to the assetPairs method.

there was a small error in the options that blocked the possibility of requesting only 1 asset

I have also added the possibility to request that the option margin, fees or leverage only

let argsAssetPairs = []; argsAssetPairs[0] = ['BTCUSD']; argsAssetPairs[1] = ['fees'] // or margin or fees;

`

assetPairs(...pairs) {

  var krak, options, pair, info = null;
  options = {};

  if (typeof pairs[0][1] !== 'undefined')
    info = pairs[0][1].toString();

  if (pairs != null) {
    if (Array.isArray(pairs[0][0])) {
      pair = pairs[0][0];
    }

    pair = pair.join(',');
    options.pair = pair;

    if (info !== null)
      options.info = info;
  }
  krak = new KrakenPublic('AssetPairs', options);
  return krak.api().then((response) => {
    return response.result;
  });
}

`

CliffS commented 3 years ago

I'm sorry, I can't make sense of this. If you can't edit the source, please send me the complete modified kraken.js so I can diff it against the compiled code.

Thanks.