Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cryptopia privatePostGetDepositAddress Python 2.7 ccxt 1.9.189 #347

Closed
PhinixPhire opened this issue Oct 19, 2017 · 5 comments
Closed

cryptopia privatePostGetDepositAddress Python 2.7 ccxt 1.9.189 #347

PhinixPhire opened this issue Oct 19, 2017 · 5 comments
Assignees
Labels

Comments

@PhinixPhire
Copy link

PhinixPhire commented Oct 19, 2017

Hey, Igor. I'm going to keep you busy today, okay? In all seriousness, I can't thank you enough for your work. I'm not sure how to fix this one... I've been fiddling around with the exchanges.py to see if I can trace the issue, but I'm getting lost.

This is my code:

cryptopia = ccxt.cryptopia({[you know how it goes]})
address_pair = cryptopia.privatePostGetDepositAddress(params={'Currency' : 'XMR'}).get('Data')
print address_pair
try:
    address_pair = (address_pair['BaseAddress'], address_pair['Address']) 
except:
    address_pair = (address_pair['Address']) 
print address_pair

This is the result:

Traceback (most recent call last):
  File "C:\Users\Kenneth\eclipse-workspace\Chank\CCXTtests.py", line 309, in <module>
    address_pair = cryptopia.privatePostGetDepositAddress(params={'Currency' : 'XMR'}).get('Data')
  File "C:\Python27\lib\site-packages\ccxt\exchanges.py", line 11070, in request
    response = self.fetch2(path, api, method, params, headers, body)
  File "C:\Python27\lib\site-packages\ccxt\exchange.py", line 238, in fetch2
    return self.fetch(request['url'], request['method'], request['headers'], request['body'])
  File "C:\Python27\lib\site-packages\ccxt\exchange.py", line 292, in fetch
    return self.handle_rest_response(decoded_text, url, method, headers, body)
  File "C:\Python27\lib\site-packages\ccxt\exchange.py", line 348, in handle_rest_response
    raise ExchangeError(' '.join([self.id, method, url, response, str(e)]))
ccxt.errors.ExchangeError: <exception str() failed>

I'm at a loss as to the cause. Let me know if you need verbose output.

Thanks so much!

@PhinixPhire PhinixPhire changed the title cryptopia cryptopia privatePostGetDepositAddress Python 2.7 ccxt 1.9.189 Oct 19, 2017
@kroitor kroitor self-assigned this Oct 19, 2017
@kroitor
Copy link
Member

kroitor commented Oct 19, 2017

Let me know if you need verbose output.

Yep, I think I do.

Let' try this:

cryptopia = ccxt.cryptopia({
    [you know how it goes],
    'verbose': True,
})
print(cryptopia.privatePostGetDepositAddress({'Currency': 'XMR'}))

@PhinixPhire
Copy link
Author

Okay, I got it... the method did not like the way I was stacking the dictionary keys, I guess. Once I formatted it like this, all is well:

Data = cryptopia.privatePostGetDepositAddress({'Currency' : 'BTC'}).get('Data')
if Data['BaseAddress']:
    print(Data['BaseAddress'], Data['Address'])
else:
    print(Data['Address'], '')

It facilitates both non-paymentid/memo addresses as well as those including the field.

Thanks for your quidance, again.

@kroitor
Copy link
Member

kroitor commented Oct 19, 2017

@PhinixPhire it accepts positional args ({}), just one argument without a name, not keyword args aka kwargs as in (params={}). Python is syntactically-sensitive to that, as it turned out. Cheers!

@kroitor kroitor closed this as completed Oct 19, 2017
kroitor added a commit that referenced this issue Oct 19, 2017
@kroitor
Copy link
Member

kroitor commented Oct 19, 2017

I added a unified deposit method to Cryptopia, in case you need it further ;) Should be available as of next version.

@PhinixPhire
Copy link
Author

Nice! Cryptopia looks like an awesome exchange. I just discovered it yesterday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants