Skip to content

Commit

Permalink
fix: Don't emit invalid typescript for contracts which have no abi me…
Browse files Browse the repository at this point in the history
…thods
  • Loading branch information
tristanmenzel committed Apr 5, 2024
1 parent 5310f98 commit 9264939
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/client/app-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ export function* appTypes(ctx: GeneratorContext): DocumentParts {
yield `export type ${name} = {`
yield IncIndent
yield* jsDoc('Maps method signatures / names to their argument and return types.')
yield 'methods:'
if (app.contract.methods.length == 0) {
yield 'methods: {}'
} else {
yield 'methods:'
}
yield IncIndent
for (const method of app.contract.methods) {
const methodSig = algokit.getABIMethodSignature(method)
Expand Down

0 comments on commit 9264939

Please sign in to comment.