solana-age-verify-sdk 2.0.0-beta.14 → 2.0.0-beta.15
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 +1 -1
- package/dist/types.d.ts +5 -1
- package/dist/verify.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -17,7 +17,11 @@ export interface VerifyConfig {
|
|
|
17
17
|
challenges: string[];
|
|
18
18
|
minLivenessScore: number;
|
|
19
19
|
minAgeConfidence: number;
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Minimum age required to pass verification.
|
|
22
|
+
* Default: 18
|
|
23
|
+
*/
|
|
24
|
+
minAgeThreshold?: number;
|
|
21
25
|
timeoutMs: number;
|
|
22
26
|
maxRetries: number;
|
|
23
27
|
cooldownMinutes: number;
|
package/dist/verify.js
CHANGED
|
@@ -601,14 +601,14 @@ export async function verifyHost18Plus(options) {
|
|
|
601
601
|
const avgTextureScore = textureAnalysisCount > 0
|
|
602
602
|
? textureScoreAccumulator / textureAnalysisCount
|
|
603
603
|
: undefined;
|
|
604
|
-
const isAgeValid = ageEstimate >= config.
|
|
604
|
+
const isAgeValid = ageEstimate >= (config.minAgeThreshold || 18);
|
|
605
605
|
const isLivenessValid = livenessScore >= config.minLivenessScore;
|
|
606
606
|
const isConfidenceValid = ageConfidence >= config.minAgeConfidence;
|
|
607
607
|
// DEBUG LOGGING
|
|
608
608
|
console.log('═══════════════════════════════════════════');
|
|
609
609
|
console.log('VERIFICATION VALIDATION SUMMARY');
|
|
610
610
|
console.log('═══════════════════════════════════════════');
|
|
611
|
-
console.log(`Age Estimate: ${ageEstimate.toFixed(1)} (threshold: ${config.
|
|
611
|
+
console.log(`Age Estimate: ${ageEstimate.toFixed(1)} (threshold: ${config.minAgeThreshold}) → ${isAgeValid ? '✓ PASS' : '✗ FAIL'}`);
|
|
612
612
|
console.log(`Age Confidence: ${(ageConfidence * 100).toFixed(1)}% (threshold: ${config.minAgeConfidence * 100}%) → ${isConfidenceValid ? '✓ PASS' : '✗ FAIL'}`);
|
|
613
613
|
console.log(`Liveness Score: ${(livenessScore * 100).toFixed(1)}% (threshold: ${config.minLivenessScore * 100}%) → ${isLivenessValid ? '✓ PASS' : '✗ FAIL'}`);
|
|
614
614
|
console.log(`Age Method: ${ageMethod}`);
|
|
@@ -618,7 +618,7 @@ export async function verifyHost18Plus(options) {
|
|
|
618
618
|
let failureReason = '';
|
|
619
619
|
if (!isOver18) {
|
|
620
620
|
if (!isAgeValid)
|
|
621
|
-
failureReason = `Estimated age (${Math.round(ageEstimate)}) is below the required ${config.
|
|
621
|
+
failureReason = `Estimated age (${Math.round(ageEstimate)}) is below the required ${config.minAgeThreshold}.`;
|
|
622
622
|
else if (!isLivenessValid)
|
|
623
623
|
failureReason = 'Liveness detection failed.';
|
|
624
624
|
else if (!isConfidenceValid)
|
|
@@ -937,7 +937,7 @@ export async function verifyHost18Plus(options) {
|
|
|
937
937
|
// Detailed Log for Developer
|
|
938
938
|
console.log('--- VERIFICATION FAILED ---');
|
|
939
939
|
console.log('Reason: Liveness or Age below threshold');
|
|
940
|
-
console.log(`Detected Age: ${ageEstimate.toFixed(1)} (Threshold: ${config.
|
|
940
|
+
console.log(`Detected Age: ${ageEstimate.toFixed(1)} (Threshold: ${config.minAgeThreshold})`);
|
|
941
941
|
console.log(`Age Confidence: ${(ageConfidence * 100).toFixed(1)}%`);
|
|
942
942
|
console.log(`Liveness Score: ${(livenessScore * 100).toFixed(1)}%`);
|
|
943
943
|
console.log(`Attempt: ${updatedRetries} / ${config.maxRetries} (Session: ${currentCooldownCount + 1} / 3)`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solana-age-verify-sdk",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Solana Age Verify is a premium, client-side SDK for privacy-preserving age verification and liveness detection. It generates a deterministic Face Hash linked to a wallet without storing facial data.",
|
|
6
6
|
"license": "MIT",
|