How to build predicate ad create abi for predicate?

I have found this code that shows how to build ABI for predicate, Generating Types from ABI | Fuels-ts

here is code that I need to run

yarn exec fuels typegen -i ./abis/*-abi.json -o ./types --predicate

how can I build predicate code to be able get files with …abi.json names related to predicate?


Hey @sway , thanks for reaching out.

Within the inputs parameter, -i in the example that you have posted, we can pass any file path. By default this is set to ../out/*-abi.json and above you have set it to ./abis/*-abi.json.

The asterisk * is denoting a non recursive wildcard search, so within the ./abis directory, all file name instances that end with -abi.json will be returned.

This wildcard search can be altered to return all instances of ...abi.json with the following path: **/*abi.json .


@danielbate Thanks a lot! Can you please check this topic too?

Just will live it here
I have used his command in frontend folder with folowing project structure

npx fuels typegen -i ../predicate/out/debug/*-abi.json -o ./src/types --predicate

after this I have got generated abi files in frontend/src/types folder

1 Like

Wow! Thanks friend :grinning: :grinning: :grinning:

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.