core.cleos

class eosfactory.core.cleos.CreateAccount(creator, name, owner_key, active_key=None, permission=None, expiration_sec=None, skip_signature=0, dont_broadcast=0, forceUnique=0, max_cpu_usage=0, max_net_usage=0, ref_block=None, is_verbose=True)

Bases: eosfactory.core.interface.Account, eosfactory.core.cleos._Cleos

Create an account, buy ram, stake for bandwidth for the account.

  • parameters:

    creator: The name, of the account creating the new account. May be an 
        object having the attribute `name`, or a string.
    name: The name of the new account.
    owner_key: The owner public key for the new account.
    active_key: The active public key for the new account.
    
    permission: An account and permission level to authorize, as in 
        'account@permission'. May be an object having the attribute `name`, 
        or a string.
    expiration: The time in seconds before a transaction expires, 
        defaults to 30s
    skip_sign: Specify if unlocked wallet keys should be used to sign 
        transaction.
    dont_broadcast: Don't broadcast transaction to the network (just print).
    forceUnique: Force the transaction to be unique. this will consume extra 
        bandwidth and remove any protections against accidently issuing the 
        same transaction multiple times.
    max_cpu_usage: Upper limit on the milliseconds of cpu usage budget, for 
        the execution of the transaction 
        (defaults to 0 which means no limit).
    max_net_usage: Upper limit on the net usage budget, in bytes, for the 
        transaction (defaults to 0 which means no limit).
    ref_block: The reference block num or block id used for TAPOS 
        (Transaction as Proof-of-Stake).
    
  • attributes:

    owner_key: Owner private key.
    active_key: Active private key.
    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.    
    
class eosfactory.core.cleos.CreateKey(key_name='', key_public='', key_private='', r1=False, is_verbose=True)

Bases: eosfactory.core.interface.Key, eosfactory.core.cleos._Cleos

Create a new keypair and print the public and private keys.

  • parameters:

    key_name: Key name.
    r1: Generate a key using the R1 curve (iPhone), instead of the 
        K1 curve (Bitcoin)
    
  • attributes:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.    
    
class eosfactory.core.cleos.GetAccount(account, is_info=True, is_verbose=True)

Bases: eosfactory.core.interface.Account, eosfactory.core.cleos._Cleos

Retrieve an account from the blockchain.

  • parameters:

    account: The account object or the name of the account to retrieve.
    is_verbose: If ``False`` do not print. Default is ``True``.
    
  • attributes:

    name: The name of the account.
    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.
    
