API¶
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.
EosSerializerAbiNameInvalidCharactersException
¶
-
exception
aioeos.exceptions.
EosSerializerAbiNameTooLongException
¶
-
exception
aioeos.exceptions.
EosSerializerException
¶ Base exception class for serializer errors
-
exception
aioeos.exceptions.
EosSerializerUnsupportedTypeException
¶ Our serializer doesn’t support provided object type
-
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_key_weight
(weight)¶ - Return type
EosKeyWeight
-
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
- Return type
bool
-
RPC¶
Serializer¶
-
class
aioeos.serializer.
AbiActionPayloadSerializer
¶ -
deserialize
(value)¶ Returns a tuple containing length of original data and deserialized value
- Return type
Tuple
[int
,bytes
]
-
serialize
(value)¶ Returns byte-encoded value
- Return type
bytes
-
-
class
aioeos.serializer.
AbiBytesSerializer
¶ Serializer for ABI bytes type. Serialized value consists of raw bytes prefixed with payload size encoded as VarUInt.
-
deserialize
(value)¶ Returns a tuple containing length of original data and deserialized value
- Return type
Tuple
[int
,bytes
]
-
serialize
(value)¶ Returns byte-encoded value
- Return type
bytes
-
-
class
aioeos.serializer.
AbiListSerializer
(list_type)¶ Serializer for ABI List type. In binary format, it basically looks like this:
[count][item 1][item 2]...
-
deserialize
(value)¶ Returns a tuple containing length of original data and deserialized value
- Return type
Tuple
[int
,List
[Any
]]
-
serialize
(value)¶ Returns byte-encoded value
- Return type
bytes
-
-
class
aioeos.serializer.
AbiNameSerializer
¶ Serializer for ABI names. ABI names can only contain these characters:
.12345abcdefghijklmnopqrstuvwxyz
. Maximum length is 13 chars.-
deserialize
(value)¶ Returns a tuple containing length of original data and deserialized value
- Return type
Tuple
[int
,str
]
-
serialize
(value)¶ Returns byte-encoded value
- Return type
bytes
-
-
class
aioeos.serializer.
AbiObjectSerializer
(abi_class)¶ -
deserialize
(value)¶ Returns a tuple containing length of original data and deserialized value
- Return type
Tuple
[int
,BaseAbiObject
]
-
serialize
(value)¶ Returns byte-encoded value
- Return type
bytes
-
-
class
aioeos.serializer.
AbiStringSerializer
¶ Serializer for ABI String type. String format is similar to bytes as it’s prefixed with length but it’s comprised of ASCII codes for each character packed in binary format.
-
deserialize
(value)¶ Returns a tuple containing length of original data and deserialized value
- Return type
Tuple
[int
,str
]
-
serialize
(value)¶ Returns byte-encoded value
- Return type
bytes
-
-
class
aioeos.serializer.
AbiTimePointSecSerializer
¶ Serializer for ABI TimePointSec type. It’s essentially a timestamp.
-
deserialize
(value)¶ Returns a tuple containing length of original data and deserialized value
- Return type
Tuple
[int
,datetime
]
-
serialize
(value)¶ Returns byte-encoded value
- Return type
bytes
-
-
class
aioeos.serializer.
AbiTimePointSerializer
¶ Serializer for ABI TimePoint type. Encodes timestamp with milisecond precision.
-
deserialize
(value)¶ Returns a tuple containing length of original data and deserialized value
- Return type
Tuple
[int
,datetime
]
-
serialize
(value)¶ Returns byte-encoded value
- Return type
bytes
-
-
class
aioeos.serializer.
BaseSerializer
¶ -
abstract
deserialize
(value)¶ Returns a tuple containing length of original data and deserialized value
- Return type
Tuple
[int
,Any
]
-
abstract
serialize
(value)¶ Returns byte-encoded value
- Return type
bytes
-
abstract
-
class
aioeos.serializer.
BasicTypeSerializer
(fmt='')¶ Serializes basic types such as integers and floats using
struct
module- Params fmt
format string, please refer to documentation for struct module
-
deserialize
(value)¶ Returns a tuple containing length of original data and deserialized value
- Return type
Tuple
[int
,Any
]
-
serialize
(value)¶ Returns byte-encoded value
- Return type
bytes
-
class
aioeos.serializer.
VarUIntSerializer
¶ Serializer for ABI VarUInt type. This type has different length based on how many bytes are required to encode given integer.
-
deserialize
(value)¶ Returns a tuple containing length of original data and deserialized value
- Return type
Tuple
[int
,int
]
-
serialize
(value)¶ Returns byte-encoded value
- Return type
bytes
-
-
aioeos.serializer.
deserialize
(value, abi_class)¶ Deserializes ABI values from binary format
- Return type
Tuple
[int
,Any
]
-
aioeos.serializer.
get_abi_type_serializer
(abi_type)¶ - Return type
-
aioeos.serializer.
serialize
(value, abi_type=None)¶ Serializes ABI values to binary format
- Return type
bytes
Types¶
-
aioeos.types.
UInt8
¶ alias of
builtins.int
-
aioeos.types.
UInt16
¶ alias of
builtins.int
-
aioeos.types.
UInt32
¶ alias of
builtins.int
-
aioeos.types.
UInt64
¶ alias of
builtins.int
-
aioeos.types.
Int8
¶ alias of
builtins.int
-
aioeos.types.
Int16
¶ alias of
builtins.int
-
aioeos.types.
Int32
¶ alias of
builtins.int
-
aioeos.types.
Int64
¶ alias of
builtins.int
-
aioeos.types.
VarUInt
¶ alias of
builtins.int
-
aioeos.types.
Float32
¶ alias of
builtins.float
-
aioeos.types.
Float64
¶ alias of
builtins.float
-
aioeos.types.
TimePointSec
¶ alias of
datetime.datetime
-
aioeos.types.
TimePoint
¶ alias of
datetime.datetime
-
aioeos.types.
Name
¶ alias of
builtins.str
-
aioeos.types.
AbiBytes
¶ alias of
builtins.bytes
-
class
aioeos.types.
BaseAbiObject
¶
-
aioeos.types.
is_abi_object
(obj)¶ Object is an ABI object if it’s a subclass of BaseAbiObject
- Return type
bool
-
class
aioeos.types.
EosPermissionLevel
(actor, permission)¶ -
actor
: Name = None¶
-
permission
: Name = None¶
-
-
class
aioeos.types.
EosPermissionLevelWeight
(permission, weight)¶ -
permission
: EosPermissionLevel = None¶
-
weight
: UInt16 = None¶
-
-
class
aioeos.types.
EosAuthority
(threshold=1, keys=<factory>, accounts=<factory>, waits=<factory>)¶ -
accounts
: List[EosPermissionLevelWeight] = None¶
-
keys
: List[EosKeyWeight] = None¶
-
threshold
: int = 1¶
-
waits
: List[EosWaitWeight] = None¶
-
-
class
aioeos.types.
EosAction
(account, name, authorization, data)¶ -
account
: Name = None¶
-
data
: AbiActionPayload = None¶
-
name
: Name = None¶
-
-
class
aioeos.types.
EosTransaction
(expiration=<factory>, ref_block_num=0, ref_block_prefix=0, max_net_usage_words=0, max_cpu_usage_ms=0, delay_sec=0, context_free_actions=<factory>, actions=<factory>, transaction_extensions=<factory>)¶ -
actions
: List[EosAction] = None¶
-
context_free_actions
: List[EosAction] = None¶
-
delay_sec
: int = 0¶
-
expiration
: TimePointSec = None¶
-
max_cpu_usage_ms
: int = 0¶
-
max_net_usage_words
: int = 0¶
-
ref_block_num
: int = 0¶
-
ref_block_prefix
: int = 0¶
-
transaction_extensions
: List[EosExtension] = None¶
-