-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from Gearbox-protocol/types_fix
feat: copy only interface types from contracts
- Loading branch information
Showing
620 changed files
with
1,836 additions
and
221,945 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const { resolve } = require("path"); | ||
const { sync: rimraf } = require("rimraf"); | ||
const { glob, runTypeChain } = require("typechain"); | ||
|
||
/** | ||
* This script copies required types from contracts repository | ||
* Which is supposed to be available at `../contracts-v2` | ||
* | ||
* Untils contracts-v2 are published, we have to run it manually and commit src/types | ||
*/ | ||
async function main() { | ||
const src = resolve(process.cwd(), "../contracts-v2/artifacts"); | ||
const dst = resolve(process.cwd(), "src/types"); | ||
const allFiles = glob(src, [ | ||
// interfaces | ||
"!(build-info)/**/I?([A-Z]|st)+([a-zA-Z0-9_]).json", | ||
"**/interfaces/**/+([a-zA-Z0-9_]).json", | ||
// temporary exceptions | ||
"**/Multicall2.json", | ||
]); | ||
|
||
rimraf(dst); | ||
|
||
const result = await runTypeChain({ | ||
cwd: process.cwd(), | ||
filesToProcess: allFiles, | ||
allFiles, | ||
outDir: dst, | ||
target: "ethers-v5", | ||
}); | ||
|
||
console.info(`Copied ${result.filesGenerated} files`); | ||
} | ||
|
||
main().catch(console.error); |
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.