legend-client
Rust client library for the Legend API. This is the same client that powers legend-cli.
Install
[]
= "0.0.1"
= { = "1", = ["full"] }
Usage
use ;
let client = new;
// List accounts
let accounts = client.accounts.list.await?;
// View portfolio
let folio = client.accounts.folio.await?;
// Create and execute a plan
use EarnParams;
let plan = client.plan.earn.await?;
let digest = plan.digest.expect;
All 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.
Error handling
use LegendPrimeError;
match client.accounts.get.await
License
MIT