core.cleos_get

class eosfactory.core.cleos_get.GetAccounts(key, is_verbose=True)[source]

Bases: eosfactory.core.cleos.Cleos

Retrieve accounts associated with a public key.

Parameters:
  • key (str or interface.Key) – The public key to retrieve accounts for.
  • is_verbose (bool) – If False do not print. Default is True.
Variables:

names (list) – The retrieved list of accounts.

class eosfactory.core.cleos_get.GetActions(account, pos=-1, offset=1, json=False, full=False, pretty=False, console=False, is_verbose=True)[source]

Bases: eosfactory.core.cleos.Cleos

Retrieve all actions with specific account name referenced in authorization or receiver.

Note that available actions are filtered. By default, all actions are filered off. To see the actions, the node has to be restarted with the –filter-on option.

Parameters:
  • account (str) – Name of account to query on.
  • pos (int) – Sequence number of action for this account, -1 for last. Default is -1.
  • offset (int) – Get actions [pos,pos+offset] for positive offset or [pos-offset,pos) for negative offset. Default is 1.
  • json (bool) – Responce received as JSON, if any. Default is False.
  • full (bool) – Don’t truncate action json. Default is False.
  • pretty (bool) – Pretty print full action json. Default is False.
  • console (bool) – print console output generated by action. Default is False.
  • is_verbose (bool) – If False do not print. Default is True.
class eosfactory.core.cleos_get.GetBlock(block_number, block_id=None, is_verbose=True)[source]

Bases: eosfactory.core.cleos.Cleos

Retrieve a full block from the blockchain.

Parameters:
  • block_number (int) – The number of the block to retrieve.
  • block_id (str) – The ID of the block to retrieve, if set, defaults to “”.
  • is_verbose (bool) – If False, print a message. Default is True.
Returns:

A eosfactory.core.cleos.Cleos object.

class eosfactory.core.cleos_get.GetCode(account, code='', abi='', wasm=False, is_verbose=True)[source]

Bases: eosfactory.core.cleos.Cleos

Retrieve the code and ABI for an account.

Parameters:
  • account (str or interface.Account) – The account to retrieve.
  • code (str) – If set, the name of the file to save the contract .wast/wasm to.
  • abi (str) – If set, the name of the file to save the contract .abi to.
  • wasm (bool) – Save contract as wasm.
  • is_verbose (bool) – If False do not print. Default is True.
Variables:

code_hash (str) – The hash of the code.

class eosfactory.core.cleos_get.GetInfo(is_verbose=True)[source]

Bases: eosfactory.core.cleos.Cleos

Get current blockchain information.

Parameters:

is_verbose (bool) – If False, print a message. Default is True.

Returns:

A eosfactory.core.cleos.Cleos object, extended with the following items:

Variables:
  • head_block_time (str) – The time of the most recent block.
  • head_block (int) – The most recent block number.
  • last_irreversible_block_num (int) – The number of the most recent irreversible block.
class eosfactory.core.cleos_get.GetTable(account, table, scope, binary=False, limit=10, lower='', upper='', index='', key_type='', encode_type='', reverse=False, show_payer=False, is_verbose=True)[source]

Bases: eosfactory.core.cleos.Cleos

Retrieve the contents of a database table

Parameters:
  • table (str) – The name of the table as specified by the contract abi.
  • scope (str or interface.Account) – The scope within the account in which the table is found.
  • binary (bool) – Return the value as BINARY rather than using abi to interpret as JSON. Default is False.
  • limit (int) – The maximum number of rows to return. Default is 10.
  • lower (str) – JSON representation of lower bound value of key, defaults to first.
  • upper (str) – JSON representation of upper bound value value of key, defaults to last.
  • index (int or str) – Index number, 1 - primary (first), 2 - secondary index (in order defined by multi_index), 3 - third index, etc. Number or name of index can be specified, e.g. ‘secondary’ or ‘2’.
  • key_type (str) – The key type of –index, primary only supports (i64), all others support (i64, i128, i256, float64, float128, ripemd160, sha256). Special type ‘name’ indicates an account name.
  • enncode_type (str) – The encoding type of key_type (i64 , i128 , float64, float128) only support decimal encoding e.g. ‘dec’i256 - supports both ‘dec’ and ‘hex’, ripemd160 and sha256 is ‘hex’ only.
  • reverse (bool) – Iterate in reverse order.
  • is_verbose (bool) – If False do not print. Default is True.