Skip to content

Commit

Permalink
Implement ticker API
Browse files Browse the repository at this point in the history
  • Loading branch information
suminb committed May 31, 2020
1 parent 9f99efd commit 54041df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions korbit/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ def get_orderbook(order_type=None):
return orderbook


def get_ticker(currency_pair='btc_krw'):
return get('ticker', currency_pair=currency_pair)


def get_detailed_ticker():
"""
Fields:
Expand Down
7 changes: 7 additions & 0 deletions tests/basic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ def test_get_orderbook_by_type():
assert isinstance(orderbook_asks, Iterable)


@pytest.mark.parametrize('currency_pair', ['btc_krw', 'eth_krw'])
def test_ticker(currency_pair):
ticker = get_ticker(currency_pair)
assert 'timestamp' in ticker
assert 'last' in ticker


def test_get_transactions():
transactions = get_transactions()
assert type(transactions) == list
Expand Down

0 comments on commit 54041df

Please sign in to comment.