API¶
Contracts¶
eosio¶
Helpers for creating actions on eosio contract
-
aioeos.contracts.eosio.buyrambytes(payer, receiver, amount, authorization=[]) → aioeos.types.EosAction¶
-
aioeos.contracts.eosio.delegatebw(from_account, receiver, stake_net_quantity, stake_cpu_quantity, transfer=False, authorization=[]) → aioeos.types.EosAction¶
-
aioeos.contracts.eosio.newaccount(creator, account_name, owner_keys, active_keys=None, authorization=[]) → aioeos.types.EosAction¶
-
aioeos.contracts.eosio.sellram(account, amount, authorization=[]) → aioeos.types.EosAction¶
-
aioeos.contracts.eosio.undelegatebw(from_account, receiver, unstake_net_quantity, unstake_cpu_quantity, authorization=[]) → aioeos.types.EosAction¶
eosio_token¶
Helpers for creating actions on eosio.token contract
-
aioeos.contracts.eosio_token.close(owner, symbol, authorization=[]) → aioeos.types.EosAction¶
-
aioeos.contracts.eosio_token.transfer(from_addr: str, to_addr: str, quantity: str, memo: str = '', authorization=[]) → aioeos.types.EosAction¶
Exceptions¶
-
exception
aioeos.exceptions.EosAccountDoesntExistException¶ Thrown by get_account where account doesn’t exist
-
exception
aioeos.exceptions.EosAccountExistsException¶ Thrown by create_wallet where account with given name already exists
-
exception
aioeos.exceptions.EosActionValidateException¶ Raised when action payload is invalid
-
exception
aioeos.exceptions.EosAssertMessageException¶ Generic assertion error from smart contract, can mean literally anything, need to parse C++ traceback to figure out what went wrong.
-
exception
aioeos.exceptions.EosDeadlineException¶ Transaction timed out
-
exception
aioeos.exceptions.EosMissingTaposFieldsException¶ TAPOS fields are missing from Transaction object
-
exception
aioeos.exceptions.EosRamUsageExceededException¶ Transaction requires more RAM than what’s available on the account
-
exception
aioeos.exceptions.EosRpcException¶ Base EOS exception
-
exception
aioeos.exceptions.EosSerializerUnsupportedTypeException¶ Our serializer doesn’t support provided object type, shouldn’t happen
-
exception
aioeos.exceptions.EosTxCpuUsageExceededException¶ Not enough EOS were staked for CPU
-
exception
aioeos.exceptions.EosTxNetUsageExceededException¶ Not enough EOS were staked for NET
Keys¶
-
class
aioeos.keys.EOSKey(private_key=None, public_key=None)¶ EOSKey instance.
Depends on which kwargs are given, this works in a different way: - No kwargs - generates a new private key - Only private_key - public key is being derived from private key - Only public_key - EOSKey instance has no private key
-
sign(digest)¶ Signs sha256 hash with private key. Returns signature in format: SIG_K1_{digest}
-
to_public()¶ Returns compressed, base58 encoded public key prefixed with EOS
-
to_pvt(key_type='K1')¶ Converts private key to PVT format
-
to_wif()¶ Converts private key to legacy WIF format
-
verify(encoded_sig, digest)¶ Verifies signature with private key
-
RPC¶
-
class
aioeos.rpc.EosJsonRpc(url)¶ -
abi_json_to_bin(code, action, args)¶
-
get_abi(account_name: str)¶
-
get_account(account_name: str)¶
-
get_actions(account_name: str, pos=None, offset=None)¶
-
get_block(block_num_or_id)¶
-
get_block_header_state(block_num_or_id)¶
-
get_code(account_name: str)¶
-
get_controlled_accounts(account_name: str)¶
-
get_currency_balance(code: str, account: str, symbol: str)¶
-
get_currency_stats(code: str, symbol: str)¶
-
get_db_size()¶
-
get_info()¶
-
get_key_accounts(public_key)¶
-
get_producer_schedule()¶
-
get_producers(json=True, lower_bound='', limit=50)¶
-
get_raw_abi(account_name: str)¶
-
get_raw_code_and_abi(account_name: str)¶
-
get_required_keys(transaction, available_keys)¶
-
get_table_by_scope(code, table, lower_bound='', upper_bound='', limit=10)¶
-
get_table_rows(code, scope, table, table_key='', lower_bound='', upper_bound='', index_position=1, key_type='', limit=10, reverse=False, show_payer=False, json=True)¶
-
get_transaction(tx_id: str, block_num_hint=None)¶
-
post(endpoint, json={})¶
-
push_transaction(signatures, serialized_transaction)¶
-
Serializer¶
-
class
aioeos.serializer.AbiStringSerializer¶ EOS String format is similar to bytes as it’s prefixed with length and is comprised of ASCII codes for each character packed in binary format.
-
deserialize(value)¶
-
serialize(value)¶
-
-
aioeos.serializer.decode(abi_class, field_name, binary)¶
-
aioeos.serializer.decode_eos_type(eos_type, binary)¶
-
aioeos.serializer.deserialize(binary, abi_class)¶
-
aioeos.serializer.encode(obj, field_name)¶
-
aioeos.serializer.encode_eos_type(eos_type, value)¶
-
aioeos.serializer.serialize(obj)¶
Types¶
-
class
aioeos.types.BaseAbiObject¶
-
class
aioeos.types.EosAction(account: <function NewType.<locals>.new_type at 0x7fc878803d08>, name: <function NewType.<locals>.new_type at 0x7fc878803d08>, authorization: List[aioeos.types.EosAuthorization], data: <function NewType.<locals>.new_type at 0x7fc878803f28>)¶
-
class
aioeos.types.EosAuthorization(actor: <function NewType.<locals>.new_type at 0x7fc878803d08>, permission: <function NewType.<locals>.new_type at 0x7fc878803d08>)¶
-
class
aioeos.types.EosExtension(extension_type: <function NewType.<locals>.new_type at 0x7fc878803840>, data: <function NewType.<locals>.new_type at 0x7fc878803f28>)¶
-
class
aioeos.types.EosTransaction(expiration: <function NewType.<locals>.new_type at 0x7fc878803e18> = None, ref_block_num: <function NewType.<locals>.new_type at 0x7fc878803840> = 0, ref_block_prefix: <function NewType.<locals>.new_type at 0x7fc8788038c8> = 0, max_net_usage_words: <function NewType.<locals>.new_type at 0x7fc878801048> = 0, max_cpu_usage_ms: <function NewType.<locals>.new_type at 0x7fc87889f0d0> = 0, delay_sec: <function NewType.<locals>.new_type at 0x7fc878801048> = 0, context_free_actions: List[aioeos.types.EosAction] = <factory>, actions: List[aioeos.types.EosAction] = <factory>, transaction_extensions: List[aioeos.types.EosExtension] = <factory>)¶ -
delay_sec= 0¶
-
expiration= None¶
-
max_cpu_usage_ms= 0¶
-
max_net_usage_words= 0¶
-
ref_block_num= 0¶
-
ref_block_prefix= 0¶
-