Author Topic: [API] get_account_history, only stop parameter appears to affect output  (Read 3926 times)

0 Members and 1 Guest are viewing this topic.

Offline bytemaster

This issue has been fixed and the next release should have this API as well as a new, more friendly API. 
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
We have someone testing/documenting this API as well as working on a new API that is easier.   
Thanks .. that sounds great.

But by now I am fairly sure that there is a bug in the call's implementation. Try to get all transactions from an account that has more than 100 or 200 transactions .. you will see

You also made me curious who there is that is testing and documenting the API?

Offline bytemaster

We have someone testing/documenting this API as well as working on a new API that is easier.   
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc

Offline monsterer

Ok, finally figured out the parameters are not local indices on the account you specify, but global operation indices. However, I'm still seeing odd results:

Code: [Select]
{"id":4,"method":"call","params":[2,"get_account_history",["1.2.29495","1.11.88751",10,"1.11.96290"]]}

leads to returning op ids 88893, 88846 and 88845, but this following call, which has been tuned to return only those results by exact index range:

Code: [Select]
{"id":4,"method":"call","params":[2,"get_account_history",["1.2.29495","1.11.88845",10,"1.11.88893"]]}

leads to nothing being returned at all?
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline monsterer

The call returns ops for the given account such that

    stop < op.id <= start

except when start is 0, in which case it returns them all.  So by using operation 1, you will get no results unless the account you are querying is the account which performed operation 1.

Our API definitely has some rough edges.

Ok, so start and stop are backwards?

edit: flipping them seems to result in 0 every time...
« Last Edit: October 23, 2015, 03:25:50 pm by monsterer »
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline theoretical

So, why if I start from operation 0 do I get results, but if I start from operation 1 I get no results?

The call returns ops for the given account such that

    stop < op.id <= start

except when start is 0, in which case it returns them all.  So by using operation 1, you will get no results unless the account you are querying is the account which performed operation 1.

Our API definitely has some rough edges.
BTS- theoretical / PTS- PZxpdC8RqWsdU3pVJeobZY7JFKVPfNpy5z / BTC- 1NfGejohzoVGffAD1CnCRgo9vApjCU2viY / the delegate formerly known as drltc / Nothing said on these forums is intended to be legally binding / All opinions are my own unless otherwise noted / Take action due to my posts at your own risk

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I also noticed that .. and have no answer for you as to the reason for this ..

Offline monsterer

Ok, update: got the permissions set up so I can call the history method on the witness, but I'm getting confusing output:

Code: [Select]
{"id":4,"method":"call","params":[2,"get_account_history",["1.2.29495","1.11.10",20,"1.11.1"]]}

returns 0 results, and

Code: [Select]
{"id":4,"method":"call","params":[2,"get_account_history",["1.2.29495","1.11.10",20,"1.11.0"]]}

returns 20 results

So, why if I start from operation 0 do I get results, but if I start from operation 1 I get no results?
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline monsterer

you can access this only via websocket connection and only after requesting access to the history_api
this will not work with the cli wallet ..

the syntax for the cli wallet is different
it only takes the name and a limit

get_account_history monsterer 10

Oh wow, ok. Thanks for the update.
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
you can access this only via websocket connection and only after requesting access to the history_api
this will not work with the cli wallet ..

the syntax for the cli wallet is different
it only takes the name and a limit

get_account_history monsterer 10

Offline monsterer

My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc

Offline monsterer

Code: [Select]
get_account_history 1.2.29495 1.11.0 100 1.11.0
if you want to truncate to the more recent once you can change the first "1.11.0" into one of the op ids you see in the output"
the max possible number of ops is 100 afaik

Hmm, that results in:

Code: [Select]
4 parse_error_exception: Parse Error
Couldn't parse int64_t
    {}
    th_a  string.cpp:100 to_int64
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Code: [Select]
get_account_history 1.2.29495 1.11.0 100 1.11.0
if you want to truncate to the more recent once you can change the first "1.11.0" into one of the op ids you see in the output"
the max possible number of ops is 100 afaik

Offline monsterer

Calling:

get_account_history monsterer 2 2 1
get_account_history monsterer 2 1 1
get_account_history monsterer 2 1 2

all result in the same data output. Can anyone explain how this is supposed to work?

http://docs.bitshares.eu/api/history.html

Documentation states that stop, limit and start should each affect the data returned, but that doesn't seem to be the case.
« Last Edit: October 22, 2015, 09:06:39 am by monsterer »
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads