beem.snapshot

class beem.snapshot.AccountSnapshot(account, account_history=[], blockchain_instance=None, **kwargs)

Bases: list

This class allows to easily access Account history

Parameters:
  • account_name (str) – Name of the account
  • blockchain_instance (Steem) – Steem instance
build(only_ops=[], exclude_ops=[], enable_rewards=False, enable_out_votes=False, enable_in_votes=False)

Builds the account history based on all account operations

Parameters:
  • only_ops (array) – Limit generator by these operations (optional)
  • exclude_ops (array) – Exclude these operations from generator (optional)
build_curation_arrays(end_date=None, sum_days=7)

Build curation arrays

build_rep_arrays()

Build reputation arrays

build_sp_arrays()

Builds the own_sp and eff_sp array

build_vp_arrays()

Build vote power arrays

get_account_history(start=None, stop=None, use_block_num=True)

Uses account history to fetch all related ops

Parameters:
  • start (int, datetime) – start number/date of transactions to return (optional)
  • stop (int, datetime) – stop number/date of transactions to return (optional)
  • use_block_num (bool) – if true, start and stop are block numbers, otherwise virtual OP count numbers.
get_data(timestamp=None, index=0)

Returns snapshot for given timestamp

get_ops(start=None, stop=None, use_block_num=True, only_ops=[], exclude_ops=[])

Returns ops in the given range

parse_op(op, only_ops=[], enable_rewards=False, enable_out_votes=False, enable_in_votes=False)

Parse account history operation

reset()

Resets the arrays not the stored account history

search(search_str, start=None, stop=None, use_block_num=True)

Returns ops in the given range

update(timestamp, own, delegated_in=None, delegated_out=None, steem=0, sbd=0)

Updates the internal state arrays

Parameters:
  • timestamp (datetime) – datetime of the update
  • own (amount.Amount, float) – vests
  • delegated_in (dict) – Incoming delegation
  • delegated_out (dict) – Outgoing delegation
  • steem (amount.Amount, float) – steem
  • sbd (amount.Amount, float) – sbd
update_in_vote(timestamp, weight, op)
update_out_vote(timestamp, weight)
update_rewards(timestamp, curation_reward, author_vests, author_steem, author_sbd)