class eosfactory.core.cleos.GetAccounts(key, is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

Retrieve accounts associated with a public key.

  • attributes:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.
    
class eosfactory.core.cleos.GetBlock(block_number, block_id=None, is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

Retrieve a full block from the blockchain.

  • parameters:

    block_number: The number of the block to retrieve.
    block_id: The ID of the block to retrieve, if set, defaults to "".
    is_verbose: If ``False``, Default is ``True``.
    
  • attributes:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.    
    
class eosfactory.core.cleos.GetCode(account, code='', abi='', wasm=False, is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

Retrieve the code and ABI for an account.

  • parameters:

    account: The name of an account whose code should be retrieved. 
        May be an object having the  May be an object having the attribute 
        `name`, or a string.
    code: The name of the file to save the contract .wast/wasm to.
    abi: The name of the file to save the contract .abi to.
    wasm: Save contract as wasm.
    
  • attributes:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.    
    
class eosfactory.core.cleos.GetInfo(is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

Get current blockchain information.

  • parameters:

    is_verbose: If ``False``, do not print.
    
  • attributes:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.
    
class eosfactory.core.cleos.GetTable(account, table, scope, binary=False, limit=10, key='', lower='', upper='', is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

Retrieve the contents of a database table

  • parameters:

    account: The name of the account that owns the table. May be 
        an object having the attribute `name`, or a string.
    scope: The scope within the account in which the table is found. May be
        an object having the attribute `name`, or a string.
    table: The name of the table as specified by the contract abi.
    binary: Return the value as BINARY rather than using abi to 
        interpret as JSON
    limit: The maximum number of rows to return.
    key: The name of the key to index by as defined by the abi, 
        defaults to primary key.
    lower: JSON representation of lower bound value of key, 
        defaults to first.
    upper: JSON representation of upper bound value value of key, 
        defaults to last.
    
  • attributes:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.
    
class eosfactory.core.cleos.GetTransaction(transaction_id, is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

Retrieve a transaction from the blockchain.

  • parameters:

    transaction_id: ID of the transaction to retrieve.
    is_verbose: If ``False`` do not print. Default is ``True``.
    
  • attributes:

    transaction_id: ID of the transaction retrieved.
    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.
    
class eosfactory.core.cleos.PushAction(account, action, data, permission=None, expiration_sec=None, skip_signature=0, dont_broadcast=0, forceUnique=0, max_cpu_usage=0, max_net_usage=0, ref_block=None, is_verbose=True, json=False)

Bases: eosfactory.core.cleos._Cleos

Push a transaction with a single action.

  • parameters:

    account: The account to publish a contract for.  May be an object 
        having the  May be an object having the attribute `name`, 
        or a string.
    action: A JSON string or filename defining the action to execute on 
        the contract.
    data: The arguments to the contract.
    permission: An account and permission level to authorize, as in 
        'account@permission'. May be an object having the attribute `name`, 
        or a string.
    expiration: The time in seconds before a transaction expires, 
        defaults to 30s
    skip_sign: Specify if unlocked wallet keys should be used to sign 
        transaction.
    dont_broadcast: Don't broadcast transaction to the network (just print).
    forceUnique: Force the transaction to be unique. this will consume extra 
        bandwidth and remove any protections against accidently issuing the 
        same transaction multiple times.
    max_cpu_usage: Upper limit on the milliseconds of cpu usage budget, for 
        the execution of the transaction 
        (defaults to 0 which means no limit).
    max_net_usage: Upper limit on the net usage budget, in bytes, for the 
        transaction (defaults to 0 which means no limit).
    ref_block: The reference block num or block id used for TAPOS 
        (Transaction as Proof-of-Stake).
    
  • attributes:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.
    
class eosfactory.core.cleos.SetContract(account, contract_dir, wasm_file=None, abi_file=None, permission=None, expiration_sec=None, skip_signature=0, dont_broadcast=0, forceUnique=0, max_cpu_usage=0, max_net_usage=0, ref_block=None, is_verbose=True, json=False)

Bases: eosfactory.core.cleos._Cleos

Create or update the contract on an account.

  • parameters:

    account: The account to publish a contract for. May be an object 
        having the  May be an object having the attribute `name`, 
        or a string.
    contract_dir: The path containing the .wast and .abi. 
    wasm_file: The file containing the contract WASM relative 
        to contract_dir.
    abi_file: The ABI for the contract relative to contract-dir.
    
    permission: An account and permission level to authorize, as in 
        'account@permission'. May be an object having the attribute `name`, 
        or a string.
    expiration: The time in seconds before a transaction expires, 
        defaults to 30s
    skip_sign: Specify if unlocked wallet keys should be used to sign 
        transaction.
    dont_broadcast: Don't broadcast transaction to the network (just print).
    forceUnique: Force the transaction to be unique. this will consume extra 
        bandwidth and remove any protections against accidently issuing the 
        same transaction multiple times.
    max_cpu_usage: Upper limit on the milliseconds of cpu usage budget, for 
        the execution of the transaction 
        (defaults to 0 which means no limit).
    max_net_usage: Upper limit on the net usage budget, in bytes, for the 
        transaction (defaults to 0 which means no limit).
    ref_block: The reference block num or block id used for TAPOS 
        (Transaction as Proof-of-Stake).
    
  • attributes:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.    
    
class eosfactory.core.cleos.WalletCreate(name='default', password='', is_verbose=True)

Bases: eosfactory.core.interface.Wallet, eosfactory.core.cleos._Cleos

Create a new wallet locally.

  • parameters:

    name: The name of the new wallet, defaults to ``default``.
    password: The password to the wallet, if the wallet exists. Default is None.
    is_verbose: If ``False`` do not print. Default is ``True``.
    
  • attributes:

    name: The name of the wallet.
    password: The password returned by wallet create.
    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.
    
class eosfactory.core.cleos.WalletImport(key, wallet='default', is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

Import a private key into wallet.

  • parameters:

    wallet: A wallet object or the name of the wallet to import key into.
    key: A key object or a private key in WIF format to import.
    is_verbose: If ``False`` do not print. Default is ``True``.
    
  • attributes:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.
    
class eosfactory.core.cleos.WalletKeys(is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

List of public keys from all unlocked wallets.

  • parameters:

    is_verbose: If ``False`` do not print. Default is ``True``.
    
  • parameters:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.
    
  • attributes:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.
    
class eosfactory.core.cleos.WalletList(is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

List opened wallets, * marks unlocked.

  • parameters:

    is_verbose: If ``False`` do not print. Default is ``True``.
    
  • attributes:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.
    
class eosfactory.core.cleos.WalletLock(wallet='default', is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

Lock wallet.

  • parameters:

    wallet: The name of the wallet to import key into. May be an object 
        having the  May be an object having the attribute `name`, 
        or a string. 
    is_verbose: If ``False`` do not print. Default is ``True``.
    
  • parameters:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.
    
class eosfactory.core.cleos.WalletLockAll(is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

Lock all unlocked wallets.

class eosfactory.core.cleos.WalletOpen(wallet='default', is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

Open an existing wallet.

  • parameters:

    wallet: The name of the wallet to import key into. May be an object 
        having the  May be an object having the attribute `name`, 
        or a string. 
    is_verbose: If ``False`` do not print. Default is ``True``.
    
  • attributes:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.
    
class eosfactory.core.cleos.WalletRemove_key(key, wallet, password, is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

Remove key from wallet - parameters:

wallet: A wallet object or the name of the wallet to import key into.
password: The password returned by wallet create.
key: A key object or a private key in WIF format to import.
is_verbose: If ``False`` do not print. Default is ``True``.
  • attributes:

    error: Whether any error ocurred.
    is_verbose: If set, print output.
    
class eosfactory.core.cleos.WalletStop(is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

Stop keosd (doesn’t work with nodeos).

class eosfactory.core.cleos.WalletUnlock(wallet='default', password='', timeout=0, is_verbose=True)

Bases: eosfactory.core.cleos._Cleos

Unlock wallet.

  • parameters:

    wallet: The name of the wallet. May be an object 
        having the  May be an object having the attribute `name`,
        or a string.
    password: If the wallet argument is not a wallet object, the password 
        returned by wallet create, else anything, defaults to "".
    is_verbose: If ``False`` do not print. Default is ``True``.
    
  • attributes:

    error: Whether any error ocurred.
    json: The json representation of the object.
    is_verbose: If set, print output.