-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: sdk cleaning old useless stuff (#284)
- Loading branch information
Showing
18 changed files
with
5 additions
and
408 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,9 @@ | ||
# <img src="logo.svg" alt="Angle SDK" height="40px"> Angle SDK | ||
|
||
- [Angle SDK](#angle-sdk) | ||
- [Warning:](#warning) | ||
- [Estimators](#estimators) | ||
- [Example:](#example) | ||
- [Ethereum Read & Write](#ethereum-read--write) | ||
- [Example:](#example-1) | ||
- [Keeper functions](#keeper-functions) | ||
- [Constants](#constants) | ||
- [Lib](#lib) | ||
- [Build and use in development environment](#build-and-use-in-development-enviroment) | ||
|
||
SDK to build applications on top of [Angle Protocol](https://angle.money). | ||
This is a SDK maintained by Angle Labs to build applications on top of [Angle Protocol](https://angle.money) and [Merkl](https://merkl.angle.money). | ||
|
||
## Warning | ||
|
||
This SDK is in open beta, and is constantly under development. USE AT YOUR OWN RISK. | ||
|
||
Please make sure you're using the last SDK version, otherwise the results / addresses may be incorrect. | ||
|
||
## Estimators | ||
|
||
Estimators are utility functions to preview the result of Angle's operations. | ||
|
||
```js | ||
import { estimateMint, parseAmount } from '@angleprotocol/sdk'; | ||
// To compute the amount of stablecoin you'd get from a mint | ||
|
||
const stablecoinsObtained = await estimateMint(parseAmount.usdc(1), 'USDC', 'agEUR'); | ||
console.log(stablecoinsObtained); | ||
``` | ||
|
||
## Ethereum Read & Write | ||
|
||
Located in the `calls` folder, these functions are example of scripted interactions with Angle Protocol's contracts. | ||
|
||
```js | ||
import { ethers } from 'ethers'; | ||
|
||
import { ChainId, harvest } from '@angleprotocol/sdk'; | ||
// To harvest a collateral strategy | ||
|
||
const signer = // initialize an ethers signer | ||
|
||
const receipt = await harvest(ChainId.MAINNET, 'agEUR', 'USDC', signer); | ||
await receipt.wait(); | ||
``` | ||
|
||
## Keeper functions | ||
|
||
Located in the `calls` folder, a set of functions that can be used to build keeper bots | ||
|
||
## Constants | ||
|
||
Located in the `constants` folder, all the contract addresses, parameters and abis | ||
|
||
## Lib | ||
|
||
Located in the `lib` folder, a set of classes and utilities that can be used to work with big numbers | ||
|
||
### Build and use in development environment | ||
|
||
1. To properly generate the ABI types run `yarn generate-types-from-abis`. | ||
|
||
2. To build the SDK run `yarn build`. | ||
|
||
3. Once built, run `yarn link`. This will create a symbolic link to this package in your local yarn repositories. | ||
|
||
4. To add the local package to your project, go in the root directory of your project (where you would typically run `yarn add ...`) and run `yarn link @angleprotocol/sdk`. _Notice that `@angleprotocol/sdk` is the name of the SDK project in its `package.json` file._ | ||
|
||
If you update the SDK you will have to rerun Step 1 but the linking to the newest version will be done automatically in the other projects (you do not need to rerun Steps 2 and 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@angleprotocol/sdk", | ||
"version": "3.0.126", | ||
"description": "SDK for Angle Protocol DApps", | ||
"description": "SDK for Angle DApps", | ||
"keywords": [ | ||
"angle", | ||
"angle money", | ||
|
@@ -26,7 +26,7 @@ | |
}, | ||
"license": "GPL-3.0-or-later", | ||
"author": { | ||
"name": "Angle Core Team", | ||
"name": "Angle Labs", | ||
"email": "[email protected]", | ||
"url": "https://angle.money" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.