Skip to content

Feat/jurisdiction presets sdk events revocation export - #445

Open
reuben148 wants to merge 2 commits into
ToluLabs:mainfrom
reuben148:feat/jurisdiction-presets-sdk-events-revocation-export
Open

Feat/jurisdiction presets sdk events revocation export#445
reuben148 wants to merge 2 commits into
ToluLabs:mainfrom
reuben148:feat/jurisdiction-presets-sdk-events-revocation-export

Conversation

@reuben148

Copy link
Copy Markdown

Closes #391, Closes #392, Closes #393, Closes #394

Summary

Implements and closes four issues:

#391 — Country allowlist as SDK-configurable jurisdiction preset

  • Added named jurisdiction presets in the SDK (presets.ts) — eu, eea, us, non-sanctioned — that expand to ISO 3166-1 numeric code sets.
  • Wired into buildVerifyUrl via claimParams.preset, and exposed resolveJurisdictionPreset() for witness inputs.
  • JurisdictionPresetError on unknown names; explicit restricted overrides the preset.

#392 — SDK event subscription for claim changes

  • Added subscribeClaims({ wallet, claimType?, pollMs?, indexerUrl?, onEvent }) (subscribe.ts), backed by the indexer's /claims API, returning { unsubscribe }.
  • Seeds a snapshot, fires added/updated/revoked only on change, creates claims on the fly so consumers are never stale.

#393 — Revocation reason codes

  • ProofRegistry.revoke now takes an optional reason code (RevocationReason: 10 expired / 20 superseded / 30 fraud / 40 user_request / 50 other), stored on the record and emitted in the revoke event.
  • Indexer persists revoked_reason and exposes revocation_reason_label on /claims; revoke-event parsing aligned to the current layout.
  • SDK/client expose getRevocationReason() + REVOCATION_REASONS.

#394 — Holder proof-history export

  • Holder page CSV/JSON export of non-sensitive proof history (claim type, verified_at, expiry, tx hash, issuer), built offline from local state (exportProofHistory.ts).

Merge base

Includes merge of latest main (badge #440 + concurrency fix #442) with one resolved conflict in frontend/packages/sdk/src/index.ts.

…s, proof-history export

Closes ToluLabs#391, Closes ToluLabs#392, Closes ToluLabs#393, Closes ToluLabs#394

- sdk(ToluLabs#391): add named country-allowlist jurisdiction presets (eu, eea, us,
  non-sanctioned) expanding to ISO 3166-1 numeric codes; wire into
  buildVerifyUrl via claimParams.preset and expose resolveJurisdictionPreset
  for witness inputs
- sdk/indexer(ToluLabs#392): add indexer-backed subscribeClaims(wallet[, claimType])
  returning { unsubscribe }; seeds snapshot, fires added/updated/revoked only
  on change, creates claims on the fly so consumers are never stale
- contract/indexer/sdk(ToluLabs#393): ProofRegistry.revoke takes an optional reason
  code (RevocationReason 10/20/30/40/50), stored on the record and emitted in
  the revoke event; indexer persists revoked_reason and surfaces
  revocation_reason_label; SDK/client expose getRevocationReason +
  REVOCATION_REASONS
- frontend(ToluLabs#394): holder page CSV/JSON export of non-sensitive proof history
  (claim type, timestamps, tx hash, issuer) built offline from local state
…jurisdiction-presets-sdk-events-revocation-export

# Conflicts:
#	frontend/packages/sdk/src/index.ts
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@reuben148 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Psalmuel01

Copy link
Copy Markdown
Collaborator

Nice - this genuinely implements all four (jurisdiction presets #391, subscribeClaims #392, revocation reason codes #393, proof-history export #394), and the Closes refs are correct. Three CI failures to fix before merge:

  1. Clippy: two assert_eq! with a literal bool in the new proof_registry tests. Use assert!(x) / assert!(!x) instead. Clippy is blocking, so this fails the contract build.

  2. Frontend SDK test: the vitest mock of ../../proof-registry/src/index is missing the new REVOCATION_REASONS export. Add it to the vi.mock return so the mock matches the real module.

  3. env-check: a new env var this PR reads is not in .env.example (likely the subscription/indexer URL). Run node frontend/scripts/check-env-sync.mjs locally to see which one, and document it.

Fix those three and it should go green. Good, well-scoped work otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants