Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chainId can be String #15

Open
josh-burton opened this issue Jan 10, 2022 · 5 comments · May be fixed by #16
Open

chainId can be String #15

josh-burton opened this issue Jan 10, 2022 · 5 comments · May be fixed by #16

Comments

@josh-burton
Copy link
Contributor

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.

@josh-burton josh-burton linked a pull request Jan 10, 2022 that will close this issue
@RootSoft
Copy link
Owner

Thanks for the PR.
I will review it asap

@RootSoft
Copy link
Owner

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).

@josh-burton
Copy link
Contributor Author

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.

@RootSoft
Copy link
Owner

RootSoft commented Mar 1, 2022

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/)

@kevin-sakemaer
Copy link

any update on this ? we got the problem with Elrond wallet maiar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants