Skip to main content

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:

  1. Fork it!
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. 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

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)

Source distribution for archethic 0.0.1.2
File Size Uploaded
archethic-0.0.1.2.tar.gz 17.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for archethic 0.0.1.2
File Interpreter ABI Platform
archethic-0.0.1.2-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.0.1.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page