Context
PR#116 (pending) adds a PassportClient to the SDK with typed credential verification. A common SDK use-case is checking whether a passport has been revoked — this should be efficient and cache-friendly to avoid hammering the API.
What to implement
Method: PassportClient.isRevoked(passportId)
async isRevoked(passportId: string): Promise<boolean>
Caching
- Cache the result per
passportId for 60 seconds (configurable via cacheMs option)
- On cache hit: return cached result
- On cache miss: call
GET /api/protocol/passport/:id and check status === 'revoked'
- Revocation is permanent — once
true, cache indefinitely
Constructor option
new PassportClient({ baseUrl, apiKey, revocationCacheMs: 60_000 })
Acceptance criteria
🎁 Evidencia visual = reward extra
- Si tu PR incluye video demo o capturas de pantalla mostrando la funcionalidad pedida funcionando end-to-end, va a ser considerado para rewards de GrantFox en esta issue. No es obligatorio, pero suma mucho para la evaluación.
Context
PR#116 (pending) adds a
PassportClientto the SDK with typed credential verification. A common SDK use-case is checking whether a passport has been revoked — this should be efficient and cache-friendly to avoid hammering the API.What to implement
Method: PassportClient.isRevoked(passportId)
Caching
passportIdfor 60 seconds (configurable viacacheMsoption)GET /api/protocol/passport/:idand checkstatus === 'revoked'true, cache indefinitelyConstructor option
Acceptance criteria
isRevoked('active-id')→falseisRevoked('revoked-id')→truecacheMs→ returns cached result without network calltrueresults)🎁 Evidencia visual = reward extra