{"id":28380669,"url":"https://github.com/0xsequence/ethers-eip712","last_synced_at":"2025-08-04T08:38:23.092Z","repository":{"id":63524386,"uuid":"285854214","full_name":"0xsequence/ethers-eip712","owner":"0xsequence","description":"Ethereum Typed Data Hashing and Signing (EIP712) implementation for ethers.js","archived":false,"fork":false,"pushed_at":"2020-08-10T17:26:20.000Z","size":98,"stargazers_count":40,"open_issues_count":2,"forks_count":5,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-06-06T03:39:54.201Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xsequence.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-07T14:53:18.000Z","updated_at":"2024-04-23T11:41:16.000Z","dependencies_parsed_at":"2022-11-20T16:02:18.096Z","dependency_job_id":null,"html_url":"https://github.com/0xsequence/ethers-eip712","commit_stats":null,"previous_names":["arcadeum/ethers-eip712"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/0xsequence/ethers-eip712","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fethers-eip712","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fethers-eip712/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fethers-eip712/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fethers-eip712/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xsequence","download_url":"https://codeload.github.com/0xsequence/ethers-eip712/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fethers-eip712/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259810961,"owners_count":22915134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-30T03:09:03.112Z","updated_at":"2025-06-16T13:10:11.187Z","avatar_url":"https://github.com/0xsequence.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ethers-eip712\n=============\n\n`ethers-eip712` is an npm package that implements the Ethereum Typed Data (EIP712)\nfor structured data hashing and signing proposal, written in TypeScript for ethers.js.\n\nEIP712: https://eips.ethereum.org/EIPS/eip-712\n\n## Usage\n\n`yarn install ethers-eip712` or `npm install ethers-eip712`\n\nNOTE: both ethers v4 and ethers v5 are compatible by this single library.\n\n\n## Example\n\n```typescript\nimport { ethers } from 'ethers'\nimport { TypedDataUtils } from 'ethers-eip712'\n\nconst typedData = {\n  types: {\n    EIP712Domain: [\n      {name: \"name\", type: \"string\"},\n      {name: \"version\", type: \"string\"},\n      {name: \"chainId\", type: \"uint256\"},\n      {name: \"verifyingContract\", type: \"address\"},\n    ],\n    Person: [\n      {name: \"name\", type: \"string\"},\n      {name: \"wallet\", type: \"address\"},  \n    ]\n  },\n  primaryType: 'Person' as const,\n  domain: {\n    name: 'Ether Mail',\n    version: '1',\n    chainId: 1,\n    verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC'\n  },\n  message: {\n    'name': 'Bob',\n    'wallet': '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB'\n  }\n}\n\nconst digest = TypedDataUtils.encodeDigest(typedData)\nconst digestHex = ethers.utils.hexlify(digest)\n\nconst wallet = ethers.Wallet.createRandom()\nconst signature = wallet.signMessage(digest)\n```\n\n[See tests for more examples](./tests/typed-data.test.ts)\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsequence%2Fethers-eip712","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xsequence%2Fethers-eip712","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsequence%2Fethers-eip712/lists"}