Skip to main content

debridge-py

CI PyPI Docs Python versions License: MIT

Typed Python client for the deBridge DLN cross-chain swap/order API. Works across EVM chains and Solana (19+ chains), sync and async, with full type hints (py.typed), built on httpx + pydantic v2.

The client covers the public, no-auth data endpoints needed to quote and track cross-chain orders. Signing and broadcasting the returned transaction is left to you (optionally with the [exec] extra: web3.py for EVM, solders for Solana).

Install

pip install debridge-py
# optional signing helpers:
pip install "debridge-py[exec]"

Quickstart

from debridge import DebridgeClient
from debridge.constants import ChainId

with DebridgeClient() as client:
    # 1. discover supported chains
    chains = client.get_supported_chains()

    # 2. quote + build a cross-chain order (10 USDC Base -> USDC Arbitrum)
    order = client.create_order(
        src_chain_id=ChainId.BASE,
        src_chain_token_in="0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        src_chain_token_in_amount="10000000",          # 10 USDC (6 decimals)
        dst_chain_id=ChainId.ARBITRUM,
        dst_chain_token_out="0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
        dst_chain_token_out_amount="auto",              # API quotes the output
        dst_chain_token_out_recipient="0xYourRecipient",
        sender_address="0xYourSender",
    )
    print(order.estimation.dst_chain_token_out.amount)  # estimated output
    print(order.tx.to, order.tx.value, order.tx.data)   # tx to sign & send

    # 3. after broadcasting order.tx, poll until the order settles
    final = client.poll_status(order.order_id, interval=5, timeout=600)
    print(final.status)  # e.g. "Fulfilled"

Async

import asyncio
from debridge import AsyncDebridgeClient

async def main():
    async with AsyncDebridgeClient() as client:
        chains = await client.get_supported_chains()
        print(len(chains.chains))

asyncio.run(main())

EVM and Solana

Addresses and amounts are kept as strings so the same models represent both 0x-hex (EVM) and base58 (Solana) values and amounts beyond 64-bit range. The returned transaction adapts to the source chain:

  • EVM source → order.tx has data, to, value (an EVM call).
  • Solana source → order.tx has only data (the serialized versioned tx as hex).

Native-token sentinels are exposed as constants.EVM_NATIVE_TOKEN and constants.SOLANA_NATIVE_TOKEN.

API surface

Method Endpoint
get_supported_chains() GET /supported-chains-info
get_token_list(chain_id) GET /token-list
create_order(...) GET /dln/order/create-tx
get_order_status(order_id) GET /dln/order/{id}/status
get_order(order_id) GET /dln/order/{id}
poll_status(order_id, interval, timeout) polls status to a terminal state

Every method exists on both DebridgeClient (sync) and AsyncDebridgeClient (async, with await). Errors raise DebridgeAPIError (a DebridgeError), exposing .error_id, .error_code, .message, .req_id, .status_code — including compliance blocks that the API returns with HTTP 200.

Configuration

DebridgeClient(base_url="https://my-proxy.example/v1.0", timeout=30.0)

base_url defaults to https://dln.debridge.finance/v1.0 and can point at any compatible endpoint.

Development

uv venv --python 3.9 && source .venv/bin/activate
uv pip install -e ".[dev]"
pytest            # unit tests (network mocked, integration deselected)
pytest -m integration   # one live test against the real API
ruff check . && ruff format --check .
mypy

See CONTRIBUTING.md for the full contributor workflow and CHANGELOG.md for release history.

License

MIT — see LICENSE.

Metadata

Release files for debridge-py 0.1.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 debridge-py 0.1.0
File Size Uploaded
debridge_py-0.1.0.tar.gz 16.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for debridge-py 0.1.0
File Interpreter ABI Platform
debridge_py-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.1 kB

Release files / debridge_py-0.1.0.tar.gz

Download URL debridge_py-0.1.0.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7968047b55ebd67a169ac52b3eb9f9328c93f5a0c42addcd38bcfabbb8ec9e7a
BLAKE2b-256 checksum
How to use checksums
11e6e08c1521bb96ce2323a971c1a253469af8840ac87a5e9f8f122236862a0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / debridge_py-0.1.0-py3-none-any.whl

Download URL debridge_py-0.1.0-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea00c0582ceefd250e6a4a2e9a30b3644e35fbf32415c2bfb35e1beb57413aa6
BLAKE2b-256 checksum
How to use checksums
4f93de41dd443777fa1115c3588d5f91653f7d9e38bed320ef705b134f8af342
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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