Ercoin reactor
ern_reactor is a Python library that allows performing arbitrary actions in reaction to Ercoin transfers, with live synchronization and catching up after coming back online. Licensed under Apache License 2.0. Python 3.8 or newer is required.
How to use
See the help for ern_reactor.ErcoinReactor:
import ern_reactor
help(ern_reactor.ErcoinReactor)
You need to implement the get_namespace and process_tx methods. To inspect the structure of the transaction dictionary which is passed to process_tx, see ern_reactor.TransferTx.__annotations__.
A basic example
This scripts connects to a local Ercoin node and live prints transaction values for transfers received by an Ercoin address (Base64-encoded) specified on the command line:
import asyncio
import decimal
import sys
from ern_reactor import ErcoinReactor
class DummyReactor(ErcoinReactor):
def get_namespace(self):
return 'dummy'
async def process_tx(self, tx):
amount_in_ern = decimal.Decimal(tx['value']) / 10**6
print(f'Received {amount_in_ern} ERN')
if __name__ == '__main__':
reactor = DummyReactor(
node='127.0.0.1',
to_address=sys.argv[1],
ssl=False,
)
try:
asyncio.run(reactor.start())
except KeyboardInterrupt:
sys.exit(0)
Metadata
Release files for ern-reactor 0.2.3
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 |
|---|---|---|---|---|
| ern_reactor-0.2.3.tar.gz | 6.0 kB | Without provenance | Details for ern_reactor-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ern_reactor-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for ern_reactor-0.2.3-py3-none-any.whl |
Total release size: 12.0 kB
Release files / ern_reactor-0.2.3.tar.gz
| Download URL | ern_reactor-0.2.3.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4effe97af8ddddefa09df0d33b9837e24d1335c583388ef5e405fd41fa152a17
|
|
BLAKE2b-256 checksum How to use checksums |
06d9efc2f4e31e3cde3095af94a06243094b12492bf6c0fba4f7d92c9f503d8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.7
|
Release files / ern_reactor-0.2.3-py3-none-any.whl
| Download URL | ern_reactor-0.2.3-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
599df12212e234b565483055c1fe390b1fb6f1f67eff29c84a144a1105356309
|
|
BLAKE2b-256 checksum How to use checksums |
2c070c7c6d62e126892b992407f925321941b14bba63430b7d67274889bd16e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.7
|
Security for ern-reactor 0.2.3
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.