Catalog PyPI
PACKAGE EXPLORERView in registry

across-protocol-py

PyPI

Typed Python client for the Across Protocol bridge API (sync + async).

acrossbridgecross-chaindefiethereumweb3
Versions collected1
Direct dependencies7From release 0.1.0
Last observed20 Oct, 18:26 UTC

README

Version 0.1.0 documentation

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

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.023 Jun 20267

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
robertruben98/across-protocol-py

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:26 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:fd5a060a2da6a58b5395407ac3f6434ce66cca7b8a8d43a23b744d12401e4d19