Beem update: Change recovery account, list recovery account change requests and full delegation listings

9개월 전


Image: @creativista

Repository

https://github.com/holgern/beem

Beem, the python library for Steem by @holger80, has been extended by methods to change the recovery account, list pending recovery account changes, and the option to list all outgoing delegations also for accounts with many delegations like @steem.

New: Change recovery account

PR #130 / Commit c2109e2.
Each Steem account has a recovery partner that can recover the account with a recent owner key in case the password or key got leaked and changed. You can see the recovery partner for example on steemd.com in the left column:

rec_account_steemd.png

The default recovery partner of each account is typically its creator, but the recovery account can also be changed. Support to change the recovery account has been added to beem's Account class now:

[...]
acc = Account("accountname")
acc.change_recovery_account("new_recovery_partner")
[...]

Note that a request to change the recovery account takes 30 days until the changes are active. Another request within this time restarts the 30 day period. Setting the current recovery account again cancels any pending change request.

New: List pending recovery account change requests

PR #130 / Commit 83381b.
Steem keeps track of all pending recovery account change requests to apply the changes 30 days after the requests were submitted. There are two Steem API methods that allow listing pending change requests, one for all open requests of any account and one for one or more specific accounts. These methods were integrated into beem and are available now in the Blockchain class:

  • List all open requests: Up to 1000 requests can be retrieved per call, follow-up requets can be constructed by setting the start parameter.
>>> from beem.blockchain import Blockchain
>>> blockchain = Blockchain()
>>> blockchain.list_change_recovery_account_requests()
[{'id': 511, 'account_to_recover': 'bott',
  'recovery_account': 'bott', 'effective_on':
  '2018-12-18T01:46:24'}, ...]
  • List open requests of one or more specific accounts:
>>> from beem.blockchain import Blockchain
>>> blockchain = Blockchain()
>>> blockchain.find_change_recovery_account_requests('bott')
 [{'id': 511, 'account_to_recover': 'bott',
  'recovery_account': 'bott', 'effective_on':
  '2018-12-18T01:46:24'}

Improvement: List all outpoing delegations

PR #129.
The Account.get_vesting_delegations() method existed before and could be used with pre-appbase nodes to list all outgoing delegations of an account. With the switch to appbase, the internal API call used in this function was find_vesting_delegations. This method can provide up to 1000 entries, but not more. While this is sufficient for most accounts, this may not be enough for accounts like @steem with way more than 1000 outgoing delegations. By switching the internal API call to list_vesting_delegations and a few adjustments on the result handling, all delegations of an account can be fetched with beem now. Here's an example to get all (close to 1M!) outgoing delegations of @steem:

from beem.account import Account
results = limit = 1000
last_delegatee = None
acc = Account("steem")
while results == limit:
    delegs = acc.get_vesting_delegations(last_delegatee, limit)
    results = len(delegs)
    for deleg in delegs
        last_delegatee = deleg['delegatee']
        print(deleg)

Fix: Testnet/3rd-party chain compatibility

PR #127
The following fixes improve the compatibility of beem with the testnet where the asset symbols are different to STEEM, SBD and VESTS, and with 3rd-party chains or Steem forks:

  • missing steem_instance in Amount() call within steem.sbd_to_rhares() led to AssetDoesNotExistsException on 3rd-party chains
  • restructuring steem.sbd_to_rshares() to avoid redundant function calls and
    streamline the calculations
  • replacing hard-coded symbols with the generic symbol names in Account()

GitHub Account

https://github.com/crokkon

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
STEEMKR.COM IS SPONSORED BY
ADVERTISEMENT
Sort Order:  trending
  • Great job on make it easier to change the recovery partner. A cool feature of STEEM. This will help adoption in the long term.
  • I was searching why this needed to be an int, when I realised it should return rshares.

    Perhaps this would be clearer:
rshares = sbd.amount / self.get_sbd_per_rshares(use_stored_data=use_stored_data
return int(rshares)

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

·

Thanks for the review, @helo! I see your point on the int, that's indeed not obvious at this point - thanks for the remark!

·

Thank you for your review, @helo! Keep up the good work!

Awesome one!
Glad you're still working on beem, I barely have time for such stuff lately sadly :-(

·

Thanks @flugschwein! I see you're busy with delegation removals lately? ;)

Hi @crokkon!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 4.979 which ranks you at #1117 across all Steem accounts.
Your rank has not changed in the last three days.

In our last Algorithmic Curation Round, consisting of 201 contributions, your post is ranked at #194.

Evaluation of your UA score:
  • Some people are already following you, keep going!
  • The readers appreciate your great work!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server

Hey, @crokkon!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Hi @crokkon, I know you're not the only moderator for analysis. But you're the only one that I've contacted so I leave a comment here. My post https://steemit.com/utopian-io/@blockchainstudio/effect-of-haircut-early-voting-beneficiary-on-dust-payout hasn't been reviewed and now it's almost 4 day old. I even set 5% beneficiary for the first time :) So please you or someone review my post. Thank you.

·

Apologies for the delay! I'm aware and will take care of your post within the next few hours

·
·