Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Fix KrakenFormattedResponse.ticker() #174

Merged
merged 1 commit into from
Mar 23, 2018

Conversation

alexanderkoumis
Copy link

self.method_args[0] refers to a bitex.interface.kraken.Kraken object,
self.method_args[1] refers to the pair symbol. Update index for
accessing pair from 0 to 1.

Without this fix, running the following code:

import bitex
kraken = bitex.Kraken()
ticker_kraken = kraken.ticker(bitex.ETHUSD).ticker()

will result in the following exception:

Traceback (most recent call last):
  File "test.py", line 3, in <module>
    ticker_kraken = kraken.ticker(bitex.ETHUSD).ticker()
  File "/usr/local/lib/python3.6/site-packages/bitex/formatters/kraken.py", line 20, in ticker
    data = self.json(parse_int=str, parse_float=str)['result'][pair]
KeyError: <bitex.interface.kraken.Kraken object at 0x108d7c4a8>

self.method_args[0] refers to a bitex.interface.kraken.Kraken object,
self.method_args[1] refers to the pair symbol. Update index for
accessing pair from 0 to 1.
@deepbrook deepbrook merged commit 6e3bae8 into Crypto-toolbox:dev Mar 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants