aergo.herapy.obj package

Submodules

aergo.herapy.obj.abi module

class aergo.herapy.obj.abi.Abi(abi)[source]

Bases: object

Abi stores a contract abi.

functions
json()[source]
language
state_variables
version

aergo.herapy.obj.address module

class aergo.herapy.obj.address.Address(pubkey: Union[str, bytes, ecdsa.ecdsa.Public_key], empty: bool = False, curve: ecdsa.curves.Curve = SECP256k1)[source]

Bases: object

curve
static decode(addr: Optional[str]) → bytes[source]
static encode(addr: Optional[bytes]) → str[source]
public_key
value
class aergo.herapy.obj.address.GovernanceTxAddress[source]

Bases: enum.Enum

An enumeration.

ENTERPRISE = 'aergo.enterprise'
NAME = 'aergo.name'
SYSTEM = 'aergo.system'
aergo.herapy.obj.address.check_name_address(addr: str) → int[source]

aergo.herapy.obj.aer module

class aergo.herapy.obj.aer.Aer(value: Union[bytes, str, int, float] = '0 aer')[source]

Bases: object

Return Aergo Unit, AER(/ˈɛəɹ/).

aer
aergo
dec
gaer

aergo.herapy.obj.aergo_conf module

class aergo.herapy.obj.aergo_conf.AergoConfig[source]

Bases: object

account
account_unlocktimeout
add_conf(k, v, c='base')[source]
auth
auth_enablelocalconf
authdir
blockchain
blockchain_coinbaseaccount
blockchain_forceresetheight
blockchain_maxanchorcount
blockchain_maxblocksize
blockchain_statetrace
blockchain_verifiercount
blockchain_verifyonly
blockchain_zerofee
conf
consensus
consensus_blockinterval
consensus_enablebp
consensus_raft
datadir
dbtype
enableprofile
enabletestmode
mempool
mempool_dumpfilepath
mempool_enablefadeout
mempool_fadeoutperiod
mempool_showmetrics
mempool_verifiers
monitor
monitor_endpoint
monitor_protocol
p2p
p2p_logfullpeerid
p2p_netprotocoladdr
p2p_netprotocolport
p2p_npaddpeers
p2p_npaddpolarises
p2p_npbindaddr
p2p_npbindport
p2p_npcert
p2p_npdiscoverpeers
p2p_npexposeself
p2p_nphiddenpeers
p2p_npkey
p2p_npmaxpeers
p2p_nppeerpool
p2p_nptls
p2p_npusepolaris
personal
polaris
polaris_allowprivate
polaris_genesisfile
profileport
rpc
rpc_netserviceaddr
rpc_netserviceport
rpc_netservicetrace
rpc_nsallowcors
rpc_nscacert
rpc_nscert
rpc_nskey
rpc_nstls
usetestnet

aergo.herapy.obj.block module

class aergo.herapy.obj.block.Block(hash_value: Union[aergo.herapy.obj.block_hash.BlockHash, str, bytes, None] = None, height: Optional[int] = None, grpc_block=None, grpc_block_header=None, tx_cnt: int = 0, size: int = 0)[source]

Bases: object

block_no
blocks_root_hash
chain_id
chain_id_hash
chain_id_hash_b58
coinbase_account
confirms
datetimestamp
get_tx(index: int) → aergo.herapy.obj.transaction.Transaction[source]
hash
height
json(header_only: bool = False) → Dict[KT, VT][source]
num_of_tx
prev
public_key
receipts_root_hash
sign
size
timestamp
tx_list
txs_root_hash

aergo.herapy.obj.block_hash module

class aergo.herapy.obj.block_hash.BlockHash(bh: Union[str, bytes])[source]

Bases: object

value

aergo.herapy.obj.block_meta_stream module

class aergo.herapy.obj.block_meta_stream.BlockMetaStream(block_meta_stream)[source]

Bases: aergo.herapy.obj.stream.Stream

aergo.herapy.obj.block_stream module

class aergo.herapy.obj.block_stream.BlockStream(block_stream)[source]

Bases: aergo.herapy.obj.stream.Stream

next() → aergo.herapy.obj.block.Block[source]

aergo.herapy.obj.blockchain_info module

class aergo.herapy.obj.blockchain_info.BlockchainInfo(chain_info, consensus_info=None)[source]

Bases: object

consensus_info
gas_price
json()[source]
max_block_size
max_tokens
minimum_staking
name_price
number_of_bp
total_staking

aergo.herapy.obj.blockchain_status module

class aergo.herapy.obj.blockchain_status.BlockchainStatus(status)[source]

Bases: object

best_block_hash
best_block_height
best_chain_id_hash
best_chain_id_hash_b58
consensus_info
json() → Dict[KT, VT][source]

aergo.herapy.obj.call_info module

class aergo.herapy.obj.call_info.CallInfo(name, args)[source]

Bases: object

CallInfo is used to store contract call/query arguments for json serialization.

aergo.herapy.obj.chain_id module

class aergo.herapy.obj.chain_id.ChainID(chain_id)[source]

Bases: object

consensus
is_mainnet
is_public
json()[source]
magic

aergo.herapy.obj.change_conf_info module

class aergo.herapy.obj.change_conf_info.ChangeConfInfo(info)[source]

Bases: object

ChangeConfInfo shows the state of the request ‘changeCluster’ to change configuration of RAFT cluster and member list of the cluster.

error
json()[source]
members
state
class aergo.herapy.obj.change_conf_info.ChangeConfState[source]

Bases: enum.Enum

ChangeConfState holds the state of the request ‘changeCluster’ to change configuration of RAFT cluster.

APPLIED = 2
PROPOSED = 0
SAVED = 1

aergo.herapy.obj.consensus_info module

class aergo.herapy.obj.consensus_info.ConsensusInfo(info, consensus_type=None)[source]

Bases: object

block_producer_list
detail
json()[source]
lib_hash

get the last irreversible block (LIB) hash :return:

lib_no

get the last irreversible block (LIB) number :return:

status
type

aergo.herapy.obj.event module

class aergo.herapy.obj.event.Event(grpc_event)[source]

Bases: object

arguments
block_hash
block_height
contract_address
index
json()[source]
name
tx_hash
tx_index

aergo.herapy.obj.event_stream module

class aergo.herapy.obj.event_stream.EventStream(event_stream)[source]

Bases: aergo.herapy.obj.stream.Stream

next()[source]

aergo.herapy.obj.name_info module

class aergo.herapy.obj.name_info.NameInfo(info)[source]

Bases: object

NameInfo is used to store information of name system.

destination
info
json()[source]
name
owner

aergo.herapy.obj.node_info module

class aergo.herapy.obj.node_info.NodeInfo(node_info)[source]

Bases: object

json()[source]

aergo.herapy.obj.peer module

class aergo.herapy.obj.peer.Peer[source]

Bases: object

address
id
info
json()[source]
port
state

aergo.herapy.obj.private_key module

class aergo.herapy.obj.private_key.PrivateKey(pk: Union[str, bytes, None])[source]

Bases: object

address
asymmetric_decrypt_msg(address: Union[str, aergo.herapy.obj.address.Address], enc_msg: Union[str, bytes]) → bytes[source]
asymmetric_encrypt_msg(address: Union[str, aergo.herapy.obj.address.Address], msg: Union[str, bytes]) → str[source]
get_signing_key() → ecdsa.keys.SigningKey[source]
public_key
sign_msg(msg: bytes) → bytes[source]
verify_sign(msg: bytes, sign: bytes) → bool[source]

aergo.herapy.obj.sc_state module

class aergo.herapy.obj.sc_state.SCState(account: aergo.herapy.account.Account, var_proofs: aergo.herapy.obj.var_proof.VarProofs)[source]

Bases: object

SCState holds the inclusion/exclusion proofs of a contract state in the global trie and of a variable’s value in the contract trie. SCState is returned by aergo.query_sc_state() for easy merkle proof verification give a root.

account
var_proofs
verify_proof(root: bytes) → bool[source]

Verify that the given inclusion and exclusion proofs are correct

class aergo.herapy.obj.sc_state.SCStateVar(var_name: str, array_index: Optional[int] = None, map_key: Optional[str] = None, empty: bool = False)[source]

Bases: object

SCStateVar represents each variable of a calling smart contract. If the variable is the ‘state.var’ type, you can skip ‘array_index’ and ‘map_key’. If the variable is the ‘state.array’ type, use ‘array_index’ with the index number. If the variable is the ‘state.map’ type, use ‘map_key’ with the key name of the map.

aergo.herapy.obj.stream module

class aergo.herapy.obj.stream.Stream(grpc_stream)[source]

Bases: object

cancel()[source]
cancelled()[source]
done()[source]
is_active()[source]
next()[source]
running()[source]
start()[source]
started
stop()[source]
stopped

aergo.herapy.obj.transaction module

Transaction class.

class aergo.herapy.obj.transaction.Transaction(from_address: Union[bytes, aergo.herapy.obj.address.Address, None] = None, to_address: Union[bytes, aergo.herapy.obj.address.Address, None] = None, nonce: int = 0, amount: Union[bytes, str, int, float] = 0, payload: Optional[bytes] = None, gas_price: int = 0, gas_limit: int = 0, read_only: bool = False, tx_hash: Optional[bytes] = None, tx_sign: Union[bytes, str, None] = None, tx_type=<TxType.TRANSFER: 4>, chain_id: Optional[bytes] = None, block=None, index_in_block: int = -1, is_in_mempool: bool = False)[source]

Bases: object

Transaction data structure.

amount
block
calculate_hash(including_sign: bool = True) → bytes[source]
chain_id
from_address
gas_limit
gas_price
index_in_block
is_in_mempool
json(without_block: bool = False) → Dict[KT, VT][source]
nonce
payload
payload_str
sign
sign_str
to_address
tx_hash
tx_type
class aergo.herapy.obj.transaction.TxType[source]

Bases: enum.Enum

An enumeration.

GOVERNANCE = 1
NORMAL = 0
SC_CALL = 5
SC_DEPLOY = 6
SC_FEE_DELEGATION = 3
SC_REDEPLOY = 2
TRANSFER = 4

aergo.herapy.obj.tx_hash module

class aergo.herapy.obj.tx_hash.TxHash(th: Optional[bytes])[source]

Bases: object

aergo.herapy.obj.tx_result module

class aergo.herapy.obj.tx_result.TxResult(result, tx=None)[source]

Bases: object

json()[source]
type
class aergo.herapy.obj.tx_result.TxResultType[source]

Bases: enum.Enum

An enumeration.

COMMIT_RESULT = 0
RECEIPT = 1

aergo.herapy.obj.var_proof module

class aergo.herapy.obj.var_proof.VarProofs(var_proofs, storage_keys: List[bytes])[source]

Bases: list

VarProof holds the inclusion/exclusion proof of a variable state inside a contract state trie

storage_keys
var_proofs
verify_proof(root: bytes) → bool[source]

verify that the given inclusion and exclusion proofs are correct

verify_var_proof(root: bytes, var_proof, trie_key: bytes) → bool[source]

Module contents