valtu: the Valtu Wallet SDK for Python
The official Python SDK for Valtu, self-custody wallet infrastructure for stablecoin payments. It gives you a signed API client, webhook verification and enclave attestation checks.
- Python 3.9+
- One dependency (
cryptography) - Typed
- MIT
pip install valtu
Quick start
from valtu import Valtu, deposit_address
valtu = Valtu.from_env() # VALTU_PRIVATE_KEY, or VALTU_KEY_FILE=valtu-server.json
# One deposit wallet per customer. It's idempotent, so call it every time.
wallet = valtu.wallets.for_customer("cus_42")
print(deposit_address(wallet, "tron"))
# A payout. The same external_id never pays twice, even if you retry.
amount = valtu.assets.to_base_units("USDT-TRC20", "25.50") # "25500000"
transfer = valtu.transfers.create(
wallet_id=HOT_WALLET_ID, asset="USDT-TRC20", amount=amount,
to="TQ...", external_id="payout-123",
)
print(transfer["status"]) # QUEUED, or PENDING_APPROVAL if a policy asks for approvals
Keyword arguments are snake_case. The SDK sends them in the API's camelCase. Responses are the API's
JSON objects as dicts, with the API's field names (walletId, externalId…).
Webhooks
Verify the raw request body, before you parse it.
from valtu import construct_event, EventDeduper, WebhookVerificationError
dedupe = EventDeduper()
@app.post("/webhooks/valtu") # Flask
def valtu_webhook():
try:
event = construct_event(request.get_data(), request.headers, public_key=WEBHOOK_PUBLIC_KEY)
except WebhookVerificationError:
return "", 400
if dedupe.first(event["id"]):
handle(event) # e.g. "deposit.confirmed", "transfer.confirmed"
return "", 200
Get WEBHOOK_PUBLIC_KEY (Ed25519, not a secret) from Dashboard → Webhooks, or from
valtu.webhooks.public_key()["publicKey"]. You can pass secret= instead to check the HMAC signature.
Check the enclave yourself
Signing keys live in a hardware enclave. Don't take our word for what runs there: check it.
import secrets
from valtu import verify_attestation
nonce = secrets.token_hex(32)
for doc in valtu.attestation(nonce)["attestations"]:
result = verify_attestation(doc["document"], nonce=nonce, expected_pcr0=PUBLISHED_PCR0)
print(result.module_id, result.statement["keys"])
verify_attestation checks the following, and raises AttestationError if any check fails:
- the certificate chain up to the hardware vendor's root;
- the document's signature;
- your nonce;
- the image measurement.
The published measurements and key anchors are at https://valtu.io/docs/security.
What's in the client
valtu.wallets |
create, for_customer, get, find_by_external_id, balances, list, iterate |
valtu.transfers |
create, preview, create_batch, get, find_by_external_id, cancel, list, iterate, wait |
valtu.deposits |
get, find_by_tx_hash, lookup, list, iterate |
valtu.assets |
list, get, to_base_units, from_base_units |
valtu.checkouts |
create, get, list, iterate, cancel |
valtu.contracts |
list, get, call |
valtu.messages |
create, get, list |
valtu.webhooks / valtu.events |
list, public_key, test / list |
valtu |
workspace(), balances(), networks(), attestation(nonce), request(method, path, body) |
How it behaves
- Every request is signed with your API key, using ECDSA P-256 over the method, path, timestamp, a single-use nonce and the body hash.
- Valtu stores only the public key.
- Nobody in between can change or replay a request.
- Retries: GETs, and writes with an
external_id, are retried on network errors and 429/502/503/504. The SDK honoursRetry-After. - Errors:
ValtuErrorcarriesstatus, a stablecode,messageandrequest_id. Quote therequest_idto support. - Amounts are integer strings in base units.
to_base_unitsandfrom_base_unitsconvert exactly, and refuse floats.
Links
- API guide: https://valtu.io/docs/api
- TypeScript SDK: https://github.com/Valtu-Wallet/wallet-kit (
npm i @valtu/wallet-kit) - Examples: https://github.com/Valtu-Wallet/examples
- Security: https://valtu.io/docs/security · report issues to security@valtu.io
Metadata
Release files for valtu 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| valtu-0.1.0.tar.gz | 23.7 kB | With provenance | Details for valtu-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| valtu-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for valtu-0.1.0-py3-none-any.whl |
Total release size: 42.6 kB
Release files / valtu-0.1.0.tar.gz
| Download URL | valtu-0.1.0.tar.gz |
|---|---|
| Size | 23.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09ec1c910665bb05ef75823afc672cf9b3205edfeabd31adf544134f251f1aa2
|
|
BLAKE2b-256 checksum How to use checksums |
668b60727b880bfc9eb1e6f8a2e0f6efa63020c6d3356875745d0f698e8bfee1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / valtu-0.1.0-py3-none-any.whl
| Download URL | valtu-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eb84c7fa2b0130b0bc4541c80e3205962e967285ea7b9a0ab460558d03affb99
|
|
BLAKE2b-256 checksum How to use checksums |
095701f86ac7e9beed8f455ae643810ee10d7c297908404ec14be071f1622e88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logSecurity for valtu 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for valtu-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.