solana-age-verify-sdk 2.0.0-beta.14 → 2.0.0-beta.16

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 CHANGED
@@ -1,4 +1,4 @@
1
- # Solana Age Verify SDK (Beta 2.0)
1
+ # Solana Age Verify SDK (Beta)
2
2
 
3
3
  **Verify users as 18+ on-chain. Privacy-safe, no ID needed, run entirely in the browser.**
4
4
 
package/dist/security.js CHANGED
@@ -16,14 +16,8 @@ let _cachedPlatformPubKey = null;
16
16
  export function getPlatformPublicKey() {
17
17
  if (_cachedPlatformPubKey)
18
18
  return _cachedPlatformPubKey;
19
- // In a production build, this would be swapped or populated from env
20
- // For now, we use the VITE environment variable if available (Vite/Vercel)
21
- // We check VITE_TREASURY_ADDRESS first as per configuration, then fallback to legacy VITE_PLATFORM_PUBLIC_KEY
22
- const envKey = import.meta.env?.VITE_TREASURY_ADDRESS || import.meta.env?.VITE_PLATFORM_PUBLIC_KEY;
23
- if (envKey) {
24
- _cachedPlatformPubKey = new PublicKey(envKey);
25
- return _cachedPlatformPubKey;
26
- }
19
+ // Environment variable overrides disabled for security.
20
+ // We strictly use the hardcoded, obfuscated treasury address to ensure integrity in the distributed package.
27
21
  // Default/Fallback logic
28
22
  // We use a base58 encoded version that is "minified" in the code.
29
23
  // The string here is obfuscated to avoid plain text search and easy replacement.
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
- minAgeEstimate: number;
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.minAgeEstimate;
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.minAgeEstimate}) → ${isAgeValid ? '✓ PASS' : '✗ FAIL'}`);
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.minAgeEstimate}.`;
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.minAgeEstimate})`);
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.14",
3
+ "version": "2.0.0-beta.16",
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",