Open josh-burton opened 2 years ago
Thanks for the PR. I will review it asap
I will update the chainId type to a String
when releasing the stable v1 release to not introduce any breaking changes (hence the reason I wanted to opt in for a dynamic chain id).
Since the package is pre 1.0 its probably a good time to make a breaking change, although it's a pretty minor breaking change as its relaxing a type restriction.
Waiting for 1.0 is probably going to mean this package doesn't work for many people.
I've did some more testing and it will be a more breaking change then expected. Different wallets return the chain id as ints or strings and might result in casting exceptions when parsing the json, so in the end a dynamic type checking must be performed anyways.
It might also break current existing storage solutions (e.g. wallet_connect_secure_storage
)
I don't see a problem with using a dynamic
type field as the json_serializable
package will handle the casting internally, and won't force people to change integer chain ids (which are most common) to strings.
(https://chainlist.org/)
any update on this ? we got the problem with Elrond wallet maiar
Currently chainId is an int, and fails if the chainId is returned as String. It is possible for the chainId to be a String so the param should be a String rather than int.