An easy-to-host PDS on the ATProtocol, iPhone and MacOS. Maintain control of your keys and data, always.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(identity-wallet): add TypeScript IPC wrappers for claim commands

Adds typed TypeScript wrappers following existing patterns:

Types:
- IdentityInfo: resolved identity with DID, handle, PDS, rotation keys
- VerifiedClaimOp: verified operation with diff and warnings
- OpDiff: keys and services changes
- ServiceChange: per-service endpoint modifications
- ClaimResult: updated DID doc after submission
- ResolveError: handle/DID not found, PDS unreachable, network errors
- ClaimError: invalid token, verification failed, PLC errors, unauthorized

Functions:
- resolveIdentity(handleOrDid)
- startPdsAuth(pdsUrl)
- requestClaimVerification(did)
- signAndVerifyClaim(did, token)
- submitClaim(did)

authored by

Malpercio and committed by
Tangled
e364b6d8 95033fe5

+66
+66
apps/identity-wallet/src/lib/ipc.ts
··· 304 304 */ 305 305 export const saveRelayUrl = (url: string): Promise<void> => 306 306 invoke('save_relay_url', { url }); 307 + 308 + // ── Claim flow types ────────────────────────────────────────────────────── 309 + 310 + export interface IdentityInfo { 311 + did: string; 312 + handle: string; 313 + pdsUrl: string; 314 + currentRotationKeys: string[]; 315 + deviceKeyIsRoot: boolean; 316 + } 317 + 318 + export interface VerifiedClaimOp { 319 + diff: OpDiff; 320 + signedOp: string; 321 + warnings: string[]; 322 + } 323 + 324 + export interface OpDiff { 325 + addedKeys: string[]; 326 + removedKeys: string[]; 327 + changedServices: ServiceChange[]; 328 + prevCid: string; 329 + } 330 + 331 + export interface ServiceChange { 332 + id: string; 333 + changeType: string; 334 + oldEndpoint: string | null; 335 + newEndpoint: string | null; 336 + } 337 + 338 + export interface ClaimResult { 339 + updatedDidDoc: Record<string, unknown>; 340 + } 341 + 342 + // ── Claim flow error types ──────────────────────────────────────────────── 343 + 344 + export type ResolveError = 345 + | { code: 'HANDLE_NOT_FOUND' } 346 + | { code: 'DID_NOT_FOUND' } 347 + | { code: 'PDS_UNREACHABLE' } 348 + | { code: 'NETWORK_ERROR'; message: string }; 349 + 350 + export type ClaimError = 351 + | { code: 'INVALID_TOKEN' } 352 + | { code: 'VERIFICATION_FAILED'; message: string } 353 + | { code: 'PLC_DIRECTORY_ERROR'; message: string } 354 + | { code: 'UNAUTHORIZED' } 355 + | { code: 'NETWORK_ERROR'; message: string }; 356 + 357 + // ── Claim flow IPC wrappers ──────────────────────────────────────────────── 358 + 359 + export const resolveIdentity = (handleOrDid: string): Promise<IdentityInfo> => 360 + invoke('resolve_identity', { handleOrDid }); 361 + 362 + export const startPdsAuth = (pdsUrl: string): Promise<void> => 363 + invoke('start_pds_auth', { pdsUrl }); 364 + 365 + export const requestClaimVerification = (did: string): Promise<void> => 366 + invoke('request_claim_verification', { did }); 367 + 368 + export const signAndVerifyClaim = (did: string, token: string): Promise<VerifiedClaimOp> => 369 + invoke('sign_and_verify_claim', { did, token }); 370 + 371 + export const submitClaim = (did: string): Promise<ClaimResult> => 372 + invoke('submit_claim', { did });