Skip to content

Commit

Permalink
fix(EIP712): chainId should support uint256 values (#257)
Browse files Browse the repository at this point in the history
* changed type

* changed type

* Create shiny-kiwis-smash.md

* Update .changeset/shiny-kiwis-smash.md

* Update packages/abitype/src/abi.ts

* Update packages/abitype/src/zod.ts

---------

Co-authored-by: awkweb <[email protected]>
  • Loading branch information
freemanzMrojo and tmm authored Dec 3, 2024
1 parent b3a5976 commit ee60e67
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-kiwis-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"abitype": patch
---

Updated `TypedDataDomain` `chainId` to support `uint256` values via `bigint`.
2 changes: 1 addition & 1 deletion packages/abitype/src/abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export type Abi = readonly (
// Typed Data Types

export type TypedDataDomain = {
chainId?: number | undefined
chainId?: number | bigint | undefined
name?: string | undefined
salt?: ResolvedRegister['bytesType']['outputs'] | undefined
verifyingContract?: Address | undefined
Expand Down
2 changes: 1 addition & 1 deletion packages/abitype/src/zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export const Abi = z
// Typed Data Types

export const TypedDataDomain = z.object({
chainId: z.number().optional(),
chainId: z.union([z.number(), z.bigint()]).optional(),
name: Identifier.optional(),
salt: z.string().optional(),
verifyingContract: Address.optional(),
Expand Down

0 comments on commit ee60e67

Please sign in to comment.