Giter VIP home page Giter VIP logo

Comments (15)

enricobacis avatar enricobacis commented on June 7, 2024

Does it happen even without Decimal? Can you try to cast your decimal to something else like a string before passing it to the api?

from poloniex.

timoballard avatar timoballard commented on June 7, 2024

I am also encountering the 422 error. It began happening approximately 2 weeks ago; no code was changed on my end.

from poloniex.

enricobacis avatar enricobacis commented on June 7, 2024

from poloniex.

timoballard avatar timoballard commented on June 7, 2024

I use the same API key with cointracking.info and everything seems to work fine there. I'm guessing that something recently changed on the Poloniex side that is causing problems with your client. I get the same error with version 0.0.13 and 0.0.15

from poloniex.

paolinux79 avatar paolinux79 commented on June 7, 2024

I tried using str() float() unicode() and i get always the 422.
If i try with integer .buy(currencyPair=defaultCurrencyPair,rate=1,amount=1) i obviously get a "not enough" message!

from poloniex.

enricobacis avatar enricobacis commented on June 7, 2024

I might have managed to reproduce this, but I have to check with you.

Could you please try this in your system and send me the output?

print(Decimal("0.001"))

from poloniex.

paolinux79 avatar paolinux79 commented on June 7, 2024
>>> from decimal import Decimal
>>> print(Decimal("0.001"))
0.001
>>> 

from poloniex.

enricobacis avatar enricobacis commented on June 7, 2024

from poloniex.

enricobacis avatar enricobacis commented on June 7, 2024

Ok, I've debugged a bit more and discovered that Poloniex changed the way to return error messages:

Before

status code: 200
body: {"error": "........."}

Now

status code: 422
body: {"error": "........."}

So now the error message from requests was shadowing the real error message. In version 0.0.17 this is fixed. Can you try with version 0.0.17 and post the exception that you get?

from poloniex.

paolinux79 avatar paolinux79 commented on June 7, 2024

with 0.0.17

poland.buy(currencyPair=defaultCurrencyPair,rate="0,000001",amount="0,000001")

poloniex.exceptions.PoloniexCommandException: Invalid rate parameter.

from poloniex.

enricobacis avatar enricobacis commented on June 7, 2024

Perfect, as I expected.

Basically "0,000001" is not a valid input "0.000001" is

from poloniex.

paolinux79 avatar paolinux79 commented on June 7, 2024

It makes sense:

poland.buy(currencyPair=defaultCurrencyPair,rate="0.000001",amount="0.000001")

poloniex.exceptions.PoloniexCommandException: Total must be at least 1.

from poloniex.

enricobacis avatar enricobacis commented on June 7, 2024

Do you still have the problem with Decimal?

from poloniex.

paolinux79 avatar paolinux79 commented on June 7, 2024

It does not matter, I tried decimal just as a work around.

from poloniex.

enricobacis avatar enricobacis commented on June 7, 2024

from poloniex.

Related Issues (17)

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.