https://github.com/yearn/yearn-sdk
🦧 SDK for the yearn.finance platform. WIP
https://github.com/yearn/yearn-sdk
defi ethereum sdk yearn
Last synced: over 1 year ago
JSON representation
🦧 SDK for the yearn.finance platform. WIP
- Host: GitHub
- URL: https://github.com/yearn/yearn-sdk
- Owner: yearn
- License: mit
- Created: 2021-01-23T16:35:21.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-02-03T16:25:22.000Z (over 3 years ago)
- Last Synced: 2025-03-20T19:07:25.337Z (over 1 year ago)
- Topics: defi, ethereum, sdk, yearn
- Language: TypeScript
- Homepage: https://npm.im/@yfi/sdk
- Size: 3.35 MB
- Stars: 53
- Watchers: 5
- Forks: 56
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yearn SDK
[](https://github.com/nymmrx/yearn-sdk/actions?query=workflow%3ACI)
[](https://prettier.io/)
## Getting Started
### Installation
```
npm i @yfi/sdk
```
### Configuration/Usage
To use the SDK, you will need to instantiate a Yearn object with your desired configuration;
```
import { Yearn } from "@yfi/sdk";
import { JsonRpcProvider } from "@ethersproject/providers";
// Ethereum mainnet
const chainId = 1;
// It is recommended to use Alchemy for your Web3 provider when using the Yearn SDK.
const rpcUrl = "https://eth-mainnet.alchemyapi.io/v2/secret-id-here";
const yearn = new Yearn(chainId, {
provider: new JsonRpcProvider(rpcUrl)
});
```
## Documentation
Autogenerated documentation can be found [here](https://yearn.github.io/yearn-sdk).
## Helpful links
- 🌐 [Live site](https://yearn.finance)
- ⚖️ [Governance forum](https://gov.yearn.finance)
- 📑 [Documentation](https://docs.yearn.finance)
## Contributing
- Code style follows prettier conventions (`yarn lint`). Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
- PR conventions should follow our guidelines outlined at https://github.com/yearn/yearn-sdk/wiki/PR-conventions
## Releasing the SDK to npmjs
- Get write access to the package on npmjs - https://www.npmjs.com/package/@yfi/sdk
- Login to npm - `npm login`
- Install np - https://www.npmjs.com/package/np
- Checkout and pull the master branch
- Run `yarn build`
- Run `np` and follow the instructions
## Debug the website with a local copy of the sdk
- Install yalc - https://www.npmjs.com/package/yalc
- Run `yarn build`
- Run `yalc publish`
- Clone the website repo, configure the enviornment and open a terminal in it - https://github.com/yearn/yearn-finance-v3
- Run `yalc add @yfi/sdk`
- Run `yarn install`
- Run `yarn start`