You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, type-paths are feature-gated behind the forc flag --json-abi-with-callpaths.
Once the TS SDK implements support for type paths, forc will make this behavior default.
Running forc build with the flag --json-abi-with-callpaths "outputs json abi with callpaths instead of names for struct and enums". We can take the sway program below as an example:
The second abi names the struct from the std library with its callpath. This is very beneficial because we can use it to differentiate between sway standard library constructs and custom constructs and custom-tailor our typegen and abi-coder for a better developer experience.
For example, the generated types and functions based on the first abi would be
From this rust-sdk issue:
Running
forc build
with the flag--json-abi-with-callpaths
"outputs json abi with callpaths instead of names for struct and enums". We can take the sway program below as an example:Running
forc build
produces these types in the abi:Whereas building it with
--json-abi-with-callpaths
produces this:The second abi names the struct from the std library with its callpath. This is very beneficial because we can use it to differentiate between sway standard library constructs and custom constructs and custom-tailor our typegen and abi-coder for a better developer experience.
For example, the generated types and functions based on the first abi would be
Whereas what we could support with this flag is the following:
This way we can custom-tailor other std types like
EvmAddress
,Identity
,ContractId
, etc.Our typegen currently doesn't support this build flag because it generates the corresponding types like this:
The text was updated successfully, but these errors were encountered: