Nukez

Docs · PyNukez

Python SDK

python · v4.0.21

Python

PyNukez

PyNukez

PyNukez provides a Python client for requesting storage, confirming externally executed payments, provisioning lockers, uploading files, downloading stored content, and verifying receipts or storage attestations. The SDK signs gateway envelopes but does not execute blockchain transfers or custody payment keys.

Install

Install the package

Add the published PyNukez package to a Python 3.9+ runtime before constructing any client.

shell
pip install pynukez # Python 3.9+# current public release: 4.0.21# optional SDK-development extra:# pip install "pynukez[dev]"

Code notes

Install the PyPI package into any Python 3.9+ runtime. The core SDK covers gateway requests, receipts, locker provisioning, file operations, attestation, and verification; payment execution stays outside the SDK.

PyNukez supports Solana and Monad payment flows, including Ed25519 and secp256k1 signing contexts. Transfer helpers belong outside the core client.

Storage request

Request storage, pay externally, confirm the receipt

Use PyNukez to request payment instructions and confirm a completed transfer; execute the transfer with your own wallet, CLI, relay, or helper.

python
from pynukez import Nukez client = Nukez(    keypair_path="~/.config/solana/id.json",  # local envelope signer    base_url="https://api.nukez.xyz",    network="mainnet-beta",) request = client.request_storage(units=1, provider="gcs")print(request.next_step)print(request.payment_options) # Execute the selected transfer outside PyNukez.tx_sig = "..." receipt = client.confirm_storage(request.pay_req_id, tx_sig=tx_sig)client.provision_locker(receipt.id)

Code notes

A storage request returns payment instructions and the available x402 payment options. Execute one transfer with your own wallet, CLI, hardware signer, relay, or helper, then pass the resulting transaction signature back to PyNukez.

For SPL or EVM helper flows, pass the helper's confirm_kwargs() into confirm_storage so payment_chain and payment_asset are included when needed.

Locker operations

Upload, download, attest, and verify

After the receipt provisions a locker, use the receipt id for file operations and verification calls.

python
from pathlib import Path local_file = Path("~/Documents/report.pdf").expanduser()uploaded = client.upload_file_path(    receipt.id,    str(local_file),    content_type="application/pdf",) file_urls = client.get_file_urls(receipt.id, uploaded["filename"])data = client.download_bytes(file_urls.download_url) out = Path("~/Downloads/nukez_report.pdf").expanduser()out.parent.mkdir(parents=True, exist_ok=True)out.write_bytes(data) att = client.attest(receipt.id, sync=True)receipt_hash = client.verify_receipt_hash(receipt.id)storage = client.verify_storage(receipt.id) assert receipt_hash.matchesassert storage.attested

Code notes

After provisioning, use the receipt id for file operations. The SDK includes convenience upload helpers, URL refresh and download helpers, receipt-hash verification, storage verification, and attestation.

For lower-level control, use create_file(), upload_bytes(), and confirm_file(); for large sets, use bulk_upload_paths() or upload_directory().

§ next