{"name":"@signinwithethereum/siwe-parser","version":"4.0.1","keywords":["ethereum","sign-in","sign-in-with-ethereum","siwe","siwe-parser","sign-in-with-ethereum-parser"],"author":{"name":"Ethereum Identity Foundation"},"license":"Apache-2.0","_id":"@signinwithethereum/siwe-parser@4.0.1","maintainers":[{"name":"jwahdatehagh","email":"jalil@1001.digital"}],"homepage":"https://github.com/signinwithethereum/siwe","bugs":{"url":"https://github.com/signinwithethereum/siwe/issues"},"dist":{"shasum":"8f5ad1890ce9cb984e7977324f11462d4296b7d8","tarball":"http://registry-npm.ywwl.com/@signinwithethereum/siwe-parser/download/@signinwithethereum/siwe-parser-4.0.1.tgz","fileCount":6,"integrity":"sha512-NT1cq5yaGnUc5Fsw2quqdw3zBMvU3yKlAvryuQ4BN0Mxvi4kwX12ahMpX7SZqOj3jrI2KQGZGNzKqZmQql5jcw==","signatures":[{"sig":"MEYCIQDBho02fFEF/1wr0nYPgrk+x2XNH1X525AmJp/pORunegIhALZbpfH6yeRjmx8fPKbKryhkNFjz69G52pt+ek7eWcys","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":125272,"size":24440,"noattachment":false,"key":"/@signinwithethereum/siwe-parser/-/@signinwithethereum/siwe-parser-4.0.1.tgz"},"main":"dist/parsers.cjs","type":"module","_from":"file:signinwithethereum-siwe-parser-4.0.1.tgz","types":"dist/parsers.d.ts","module":"dist/parsers.mjs","exports":{".":{"import":{"types":"./dist/parsers.d.ts","default":"./dist/parsers.mjs"},"require":{"types":"./dist/parsers.d.ts","default":"./dist/parsers.cjs"}}},"scripts":{"apg":"apg -i ./lib/siwe-abnf.txt -o ./lib/siwe-grammar --typescript","lint":"eslint .","test":"vitest run","build":"vite build","format":"prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\""},"_npmUser":{"name":"jwahdatehagh","email":"jalil@1001.digital"},"_resolved":"/tmp/d458edf6c1db6ca6ec23e0386832ae07/signinwithethereum-siwe-parser-4.0.1.tgz","_integrity":"sha512-NT1cq5yaGnUc5Fsw2quqdw3zBMvU3yKlAvryuQ4BN0Mxvi4kwX12ahMpX7SZqOj3jrI2KQGZGNzKqZmQql5jcw==","repository":{"url":"git+https://github.com/signinwithethereum/siwe.git","type":"git"},"_npmVersion":"11.9.0","description":"Parse Messages that conform to EIP-4361: Sign in with Ethereum (SIWE)","directories":{},"_nodeVersion":"24.14.0","dependencies":{"apg-js":"^4.4.0","@noble/hashes":"^1.7.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/siwe-parser_4.0.1_1774290500279_0.06531516485397448","host":"s3://npm-registry-packages-npm-production"},"readme":"# @signinwithethereum/siwe-parser\n\nA parser for [EIP-4361: Sign in with Ethereum](https://eips.ethereum.org/EIPS/eip-4361) messages, using an ABNF grammar for strict specification compliance.\n\n## Installation\n\n```bash\nnpm install @signinwithethereum/siwe-parser\n```\n\n## Usage\n\n### Parsing a SIWE message\n\n```typescript\nimport { ParsedMessage } from '@signinwithethereum/siwe-parser'\n\nconst message = new ParsedMessage(rawMessage)\n\nconsole.log(message.domain)\nconsole.log(message.address)\nconsole.log(message.uri)\nconsole.log(message.version)\nconsole.log(message.chainId)\nconsole.log(message.nonce)\nconsole.log(message.issuedAt)\n```\n\nThe constructor throws if the message does not conform to EIP-4361.\n\n### Validating a URI\n\n```typescript\nimport { isUri } from '@signinwithethereum/siwe-parser'\n\nisUri('https://example.com') // true\n```\n\n### Utilities\n\n```typescript\nimport {\n  isEIP55Address,\n  isValidISO8601Date,\n} from '@signinwithethereum/siwe-parser'\n\nisEIP55Address('0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B') // true\nisValidISO8601Date('2024-01-01T00:00:00Z') // true\n```\n\n## Parsed Fields\n\n| Field            | Type       | Required |\n| ---------------- | ---------- | -------- |\n| `domain`         | `string`   | Yes      |\n| `address`        | `string`   | Yes      |\n| `uri`            | `string`   | Yes      |\n| `version`        | `string`   | Yes      |\n| `chainId`        | `number`   | Yes      |\n| `nonce`          | `string`   | Yes      |\n| `issuedAt`       | `string`   | Yes      |\n| `scheme`         | `string`   | No       |\n| `statement`      | `string`   | No       |\n| `expirationTime` | `string`   | No       |\n| `notBefore`      | `string`   | No       |\n| `requestId`      | `string`   | No       |\n| `resources`      | `string[]` | No       |\n\n## Related\n\nFor full SIWE message creation, signing, and verification (including ERC-1271 and EIP-6492 support), use [`@signinwithethereum/siwe`](https://www.npmjs.com/package/@signinwithethereum/siwe) which includes this parser.\n\n## Disclaimer\n\nOur TypeScript library for Sign In with Ethereum has not yet undergone a formal security\naudit. We welcome continued feedback on the usability, architecture, and security\nof this implementation.\n","publish_time":1774290500418,"_cnpm_publish_time":1774290500418,"dist-tags":{"latest":"4.2.1"}}