{"_id":"@attestto/identity-resolver","name":"@attestto/identity-resolver","dist-tags":{"latest":"0.3.0"},"versions":{"0.3.0":{"name":"@attestto/identity-resolver","version":"0.3.0","description":"Identity middleware — resolve DIDs, domains, SBTs, credentials, and compliance status from any wallet address","type":"module","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./providers":{"types":"./dist/providers/index.d.ts","import":"./dist/providers/index.js","require":"./dist/providers/index.cjs"}},"scripts":{"build":"tsup src/index.ts src/providers/index.ts --format esm,cjs --dts --clean","lint":"tsc --noEmit","prepublishOnly":"npm run build"},"keywords":["did","wallet","identity","resolver","sbt","verifiable-credentials","solana","ethereum","sns","ens","civic","ssi"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Attestto-com/identity-resolver.git"},"author":{"name":"Eduardo Chongkan"},"devDependencies":{"tsup":"^8.0.0","typescript":"^5.4.0"},"gitHead":"1cf0401322e8eb583517fb273431eb30651856e4","_id":"@attestto/identity-resolver@0.3.0","bugs":{"url":"https://github.com/Attestto-com/identity-resolver/issues"},"homepage":"https://github.com/Attestto-com/identity-resolver#readme","_nodeVersion":"25.6.1","_npmVersion":"11.9.0","dist":{"integrity":"sha512-i3CTOlG8mdddxQwrD8y7sinV/Wc2w9ZxopEIRMjroQcq8HXORt6oyouZ4z1Ghk3ZB9jnsMN3VewdcdmEzok+3g==","shasum":"4dab9c37cfe466de274f7368bee04eec2ceebab7","tarball":"https://registry.npmjs.org/@attestto/identity-resolver/-/identity-resolver-0.3.0.tgz","fileCount":13,"unpackedSize":28266,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDGmRjk9wja2I3wtka6e8KANjTB7hdbB5eQNQn06b5fuAIgLIhMZIV+F5E7LCq8md+9cl191lovAZL0Gn9+IXCZ2js="}]},"_npmUser":{"name":"chongkan","email":"e.chongkan@gmail.com"},"directories":{},"maintainers":[{"name":"chongkan","email":"e.chongkan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/identity-resolver_0.3.0_1773927723074_0.25740240866333486"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-19T13:42:02.984Z","0.3.0":"2026-03-19T13:42:03.209Z","modified":"2026-03-19T13:42:03.487Z"},"maintainers":[{"name":"chongkan","email":"e.chongkan@gmail.com"}],"description":"Identity middleware — resolve DIDs, domains, SBTs, credentials, and compliance status from any wallet address","homepage":"https://github.com/Attestto-com/identity-resolver#readme","keywords":["did","wallet","identity","resolver","sbt","verifiable-credentials","solana","ethereum","sns","ens","civic","ssi"],"repository":{"type":"git","url":"git+https://github.com/Attestto-com/identity-resolver.git"},"author":{"name":"Eduardo Chongkan"},"bugs":{"url":"https://github.com/Attestto-com/identity-resolver/issues"},"license":"MIT","readme":"# identity-resolver\n\nPluggable on-chain identity discovery for wallet addresses. Given a wallet address and chain, discover all DIDs, SBTs, attestations, and credentials attached to it.\n\nThe consumer decides which identity types to accept and in what priority — no hardcoded assumptions, no hardcoded endpoints.\n\n```\nnpm install identity-resolver\n```\n\n## Quick Start\n\n```ts\nimport { resolveIdentities, sns, pkh } from 'identity-resolver'\n\nconst identities = await resolveIdentities({\n  chain: 'solana',\n  address: 'ATTEstto1234567890abcdef...',\n  providers: [\n    sns({ apiUrl: '/api/sns', resolverUrl: '/api/resolver' }),\n    pkh(),  // Fallback — always resolves, no network calls\n  ],\n})\n\n// Returns: ResolvedIdentity[]\n// [\n//   { provider: 'sns', did: 'did:sns:alice.sol', label: 'alice.sol', type: 'domain', meta: { ... } },\n//   { provider: 'pkh', did: 'did:pkh:solana:5eykt4...:ATTEstto...', label: 'ATTEstto...', type: 'did', meta: {} }\n// ]\n```\n\n## Built-in Providers\n\n| Provider | Type | Network calls |\n|---|---|---|\n| `pkh()` | `did:pkh` fallback | None — deterministic DID from address |\n| `sns(opts)` | SNS `.sol` domains | `apiUrl` for domain lookup, `resolverUrl` for DID Document |\n\n## External Providers\n\nInstall additional providers for more identity types:\n\n```bash\nnpm install @attestto/wir-sns          # SNS domains → did:sns\nnpm install @attestto/wir-attestto-creds  # KYC, SBTs, VCs\nnpm install @attestto/wir-civic        # Civic Pass gateway tokens\nnpm install @attestto/wir-ens          # ENS domains → did:ens\n```\n\n## API\n\n### `resolveIdentities(options): Promise<ResolvedIdentity[]>`\n\n```ts\ninterface ResolveOptions {\n  chain: Chain                    // 'solana', 'ethereum', or custom\n  address: string                 // Wallet address / public key\n  providers: IdentityProvider[]   // Ordered list — defines priority\n  rpcUrl?: string                 // Global RPC override\n  timeoutMs?: number              // Per-provider timeout (default 5000ms)\n  stopOnFirst?: boolean           // Stop after first provider returns results\n  signal?: AbortSignal            // Cancellation\n}\n```\n\n### `ResolvedIdentity`\n\n```ts\ninterface ResolvedIdentity {\n  provider: string                // Which provider found this\n  did: string | null              // Resolved DID, if applicable\n  label: string                   // Human-readable label\n  type: IdentityType              // 'domain' | 'sbt' | 'attestation' | 'credential' | 'did' | 'score'\n  meta: Record<string, unknown>   // Provider-specific metadata\n}\n```\n\n## Writing a Provider\n\n```ts\nimport type { IdentityProvider } from 'identity-resolver'\n\nexport function myProvider(opts: { apiUrl: string }): IdentityProvider {\n  return {\n    name: 'my-provider',\n    chains: ['solana'],\n    async resolve(ctx) {\n      const res = await fetch(`${opts.apiUrl}/resolve/${ctx.address}`)\n      const data = await res.json()\n      return data.identities.map(i => ({\n        provider: 'my-provider',\n        did: i.did,\n        label: i.name,\n        type: 'credential',\n        meta: i,\n      }))\n    },\n  }\n}\n```\n\n## Part of the Identity Middleware Stack\n\n| Step | Package | Role |\n|---|---|---|\n| 1 | WalletConnect / Phantom | Connect wallet → get address |\n| 2 | **identity-resolver** | Resolve address → DIDs, domains, credentials |\n| 3 | [identity-bridge](https://npmjs.com/package/identity-bridge) | Discover credential wallets → VP exchange → verify |\n\n## Security\n\nNo hardcoded endpoints. Every provider requires explicit URLs. See [SECURITY.md](https://github.com/Attestto-com/identity-resolver/blob/main/SECURITY.md).\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-7d7f1a8aaf47fd91056d9872be009bf0"}