def wasp(): """Go down the list of Steem Engine tokens and transfer full balance to destination""" send_to = input("Enter destination: ") active_wif = getpass(prompt="Active key: ") steem = Steem(keys=[active_wif], nodes="https://api.steemit.com") w = Wallet(steem_instance=steem) t = Tokens() usr = w.getAccountFromPrivateKey(active_wif) sew = seWallet(account=usr, steem_instance=steem) tokens = sew.get_balances() for token in tokens: symbol = token["symbol"] info = t.get_token(symbol) p = info["precision"] b = float(token["balance"]) balance = float(f"{b:.{p}f}") if balance > 0: print(f"[ Transfering {balance} of {symbol} to {send_to} ]") # pprint(sew.transfer(send_to, balance, symbol, memo="waspsting.py transfer") sew.transfer(send_to, balance, symbol, memo="waspsting.py transfer") time.sleep(1) return None
def claim_it(chain, mana): """Very simple Utility to claim HIVE and/or STEEM account tokens""" api = {"steem": "https://api.steemit.com", "hive": "https://api.hive.blog"} wif = click.prompt("Enter private key", confirmation_prompt=False, hide_input=True) for network in chain: steem = Steem(node=api[network], keys=wif) set_shared_steem_instance(steem) wallet = Wallet(shared_steem_instance()) steemid = wallet.getAccountFromPrivateKey(wif) account = Account(steemid, steem_instance=shared_steem_instance()) mana_old = account.get_rc_manabar() mana_human_readable = mana_old["current_mana"] / 1e9 tries = 2 for i in range(tries): try: if mana_human_readable > mana: click.echo(f"[Mana on {network} Before: %f RC]" % (mana_old["current_mana"] / 1e9)) tx = steem.claim_account(creator=steemid, fee=None) pprint(tx) time.sleep(5) mana_new = account.get_rc_manabar() click.echo(f"[Mana on {network} After: %f RC]" % (mana_new["current_mana"] / 1e9)) rc_costs = mana_old["current_mana"] - mana_new[ "current_mana"] click.echo("[Mana cost: %f RC]" % (rc_costs / 1e9)) else: click.echo( f"[Skipping claim account: current mana of %f lower than the set limit of %f on {network}]" % (mana_human_readable, mana)) time.sleep(5) except Exception as e: click.echo('[Error:', e, ' - Trying Again]') time.sleep(2) if i < tries: continue else: click.echo('[Failed to claim]') else: break
def wasp(): """ Go down the list of Steem Engine tokens and transfer full balance to destination""" send_to = input('Enter destination: ') active_wif = input('Enter your Active Key: ') steem = Steem(keys=[active_wif], nodes='https://api.steemit.com') w = Wallet(steem_instance=steem) t = Tokens() usr = w.getAccountFromPrivateKey(active_wif) sew = seWallet(account=usr, steem_instance=steem) tokens = sew.get_balances() for token in tokens: symbol = token['symbol'] info = t.get_token(symbol) p = info['precision'] b = float(token['balance']) balance = float(f'{b:.{p}f}') if balance > 0: print(f'[ Transfering {balance} of {symbol} to {send_to} ]') #pprint(sew.transfer(send_to, balance, symbol, memo="waspsting.py transfer") sew.transfer(send_to, balance, symbol, memo="waspsting.py transfer") time.sleep(1) return None
#!/usr/bin/env python3 import getpass from pprint import pprint from beem import Steem from beem.account import Account from beem.wallet import Wallet active_wif = getpass.getpass(prompt='Active key: ') hv = Steem(node="http://anyx.io", keys=[active_wif]) w = Wallet(steem_instance=hv) usr = w.getAccountFromPrivateKey(active_wif) a = Account(usr, steem_instance=hv) deleg = a.get_vesting_delegations() for x in deleg: delegatee = x['delegatee'] print(f'[Dropping delegation to {delegatee} to 0]') pprint(a.delegate_vesting_shares(delegatee, 0))
from pprint import pprint import requests from beem.steem import Steem from beem.wallet import Wallet from pandas import read_csv from sqlalchemy import create_engine logging.basicConfig(level=logging.INFO, format="%(asctime)s %(message)s", datefmt="%m/%d/%Y %I:%M:%S %p") wif = os.environ["STEEM_WIF"] stm = Steem(node="https://api.steemit.com", keys=wif, nobroadcast=False) w = Wallet(blockchain_instance=stm) author = w.getAccountFromPrivateKey(wif) logging.debug(author) engine = create_engine("sqlite:///covid.db") covid_cvs = requests.get( "https://opendata.ecdc.europa.eu/covid19/casedistribution/csv") yesterday = datetime.now() + timedelta(days=-1) covid_day = yesterday.strftime("%d/%m/%Y") df = read_csv(StringIO(covid_cvs.text)) sql = df.to_sql("Covid", con=engine, if_exists="replace") result = engine.execute(f'SELECT * FROM Covid where dateRep="{covid_day}"') data = result.fetchall() def main(): title = f"European Centre for Disease Prevention and Control Report for Date {covid_day}"