core.cleos

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

Bases: shell.interface.Account, 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`, like `CreateAccount`, 
        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 a `CreateAccount` or `Account` object
    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 core.cleos.CreateKey(key_name, key_public='', key_private='', r1=False, is_verbose=True)

Bases: shell.interface.Key, 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 core.cleos.GetAccount(account, is_info=True, is_verbose=True)

Bases: shell.interface.Account, 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.
    
  • output json:

    {
        "ram_usage": 6614,
        "ram_quota": 290972,
        "core_liquid_balance": "29866.4394 EOS",
        "cpu_limit": {
            "used": 461316,
            "available": 3223327,
            "max": 3684643
        },
    
        "total_resources": {
            "owner": "dgxo1uyhoytn",
            "net_weight": "100.1000 EOS",
            "cpu_weight": "100.1000 EOS",
            "ram_bytes": 290972
        },
        "self_delegated_bandwidth": {
            "from": "dgxo1uyhoytn",
            "to": "dgxo1uyhoytn",
            "net_weight": "100.1000 EOS",
            "cpu_weight": "100.1000 EOS"
        },
        "net_limit": {
            "used": 12403,
            "available": 19299535,
            "max": 19311938
        },
    
        "net_weight": 1001000,
        "cpu_weight": 1001000,
        "account_name": "dgxo1uyhoytn",
        "head_block_num": 12252494,
        "head_block_time": "2018-08-30T08:18:57.500",
        "privileged": false,
        "last_code_update": "1970-01-01T00:00:00.000",
        "created": "2018-07-18T18:28:38.000",
        "permissions": [{
            "perm_name": "active",
            "parent": "owner",
            "required_auth": {
                "threshold": 1,
                "keys": [{
                    "key": "EOS6HDfGKbR79Gcs74LcQfvL6x8eVhZNXMGZ48Ti7u84nDnyq87rv",
                    "weight": 1
                }
                ],
                "accounts": [],
                "waits": []
            }
            },{
            "perm_name": "owner",
            "parent": "",
            "required_auth": {
                "threshold": 1,
                "keys": [{
                    "key": "EOS8AipFftYjovw8xpuqCxsjid57XqNstDyeTVmLtfFYNmFrgY959",
                    "weight": 1
                }
                ],
                "accounts": [],
                "waits": []
            }
            }
        ],
        "refund_request": null,
        "voter_info": {
            "owner": "dgxo1uyhoytn",
            "proxy": "",
            "producers": [],
            "staked": 2168000,
            "last_vote_weight": "0.00000000000000000",
            "proxied_vote_weight": "0.00000000000000000",
            "is_proxy": 0
        }
    }
    
class core.cleos.GetAccounts(key, is_verbose=True)

Bases: 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 core.cleos.GetBlock(block_number, block_id=None, is_verbose=True)

Bases: 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 core.cleos.GetCode(account, code='', abi='', wasm=False, is_verbose=True)

Bases: 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`, like `CreateAccount`, 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 core.cleos.GetInfo(is_verbose=True)

Bases: 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 core.cleos.GetTable(account, table, scope, binary=False, limit=10, key='', lower='', upper='', is_verbose=True)

Bases: 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  May be an object having the attribute 
        `name`, like `CreateAccount`, or a string.
    scope: The scope within the account in which the table is found,
        can be a `CreateAccount` or `Account` object, or a name.
    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 core.cleos.GetTransaction(transaction_id, is_verbose=True)

Bases: 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 core.cleos.PushAction(account, action, data, permission=None, expiration_sec=30, 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: 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`, like 
        `CreateAccount`, 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 a `CreateAccount` or `Account` object
    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 core.cleos.SetContract(account, contract_dir, wasm_file=None, abi_file=None, permission=None, expiration_sec=30, 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: 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`, like 
        `CreateAccount`, 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 a `CreateAccount` or `Account` object
    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 core.cleos.WalletCreate(name='default', password='', is_verbose=True)

Bases: shell.interface.Wallet, 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 core.cleos.WalletImport(key, wallet='default', is_verbose=True)

Bases: 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 core.cleos.WalletKeys(is_verbose=True)

Bases: 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 core.cleos.WalletList(is_verbose=True)

Bases: 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 core.cleos.WalletLock(wallet='default', is_verbose=True)

Bases: 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`, like 
        `CreateAccount`, 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 core.cleos.WalletLockAll(is_verbose=True)

Bases: core.cleos._Cleos

Lock all unlocked wallets.

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

Bases: 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`, like 
        `CreateAccount`, 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 core.cleos.WalletRemove_key(key, wallet, password, is_verbose=True)

Bases: 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 core.cleos.WalletStop(is_verbose=True)

Bases: core.cleos._Cleos

Stop keosd (doesn’t work with nodeos).

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

Bases: 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`, 
        like `CreateAccount`, 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.