yearn / yearn-sdk

🦧 SDK for the yearn.finance platform. WIP
https://npm.im/@yfi/sdk
MIT License
53 stars 56 forks source link

feat: add ability to fetch strategy harvest info #291

Open jstashh opened 2 years ago

jstashh commented 2 years ago

Description

Add a getHarvests function to StrategiesInterface that returns data about the harvests of a strategy, optionally within a specified window of blocks

Data returned about each Harvest:

export interface HarvestData {
  transactionId: string;
  gain: BigNumber;
  gainUsdc: BigNumber;
  loss: BigNumber;
  time: Date;
  estimatedTotalAssets: BigNumber;
  apr: number;
}

Motivation and Context

Adding more functionality to the SDK for rendering data about vaults/strategies.

How Has This Been Tested?

added unit tests

github-actions[bot] commented 2 years ago

size-limit report 📦

Path Size
dist/sdk.cjs.production.min.js 48.05 KB (+1.17% 🔺)
dist/sdk.esm.js 48.39 KB (+1.18% 🔺)