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
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,14 @@ 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
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
12 changes: 12 additions & 0 deletions abi/packages/arbitrum/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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
12 changes: 12 additions & 0 deletions abi/packages/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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
12 changes: 12 additions & 0 deletions abi/packages/liquidators/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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
12 changes: 12 additions & 0 deletions abi/packages/oracles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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
12 changes: 12 additions & 0 deletions abi/packages/periphery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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
13 changes: 13 additions & 0 deletions abi/packages/utils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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": ""
}
24 changes: 24 additions & 0 deletions abi/scripts/after-build/after-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
GREEN='\033[0;32m'
NOCOLOR='\033[0m'
YELLOW='\033[1;33m'
echo "${YELLOW}==========================================================="
echo "4/4 Creating package.jsons"
echo "===========================================================${NOCOLOR}"

cat ./abi/scripts/after-build/cjs.json >> ./abi/packages/arbitrum/dist/cjs/package.json
cat ./abi/scripts/after-build/cjs.json >> ./abi/packages/core/dist/cjs/package.json
cat ./abi/scripts/after-build/cjs.json >> ./abi/packages/liquidators/dist/cjs/package.json
cat ./abi/scripts/after-build/cjs.json >> ./abi/packages/oracles/dist/cjs/package.json
cat ./abi/scripts/after-build/cjs.json >> ./abi/packages/periphery/dist/cjs/package.json
cat ./abi/scripts/after-build/cjs.json >> ./abi/packages/utils/dist/cjs/package.json

cat ./abi/scripts/after-build/esm.json >> ./abi/packages/arbitrum/dist/esm/package.json
cat ./abi/scripts/after-build/esm.json >> ./abi/packages/core/dist/esm/package.json
cat ./abi/scripts/after-build/esm.json >> ./abi/packages/liquidators/dist/esm/package.json
cat ./abi/scripts/after-build/esm.json >> ./abi/packages/oracles/dist/esm/package.json
cat ./abi/scripts/after-build/esm.json >> ./abi/packages/periphery/dist/esm/package.json
cat ./abi/scripts/after-build/esm.json >> ./abi/packages/utils/dist/esm/package.json

echo "${GREEN}==========================================================="
echo "Packages created successfully!"
echo "===========================================================${NOCOLOR}\a"
3 changes: 3 additions & 0 deletions abi/scripts/after-build/cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
3 changes: 3 additions & 0 deletions abi/scripts/after-build/esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
23 changes: 23 additions & 0 deletions abi/scripts/tsconfig/tsconfig-base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"declaration": true,
"declarationDir": "dist/types",
"esModuleInterop": true,
"inlineSourceMap": false,
"lib": ["esnext"],
"listEmittedFiles": false,
"listFiles": false,
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"pretty": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"traceResolution": false,
},
"compileOnSave": false,
"exclude": ["node_modules"],
"include": ["src"],
}
Loading