diff --git a/scripts/build.ts b/scripts/build.ts index eabca83..25f2622 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -1,5 +1,6 @@ import fs from "fs"; import mkdirp from "mkdirp"; +import protocolsInfo from "../protocolsInfoForScreener.json"; const protocols = fs.readdirSync("./protocols"); @@ -12,8 +13,10 @@ fs.copyFileSync("./types.ts", "./dist/types.ts"); fs.writeFileSync( "./dist/index.ts", ` - import { Protocol } from "../types"; + import { Protocol, ProtocolForScreeener } from "../types"; export default [${protocolInfo.toString()}] as Protocol[]; + const protocolsInfoForScreener: Record = ${JSON.stringify(protocolsInfo)}; + export {protocolsInfoForScreener}; `, ); diff --git a/types.ts b/types.ts index c42e760..1e627e0 100644 --- a/types.ts +++ b/types.ts @@ -44,4 +44,11 @@ export const ProtocolIo = t.type({ treasuryAddresses: t.union([t.array(t.string), t.undefined]), }); +export const ProtocolForScreeenerIo = t.type({ + name: t.string, + treasuryAddresses: t.array(t.string), +}); + +export type ProtocolForScreeener = t.TypeOf; + export type Protocol = t.TypeOf;