Skip to main content

Veil Labs Python SDK for private market data, swaps, and transfers.

Project description

Veil Labs Python SDK

Official SDK Python Version License: MIT GitHub Repository

The official Python SDK for Veil Labs, a privacy-first platform providing anonymous swaps (Private Swap), multi-destination distributions (Private Seed), and secure proxy transfers across multiple blockchain networks.


🚀 Features

  • Private Swaps: Securely exchange tokens with built-in privacy.
  • Private Seed Distribution: Distribute assets to multiple destination addresses in a single privacy-preserving transaction.
  • Proxy Transfers: Anonymize your transfers via secure proxy nodes.
  • Market Intelligence: Real-time access to supported currencies, pairs, and price estimates.
  • Dual Support: Native support for both Synchronous and Asynchronous (asyncio) workflows.
  • Type-Safe Models: Fully powered by Pydantic for robust data validation and IDE autocompletion.

📦 Installation

Install the SDK using pip:

pip install veillabs-python-sdk

Or using uv (recommended for modern workflows):

uv add veillabs-python-sdk

🏃 Quick Start

Synchronous Client

Ideal for scripts and quick automation tasks.

from veillabs import VeilLabsClient

# Connect using the synchronous client
with VeilLabsClient() as client:
    # 1. Fetch available currencies
    currencies = client.market.get_currencies()
    print(f"Supported Currencies: {len(currencies)}")

    # 2. Get an exchange estimate
    estimate = client.market.get_estimate(
        fromTicker="eth",
        toTicker="usdc",
        fromAmount="1.0",
        fromNetwork="mainnet",
        toNetwork="mainnet"
    )
    print(f"1 ETH = {estimate.to_amount} USDC")

Asynchronous Client

Recommended for high-concurrency environments like web services (FastAPI, Django, etc.).

import asyncio
from veillabs import AsyncVeilLabsClient

async def main():
    async with AsyncVeilLabsClient() as client:
        # Fetch platform stats
        stats = await client.stats.get_volume()
        print(f"Total Platform Volume: ${stats.total_volume_usd:,.2f}")

if __name__ == "__main__":
    asyncio.run(main())

🛠 Detailed Usage

1. Market Data (client.market)

Access real-time data about the platform's supported assets and trading pairs.

  • get_currencies(): Retrieve list of all supported cryptocurrencies.
  • get_pairs(ticker, net): Get valid trading destinations for a specific asset.
  • get_estimate(**params): Calculate real-time exchange rates and output values.
  • get_ranges(**params): Determine minimum and maximum transaction limits.

2. Private Swaps (client.swap)

Initiate anonymous cross-chain or same-chain token exchanges.

swap = client.swap.create(
    fromTicker="eth",
    toTicker="btc",
    amount="0.5",
    addressTo="1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",
    fromNetwork="mainnet",
    toNetwork="mainnet"
)
print(f"Swap Created! Tracking ID: {swap.id}")

3. Private Seed Distribution (client.seed)

Distribute a fixed amount of cryptocurrency to multiple recipient addresses.

seed = client.seed.create(
    ticker="usdt",
    totalAmount="1000",
    destinations=[
        {"address": "0x123...", "percentage": 50},
        {"address": "0x456...", "percentage": 50}
    ],
    network="bsc"
)

4. Proxy Transfers (client.transfer)

Move funds securely through the Veil Labs proxy nodes to obfuscate the transaction path.

  • client.transfer.single(**params): Secure transfer to one recipient.
  • client.transfer.multi(**params): Secure transfer to multiple recipients.

5. Unified Transaction Tracking (client.track)

Maintain full visibility of your transaction progress using the unified track method.

status = client.track("TRANSACTION_ID")
print(f"Current Status: {status.status}") # e.g., 'pending', 'completed'

📊 Models & Data Structures

Every response is returned as a Pydantic model, providing built-in validation and type hinting.

Model Purpose
Currency Details about an asset (ticker, name, network, logo).
Pair Details about available trading pairs.
Estimate Rate and amount calculation results.
SwapResponse Success response and metadata for new swaps.
TrackingResponse Universal status check result.

🛡 Network & Error Handling

The SDK utilizes httpx and raises standard status exceptions for API errors.

import httpx
from veillabs import VeilLabsClient

try:
    with VeilLabsClient() as client:
        result = client.market.get_estimate(fromTicker="eth", ...)
except httpx.HTTPStatusError as e:
    print(f"API returned error: {e.response.status_code}")
except Exception as e:
    print(f"Connection error: {e}")

🔗 Links


📄 License

This SDK is open-source software licensed under the MIT License. See LICENSE for the full text.


Developed with privacy at its core by Veil Labs.

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

veillabs_python_sdk-0.2.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

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

veillabs_python_sdk-0.2.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file veillabs_python_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: veillabs_python_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for veillabs_python_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 658b9712687cf3a99177d97a226358a22705094ddc9df1b2f2aab0ebf2f9a7f2
MD5 45c1f508f830a004d665abbfb091b285
BLAKE2b-256 ff755760f8db58230111f24fdafeb9adada8a4ca56fc03ae11147ef235dcdecb

See more details on using hashes here.

File details

Details for the file veillabs_python_sdk-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for veillabs_python_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a03e8020d786a5f21e89b75a98946f218798c8c92f6bef8ca25a164ffcb8dd1e
MD5 35349b84fbab5d3db024029d262c49cf
BLAKE2b-256 2236fde45b922982bbcfdb2f9de47be4d6ed2981856c6a35db21856074f76f08

See more details on using hashes here.

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