> 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 WheelX AI-powered aggregation 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              |
