> For the complete documentation index, see [llms.txt](https://docs.wheelx.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wheelx.fi/sdk-and-widget/python-sdk.md).

# Python SDK

Developers can use the **Python SDK** to build backend services and automation scripts that interact with the **Multichain Bridge + DEX AI Aggregator** platform.

<https://github.com/wheelx-fi/wheelx-sdk/tree/main/python>

### Install

```
pip install wheelx-sdk
```

With Web3 support for transaction execution:

```
pip install wheelx-sdk[web3]
```

### Quick Start

```
from wheelx_sdk import WheelXSDK, QuoteRequest

sdk = WheelXSDK()

quote_request = QuoteRequest(
from_chain=1,
to_chain=1,
from_token="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",  # USDC
to_token="0xdAC17F958D2ee523a2206206994597C13D831ec7",    # USDT
from_address="0x742d35Cc6634C0532925a3b8Dc9F6A7c5D3a7C6a",
to_address="0x742d35Cc6634C0532925a3b8Dc9F6A7c5D3a7C6a",
amount=1000000,
slippage=50
)

quote = sdk.get_quote(quote_request)
print(f"Quote received: {quote.amount_out}")
print(f"Request ID: {quote.request_id}")
```

### Transaction Execution

```
from wheelx_sdk import TransactionExecutor

executor = TransactionExecutor("https://mainnet.infura.io/v3/YOUR_PROJECT_ID")
transaction = executor.build_transaction(quote.tx, quote_request.from_address)
tx_hash = executor.sign_and_send_transaction(transaction, "YOUR_PRIVATE_KEY")
print(f"Transaction sent: {tx_hash}")
receipt = executor.wait_for_transaction(tx_hash)
print(f"Confirmed in block: {receipt.blockNumber}")
```

### API Reference

#### WheelXSDK

| Method                         | Description                       |
| ------------------------------ | --------------------------------- |
| `WheelXSDK(base_url?)`         | Create new SDK instance           |
| `get_quote(quote_request)`     | Get a quote for token swap/bridge |
| `get_order_status(request_id)` | Get order status by request ID    |

#### TransactionExecutor

| Method                                       | Description                        |
| -------------------------------------------- | ---------------------------------- |
| `build_transaction(tx_data, address)`        | Build transaction dict for signing |
| `sign_and_send_transaction(tx, private_key)` | Sign and send transaction          |
| `wait_for_transaction(tx_hash, timeout=300)` | Wait for confirmation              |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.wheelx.fi/sdk-and-widget/python-sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
