Skip to main content

across-protocol-py

CI PyPI Docs Python versions License: MIT

A typed Python client for the Across Protocol bridge API. It wraps the public, keyless quoting endpoints with pydantic v2 models and ships both synchronous and asynchronous httpx-based clients.

  • Sync (AcrossClient) and async (AsyncAcrossClient) clients with identical surfaces.
  • Fully typed (py.typed), validated request/response models.
  • Headline quoting via /suggested-fees, plus /available-routes, /limits, and deposit status tracking with a poll-to-terminal helper.

Installation

pip install across-protocol-py

Quickstart

Get a cross-chain bridge quote (USDC from Ethereum to Polygon) in a few lines:

from across_protocol import AcrossClient

with AcrossClient() as client:
    quote = client.get_suggested_fees(
        input_token="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",   # USDC on Ethereum
        output_token="0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",  # USDC.e on Polygon
        origin_chain_id=1,
        destination_chain_id=137,
        amount=10_000_000,  # 10 USDC (6 decimals)
    )
    print(f"Output amount: {quote.output_amount}")
    print(f"Total relay fee: {quote.total_relay_fee.total}")
    print(f"Estimated fill time: {quote.estimated_fill_time_sec}s")

The async client mirrors the sync API:

import asyncio
from across_protocol import AsyncAcrossClient


async def main() -> None:
    async with AsyncAcrossClient() as client:
        quote = await client.get_suggested_fees(
            input_token="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            output_token="0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
            origin_chain_id=1,
            destination_chain_id=137,
            amount=10_000_000,
        )
        print(quote.output_amount)


asyncio.run(main())

Other endpoints

with AcrossClient() as client:
    routes = client.get_available_routes()             # GET /available-routes
    limits = client.get_limits(...)                    # GET /limits
    status = client.get_deposit_status(                # GET /deposit/status
        origin_chain_id=1, deposit_id=2000000,
    )
    # Block until the deposit reaches a terminal state (filled / refunded / expired):
    final = client.wait_for_deposit(origin_chain_id=1, deposit_id=2000000)

Configuration

The base URL defaults to https://app.across.to/api and can be overridden:

client = AcrossClient(base_url="https://testnet.across.to/api", timeout=30.0)

Development

pip install -e ".[dev]"
ruff check .
mypy src
pytest -q                      # unit tests (respx-mocked)
pytest -m integration -q       # live integration test (hits the real API)

License

MIT

Metadata

Release files for across-protocol-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 across-protocol-py 0.1.0
File Size Uploaded
across_protocol_py-0.1.0.tar.gz 18.6 kB Details

Built distribution (wheel)

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

Total release size: 33.2 kB

Release files / across_protocol_py-0.1.0.tar.gz

Download URL across_protocol_py-0.1.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ce5847b47d04c5d1e6a71912fb2e520096b5825cf8752568b598d331b0c19e34
BLAKE2b-256 checksum
How to use checksums
fd161ad0cdd5da07246c619f7c7da8c4ec24c6129819c09b4f43eb3c1b62df6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

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

Download URL across_protocol_py-0.1.0-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
afc2204e8d3ecca58e523b31919c0c7233976c9582d604f893ea336b4c34ff93
BLAKE2b-256 checksum
How to use checksums
21a512fcb94e3c90005ff9875ad0464638c2c4c8470a0c651fceb7a9752e4439
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