core.interface

class eosfactory.core.interface.Account(name, owner_key=None, active_key=None)[source]

Bases: eosfactory.core.interface.Omittable

Having the name and key_public and key_private attributes.

Parameters
  • name (str) – EOSIO contract name

  • owner_key (str or Key) – The owner key of the account.

  • active_key (str or Key) – The account key of the account.

Variables
  • name (str) – EOSIO contract name

  • owner_key (str or Key) – The owner key of the account.

  • active_key (str or Key) – The account key of the account.

active()[source]

Get the public active key

Returns

str – public active key

owner()[source]

Get the public owner key

Returns

str – public owner key

class eosfactory.core.interface.Key(key_public, key_private)[source]

Bases: eosfactory.core.interface.Omittable

Having the key_public and key_private attributes.

Parameters
  • key_public (str) – The public key of a key pair.

  • key_private (str) – The private key of a key pair.

Variables
  • key_public (str) – The public key of a key pair.

  • key_private (str) – The private key of a key pair.

class eosfactory.core.interface.Omittable[source]

Bases: object

Having the err_msg attribute.

class eosfactory.core.interface.Permission[source]

Bases: enum.Enum

Enumeration {OWNER, ACTIVE}

class eosfactory.core.interface.Wallet(name, password=None)[source]

Bases: eosfactory.core.interface.Omittable

Having the name and password attributes.

Parameters
  • name (str) – The wallet name.

  • password (str) – The password to the wallet.

Variables
  • name (str) – The wallet name.

  • password (str) – The password to the wallet.

eosfactory.core.interface.account_arg(account)[source]

Accepts any account argument.

Parameters

account (str or interface.Account) – account argument.

Returns

str – The EOSIO name of the account argument.

eosfactory.core.interface.key_arg(key, is_owner_key=True, is_private_key=True)[source]

Accepts any key argument.

Parameters
  • key (str or Key or interface.Account) – The key argument.

  • is_owner_key (bool) – Solves ambivalence of the key parameter if the key argument is an .interface.Account object.

  • is_private_key (bool) – Solves ambivalence of the key parameter if the the key argument is a .Key or .interface.Account object

Returns

str – The value of the key argument.

eosfactory.core.interface.permission_arg(permission)[source]

Accepts any permission argument.

Args: :param permission (.interface.Account or str or (str, str) or (.interface.Account, str) or any list of the previous items): The permission argument.

Exemplary values of the argument permission:

eosio # eosio is an interface.Account object

perm_str = "eosio@owner"

perm_tuple = ("eosio", "owner")

perm_tuple = (eosio, interface.Permission.ACTIVE)

perm_list = ["eosio@owner", (eosio, .Permission.ACTIVE)]
Returns

[(str, str)] – A list of tuples (<account name>, <permission name>).

eosfactory.core.interface.wallet_arg(wallet)[source]

Accepts any wallet argument.

Parameters

wallet (str or interface.Wallet) – wallet argument.

Returns

str – name of the wallet argument.