Skip to content
Snippets Groups Projects

Ms new wallet methods

Closed Marcin Sobczyk requested to merge ms-new-wallet-methods into develop
Files
3
@@ -13,3 +13,31 @@ class AccountHistoryApi(ApiBase):
'only_virtual': only_virtual,
}
)
def enum_virtual_ops(self, block_range_begin, block_range_end, include_reversible=False):
return self._send(
'enum_virtual_ops',
{
'block_range_begin': block_range_begin,
'block_range_end': block_range_end,
'include_reversible': include_reversible
}
)
def count_ops_by_type(self, op_type, start, limit=50):
"""
:param op_type: type of operation (ex. 'producer_reward_operation')
:param start: start queries with this block number
:param limit: limit queries until start-limit+1
"""
count = {}
method = 'account_history_api.get_ops_in_block'
for i in range(start, start-limit, -1):
response = self.get_ops_in_block(i, False)
ops = response["result"]["ops"]
count[i] = 0
for op in ops:
this_op_type = op["op"]["type"]
if this_op_type == op_type:
count[i] += 1
return count
Loading