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

EIP712 - Cannot pass a string as chainId #3026

Closed
1 task done
freemanzMrojo opened this issue Nov 19, 2024 · 2 comments
Closed
1 task done

EIP712 - Cannot pass a string as chainId #3026

freemanzMrojo opened this issue Nov 19, 2024 · 2 comments

Comments

@freemanzMrojo
Copy link
Contributor

freemanzMrojo commented Nov 19, 2024

Check existing issues

Viem Version

2.21.45

Current Behavior

Currently the TypedDataDomain looks like this:

export type TypedDataDomain = {
  chainId?: number | undefined
  name?: string | undefined
  salt?: ResolvedRegister['bytesType']['outputs'] | undefined
  verifyingContract?: Address | undefined
  version?: string | undefined
}

Sometimes the chainId might be larger than a number, so I was wondering whether it would be possible to also support string and bigint (or maybe just string) for that field.

I have seen in another "famous library" (:p) that the type for chainId is number | bigint | string | null.

Thanks in advance.

Expected Behavior

I can pass a string as chainId. Specifically, I would like to be able to pass these values:

  1. 14018334920824264832118464179726739019961432051877733167310318607178
  2. 1176455790972829965191905223412607679856028701100105089447013101863
  3. 20257036855429895315704288894496386224204271168750785572924599986678

Steps To Reproduce

No response

Link to Minimal Reproducible Example

No response

Anything else?

No response

@freemanzMrojo
Copy link
Contributor Author

Closing this in favor of wevm/abitype#256 since I saw the type is defined there.

Copy link
Contributor

github-actions bot commented Dec 7, 2024

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Viem version. If you have any questions or comments you can create a new discussion thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant