python-bittrex missing positional arguments

0 votes

I am trying to make a buy limit purchase via the bittrex api and I am getting an error that my arguments are in the wrong place.

from bittrex.bittrex import API_V2_0, Bittrex
import json

my_bittrex = Bittrex("zzzzz", "zzzzz", api_version=API_V2_0)

trade = 'BTC'
currency = 'TRX'
market = '{0}-{1}'.format(trade, currency)


b = (my_bittrex.buy_limit({market, 100, float(0.00005550)}))

error:

Traceback (most recent call last):
  File "bittrex/apitest.py", line 17, in <module>
    b = (my_bittrex.buy_limit({market, 100, float(0.00005550)}))
TypeError: buy_limit() missing 2 required positional arguments: 'quantity' and 'rate'

How do I properly position my arguments for bittrex?

Sep 6, 2018 in Blockchain by digger
• 26,740 points
456 views

1 answer to this question.

0 votes

Looking at the source code from ericsomdahl/python-bittrex

For the buy_limit function it looks like you are passing values to the function incorrectly. You shouldn't be passing a dictionary, instead it should look something like this:

b = my_bittrex.buy_limit(market=market, quantity=100, rate=float(0.00005550))

Or this

params = {'market': market, 'quantity': 100, 'rate': float(0.00005550)}
b = my_bittrex.buy_limit(**params)

For the trade_buy method you can pass parameters in a similar way:

b = my_bittrex.trade_buy(
    market=market, 
    quantity=100, 
    rate=float(0.00005550))
answered Sep 6, 2018 by slayer
• 29,350 points

Related Questions In Blockchain

+1 vote
1 answer
0 votes
1 answer

Error: t: Instance org.acme.seller.Car#HW7722 missing required field oldOwner

This error occurs if you have added a ...READ MORE

answered Jun 21, 2018 in Blockchain by Christine
• 15,790 points

edited Jun 21, 2018 by Christine 1,186 views
0 votes
1 answer

Error while trying to create dir if missing: mkdir /var/hyperledger: permission denied

The following commands should help: sudo mkdir -p ...READ MORE

answered Jul 6, 2018 in Blockchain by Christine
• 15,790 points
1,558 views
0 votes
1 answer

Blockchain Python Syntax Error

Look here:  print('Block #{} has been added to ...READ MORE

answered Jul 13, 2018 in Blockchain by Christine
• 15,790 points
704 views
0 votes
1 answer

Python request module for bitcoin json rpc

This should work: #!/usr/bin/env python import getpass import json import requests ...READ MORE

answered Aug 28, 2018 in Blockchain by digger
• 26,740 points
2,172 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,663 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 26,740 points
43,808 views
0 votes
1 answer
+2 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP