ArchEthic SDK for Python
This repo aims to provide a Python SDK for the ArchEthic project.
It is based on the official javascript sdk.
Installation
pip install archethic
Example
import archethic
api = archethic.Api("https://testnet.archethic.net")
# make sure you have funds in your wallet !
seed = 'mySuperSeed'
ref_index = api.get_transaction_index(archethic.derive_address(seed, 0))
rx_address = archethic.derive_address("rx_address", 0)
tx = archethic.TransactionBuilder('transfer')
tx.add_uco_transfer(rx_address, 10.102)
tx.build(seed, ref_index)
tx.origin_sign(archethic.ORIGIN_PRIVATE_KEY)
transaction_fee = api.get_transaction_fee(tx)
print(f"fee : {transaction_fee['fee']} UCOs")
response = api.send_tx(tx)
print(response)
# prints :
# fee : 0.12413171 UCOs
# {'status': 'pending', 'transaction_address': '00008808978E67F37E0AFF023682AAB48843CF5B340A00B1F1C0668B003EC21E358F'}
Contribution
Thank you for considering to help out with the source code. We welcome contributions from anyone and are grateful for even the smallest of improvement.
Please to follow this workflow:
- Fork it!
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
(copied from archethic-foundation)
TODOs
Utils
- Implementation of utils
Cryptographic functions
- get_originKey()
- derive_keypair()
- derive_address()
- ec_encrypt()
- aes_encrypt()
Transaction building
- create TransactionBuilder class (TB)
- TB.set_code()
- TB.set_content()
- TB.add_ownership()
- TB.add_UCO_transfer()
- TB.add_TOKEN_transfer()
- TB.add_recipient()
- TB.build()
- TB.origin_sign()
- TB.toJSON()
- Interacting with other signer
- TB.previous_signature_payload()
- TB.set_previous_signature_and_previous_public_key()
- TB.set_address()
- TB.origin_signature_payload()
- TB.set_origin_sign()
Remote Endpoint calls
- addOriginKey()
- TB.send_transaction()
- wait_confirmations()
- get_transaction_index()
- get_storage_nonce_public_key()
- get_transaction_fee()
- get_transaction_ownerships()
Keychain / Wallet management
comming soon
Metadata
Release files for archethic 0.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 |
|---|---|---|---|---|
| archethic-0.0.1.2.tar.gz | 17.4 kB | Without provenance | Details for archethic-0.0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| archethic-0.0.1.2-py3-none-any.whl | Python 3 | none | any | Details for archethic-0.0.1.2-py3-none-any.whl |
Total release size: 36.3 kB
Release files / archethic-0.0.1.2.tar.gz
| Download URL | archethic-0.0.1.2.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4e15e8257fc72bfea6bd8e989ee1167a1e5eb8297947e1e8eabb00029651566
|
|
BLAKE2b-256 checksum How to use checksums |
ee460c923d99dfbfeacb8915ea1b80fdf96f903c961030e9e332b0d4d86891ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Release files / archethic-0.0.1.2-py3-none-any.whl
| Download URL | archethic-0.0.1.2-py3-none-any.whl |
|---|---|
| Size | 18.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f54947e209a5a00140f55197ed585d7aab5d872c801a76f331dcef79d78af4cf
|
|
BLAKE2b-256 checksum How to use checksums |
11e1bfce770536c84907afeb905725b7987f3e1ad978bcf0980382d3b02f3c88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Security for archethic 0.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.