This repo aims to provide a Python SDK for the ArchEthic project.
It is based on the official javascript sdk.
pip install archethic
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'}
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)
- Implementation of utils
- get_originKey()
- derive_keypair()
- derive_address()
- ec_encrypt()
- aes_encrypt()
- 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()
- addOriginKey()
- TB.send_transaction()
- wait_confirmations()
- get_transaction_index()
- get_storage_nonce_public_key()
- get_transaction_fee()
- get_transaction_ownerships()
comming soon