@reclaimprotocol/js-sdk 5.0.0-dev.2 → 5.0.0-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -41
- package/dist/index.d.ts +170 -100
- package/dist/index.js +166 -77
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -266,81 +266,6 @@ interface ResponseRedactionSpec {
|
|
|
266
266
|
xPath: string;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
/**
|
|
270
|
-
* Content validation configuration specifying essential required hashes and optional extra proofs.
|
|
271
|
-
* Used to explicitly validate that a generated proof matches the exact request structure expected.
|
|
272
|
-
*/
|
|
273
|
-
type ValidationConfigWithHash = {
|
|
274
|
-
/**
|
|
275
|
-
* Array of computed hashes that must be satisfied by the proofs.
|
|
276
|
-
*
|
|
277
|
-
* An element can be a `HashRequirement` object or a string that is equivalent to
|
|
278
|
-
* a `{ value: '<hash>', required: true, multiple: false }` as `HashRequirement`.
|
|
279
|
-
*/
|
|
280
|
-
hashes: (string | HashRequirement)[];
|
|
281
|
-
};
|
|
282
|
-
/**
|
|
283
|
-
* Content validation configuration specifying the provider id and version used in the verification session that generated the proofs.
|
|
284
|
-
* Used to explicitly validate that a generated proof matches the exact request structure expected.
|
|
285
|
-
*
|
|
286
|
-
* See also:
|
|
287
|
-
*
|
|
288
|
-
* * `ReclaimProofRequest.getProviderVersion()` - With a ReclaimProofRequest object, you can get the provider id & exact version of provider used in verification session.
|
|
289
|
-
*/
|
|
290
|
-
interface ValidationConfigWithProviderInformation {
|
|
291
|
-
/**
|
|
292
|
-
* The identifier of provider used in verifications that resulted in a proof
|
|
293
|
-
*
|
|
294
|
-
* See also:
|
|
295
|
-
*
|
|
296
|
-
* * `ReclaimProofRequest.getProviderVersion()` - With a ReclaimProofRequest object, you can get the provider id & exact version of provider used in verification session.
|
|
297
|
-
**/
|
|
298
|
-
providerId: string;
|
|
299
|
-
/**
|
|
300
|
-
* The exact version of provider used in verifications that resulted in a proof.
|
|
301
|
-
*
|
|
302
|
-
* This cannot be a version constaint or version expression. It can be undefined or left blank if proof must be validated with latest version of provider.
|
|
303
|
-
* Patches for the next provider version are also fetched and hashes from that spec is also be used to compare the hashes from proof.
|
|
304
|
-
*
|
|
305
|
-
* See also:
|
|
306
|
-
*
|
|
307
|
-
* * `ReclaimProofRequest.getProviderVersion()` - With a ReclaimProofRequest object, you can get the provider id & exact version of provider used in verification session.
|
|
308
|
-
**/
|
|
309
|
-
providerVersion?: string;
|
|
310
|
-
/**
|
|
311
|
-
* List of allowed pre-release tags.
|
|
312
|
-
* For example, if you are using AI, provide `['ai']` to allow AI patch versions of the provider.
|
|
313
|
-
*/
|
|
314
|
-
allowedTags?: string[];
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Legacy configuration to completely bypass content validation during verification.
|
|
318
|
-
* Warning: Using this poses a risk as it avoids strictly matching proof parameters to expected hashes.
|
|
319
|
-
*/
|
|
320
|
-
interface ValidationConfigWithDisabledValidation {
|
|
321
|
-
dangerouslyDisableContentValidation: true;
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Represents the configuration options applied when validating proof contents, allowing
|
|
325
|
-
* strict hash checking or intentionally skipping validation if flagged.
|
|
326
|
-
*/
|
|
327
|
-
type ValidationConfig = ValidationConfigWithHash | ValidationConfigWithProviderInformation | ValidationConfigWithDisabledValidation;
|
|
328
|
-
/**
|
|
329
|
-
* Describes the comprehensive configuration required to initialize the proof verification process.
|
|
330
|
-
* Aligns with `ValidationConfig` options for verifying signatures alongside proof contents.
|
|
331
|
-
*/
|
|
332
|
-
type VerificationConfig = ValidationConfig;
|
|
333
|
-
declare function assertValidProofsByHash(proofs: Proof[], config: ProviderHashRequirementsConfig): void;
|
|
334
|
-
declare function isHttpProviderClaimParams(claimParams: unknown): claimParams is HttpProviderClaimParams;
|
|
335
|
-
declare function getHttpProviderClaimParamsFromProof(proof: Proof): HttpProviderClaimParams;
|
|
336
|
-
/**
|
|
337
|
-
* Asserts that the proof is validated by checking the content of proof with with expectations from provider config or hash based on [options]
|
|
338
|
-
* @param proofs - The proofs to validate
|
|
339
|
-
* @param config - The validation config
|
|
340
|
-
* @throws {ProofNotValidatedError} When the proof is not validated
|
|
341
|
-
*/
|
|
342
|
-
declare function assertValidateProof(proofs: Proof[], config: VerificationConfig): Promise<void>;
|
|
343
|
-
|
|
344
269
|
type ClaimID = ProviderClaimData['identifier'];
|
|
345
270
|
type ClaimInfo = Pick<ProviderClaimData, 'context' | 'provider' | 'parameters'>;
|
|
346
271
|
type CompleteClaimData = Pick<ProviderClaimData, 'owner' | 'timestampS' | 'epoch'> & ClaimInfo;
|
|
@@ -369,7 +294,6 @@ type CreateVerificationRequest = {
|
|
|
369
294
|
type StartSessionParams = {
|
|
370
295
|
onSuccess: OnSuccess;
|
|
371
296
|
onError: OnError;
|
|
372
|
-
verificationConfig?: VerificationConfig;
|
|
373
297
|
};
|
|
374
298
|
type OnSuccess = (proof?: Proof | Proof[]) => void;
|
|
375
299
|
type OnError = (error: Error) => void;
|
|
@@ -456,7 +380,7 @@ type ReclaimFlowLaunchOptions = {
|
|
|
456
380
|
* Verification mode for the flow.
|
|
457
381
|
*
|
|
458
382
|
* - `'portal'`: Opens the portal URL in the browser (remote browser verification).
|
|
459
|
-
* - `'app'`:
|
|
383
|
+
* - `'app'`: Verifier app flow via the share page. If `useAppClip` is `true`, uses App Clip on iOS.
|
|
460
384
|
*
|
|
461
385
|
* Can be set at call time via `triggerReclaimFlow({ verificationMode })` or `getRequestUrl({ verificationMode })`,
|
|
462
386
|
* or at init time via `launchOptions: { verificationMode }`.
|
|
@@ -464,7 +388,28 @@ type ReclaimFlowLaunchOptions = {
|
|
|
464
388
|
* @default 'portal'
|
|
465
389
|
*/
|
|
466
390
|
verificationMode?: 'app' | 'portal';
|
|
391
|
+
/**
|
|
392
|
+
* Target DOM element to embed the verification flow in an iframe.
|
|
393
|
+
* When provided, the portal opens inside the element instead of a new tab.
|
|
394
|
+
* Use `closeEmbeddedFlow()` to remove the iframe programmatically.
|
|
395
|
+
*
|
|
396
|
+
* Only applies to portal mode.
|
|
397
|
+
*/
|
|
398
|
+
target?: HTMLElement;
|
|
399
|
+
};
|
|
400
|
+
/**
|
|
401
|
+
* Handle returned by `triggerReclaimFlow` to control the launched flow.
|
|
402
|
+
*/
|
|
403
|
+
type FlowHandle = {
|
|
404
|
+
/** Closes the flow (removes iframe, closes tab, stops polling) */
|
|
405
|
+
close: () => void;
|
|
406
|
+
/** The iframe element when using embedded mode, `undefined` otherwise */
|
|
407
|
+
iframe?: HTMLIFrameElement;
|
|
408
|
+
/** The tab/window reference when using new tab mode, `undefined` otherwise */
|
|
409
|
+
tab?: Window | null;
|
|
467
410
|
};
|
|
411
|
+
/** Alias for `FlowHandle` */
|
|
412
|
+
type EmbeddedFlowHandle = FlowHandle;
|
|
468
413
|
type ModalOptions = {
|
|
469
414
|
title?: string;
|
|
470
415
|
description?: string;
|
|
@@ -544,7 +489,7 @@ type HttpRedirectionMethod = 'GET' | 'POST';
|
|
|
544
489
|
/**
|
|
545
490
|
* Options for HTTP redirection.
|
|
546
491
|
*
|
|
547
|
-
* Only supported by
|
|
492
|
+
* Only supported by Portal flow.
|
|
548
493
|
* On other SDKs, this will be ignored and a GET redirection will be performed with the URL.
|
|
549
494
|
*
|
|
550
495
|
* @since 4.11.0
|
|
@@ -597,13 +542,15 @@ type TemplateData = {
|
|
|
597
542
|
metadata?: Record<string, string>;
|
|
598
543
|
preferredLocale?: ProofRequestOptions['preferredLocale'];
|
|
599
544
|
};
|
|
545
|
+
type TrustedData = {
|
|
546
|
+
context: Record<string, unknown>;
|
|
547
|
+
extractedParameters: Record<string, string>;
|
|
548
|
+
};
|
|
600
549
|
type VerifyProofResult = {
|
|
601
550
|
isVerified: boolean;
|
|
602
551
|
isTeeVerified?: boolean;
|
|
603
|
-
data:
|
|
604
|
-
|
|
605
|
-
extractedParameters: Record<string, string>;
|
|
606
|
-
}[];
|
|
552
|
+
data: TrustedData[];
|
|
553
|
+
error?: Error;
|
|
607
554
|
};
|
|
608
555
|
type ProviderVersionConfig = {
|
|
609
556
|
major?: number;
|
|
@@ -653,6 +600,88 @@ type ProviderHashRequirementsResponse = {
|
|
|
653
600
|
providerVersionString?: string;
|
|
654
601
|
};
|
|
655
602
|
|
|
603
|
+
/**
|
|
604
|
+
* Content validation configuration specifying essential required hashes and optional extra proofs.
|
|
605
|
+
* Used to explicitly validate that a generated proof matches the exact request structure expected.
|
|
606
|
+
*/
|
|
607
|
+
type ValidationConfigWithHash = {
|
|
608
|
+
/**
|
|
609
|
+
* Array of computed hashes that must be satisfied by the proofs.
|
|
610
|
+
*
|
|
611
|
+
* An element can be a `HashRequirement` object or a string that is equivalent to
|
|
612
|
+
* a `{ value: '<hash>', required: true, multiple: false }` as `HashRequirement`.
|
|
613
|
+
*/
|
|
614
|
+
hashes: (string | HashRequirement)[];
|
|
615
|
+
};
|
|
616
|
+
/**
|
|
617
|
+
* Content validation configuration specifying the provider id and version used in the verification session that generated the proofs.
|
|
618
|
+
* Used to explicitly validate that a generated proof matches the exact request structure expected.
|
|
619
|
+
*
|
|
620
|
+
* See also:
|
|
621
|
+
*
|
|
622
|
+
* * `ReclaimProofRequest.getProviderVersion()` - With a ReclaimProofRequest object, you can get the provider id & exact version of provider used in verification session.
|
|
623
|
+
*/
|
|
624
|
+
interface ValidationConfigWithProviderInformation {
|
|
625
|
+
/**
|
|
626
|
+
* The identifier of provider used in verifications that resulted in a proof
|
|
627
|
+
*
|
|
628
|
+
* See also:
|
|
629
|
+
*
|
|
630
|
+
* * `ReclaimProofRequest.getProviderVersion()` - With a ReclaimProofRequest object, you can get the provider id & exact version of provider used in verification session.
|
|
631
|
+
**/
|
|
632
|
+
providerId: string;
|
|
633
|
+
/**
|
|
634
|
+
* The exact version of provider used in verifications that resulted in a proof.
|
|
635
|
+
*
|
|
636
|
+
* This cannot be a version constaint or version expression. It can be undefined or left blank if proof must be validated with latest version of provider.
|
|
637
|
+
* Patches for the next provider version are also fetched and hashes from that spec is also be used to compare the hashes from proof.
|
|
638
|
+
*
|
|
639
|
+
* See also:
|
|
640
|
+
*
|
|
641
|
+
* * `ReclaimProofRequest.getProviderVersion()` - With a ReclaimProofRequest object, you can get the provider id & exact version of provider used in verification session.
|
|
642
|
+
**/
|
|
643
|
+
providerVersion?: string;
|
|
644
|
+
/**
|
|
645
|
+
* List of allowed pre-release tags.
|
|
646
|
+
* For example, if you are using AI, provide `['ai']` to allow AI patch versions of the provider.
|
|
647
|
+
*/
|
|
648
|
+
allowedTags?: string[];
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Legacy configuration to completely bypass content validation during verification.
|
|
652
|
+
* Warning: Using this poses a risk as it avoids strictly matching proof parameters to expected hashes.
|
|
653
|
+
*/
|
|
654
|
+
interface ValidationConfigWithDisabledValidation {
|
|
655
|
+
dangerouslyDisableContentValidation: true;
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Represents the configuration options applied when validating proof contents, allowing
|
|
659
|
+
* strict hash checking or intentionally skipping validation if flagged.
|
|
660
|
+
*/
|
|
661
|
+
type ValidationConfig = ValidationConfigWithHash | ValidationConfigWithProviderInformation | ValidationConfigWithDisabledValidation;
|
|
662
|
+
/**
|
|
663
|
+
* Describes the comprehensive configuration required to initialize the proof verification process.
|
|
664
|
+
* Aligns with `ValidationConfig` options for verifying signatures alongside proof contents.
|
|
665
|
+
*/
|
|
666
|
+
type VerificationConfig = ValidationConfig & {
|
|
667
|
+
/**
|
|
668
|
+
* If true, verifies TEE (Trusted Execution Environment) attestation included in the proof.
|
|
669
|
+
* When enabled, the result will include `isTeeVerified` and `isVerified` will be false
|
|
670
|
+
* if TEE data is missing or TEE verification fails.
|
|
671
|
+
*/
|
|
672
|
+
verifyTEE?: boolean;
|
|
673
|
+
};
|
|
674
|
+
declare function assertValidProofsByHash(proofs: Proof[], config: ProviderHashRequirementsConfig): void;
|
|
675
|
+
declare function isHttpProviderClaimParams(claimParams: unknown): claimParams is HttpProviderClaimParams;
|
|
676
|
+
declare function getHttpProviderClaimParamsFromProof(proof: Proof): HttpProviderClaimParams;
|
|
677
|
+
/**
|
|
678
|
+
* Asserts that the proof is validated by checking the content of proof with with expectations from provider config or hash based on [options]
|
|
679
|
+
* @param proofs - The proofs to validate
|
|
680
|
+
* @param config - The validation config
|
|
681
|
+
* @throws {ProofNotValidatedError} When the proof is not validated
|
|
682
|
+
*/
|
|
683
|
+
declare function assertValidateProof(proofs: Proof[], config: VerificationConfig): Promise<void>;
|
|
684
|
+
|
|
656
685
|
/**
|
|
657
686
|
* Verifies one or more Reclaim proofs by validating signatures, verifying witness information,
|
|
658
687
|
* and performing content validation against the expected configuration.
|
|
@@ -665,9 +694,8 @@ type ProviderHashRequirementsResponse = {
|
|
|
665
694
|
* * All 3 functions above are alternatives of each other and result from these functions can be directly used as `config` parameter in this function for proof validation.
|
|
666
695
|
*
|
|
667
696
|
* @param proofOrProofs - A single proof object or an array of proof objects to be verified.
|
|
668
|
-
* @param config - Verification configuration that specifies required hashes, allowed extra hashes, or disables content validation.
|
|
669
|
-
* @
|
|
670
|
-
* @returns Verification result with `isVerified`, extracted `data` from each proof, and `isTeeVerified` when `verifyTEE` is `true`
|
|
697
|
+
* @param config - Verification configuration that specifies required hashes, allowed extra hashes, or disables content validation. Optionally includes `verifyTEE` to require TEE attestation verification.
|
|
698
|
+
* @returns Verification result with `isVerified`, extracted `data` from each proof, optional `error` on failure, and `isTeeVerified` when `verifyTEE` is enabled.
|
|
671
699
|
*
|
|
672
700
|
* @example
|
|
673
701
|
* ```typescript
|
|
@@ -675,7 +703,7 @@ type ProviderHashRequirementsResponse = {
|
|
|
675
703
|
* const { isVerified, data } = await verifyProof(proof, request.getProviderVersion());
|
|
676
704
|
*
|
|
677
705
|
* // With TEE attestation verification (fails if TEE data is missing or invalid)
|
|
678
|
-
* const { isVerified, isTeeVerified, data } = await verifyProof(proof, request.getProviderVersion(), true);
|
|
706
|
+
* const { isVerified, isTeeVerified, data } = await verifyProof(proof, { ...request.getProviderVersion(), verifyTEE: true });
|
|
679
707
|
*
|
|
680
708
|
* // Or, by manually providing the details:
|
|
681
709
|
*
|
|
@@ -713,7 +741,7 @@ type ProviderHashRequirementsResponse = {
|
|
|
713
741
|
* });
|
|
714
742
|
* ```
|
|
715
743
|
*/
|
|
716
|
-
declare function verifyProof(proofOrProofs: Proof | Proof[], config: VerificationConfig
|
|
744
|
+
declare function verifyProof(proofOrProofs: Proof | Proof[], config: VerificationConfig): Promise<VerifyProofResult>;
|
|
717
745
|
/**
|
|
718
746
|
* Transforms a Reclaim proof into a format suitable for on-chain verification
|
|
719
747
|
*
|
|
@@ -756,7 +784,10 @@ declare class ReclaimProofRequest {
|
|
|
756
784
|
private templateData;
|
|
757
785
|
private extensionID;
|
|
758
786
|
private customSharePageUrl?;
|
|
787
|
+
private appSharePageUrl;
|
|
759
788
|
private customAppClipUrl?;
|
|
789
|
+
private portalTab?;
|
|
790
|
+
private portalIframe?;
|
|
760
791
|
private modalOptions?;
|
|
761
792
|
private modal?;
|
|
762
793
|
private readonly FAILURE_TIMEOUT;
|
|
@@ -832,11 +863,11 @@ declare class ReclaimProofRequest {
|
|
|
832
863
|
*
|
|
833
864
|
* @param url - The URL where users should be redirected after successful proof generation
|
|
834
865
|
* @param method - The redirection method that should be used for redirection. Allowed options: `GET`, and `POST`.
|
|
835
|
-
* `POST` form redirection is only supported in
|
|
866
|
+
* `POST` form redirection is only supported in Portal flow.
|
|
836
867
|
* @param body - List of name-value pairs to be sent as the body of the form request.
|
|
837
868
|
* `When `method` is set to `POST`, `body` will be sent with 'application/x-www-form-urlencoded' content type.
|
|
838
869
|
* When `method` is set to `GET`, if `body` is set then `body` will be sent as query parameters.
|
|
839
|
-
* Sending `body` on redirection is only supported in
|
|
870
|
+
* Sending `body` on redirection is only supported in Portal flow.
|
|
840
871
|
*
|
|
841
872
|
* @throws {InvalidParamError} When URL is invalid
|
|
842
873
|
*
|
|
@@ -889,11 +920,11 @@ declare class ReclaimProofRequest {
|
|
|
889
920
|
*
|
|
890
921
|
* @param url - The URL where users should be redirected after an error which aborts the verification process
|
|
891
922
|
* @param method - The redirection method that should be used for redirection. Allowed options: `GET`, and `POST`.
|
|
892
|
-
* `POST` form redirection is only supported in
|
|
923
|
+
* `POST` form redirection is only supported in Portal flow.
|
|
893
924
|
* @param body - List of name-value pairs to be sent as the body of the form request.
|
|
894
925
|
* When `method` is set to `POST`, `body` will be sent with 'application/x-www-form-urlencoded' content type.
|
|
895
926
|
* When `method` is set to `GET`, if `body` is set then `body` will be sent as query parameters.
|
|
896
|
-
* Sending `body` on redirection is only supported in
|
|
927
|
+
* Sending `body` on redirection is only supported in Portal flow.
|
|
897
928
|
* @throws {InvalidParamError} When URL is invalid
|
|
898
929
|
*
|
|
899
930
|
* @example
|
|
@@ -1066,7 +1097,24 @@ declare class ReclaimProofRequest {
|
|
|
1066
1097
|
private clearInterval;
|
|
1067
1098
|
private setAttestationContext;
|
|
1068
1099
|
private applyAttestationContext;
|
|
1100
|
+
private encodeTemplateData;
|
|
1069
1101
|
private buildSharePageUrl;
|
|
1102
|
+
private openPortalTab;
|
|
1103
|
+
private closePortalTab;
|
|
1104
|
+
private embedPortalIframe;
|
|
1105
|
+
/**
|
|
1106
|
+
* Closes the embedded portal iframe and stops the session polling.
|
|
1107
|
+
*
|
|
1108
|
+
* Call this to programmatically cancel the embedded verification flow
|
|
1109
|
+
* that was started with `triggerReclaimFlow({ target: element })`.
|
|
1110
|
+
* Also called automatically when verification succeeds or fails.
|
|
1111
|
+
*
|
|
1112
|
+
* @example
|
|
1113
|
+
* ```typescript
|
|
1114
|
+
* proofRequest.closeEmbeddedFlow();
|
|
1115
|
+
* ```
|
|
1116
|
+
*/
|
|
1117
|
+
closeEmbeddedFlow(): void;
|
|
1070
1118
|
/**
|
|
1071
1119
|
* Exports the Reclaim proof verification request as a JSON string
|
|
1072
1120
|
*
|
|
@@ -1109,7 +1157,7 @@ declare class ReclaimProofRequest {
|
|
|
1109
1157
|
* // Portal URL (default)
|
|
1110
1158
|
* const url = await proofRequest.getRequestUrl();
|
|
1111
1159
|
*
|
|
1112
|
-
* //
|
|
1160
|
+
* // Verifier app flow URL
|
|
1113
1161
|
* const url = await proofRequest.getRequestUrl({ verificationMode: 'app' });
|
|
1114
1162
|
* ```
|
|
1115
1163
|
*/
|
|
@@ -1118,8 +1166,9 @@ declare class ReclaimProofRequest {
|
|
|
1118
1166
|
* Triggers the appropriate Reclaim verification flow based on device type and configuration.
|
|
1119
1167
|
*
|
|
1120
1168
|
* Defaults to portal mode (remote browser verification). Pass `{ verificationMode: 'app' }`
|
|
1121
|
-
* for
|
|
1169
|
+
* for verifier app flow via the share page.
|
|
1122
1170
|
*
|
|
1171
|
+
* - **Embedded iframe**: Pass `{ target: element }` to embed the portal inside a DOM element instead of a new tab
|
|
1123
1172
|
* - Desktop: browser extension takes priority in both modes
|
|
1124
1173
|
* - Desktop portal mode (no extension): opens portal in new tab
|
|
1125
1174
|
* - Desktop app mode (no extension): shows QR code modal with share page URL
|
|
@@ -1127,15 +1176,22 @@ declare class ReclaimProofRequest {
|
|
|
1127
1176
|
* - Mobile app mode: opens share page (or App Clip on iOS if `useAppClip` is `true`)
|
|
1128
1177
|
*
|
|
1129
1178
|
* @param launchOptions - Optional launch configuration to override default behavior
|
|
1130
|
-
* @returns Promise<
|
|
1179
|
+
* @returns Promise<FlowHandle> - Handle to control the flow (close, access iframe)
|
|
1131
1180
|
* @throws {SignatureNotFoundError} When signature is not set
|
|
1132
1181
|
*
|
|
1133
1182
|
* @example
|
|
1134
1183
|
* ```typescript
|
|
1135
|
-
* // Portal flow (default)
|
|
1136
|
-
* await proofRequest.triggerReclaimFlow();
|
|
1184
|
+
* // Portal flow (default) — opens in new tab
|
|
1185
|
+
* const handle = await proofRequest.triggerReclaimFlow();
|
|
1186
|
+
* handle.tab; // Window reference to the opened tab
|
|
1187
|
+
* handle.close(); // close tab and stop polling
|
|
1188
|
+
*
|
|
1189
|
+
* // Embed portal in an iframe inside a DOM element
|
|
1190
|
+
* const handle = await proofRequest.triggerReclaimFlow({ target: document.getElementById('reclaim-container') });
|
|
1191
|
+
* handle.iframe; // HTMLIFrameElement reference
|
|
1192
|
+
* handle.close(); // remove iframe and stop polling
|
|
1137
1193
|
*
|
|
1138
|
-
* //
|
|
1194
|
+
* // Verifier app flow
|
|
1139
1195
|
* await proofRequest.triggerReclaimFlow({ verificationMode: 'app' });
|
|
1140
1196
|
*
|
|
1141
1197
|
* // App Clip on iOS (requires useAppClip: true at init)
|
|
@@ -1149,7 +1205,7 @@ declare class ReclaimProofRequest {
|
|
|
1149
1205
|
* await request.triggerReclaimFlow(); // uses 'app' mode from init
|
|
1150
1206
|
* ```
|
|
1151
1207
|
*/
|
|
1152
|
-
triggerReclaimFlow(launchOptions?: ReclaimFlowLaunchOptions): Promise<
|
|
1208
|
+
triggerReclaimFlow(launchOptions?: ReclaimFlowLaunchOptions): Promise<FlowHandle>;
|
|
1153
1209
|
/**
|
|
1154
1210
|
* Checks if the Reclaim browser extension is installed and available
|
|
1155
1211
|
*
|
|
@@ -1233,7 +1289,7 @@ declare class ReclaimProofRequest {
|
|
|
1233
1289
|
* });
|
|
1234
1290
|
* ```
|
|
1235
1291
|
*/
|
|
1236
|
-
startSession({ onSuccess, onError
|
|
1292
|
+
startSession({ onSuccess, onError }: StartSessionParams): Promise<void>;
|
|
1237
1293
|
/**
|
|
1238
1294
|
* Closes the QR code modal if it is currently open
|
|
1239
1295
|
*
|
|
@@ -1326,6 +1382,20 @@ declare function fetchProviderConfigs(providerId: string, exactProviderVersionSt
|
|
|
1326
1382
|
*/
|
|
1327
1383
|
declare function verifyTeeAttestation(proof: Proof, expectedApplicationId?: string): Promise<boolean>;
|
|
1328
1384
|
|
|
1385
|
+
declare const TeeVerificationError: {
|
|
1386
|
+
new (message?: string, innerError?: unknown | undefined): {
|
|
1387
|
+
innerError?: unknown | undefined;
|
|
1388
|
+
name: string;
|
|
1389
|
+
message: string;
|
|
1390
|
+
stack?: string;
|
|
1391
|
+
cause?: unknown;
|
|
1392
|
+
};
|
|
1393
|
+
isError(error: unknown): error is Error;
|
|
1394
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1395
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
1396
|
+
stackTraceLimit: number;
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1329
1399
|
/**
|
|
1330
1400
|
* Highly accurate device type detection - returns only 'desktop' or 'mobile'
|
|
1331
1401
|
* Uses multiple detection methods and scoring system for maximum accuracy
|
|
@@ -1353,4 +1423,4 @@ declare function isDesktopDevice(): boolean;
|
|
|
1353
1423
|
*/
|
|
1354
1424
|
declare function clearDeviceCache(): void;
|
|
1355
1425
|
|
|
1356
|
-
export { type Beacon, type BeaconState, type BodySniff, ClaimCreationType, type ClaimID, type ClaimInfo, type CompleteClaimData, type Context, type CreateVerificationRequest, DeviceType, type ExtensionMessage, type HashRequirement, type HashableHttpProviderClaimParams, type HttpFormEntry, type HttpProviderClaimParams, type HttpRedirectionMethod, type HttpRedirectionOptions, type InitSessionResponse, type InjectedRequestSpec, type InterceptorRequestSpec, type ModalOptions, type OnError, type OnSuccess, type Proof, type ProofPropertiesJSON, type ProofRequestOptions, type ProviderClaimData, type ProviderConfigResponse, type ProviderHashRequirementSpec, type ProviderHashRequirementsConfig, type ProviderHashRequirementsResponse, type ProviderVersionConfig, type ProviderVersionInfo, RECLAIM_EXTENSION_ACTIONS, type ReclaimFlowLaunchOptions, ReclaimProofRequest, type ReclaimProviderConfig, type RequestSpec, type ResponseMatchSpec, type ResponseRedactionSpec, type SerializableModalOptions, SessionStatus, type SignedClaim, type StartSessionParams, type StatusUrlResponse, type TeeAttestation, type TemplateData, type UpdateSessionResponse, type ValidationConfig, type ValidationConfigWithDisabledValidation, type ValidationConfigWithHash, type ValidationConfigWithProviderInformation, type VerificationConfig, type VerifyProofResult, type WitnessData, assertValidProofsByHash, assertValidateProof, assertVerifiedProof, clearDeviceCache, createLinkWithTemplateData, fetchProviderConfigs, fetchProviderHashRequirementsBy, fetchStatusUrl, generateSpecsFromRequestSpecTemplate, getAttestors, getDeviceType, getHttpProviderClaimParamsFromProof, getMobileDeviceType, getProviderHashRequirementsFromSpec, getShortenedUrl, hashRequestSpec, initSession, isDesktopDevice, isHttpProviderClaimParams, isMobileDevice, recoverSignersOfSignedClaim, takePairsWhereValueIsArray, takeTemplateParametersFromProofs, transformForOnchain, updateSession, verifyProof, verifyTeeAttestation };
|
|
1426
|
+
export { type Beacon, type BeaconState, type BodySniff, ClaimCreationType, type ClaimID, type ClaimInfo, type CompleteClaimData, type Context, type CreateVerificationRequest, DeviceType, type EmbeddedFlowHandle, type ExtensionMessage, type FlowHandle, type HashRequirement, type HashableHttpProviderClaimParams, type HttpFormEntry, type HttpProviderClaimParams, type HttpRedirectionMethod, type HttpRedirectionOptions, type InitSessionResponse, type InjectedRequestSpec, type InterceptorRequestSpec, type ModalOptions, type OnError, type OnSuccess, type Proof, type ProofPropertiesJSON, type ProofRequestOptions, type ProviderClaimData, type ProviderConfigResponse, type ProviderHashRequirementSpec, type ProviderHashRequirementsConfig, type ProviderHashRequirementsResponse, type ProviderVersionConfig, type ProviderVersionInfo, RECLAIM_EXTENSION_ACTIONS, type ReclaimFlowLaunchOptions, ReclaimProofRequest, type ReclaimProviderConfig, type RequestSpec, type ResponseMatchSpec, type ResponseRedactionSpec, type SerializableModalOptions, SessionStatus, type SignedClaim, type StartSessionParams, type StatusUrlResponse, type TeeAttestation, TeeVerificationError, type TemplateData, type TrustedData, type UpdateSessionResponse, type ValidationConfig, type ValidationConfigWithDisabledValidation, type ValidationConfigWithHash, type ValidationConfigWithProviderInformation, type VerificationConfig, type VerifyProofResult, type WitnessData, assertValidProofsByHash, assertValidateProof, assertVerifiedProof, clearDeviceCache, createLinkWithTemplateData, fetchProviderConfigs, fetchProviderHashRequirementsBy, fetchStatusUrl, generateSpecsFromRequestSpecTemplate, getAttestors, getDeviceType, getHttpProviderClaimParamsFromProof, getMobileDeviceType, getProviderHashRequirementsFromSpec, getShortenedUrl, hashRequestSpec, initSession, isDesktopDevice, isHttpProviderClaimParams, isMobileDevice, recoverSignersOfSignedClaim, takePairsWhereValueIsArray, takeTemplateParametersFromProofs, transformForOnchain, updateSession, verifyProof, verifyTeeAttestation };
|