ArchEthic Python SDK
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
archethic-0.0.1.2.tar.gz
(17.4 kB
view details)
Built Distribution
File details
Details for the file archethic-0.0.1.2.tar.gz
.
File metadata
- Download URL: archethic-0.0.1.2.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4e15e8257fc72bfea6bd8e989ee1167a1e5eb8297947e1e8eabb00029651566 |
|
MD5 | a2ad6ea893175041c5a2e74810ba6d47 |
|
BLAKE2b-256 | ee460c923d99dfbfeacb8915ea1b80fdf96f903c961030e9e332b0d4d86891ff |
File details
Details for the file archethic-0.0.1.2-py3-none-any.whl
.
File metadata
- Download URL: archethic-0.0.1.2-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f54947e209a5a00140f55197ed585d7aab5d872c801a76f331dcef79d78af4cf |
|
MD5 | 2786259b699aec515181e694cadd64ac |
|
BLAKE2b-256 | 11e1bfce770536c84907afeb905725b7987f3e1ad978bcf0980382d3b02f3c88 |