Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/contract packages #57

Open
wants to merge 14 commits into
base: development
Choose a base branch
from
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,13 @@ xcuserdata/

# Environment
.env

# ============================================================================ #
# Packages
# ============================================================================ #

/abi/packages/**/src
/abi/packages/**/dist
/abi/packages/**/tsconfig-base.json
/abi/packages/**/tsconfig-esm.json
/abi/packages/**/tsconfig-cjs.json
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ hh-build:; npm run hh:build
lint:; npm run lint
lint-fix:; npm run lint:fix
scripts-admin:; npm run scripts:admin
scripts-abis:; npm run scripts:abis
scripts-interfaces:; npm run scripts:interfaces
scripts-poke:; npm run scripts:poke
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,11 @@ Run `make scripts-interfaces` to automatically (re)generate interfaces and ABIs
Run `make lint-fix` to run the automatic linter across the entire codebase and autofix any issues.

It is recommended you install the following [VSCode extensions](.vscode/extensions.json) if you use VSCode.

# Available Scripts

For interface and abi generation after editing a contract run `npm scripts:interfaces`.

To generate typechain packages run `npm scripts:abis` and to publish run `./scripts/abi/publish.sh`.

To get fuse data run `npm scripts:poke` or `npm scripts:admin`.
Empty file removed abi/core/CTokenInterfaces.json
Empty file.
1 change: 0 additions & 1 deletion abi/core/CarefulMath.json

This file was deleted.

Empty file removed abi/core/ComptrollerStorage.json
Empty file.
Empty file removed abi/core/ErrorReporter.json
Empty file.
1 change: 0 additions & 1 deletion abi/core/Exponential.json

This file was deleted.

1 change: 0 additions & 1 deletion abi/core/ExponentialNoError.json

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion abi/core/SafeMath.json

This file was deleted.

Empty file.
4 changes: 4 additions & 0 deletions abi/packages/arbitrum/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src
tsconfig-base.json
tsconfig-cjs.json
tsconfig-esm.json
16 changes: 16 additions & 0 deletions abi/packages/arbitrum/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Typechain Fuse Arbitrum Contracts

This is package contains an ethers interface of all arbitrum contracts in the fuse-v1 repository.

For more information, visit the [repository](https://github.com/Rari-Capital/fuse-v1).

## Usage

```js
import { FuseSafeLiquidatorArbitrum__factory } from "@fuse-v1/arbitrum";

const contract = FuseSafeLiquidatorArbitrum__factory.connect(
contractAddress,
web3Provider
);
```
31 changes: 31 additions & 0 deletions abi/packages/arbitrum/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "@fuse-v1/arbitrum",
"version": "1.0.2",
"types": "./dist/types/index.d.ts",
"exports": {
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Rari-Capital/fuse-v1.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Rari-Capital/fuse-v1/issues"
},
"homepage": "https://github.com/Rari-Capital/fuse-v1#readme",
"dependencies": {
"@typechain/ethers-v5": "^10.1.0",
"ethers": "^5.6.8",
"typechain": "^8.1.0",
"typescript": "^4.7.3"
},
"main": "index.js",
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig-esm.json && tsc -p tsconfig-cjs.json"
},
"devDependencies": {},
"description": ""
}
4 changes: 4 additions & 0 deletions abi/packages/core/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src
tsconfig-base.json
tsconfig-cjs.json
tsconfig-esm.json
16 changes: 16 additions & 0 deletions abi/packages/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Typechain Fuse Core Contracts

This is package contains an ethers interface of all core contracts in the fuse-v1 repository.

For more information, visit the [repository](https://github.com/Rari-Capital/fuse-v1).

## Usage

```js
import { RewardsDistributorDelegate__factory } from "@fuse-v1/core";

const contract = RewardsDistributorDelegate__factory.connect(
contractAddress,
web3Provider
);
```
30 changes: 30 additions & 0 deletions abi/packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "@fuse-v1/core",
"version": "1.0.2",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"types": "./dist/types/index.d.ts",
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig-esm.json && tsc -p tsconfig-cjs.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Rari-Capital/fuse-v1.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Rari-Capital/fuse-v1/issues"
},
"homepage": "https://github.com/Rari-Capital/fuse-v1#readme",
"dependencies": {
"@typechain/ethers-v5": "^10.1.0",
"ethers": "^5.6.8",
"typechain": "^8.1.0",
"typescript": "^4.7.3"
},
"description": "This is package contains an ethers interface of all core contracts in the fuse-v1 repository.",
"main": "index.js"
}
4 changes: 4 additions & 0 deletions abi/packages/liquidators/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src
tsconfig-base.json
tsconfig-cjs.json
tsconfig-esm.json
16 changes: 16 additions & 0 deletions abi/packages/liquidators/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Typechain Fuse Liquidator Contracts

