-
Hi! Thanks for creating I'm developing a framework that currently uses TypeChain to generate contract types for user-provided ABIs. I'd much rather use this library, but I'm having trouble using I followed some IntelliSense suggestions to add the following to // tsconfig.json
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true But I still get the following TypeScript errors: I'm a relative TypeScript noob so I could be missing something fundamental here. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Unfortunately TypeScript doesn't support importing JSON as const right now. The best option is to change the file to |
Beta Was this translation helpful? Give feedback.
-
For anyone else in need it looks like @tmm said, const abi = [...] as const;
export ... If you import the object from the |
Beta Was this translation helpful? Give feedback.
-
Is this possible today? Without rename the ABI's to |
Beta Was this translation helpful? Give feedback.
Unfortunately TypeScript doesn't support importing JSON as const right now. The best option is to change the file to
.ts
and add a const assertion there.