Author Topic: Calling 'get_market_history ()' via the python API  (Read 382 times)

0 Members and 1 Guest are viewing this topic.

Offline FrankBlabu

Calling 'get_market_history ()' via the python API
« on: June 13, 2018, 05:21:54 pm »

I have difficulties calling 'get_market_history ()' via the Python API (pybitshares). If I call this function via cli_wallet (local witness node), it works fine:

Code: [Select]
get_market_history BTS USD 3600 "2017-01-01T00:00:00" "2017-01-02T00:00:00"

If I do the same call via the Python API, it fails:

Code: [Select]
>>> from bitshares.bitshares import BitShares
>>> node = BitShares ('ws://')
>>> node.rpc.get_market_history ('BTS', 'USD', 3600, '2017-01-01T00:00:00' '2017-01-02T00:00:00', api='history')
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/bitsharesapi/", line 54, in rpcexec
    return self.rpc.rpcexec(self, payload)
  File "/usr/local/lib/python3.6/dist-packages/grapheneapi/", line 174, in rpcexec
    raise RPCError(ret['error']['message'])
grapheneapi.exceptions.RPCError: Assert Exception: first_dot != second_dot:

What could I do wrong here ?

Thank you in advance !

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3570
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: Calling 'get_market_history ()' via the python API
« Reply #1 on: June 13, 2018, 10:27:22 pm »
Currently that API only accepts asset ID's but not asset symbols. cli_wallet converts symbols to IDs, but the history API doesn't, nor does the python lib.

Created issue here:
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline FrankBlabu

Re: Calling 'get_market_history ()' via the python API
« Reply #2 on: June 14, 2018, 12:03:03 pm »
That's the explanation. Thank you !