{"action":"created","issue":{"url":"https://api.github.com/repos/Aula13/poloniex/issues/16","repository_url":"https://api.github.com/repos/Aula13/poloniex","labels_url":"https://api.github.com/repos/Aula13/poloniex/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/Aula13/poloniex/issues/16/comments","events_url":"https://api.github.com/repos/Aula13/poloniex/issues/16/events","html_url":"https://github.com/Aula13/poloniex/issues/16","id":302659111,"number":16,"title":"BUY/SELL: 422 Client Error:  for url: https://poloniex.com/tradingApi","user":{"login":"paolinux79","id":2234329,"avatar_url":"https://avatars3.githubusercontent.com/u/2234329?v=4","gravatar_id":"","url":"https://api.github.com/users/paolinux79","html_url":"https://github.com/paolinux79","followers_url":"https://api.github.com/users/paolinux79/followers","following_url":"https://api.github.com/users/paolinux79/following{/other_user}","gists_url":"https://api.github.com/users/paolinux79/gists{/gist_id}","starred_url":"https://api.github.com/users/paolinux79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paolinux79/subscriptions","organizations_url":"https://api.github.com/users/paolinux79/orgs","repos_url":"https://api.github.com/users/paolinux79/repos","events_url":"https://api.github.com/users/paolinux79/events{/privacy}","received_events_url":"https://api.github.com/users/paolinux79/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-06T11:12:16Z","updated_at":"2018-03-06T17:15:58Z","closed_at":null,"author_association":"NONE","body":"I am trying to place a boy or sell order but i get the exception: requests.exceptions.HTTPError: 422 Client Error:  for url: https://poloniex.com/tradingApi\r\nHere is a code snippet:\r\n\r\n```\r\ndefaultCurrencyPair = 'USDT_BTC'\r\n\r\ndef make_satoshi(num):\r\n    return decimal.Decimal(num).quantize(decimal.Decimal('1.00000000'))\r\n\r\ndef test():\r\n    available_usd = polo.returnBalances()['USDT']\r\n    print(available_usd)\r\n    print(make_satoshi(available_usd))\r\n    print(make_satoshi(1))\r\n    polo.buy(currencyPair=defaultCurrencyPair,rate=make_satoshi(1),amount=make_satoshi(available_usd))\r\n```"},"comment":{"url":"https://api.github.com/repos/Aula13/poloniex/issues/comments/370856926","html_url":"https://github.com/Aula13/poloniex/issues/16#issuecomment-370856926","issue_url":"https://api.github.com/repos/Aula13/poloniex/issues/16","id":370856926,"user":{"login":"enricobacis","id":1180682,"avatar_url":"https://avatars2.githubusercontent.com/u/1180682?v=4","gravatar_id":"","url":"https://api.github.com/users/enricobacis","html_url":"https://github.com/enricobacis","followers_url":"https://api.github.com/users/enricobacis/followers","following_url":"https://api.github.com/users/enricobacis/following{/other_user}","gists_url":"https://api.github.com/users/enricobacis/gists{/gist_id}","starred_url":"https://api.github.com/users/enricobacis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enricobacis/subscriptions","organizations_url":"https://api.github.com/users/enricobacis/orgs","repos_url":"https://api.github.com/users/enricobacis/repos","events_url":"https://api.github.com/users/enricobacis/events{/privacy}","received_events_url":"https://api.github.com/users/enricobacis/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T17:15:58Z","updated_at":"2018-03-06T17:15:58Z","author_association":"OWNER","body":"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?"}}
{"actor":{"display_login":"enricobacis"}}