Skip to main content

stealthex

PyPI version License: ISC Python Version

Modern, fully typed Python client library for the StealthEX instant non-custodial cryptocurrency exchange API.

Official API documentation: https://documenter.getpostman.com/view/24333719/2s9YJZ54yN


Features

  • ⚡ Fixed & Floating Swaps — Exchange at real-time floating market rates or lock in a fixed rate for 20 minutes.
  • 🪙 1400+ Coins & Tokens — Wide asset selection across Bitcoin, Ethereum, Monero, Ripple, Solana, and more.
  • 🐍 Modern Pythonic Design — Type annotations, dataclass models (ExchangeDetails, StealthEXCurrency, RangeResult), context manager support (with StealthEX(...) as client:), and custom exceptions.
  • 🔒 Non-Custodial & Private — Direct wallet-to-wallet transactions with no mandatory account registration.

Installation

pip install stealthex

Requires Python 3.10 or higher.


Quick Start (Safe Check)

The quick check only inspects supported currencies and price estimates. It does not create orders:

import os
from stealthex import StealthEX

with StealthEX(api_key=os.environ["STEALTHEX_API_KEY"]) as client:
    # 1. Fetch available currencies
    currencies = client.get_currencies()
    print(f"Available currencies: {len(currencies)}")

    # 2. Query floating rate estimate for 0.1 BTC to ETH
    estimate = client.get_estimate(symbol_from="btc", symbol_to="eth", amount=0.1, fixed=False)
    print(f"Estimated receive amount: {estimate.estimated_amount} ETH")

Usage Guide

1. Creating a Floating Rate Swap

Check exchange limits, get estimate, create swap order, and monitor progress:

from stealthex import StealthEX, StealthEXError

with StealthEX(api_key="your_api_key") as client:
    # 1. Check deposit range (min and max limits)
    range_info = client.get_range(symbol_from="btc", symbol_to="eth", fixed=False)
    print(f"Min: {range_info.min_amount} BTC, Max: {range_info.max_amount or 'No limit'}")

    # 2. Create the exchange order
    order = client.create_exchange(
        currency_from="btc",
        currency_to="eth",
        amount=0.1,
        address_to="0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
        refund_address="bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",  # optional
        fixed=False,
    )

    print(f"Exchange Created! ID: {order.id}")
    print(f"Send 0.1 BTC to: {order.address_from}")
    print(f"Current Status: {order.status}")

2. Creating a Fixed Rate Swap

Lock in an exact payout amount for 20 minutes:

fixed_order = client.create_exchange(
    currency_from="eth",
    currency_to="btc",
    amount=2.0,
    address_to="bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
    fixed=True,
)

print(f"Fixed Exchange ID: {fixed_order.id}")
print(f"Guaranteed Payout: {fixed_order.amount_to} BTC")
print(f"Deposit Address: {fixed_order.address_from}")

3. Tracking Exchange Status

Check deposit confirmations and outbound transaction hashes:

status = client.get_exchange(order.id)
print(f"Status: {status.status}")

if status.status == "finished":
    print(f"Payout Tx Hash: {status.tx_to}")

API Reference

StealthEX Class

Constructor

StealthEX(
    api_key: str,
    base_url: str = "https://api.stealthex.io/v2",
    timeout: float = 30.0,
)
Parameter Type Default Description
api_key str Required Your StealthEX API key.
base_url str "https://api.stealthex.io/v2" StealthEX API base URL.
timeout float 30.0 HTTP request timeout in seconds.

Methods

  • get_currencies(fixed=None) -> list[StealthEXCurrency] — Retrieves all supported coins.
  • get_currency(symbol: str) -> StealthEXCurrency — Gets metadata for a specific coin.
  • get_pairs(symbol=None) -> list[str] — Returns available trading pairs for an asset.
  • get_range(symbol_from, symbol_to, fixed=False) -> RangeResult — Retrieves min/max limits.
  • get_min_amount(symbol_from, symbol_to, fixed=False) -> float — Minimum deposit limit.
  • get_estimate(symbol_from, symbol_to, amount, fixed=False) -> EstimateResult — Returns estimated receive amount.
  • create_exchange(currency_from, currency_to, amount, address_to, fixed=False, ...) -> ExchangeDetails — Creates order.
  • get_exchange(exchange_id: str) -> ExchangeDetails — Retrieves status of an exchange.
  • get_exchanges(limit=None) -> list[ExchangeDetails] — Lists past exchanges.

Error Handling

When the API returns an error, StealthEXError is raised:

from stealthex import StealthEX, StealthEXError

try:
    with StealthEX(api_key="invalid_key") as client:
        client.get_currencies()
except StealthEXError as exc:
    print(f"StealthEX Error: {exc.message} (Status: {exc.status})")

Common HTTP status codes:

  • 400 Bad Request — Amount outside limits or invalid address.
  • 401 Unauthorized — Invalid API key.
  • 404 Not Found — Exchange ID not found.

License

ISC

Metadata

Release files for stealthex 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stealthex 0.2.0
File Size Uploaded Provenance Actions
stealthex-0.2.0.tar.gz 20.4 kB Without provenance Details for stealthex-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 28.0 kB

Release files / stealthex-0.2.0.tar.gz

Download URL stealthex-0.2.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2f5e482441c113dc78c82308c959e758df3c809c7a02bb8cb216c8ddb0344d9a
BLAKE2b-256 checksum
How to use checksums
503448ab5cff921026ca7df82ed37d2cbc01fdfb867220fadd10a67ebdac20a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / stealthex-0.2.0-py3-none-any.whl

Download URL stealthex-0.2.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c79ee201522f12f30ef3f6874b92c0f6c574ea7ee3cee073451d49f6a79d078d
BLAKE2b-256 checksum
How to use checksums
78e9d7dee06e48900346318f25a60b32a5d40b4b25a60a61360e7a7b2a20810e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for stealthex 0.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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