BitShares Forum

Main => Technical Support => Topic started by: DarkDog on November 20, 2015, 07:24:09 am

Title: Api question (get_account_history)
Post by: DarkDog on November 20, 2015, 07:24:09 am
I have few questions about "get_account_history" - method

early "wallet_account_transaction_history"
wallet_account_transaction_history( const string& account_name,
                                                                                    const string& asset_symbol,
                                                                                    int32_t limit,
                                                                                    uint32_t start_block_num,
                                                                                    uint32_t end_block_num )const

now wallet_api::get_account_history(string name, int limit)const
max limit 100.

How can I get more records?
And use specific criteria to filter?


Title: Re: Api question (get_account_history)
Post by: roadscape on November 20, 2015, 05:19:27 pm
I believe to get more than 100 records you need to follow a linked list..

Code: [Select]
get_account openledger
  "statistics": "2.6.96393",
  [...]

get_object 2.6.96393
[{
    "most_recent_op": "2.9.258652",
    [...]

get_object 2.9.258652
[{
    "id": "2.9.258652",
    "operation_id": "1.11.248779",  <-- here's the op record
    "next": "2.9.209383" <-- here's the next node to check
}]

get_object 2.9.209383
[etc]

Filtering needs to be done separately
Title: Re: Api question (get_account_history)
Post by: DarkDog on November 22, 2015, 10:21:40 am
well, it works.
There is only one problem, how to get the decrypted memo?
Title: Re: Api question (get_account_history)
Post by: xeroc on November 22, 2015, 11:30:20 am
well, it works.
There is only one problem, how to get the decrypted memo?
There is a python library for it:
https://github.com/xeroc/python-graphenelib/blob/master/scripts/monitor-deposits/monitor.py#L50-L56

There is also a Javascript library in bitshares-2-ui/dl somewhere that works like this
https://github.com/xeroc/node-graphene-monitor/blob/master/monitor.js#L70-L80
Title: Re: Api question (get_account_history)
Post by: DarkDog on November 22, 2015, 11:52:21 am
well, it works.
There is only one problem, how to get the decrypted memo?
There is a python library for it:
https://github.com/xeroc/python-graphenelib/blob/master/scripts/monitor-deposits/monitor.py#L50-L56

There is also a Javascript library in bitshares-2-ui/dl somewhere that works like this
https://github.com/xeroc/node-graphene-monitor/blob/master/monitor.js#L70-L80

Thank you, I think there is a way easier.
I'll try to implement in C #.
Title: Re: Api question (get_account_history)
Post by: DarkDog on November 23, 2015, 09:51:09 am
It did not happen to realize the decoding in C #.

temp solution, add method to wallet_api

string wallet_api::get_memo(operation_history_id_type operation_id)const
{      
   auto obj = my->_remote_db->get_objects({ operation_id }).front();
   auto t = obj.template as<operation_history_object>();
   std::stringstream ss;
   auto memo = t.op.visit(detail::operation_printer(ss, *my, t.result));
   return memo;
}


Title: Re: Api question (get_account_history)
Post by: xeroc on November 23, 2015, 10:23:11 am
I'd recommend to put this into the code directly and do a pull request via github .. otherwise devs won't see your patch
use this repo

https://github.com/cryptonomex/graphene
Title: Re: Api question (get_account_history)
Post by: monsterer on November 23, 2015, 10:26:15 am
It did not happen to realize the decoding in C #.

It's a real PITA to get this working. Your solution is probably best - make a pull request and get it added as a real API call :)
Title: Re: Api question (get_account_history)
Post by: testz on November 23, 2015, 10:43:30 am
It did not happen to realize the decoding in C #.

It's a real PITA to get this working. Your solution is probably best - make a pull request and get it added as a real API call :)

As I know metaexchange also written in C# (https://github.com/wildbunny/metaexchange)
Can you share with community new BitShares 2.0 C# library which you made for metaexchange (https://github.com/wildbunny/metaexchange/tree/master/BitsharesRpc)?
Title: Re: Api question (get_account_history)
Post by: monsterer on November 26, 2015, 09:34:26 am
I will try and make this happen :)
Title: Re: Api question (get_account_history)
Post by: testz on November 26, 2015, 02:17:50 pm
I will try and make this happen :)

Thanks in advance.  +5%  :)
Easy integration of BitShares ecosystem with C# applications can bring us additional value.
Title: Re: Api question (get_account_history)
Post by: monsterer on November 27, 2015, 10:25:19 am
I will try and make this happen :)

Thanks in advance.  +5%  :)
Easy integration of BitShares ecosystem with C# applications can bring us additional value.

https://github.com/wildbunny/c-graphene-api

You're welcome :)
Title: Re: Api question (get_account_history)
Post by: testz on November 27, 2015, 10:26:54 am
I will try and make this happen :)

Thanks in advance.  +5%  :)
Easy integration of BitShares ecosystem with C# applications can bring us additional value.

https://github.com/wildbunny/c-graphene-api

You're welcome :)

Thanks a lot!!!  +5% +5% +5%
Title: Re: Api question (get_account_history)
Post by: xeroc on November 27, 2015, 11:03:31 am
I will try and make this happen :)

Thanks in advance.  +5%  :)
Easy integration of BitShares ecosystem with C# applications can bring us additional value.

https://github.com/wildbunny/c-graphene-api

You're welcome :)
Not that I know how to code C# .. but thanks!! +5%!