-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
42 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {mkdir, stat, writeFile} from 'node:fs/promises'; | ||
import {resolve} from 'node:path'; | ||
import ens from '@ensdomains/ens'; | ||
import resolver from '@ensdomains/resolver'; | ||
|
||
const outputFolder = './src/abis/'; | ||
const names = ['ENSRegistry', 'FIFSRegistrar', 'ReverseRegistrar', 'PublicResolver'] | ||
|
||
try { | ||
await stat(outputFolder); | ||
} catch (error) { | ||
await mkdir(outputFolder, {recursive: true}); | ||
} | ||
|
||
await writeContracts(ens); | ||
await writeContracts(resolver); | ||
|
||
async function writeContracts(contracts) { | ||
for (const key in contracts) { | ||
if(!names.includes(key)) continue; | ||
await writeFile(resolve(outputFolder, `${key}.json`), JSON.stringify(contracts[key])); | ||
} | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import ENSRegistry from './abis/ENSRegistry.json'; | ||
import FIFSRegistrar from './abis/FIFSRegistrar.json'; | ||
import ReverseRegistrar from './abis/ReverseRegistrar.json'; | ||
import PublicResolver from './abis/PublicResolver.json'; | ||
|
||
export {ENSRegistry, FIFSRegistrar, ReverseRegistrar, PublicResolver}; |
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,6 +1,7 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"include": [ | ||
"src" | ||
"src", | ||
"src/**/*.json" | ||
] | ||
} |