diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-05 10:00:55 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-05 10:00:55 +0000 |
commit | 31e8c9a35e7db46c370aed3ab63ecba0ca424744 (patch) | |
tree | 9cf209e961118084708d9ce5b0ab490b607b8a8d | |
parent | 010d105c0a927f5c3e8727314122bac8921f6529 (diff) |
automatic import of python-aioeosopeneuler20.03
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-aioeos.spec | 396 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 398 insertions, 0 deletions
@@ -0,0 +1 @@ +/aioeos-1.0.2.tar.gz diff --git a/python-aioeos.spec b/python-aioeos.spec new file mode 100644 index 0000000..4419003 --- /dev/null +++ b/python-aioeos.spec @@ -0,0 +1,396 @@ +%global _empty_manifest_terminate_build 0 +Name: python-aioeos +Version: 1.0.2 +Release: 1 +Summary: Async library for interacting with EOS.io blockchain +License: MIT +URL: https://ulam.io/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/7b/f0/99f8ce3c511b9dd3f2c0896de1698710ecce1cd6f074305bf7f43e131e93/aioeos-1.0.2.tar.gz +BuildArch: noarch + +Requires: python3-aiohttp +Requires: python3-base58 +Requires: python3-ecdsa + +%description +# aioeos + +[](http://aioeos.readthedocs.io/en/latest/?badge=latest) [](https://codecov.io/gh/ulamlabs/aioeos)   + +Async Python library for interacting with EOS.io blockchain. + +## Features + +1. Async JSON-RPC client. +2. Signing and verifying transactions using private and public keys. +3. Serializer for basic EOS.io blockchain ABI types. +4. 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 aioeos +``` + +## Usage + +### Importing a private key + +``` +from aioeos import EosAccount + +account = EosAccount(private_key='your key') +``` + +### Transferring funds + +``` +from aioeos import EosJsonRpc, EosTransaction +from aioeos.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 aioeos import EosJsonRpc, EosTransaction, EosAuthority +from aioeos.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](https://aioeos.readthedocs.io/en/latest). + +## 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 +``` + + +%package -n python3-aioeos +Summary: Async library for interacting with EOS.io blockchain +Provides: python-aioeos +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-aioeos +# aioeos + +[](http://aioeos.readthedocs.io/en/latest/?badge=latest) [](https://codecov.io/gh/ulamlabs/aioeos)   + +Async Python library for interacting with EOS.io blockchain. + +## Features + +1. Async JSON-RPC client. +2. Signing and verifying transactions using private and public keys. +3. Serializer for basic EOS.io blockchain ABI types. +4. 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 aioeos +``` + +## Usage + +### Importing a private key + +``` +from aioeos import EosAccount + +account = EosAccount(private_key='your key') +``` + +### Transferring funds + +``` +from aioeos import EosJsonRpc, EosTransaction +from aioeos.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 aioeos import EosJsonRpc, EosTransaction, EosAuthority +from aioeos.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](https://aioeos.readthedocs.io/en/latest). + +## 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 +``` + + +%package help +Summary: Development documents and examples for aioeos +Provides: python3-aioeos-doc +%description help +# aioeos + +[](http://aioeos.readthedocs.io/en/latest/?badge=latest) [](https://codecov.io/gh/ulamlabs/aioeos)   + +Async Python library for interacting with EOS.io blockchain. + +## Features + +1. Async JSON-RPC client. +2. Signing and verifying transactions using private and public keys. +3. Serializer for basic EOS.io blockchain ABI types. +4. 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 aioeos +``` + +## Usage + +### Importing a private key + +``` +from aioeos import EosAccount + +account = EosAccount(private_key='your key') +``` + +### Transferring funds + +``` +from aioeos import EosJsonRpc, EosTransaction +from aioeos.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 aioeos import EosJsonRpc, EosTransaction, EosAuthority +from aioeos.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](https://aioeos.readthedocs.io/en/latest). + +## 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 +``` + + +%prep +%autosetup -n aioeos-1.0.2 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-aioeos -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.2-1 +- Package Spec generated @@ -0,0 +1 @@ +824140e556898f684c41a01bfd5fc1a6 aioeos-1.0.2.tar.gz |