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({
        "ticker_from": "eth",
        "ticker_to": "usdc",
        "amount": "1.0",
        "network_from": "mainnet",
        "network_to": "mainnet"
    })
    print(f"1 ETH = {estimate.estimated_amount} USDC")

Asynchronous Client

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

import asyncio
from veillabs import AsyncVeilLabsClient, SwapRequest

async def main():
    async with AsyncVeilLabsClient() as client:
        # Create a swap using a Pydantic model for full type safety
        req = SwapRequest(
            ticker_from="eth",
            ticker_to="usdt",
            amount="1.0",
            address_to="0x123...",
            network_from="mainnet",
            network_to="bsc"
        )
        swap = await client.swap.create(req)
        print(f"Swap created with ID: {swap.id}")

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. Accepts EstimateRequest or dict.
  • get_ranges(params): Determine transaction limits. Accepts RangeRequest or dict.

2. Private Swaps (client.swap)

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

from veillabs import SwapRequest

# Option A: Using the SwapRequest model (Recommended)
req = SwapRequest(
    ticker_from="eth",
    ticker_to="btc",
    amount="0.5",
    address_to="1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",
    network_from="mainnet",
    network_to="mainnet"
)
swap = client.swap.create(req)

# Option B: Using a dictionary
swap = client.swap.create({
    "ticker_from": "eth",
    "ticker_to": "btc",
    ...
})

3. Private Seed Distribution (client.seed)

Distribute a fixed amount of cryptocurrency to multiple recipient addresses.

from veillabs import SeedRequest

seed = client.seed.create(SeedRequest(
    ticker_from="usdt",
    ticker_to="usdt",
    amount="1000",
    destinations=[
        {"address": "0x123...", "percentage": 50, "ticker": "usdt", "network": "bsc"},
        {"address": "0x456...", "percentage": 50, "ticker": "usdt", "network": "bsc"}
    ],
    network_from="bsc",
    network_to="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

The SDK uses Pydantic for both requests and responses, providing built-in validation and IDE autocompletion.

Request Models (Input)

Model Purpose
EstimateRequest Parameters for rate calculations.
SwapRequest Parameters for creating a private swap.
SeedRequest Parameters for asset distribution.
TransferRequest Parameters for a single proxy transfer.

Response Models (Output)

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 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, EstimateRequest

try:
    with VeilLabsClient() as client:
        req = EstimateRequest(ticker_from="eth", ...)
        result = client.market.get_estimate(req)

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.3.0.tar.gz (37.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.3.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for veillabs_python_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 4fdf70589147480200c1e64d97f39d3df4692f0c6b81fc0c350942ed9b4cadf3
MD5 bd64066ce683ff53c6f5432f49f5335c
BLAKE2b-256 fa7fe707c5848f067fa43b1c5b238c1fc081ab56d64a4ea051d7f8832688f003

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for veillabs_python_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98ca2efe8f0e2f4628590508a0268aee3b35af8c615a2eabf037964d91125585
MD5 187d335a6788430de0c93792e599b33f
BLAKE2b-256 9dedee9b001e58e5cc142ae7fb0d6901551c5cdb9222501462776ff1b7ba5069

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