keep-starknet-strange / abi-wan-kanabi

Abi parser for Cairo smart contracts, based on wagmi abitype
The Unlicense
59 stars 19 forks source link

Config error #72

Closed penovicp closed 2 months ago

penovicp commented 3 months ago

There is an issue with the configuration as documented in the README.

It's supposed to work through declaration merging, however, with the base Config being a type and the example extension being an interface instead of a merge a Duplicate identifier 'Config'. ts(2300) error happens. The error can be seen in starknet.js for all TypeScript v5 versions with the latest v5.5 having stricter behaviour and preventing the declaration file build step. The error doesn't stop type inference from working (as mentioned in the possibly related issue https://github.com/starknet-io/starknet.js/issues/1192#issuecomment-2262542921), it does stop ResolvedConfig from having the desired result (stackblitz example).

Changing the base Config to an interface (export interface Config<OptionT = any, ResultT = any, ErrorT = any> {}) resolves the error and the ResolvedConfig result.