Skip to content

Commit

Permalink
skip_account_check added to transfer to vesting
Browse files Browse the repository at this point in the history
  • Loading branch information
holgern committed Oct 24, 2020
1 parent 3a51a98 commit f1529e7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ About beem
* Node error handling and automatic node switching
* Usage of pycryptodomex instead of the outdated pycrypto
* Complete documentation of beempy and all classes including all functions
* hivesigner/steemconnect integration
* hivesigner integration
* Works on read-only systems
* Own BlockchainObject class with cache
* Contains all broadcast operations
* Estimation of virtual account operation index from date or block number
* the command line tool beempy uses click and has more commands
* SteemNodeRPC can be used to execute even not implemented RPC-Calls
* NodeRPC can be used to execute even not implemented RPC-Calls
* More complete implemention

Installation
Expand Down
25 changes: 17 additions & 8 deletions beem/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -2813,28 +2813,37 @@ def transfer(self, to, amount, asset, memo="", skip_account_check=False, account
})
return self.blockchain.finalizeOp(op, account, "active", **kwargs)

def transfer_to_vesting(self, amount, to=None, account=None, **kwargs):
def transfer_to_vesting(self, amount, to=None, account=None, skip_account_check=False, **kwargs):
""" Vest STEEM
:param float amount: Amount to transfer
:param str to: Recipient (optional) if not set equal to account
:param str account: (optional) the source account for the transfer
if not ``default_account``
:param bool skip_account_check: (optional) When True, the receiver
account name is not checked to speed up sending multiple transfers in a row
"""
if account is None:
account = self
else:
elif not skip_account_check:
account = Account(account, blockchain_instance=self.blockchain)
if to is None:
to = self # powerup on the same account
amount = self._check_amount(amount, self.blockchain.token_symbol)
if to is None and skip_account_check:
to = self["name"] # powerup on the same account
else:
to = self

if not skip_account_check:
to = Account(to, blockchain_instance=self.blockchain)
amount = self._check_amount(amount, self.blockchain.token_symbol)
to = Account(to, blockchain_instance=self.blockchain)
to_name = to["name"]
account_name = account["name"]
else:
to_name = to
account_name = account

op = operations.Transfer_to_vesting(**{
"from": account["name"],
"to": to["name"],
"from": account_name,
"to": to_name,
"amount": amount,
"prefix": self.blockchain.prefix,
"json_str": not bool(self.blockchain.config["use_condenser"]),
Expand Down

0 comments on commit f1529e7

Please sign in to comment.