Skip to main content

Python SDK for the Tensorium Proof-of-Work chain

Project description

tensorium-sdk-py

Python SDK for the Tensorium Proof-of-Work chain.

Install

pip install tensorium-sdk

Quick Start

from tensorium_sdk import TxmRPC, TxmWallet, send

rpc = TxmRPC("https://rpc.tensoriumlabs.com")
wallet = TxmWallet.from_private_key_hex("YOUR_PRIVATE_KEY_HEX")

utxos = rpc.get_utxos(wallet.address)["utxos"]
balance_atoms = sum(u["value_atoms"] for u in utxos if u["mature"])
print("Balance:", balance_atoms, "atoms")

txid = send(rpc, wallet, "txm1qdestination...", 100_000_000)
print("Sent:", txid)

Features

  • Wallet generation and restore from private key
  • Tensorium address derivation (txm1...)
  • UTXO selection
  • Raw transaction build and deterministic signing
  • HTTP RPC client for getblockcount, getutxos, and sendrawtransaction

Development

python3 -m pip install -e '.[dev]'
pytest

Example App

A minimal CLI example is included at examples/wallet_cli.py.

Show wallet summary from a private key:

export TXM_PRIVATE_KEY_HEX="YOUR_PRIVATE_KEY_HEX"
export TXM_RPC_URL="https://rpc.tensoriumlabs.com"
python3 examples/wallet_cli.py summary

Send a transaction:

export TXM_PRIVATE_KEY_HEX="YOUR_PRIVATE_KEY_HEX"
python3 examples/wallet_cli.py send --to txm1qdestination... --atoms 100000000

Publish To PyPI

Current published package:

Local publish path:

python3 -m venv .venv
.venv/bin/python -m pip install -e '.[dev]' build twine
.venv/bin/python -m build
.venv/bin/python -m twine check dist/*
.venv/bin/python -m twine upload dist/*

GitHub Actions publish path:

  1. Push the target release commit to main
  2. Run the Publish PyPI workflow manually from the Actions tab
  3. Verify the uploaded version on PyPI

Detailed publish notes:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tensorium_sdk-0.1.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tensorium_sdk-0.1.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file tensorium_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: tensorium_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tensorium_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 34573c7a29b6e25b37b0a840177e43bc48533fbccf2139ca0305189776f056ec
MD5 4bd2215bb377b709e60d60605104e900
BLAKE2b-256 e56f9edc74c2e821fe61b60e4a1dcb5af3793936a2cb53af0a0b8c780efbb9c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for tensorium_sdk-0.1.1.tar.gz:

Publisher: publish-pypi.yml on tensorium-labs/tensorium-sdk-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tensorium_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tensorium_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tensorium_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58e23999d8a094ce6ce717bee2605e767116e7f13239b5e2e87bd1a8379a835d
MD5 d0ee770c571c63a5aece7ad5cfd73592
BLAKE2b-256 304642466ca761f86fa3a285f75022d403d32d0e67da1425467bcc2205d0d1b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for tensorium_sdk-0.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on tensorium-labs/tensorium-sdk-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page