pygeek_stellar/cli_session.py
def _init_session_from_new_account():
    """
    Initializes a session from a newly created account. A Stellar keypair is randomly generated.
    :return: Returns the initialized CLI session.
    :rtype: CliSession
    """
    account_name = None
    if yes_or_no_input("Do you want to give a name to the new account to be created?") == USER_INPUT_YES:
        account_name = safe_input("Please insert the account name")

    keypair = Keypair.random()
    address = keypair.address().decode()
    seed = keypair.seed().decode()

    cli_session = CliSession(account_name, address, seed)
    if _config_file_is_to_update():
        if yes_or_no_input("Do you want to save the seed of the new account in the encrypted configuration file") == \
                USER_INPUT_YES:
            cli_session.store_account_in_config_file()
        else:
            seed_file = safe_input("Specify a file to which the seed of the new created account should be saved. "
                                   "Notice that the seed will be saved in plain text on the specified file. "
                                   "Please store it in a safe place. If anyone can reach the seed it can fully "
                                   "control your account")
            write_file(seed_file, seed)
            cli_session.store_account_in_config_file()
    return cli_session

    Initializes a session from a newly created account. A Stellar keypair is randomly generated.
    :return: Returns the initialized CLI session.
    :rtype: CliSession
    
Initializes a session from a newly created account. A Stellar keypair is randomly generated.
Initializes a session from a newly created account . A Stellar keypair is randomly generated .
def _init_session_from_new_account():
    account_name = None
    if yes_or_no_input("Do you want to give a name to the new account to be created?") == USER_INPUT_YES:
        account_name = safe_input("Please insert the account name")
    keypair = Keypair.random()
    address = keypair.address().decode()
    seed = keypair.seed().decode()
    cli_session = CliSession(account_name, address, seed)
    if _config_file_is_to_update():
        if yes_or_no_input("Do you want to save the seed of the new account in the encrypted configuration file") == \
                USER_INPUT_YES:
            cli_session.store_account_in_config_file()
        else:
            seed_file = safe_input("Specify a file to which the seed of the new created account should be saved. "
                                   "Notice that the seed will be saved in plain text on the specified file. "
                                   "Please store it in a safe place. If anyone can reach the seed it can fully "
                                   "control your account")
            write_file(seed_file, seed)
            cli_session.store_account_in_config_file()
    return cli_session
def _init_session_from_new_account ( ) : account_name = None if yes_or_no_input ( "Do you want to give a name to the new account to be created?" ) == USER_INPUT_YES : account_name = safe_input ( "Please insert the account name" ) keypair = Keypair . random ( ) address = keypair . address ( ) . decode ( ) seed = keypair . seed ( ) . decode ( ) cli_session = CliSession ( account_name , address , seed ) if _config_file_is_to_update ( ) : if yes_or_no_input ( "Do you want to save the seed of the new account in the encrypted configuration file" ) == USER_INPUT_YES : cli_session . store_account_in_config_file ( ) else : seed_file = safe_input ( "Specify a file to which the seed of the new created account should be saved. " "Notice that the seed will be saved in plain text on the specified file. " "Please store it in a safe place. If anyone can reach the seed it can fully " "control your account" ) write_file ( seed_file , seed ) cli_session . store_account_in_config_file ( ) return cli_session
Initializes a session from a newly created account.
Initializes a session from a newly created account .
"""
    Initializes a session from a newly created account. A Stellar keypair is randomly generated.
    :return: Returns the initialized CLI session.
    :rtype: CliSession
    """
Returns the initialized CLI session.
Returns the initialized CLI session .
CliSession