mirror of
https://github.com/Instadapp/boardroom-inc-protocol-Info.git
synced 2024-07-29 22:37:02 +00:00
Add build step
This commit is contained in:
parent
ea2229737a
commit
3c450e6301
|
@ -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<string, ProtocolForScreeener> = ${JSON.stringify(protocolsInfo)};
|
||||
export {protocolsInfoForScreener};
|
||||
`,
|
||||
);
|
||||
|
|
7
types.ts
7
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<typeof ProtocolForScreeenerIo>;
|
||||
|
||||
export type Protocol = t.TypeOf<typeof ProtocolIo>;
|
||||
|
|
Loading…
Reference in New Issue
Block a user