{"name":"@signinwithethereum/siwe-parser","version":"4.2.0","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.2.0","maintainers":[{"name":"brantlyefp","email":"brantly@ethfollow.xyz"},{"name":"jwahdatehagh","email":"jalil@1001.digital"}],"homepage":"https://github.com/signinwithethereum/siwe","bugs":{"url":"https://github.com/signinwithethereum/siwe/issues"},"dist":{"shasum":"19f0aec8d850d16aadcbb03d47d6b04cdaa3029d","tarball":"http://registry-npm.ywwl.com/@signinwithethereum/siwe-parser/download/@signinwithethereum/siwe-parser-4.2.0.tgz","fileCount":6,"integrity":"sha512-e3edh8XpZrEjbzVYc0BZ4ySFOa8RKTZOQTafSf1E6ejCB5XcBH93jEpYmjzry1EEocgMNq4KlB3YunsFNCXakQ==","signatures":[{"sig":"MEYCIQDXQkcVAgMNmEqIOdwQam4WZ1btCCv2fviSAlBZ8PiAyQIhAKG2QFvkaP+scopPp/Sm+KIaCMUoQKkRYqVeOMDI8f3F","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127572,"size":25107,"noattachment":false,"key":"/@signinwithethereum/siwe-parser/-/@signinwithethereum/siwe-parser-4.2.0.tgz"},"main":"dist/parsers.cjs","type":"module","_from":"file:signinwithethereum-siwe-parser-4.2.0.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/90382612d2217a87fb6a1a217a5a15eb/signinwithethereum-siwe-parser-4.2.0.tgz","_integrity":"sha512-e3edh8XpZrEjbzVYc0BZ4ySFOa8RKTZOQTafSf1E6ejCB5XcBH93jEpYmjzry1EEocgMNq4KlB3YunsFNCXakQ==","repository":{"url":"git+https://github.com/signinwithethereum/siwe.git","type":"git"},"_npmVersion":"11.11.0","description":"Parse Messages that conform to EIP-4361: Sign in with Ethereum (SIWE)","directories":{},"_nodeVersion":"24.14.1","dependencies":{"apg-js":"^4.4.0","@noble/hashes":"^1.7.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/siwe-parser_4.2.0_1776093175270_0.9765254563269727","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":1776093175411,"_cnpm_publish_time":1776093175411,"dist-tags":{"latest":"4.2.1"}}