Comments (15)
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.
I am also encountering the 422 error. It began happening approximately 2 weeks ago; no code was changed on my end.
from poloniex.
from poloniex.
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.
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.
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.
>>> from decimal import Decimal
>>> print(Decimal("0.001"))
0.001
>>>
from poloniex.
from poloniex.
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.
with 0.0.17
poland.buy(currencyPair=defaultCurrencyPair,rate="0,000001",amount="0,000001")
poloniex.exceptions.PoloniexCommandException: Invalid rate parameter.
from poloniex.
Perfect, as I expected.
Basically "0,000001" is not a valid input "0.000001" is
from poloniex.
It makes sense:
poland.buy(currencyPair=defaultCurrencyPair,rate="0.000001",amount="0.000001")
poloniex.exceptions.PoloniexCommandException: Total must be at least 1.
from poloniex.
Do you still have the problem with Decimal
?
from poloniex.
It does not matter, I tried decimal just as a work around.
from poloniex.
from poloniex.
Related Issues (17)
- Str Encoding Error on Python 2.7.13 HOT 1
- "I am not a robot" Captcha failure HOT 2
- No module named 'poloniex' HOT 5
- Active thread HOT 1
- Semaphore never releases when returnTicker() is called by a daemon thread HOT 7
- Connection Timeout HOT 4
- Internal error. Please try again HOT 4
- expected bytes or bytearray, but got str HOT 5
- Error with nonce on private method even with regenerated API key HOT 2
- Issue with Private Calls HOT 1
- New Poloniex API
- returnBalances triggers PoloniexError: Invalid json response returned
- returnTradeHistoryPublic does NOT work. HOT 2
- A simple trading tool using your library. HOT 1
- Package poloniex 0.0.10 is broken HOT 1
- polo.returnTicker() execturion shows JSONDecodeError HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poloniex.