From 3c450e6301a958e620e10d8667c8de20a912d665 Mon Sep 17 00:00:00 2001 From: sudheer Date: Thu, 10 Jun 2021 18:28:04 +0530 Subject: [PATCH] Add build step --- scripts/build.ts | 5 ++++- types.ts | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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;