Skip to main content

Python SDK

The official Python client for the Legend API. Async-first, built on httpx.

Installation

For signing transactions, you’ll also need eth-account:

Quick start

Client configuration

The client supports async context manager for automatic cleanup:
Or manage the lifecycle manually:

Accounts

Plans

Yield

Swaps

Transfers

Borrowing

Leverage

Migration

Sign and execute

Reference data

Error handling