Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

npm kraken-exchange module #29

Open
Kaexburli opened this issue Feb 15, 2021 · 3 comments
Open

npm kraken-exchange module #29

Kaexburli opened this issue Feb 15, 2021 · 3 comments
Labels

Comments

@Kaexburli
Copy link

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 CliffS self-assigned this Feb 15, 2021
@CliffS
Copy link
Collaborator

CliffS commented Feb 15, 2021

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
Copy link
Author

Kaexburli commented Feb 15, 2021

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
Copy link
Collaborator

CliffS commented Feb 15, 2021

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.

@CliffS CliffS removed their assignment Mar 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant