Git Product home page Git Product logo

Comments (5)

mshark5 avatar mshark5 commented on May 29, 2024 1

I forgot to add this email from kraken support. I guess they recently updated the add orders endpoint? I don't really know.

Delilah K. (Kraken Support)Sep 8, 2021, 23:15 PDTHello ,Thank you for stressing your use of the krakenex wrapper. It turns out there have been multiple reports from clients regarding this wrapper specifically. The code perhaps should be updated to reflect recent changes made to our REST API endpoints, specifically the AddOrders endpoint. And since this is a third party resource, we are unable to assist with the modifications to that code base in particular as that would be the responsibility of the repo owner.

(formatting edited by @veox)

from python3-krakenex.

mshark5 avatar mshark5 commented on May 29, 2024 1

Thank you so much for your help I ended up figuring it out.

For the last 6 months I had my API key and Secret listed in the kraken.key.py as strings:

"keykeykeykeykeykeykeykey"
"secretsecretsecretsecret"

But I guess after the recent update to the add orders endpoint I can't have them as strings. It just has to be:

keykeykeykeykey
secretsecretsecretsecret

Sorry for wasting you time, as I see the example has it listed this way without strings. I guess when I first started building my program I programmed it with strings and it worked perfectly until a recent update.

from python3-krakenex.

veox avatar veox commented on May 29, 2024

Search shows something similar in issue #124, and the best explanation then was this:

As to the nature of the rather-misleading error...

{
  "error": [
    "EAPI:Invalid key"
  ]
}

This is probably because the nested data (dict-in-a-dict) is mangled beyond recognition during serialisation. The server then can't even decode the message.

Which could indeed be explained by "recent changes to REST API endpoints"...


... Except that I've just tried your code near-verbatim (replaced KEEPUSD with KEEPEUR, and USD2 = 10), and it worked fine. :/

% ipython
Python 3.9.6 (default, Jun 30 2021, 10:22:16)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.19.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: # code sample
   ...: import krakenex
   ...: import math
   ...: import time
   ...:
   ...:
   ...: def round_down(n, decimals=8):
   ...:     multiplier = 10 ** decimals
   ...:     return math.floor(n * multiplier) / multiplier
   ...:
   ...: k = krakenex.API()
   ...: k.load_key('kraken-trade.key')
   ...: quote_symbol = 'KEEPEUR'
   ...: symbol = 'KEEPEUR'
   ...: round_price = 5
   ...: quote = k.query_public('Ticker', {'pair': quote_symbol})
   ...: USD2 = 10
   ...: bp = round(float(str(quote["result"][symbol]["b"][0])), round_price)
   ...: bv = round_down(USD2 / bp)
   ...: b1 = k.query_private('AddOrder',
   ...:                          {'pair': quote_symbol, 'type': 'buy', 'ordertype': 'limit', 'leverage': 'none', 'volum
   ...: e':
   ...:                              bv, 'price': bp, 'expiretm': '+10'})
   ...: print(b1)
{'error': [], 'result': {'txid': ['OORDER-ORDER-ORDERO'], 'descr': {'order': 'buy 28.18966003 KEEPEUR @ limit 0.35474'}}}

In [2]: krakenex.version.__version__
Out[2]: '2.1.0'

In [3]:

I've tried disabling the "Create & Modify Orders" permission on the key, but then the error is different:

{'error': ['EGeneral:Permission denied']}

BTW, I had to force-reload Kraken's key permission editing page (CTRL+r or the like), because it kept showing the same settings after being edited.


Anyway, I can't reproduce the error.

  • Are you sure the key/secret are copied over correctly? EDIT: And that the key has not expired?
  • Is the error produced with the exact code that you've shown?

from python3-krakenex.

veox avatar veox commented on May 29, 2024

BTW, you may also want to look through

https://github.com/veox/python3-krakenex/issues?q=EAPI%3AInvalid+key

from python3-krakenex.

veox avatar veox commented on May 29, 2024

As I understand, you now have several key files to work with.

You could try setting the key/secret values manually in the script for testing purposes. Like:

k.key = 'KEY-STRING'
k.secret = 'SECRET-STRING'

If that works, then it's something with formatting in kraken.key.py.

from python3-krakenex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.