Skip to content

Instantly share code, notes, and snippets.

@emre
Created March 2, 2018 07:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emre/1b1d819f8a369fc3b48893432813f207 to your computer and use it in GitHub Desktop.
Save emre/1b1d819f8a369fc3b48893432813f207 to your computer and use it in GitHub Desktop.
account_creator.py
from steem import Steem
from steembase.account import PasswordKey
def create_account(steemd_instance, new_account, new_account_master_key, creator):
steemd_instance.create_account(
new_account,
delegation_fee_steem="1 STEEM",
password=new_account_master_key,
creator=creator,
)
keys = {}
for key_type in ['posting','active','owner','memo']:
private_key = PasswordKey(
new_account, new_account_master_key, key_type).get_private_key()
keys[key_type] = {
"public": str(private_key.pubkey),
"private": str(private_key),
}
return keys
if __name__ == '__main__':
s = Steem(nodes=["https://api.steemit.com"],
keys=["creator_account_active_wif"])
keys = create_account(
s,
"new_account_username",
"new_account_master_key",
"creator_account_username"
)
for key, subkeys in keys.items():
print("Key Type: %s" % key)
print("Public: %s\nPrivate: %s\n--" % (
subkeys["public"], subkeys["private"]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment