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 vault info to vault interface #290

Closed jstashh closed 2 years ago

jstashh commented 2 years ago

Description

Adds a getInfo method to the vault interface which allows fetching basic data about the vault in one call, can be extended in the future if more info is needed.

An example of the data provided:

{
  name: 'Curve MIM Pool Vault',
  symbol: 'yvCurve-MIM',
  apiVersion: '0.4.3',
  emergencyShutdown: false,
  lastReport: 2022-05-23T12:48:47.000Z,
  managementFee: BigNumber { _hex: '0xc8', _isBigNumber: true },
  performanceFee: BigNumber { _hex: '0x07d0', _isBigNumber: true },
  totalAssets: BigNumber { _hex: '0x01ef9f3f4483e5456c54', _isBigNumber: true },
  depositLimit: BigNumber { _hex: '0x084595161401484a000000', _isBigNumber: true },
  debtRatio: BigNumber { _hex: '0x2710', _isBigNumber: true },
  management: '0x727fe1759430df13655ddb0731dE0D0FDE929b04',
  governance: '0xC0E2830724C946a6748dDFE09753613cd38f6767',
  guardian: '0x72a34AbafAB09b15E7191822A679f28E067C4a16',
  rewards: '0x89716Ad7EDC3be3B35695789C475F3e7A3Deb12a'
}

Motivation and Context

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

How Has This Been Tested?

Added unit test

github-actions[bot] commented 2 years ago

size-limit report 📦

Path Size
dist/sdk.cjs.production.min.js 47.5 KB (+0.54% 🔺)
dist/sdk.esm.js 47.83 KB (+0.51% 🔺)