This is package contains an ethers interface of all liquidator contracts in the fuse-v1 repository.

For more information, visit the [repository](https://github.com/Rari-Capital/fuse-v1).

## Usage

```js
import { UniswapLpTokenLiquidator__factory } from "@fuse-v1/liquidators";

const contract = UniswapLpTokenLiquidator__factory.connect(
liquidatorAddress,
web3Provider
);
```
29 changes: 29 additions & 0 deletions abi/packages/liquidators/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "@fuse-v1/liquidators",
"version": "1.0.3",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"types": "./dist/types/index.d.ts",
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig-esm.json && tsc -p tsconfig-cjs.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Rari-Capital/fuse-v1.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Rari-Capital/fuse-v1/issues"
},
"homepage": "https://github.com/Rari-Capital/fuse-v1#readme",
"dependencies": {
"@typechain/ethers-v5": "^10.1.0",
"ethers": "^5.6.8",
"typechain": "^8.1.0",
"typescript": "^4.7.3"
},
"description": ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to add a description for each package

}
4 changes: 4 additions & 0 deletions abi/packages/oracles/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src
tsconfig-base.json
tsconfig-cjs.json
tsconfig-esm.json
13 changes: 13 additions & 0 deletions abi/packages/oracles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Typechain Fuse Oracle Contracts

This is package contains an ethers interface of all oracle contracts in the fuse-v1 repository.

For more information, visit the [repository](https://github.com/Rari-Capital/fuse-v1).

## Usage

```js
import { PriceOracle__factory } from "@fuse-v1/oracles";

const contract = PriceOracle__factory.connect(oracleAddress, web3Provider);
```
29 changes: 29 additions & 0 deletions abi/packages/oracles/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "@fuse-v1/oracles",
"version": "1.0.2",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"types": "./dist/types/index.d.ts",
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig-esm.json && tsc -p tsconfig-cjs.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Rari-Capital/fuse-v1.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Rari-Capital/fuse-v1/issues"
},
"homepage": "https://github.com/Rari-Capital/fuse-v1#readme",
"dependencies": {
"@typechain/ethers-v5": "^10.1.0",
"ethers": "^5.6.8",
"typechain": "^8.1.0",
"typescript": "^4.7.3"
},
"description": ""
}
4 changes: 4 additions & 0 deletions abi/packages/periphery/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src
tsconfig-base.json
tsconfig-cjs.json
tsconfig-esm.json
16 changes: 16 additions & 0 deletions abi/packages/periphery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Typechain Fuse Periphery Contracts

This is package contains an ethers interface of all periphery contracts in the fuse-v1 repository.

For more information, visit the [repository](https://github.com/Rari-Capital/fuse-v1).

## Usage

```js
import { FusePoolDirectory__factory } from "@fuse-v1/periphery";

const contract = FusePoolDirectory__factory.connect(
contractAddress,
web3Provider
);
```
29 changes: 29 additions & 0 deletions abi/packages/periphery/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "@fuse-v1/periphery",
"version": "1.0.2",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"types": "./dist/types/index.d.ts",
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig-esm.json && tsc -p tsconfig-cjs.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Rari-Capital/fuse-v1.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Rari-Capital/fuse-v1/issues"
},
"homepage": "https://github.com/Rari-Capital/fuse-v1#readme",
"dependencies": {
"@typechain/ethers-v5": "^10.1.0",
"ethers": "^5.6.8",
"typechain": "^8.1.0",
"typescript": "^4.7.3"
},
"description": ""
}
4 changes: 4 additions & 0 deletions abi/packages/utils/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src
tsconfig-base.json
tsconfig-cjs.json
tsconfig-esm.json
16 changes: 16 additions & 0 deletions abi/packages/utils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Typechain Fuse Utility Contracts

This is package contains an ethers interface of all utility contracts in the fuse-v1 repository.

For more information, visit the [repository](https://github.com/Rari-Capital/fuse-v1).

## Usage

```js
import { InitializableClones__factory } from "@fuse-v1/utils";

const contract = InitializableClones__factory.connect(
contractAddress,
web3Provider
);
```
29 changes: 29 additions & 0 deletions abi/packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "@fuse-v1/utils",
"version": "1.0.2",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"types": "./dist/types/index.d.ts",
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig-esm.json && tsc -p tsconfig-cjs.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Rari-Capital/fuse-v1.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Rari-Capital/fuse-v1/issues"
},
"homepage": "https://github.com/Rari-Capital/fuse-v1#readme",
"dependencies": {
"@typechain/ethers-v5": "^10.1.0",
"ethers": "^5.6.8",
"typechain": "^8.1.0",
"typescript": "^4.7.3"
},
"description": ""
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading