aioeosabi
Updated version of aioeos to no longer rely on API calls to serialize data. Integrates https://github.com/stuckatsixpm/antelopy to serialize instead. Should be usable as a drop-in replacement for the original aioeos.
For Documentation: See the original aioeos Docs. Only difference is that sign_and_push_transaction now lets you specify if you want to use a stored ABI or fetch a new one. Also two new helper functions.
-
smart_sign_and_push_transaction: Signs and pushes a transaction using the cached ABI, refetching the ABI if the first try fails.
-
push_actions: Pushed out a transaction, trying out various endpoints until one succeeds.
Async Python library for interacting with EOS.io blockchain.
Features
- Async JSON-RPC client.
- Signing and verifying transactions using private and public keys.
- Serializer for basic EOS.io blockchain ABI types.
- Helpers which provide an easy way to generate common actions, such as token transfer.
Installation
Library is available on PyPi, you can simply install it using pip.
$ pip install aioeosabi
Usage
Importing a private key
from aioeosabi import EosAccount
account = EosAccount(private_key='your key')
Transferring funds
from aioeosabi import EosJsonRpc, EosTransaction
from aioeosabi.contracts import eosio_token
rpc = EosJsonRpc(url='http://127.0.0.1:8888')
block = await rpc.get_head_block()
transaction = EosTransaction(
ref_block_num=block['block_num'] & 65535,
ref_block_prefix=block['ref_block_prefix'],
actions=[
eosio_token.transfer(
from_addr=account.name,
to_addr='mysecondacc1',
quantity='1.0000 EOS',
authorization=[account.authorization('active')]
)
]
)
await rpc.sign_and_push_transaction(transaction, keys=[account.key])
Creating a new account
from aioeosabi import EosJsonRpc, EosTransaction, EosAuthority
from aioeosabi.contracts import eosio
main_account = EosAccount(name='mainaccount1', private_key='private key')
new_account = EosAccount(name='mysecondacc1')
owner = EosAuthority(
threshold=1,
keys=[new_account.key.to_key_weight(1)]
)
rpc = EosJsonRpc(url='http://127.0.0.1:8888')
block = await rpc.get_head_block()
await rpc.sign_and_push_transaction(
EosTransaction(
ref_block_num=block['block_num'] & 65535,
ref_block_prefix=block['ref_block_prefix'],
actions=[
eosio.newaccount(
main_account.name,
new_account.name,
owner=owner,
authorization=[main_account.authorization('active')]
),
eosio.buyrambytes(
main_account.name,
new_account.name,
2048,
authorization=[main_account.authorization('active')]
)
],
),
keys=[main_account.key]
)
Documentation
Docs and usage examples are available here.
Unit testing
To run unit tests, you need to bootstrap an EOS testnet node first. Use the provided ensure_eosio.sh script.
$ ./ensure_eosio.sh
Metadata
Release files for aioeosabi 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aioeosabi-0.1.2.tar.gz | 15.4 kB | Without provenance | Details for aioeosabi-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aioeosabi-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for aioeosabi-0.1.2-py3-none-any.whl |
Total release size: 33.5 kB
Release files / aioeosabi-0.1.2.tar.gz
| Download URL | aioeosabi-0.1.2.tar.gz |
|---|---|
| Size | 15.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62c05a4b45dfcda42541b9eb04d8a63238807a497d7e42599ddd252895cdfe22
|
|
BLAKE2b-256 checksum How to use checksums |
e93ba952f3642f03e405f870af5dc281fdb290d039cbf4e5946e0c188be9a4c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.12.2 Linux/6.2.0-1019-azure
|
Release files / aioeosabi-0.1.2-py3-none-any.whl
| Download URL | aioeosabi-0.1.2-py3-none-any.whl |
|---|---|
| Size | 18.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00288f5f3af5885a3d5521f683bf3d3902b11c8dda84cb083011e0c3e5118ad5
|
|
BLAKE2b-256 checksum How to use checksums |
0f364acc875bbbff8cf126e7f0b8adb044ae2547603321f3081e0452cc7ceb92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.12.2 Linux/6.2.0-1019-azure
|
Security for aioeosabi 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.