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, andsendrawtransaction
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:
- PyPI: https://pypi.org/project/tensorium-sdk/
- Latest release:
0.1.0
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:
- Push the target release commit to
main - Run the
Publish PyPIworkflow manually from the Actions tab - Verify the uploaded version on PyPI
Detailed publish notes:
- see PUBLISHING.md
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34573c7a29b6e25b37b0a840177e43bc48533fbccf2139ca0305189776f056ec
|
|
| MD5 |
4bd2215bb377b709e60d60605104e900
|
|
| BLAKE2b-256 |
e56f9edc74c2e821fe61b60e4a1dcb5af3793936a2cb53af0a0b8c780efbb9c0
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tensorium_sdk-0.1.1.tar.gz -
Subject digest:
34573c7a29b6e25b37b0a840177e43bc48533fbccf2139ca0305189776f056ec - Sigstore transparency entry: 1701749199
- Sigstore integration time:
-
Permalink:
tensorium-labs/tensorium-sdk-py@09463d87827fe8152d16f20edf8746ec1dbc1f73 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tensorium-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@09463d87827fe8152d16f20edf8746ec1dbc1f73 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58e23999d8a094ce6ce717bee2605e767116e7f13239b5e2e87bd1a8379a835d
|
|
| MD5 |
d0ee770c571c63a5aece7ad5cfd73592
|
|
| BLAKE2b-256 |
304642466ca761f86fa3a285f75022d403d32d0e67da1425467bcc2205d0d1b7
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tensorium_sdk-0.1.1-py3-none-any.whl -
Subject digest:
58e23999d8a094ce6ce717bee2605e767116e7f13239b5e2e87bd1a8379a835d - Sigstore transparency entry: 1701749252
- Sigstore integration time:
-
Permalink:
tensorium-labs/tensorium-sdk-py@09463d87827fe8152d16f20edf8746ec1dbc1f73 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tensorium-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@09463d87827fe8152d16f20edf8746ec1dbc1f73 -
Trigger Event:
workflow_dispatch
-
Statement type: