Skip to main content

Rust SDK

The legend-client crate is a typed HTTP client for the Legend API. It’s the same SDK that powers the legend-cli binary.

Installation

Client Setup

Accounts

Plans

All 14 plan types are supported: earn, withdraw, swap, transfer, borrow, repay, claim_rewards, loop_long, unloop_long, add_backing, withdraw_backing, migrate, swap_and_supply, reinvest_rewards.

Portfolio and Activities

Reference Data

Error Handling

Signing with legend-signer

The companion legend-signer crate handles P256 key management and Turnkey signing:
On macOS, use KeychainSigner for Keychain-stored keys: