solana-age-verify-sdk 2.0.0-beta.4 → 2.0.0-beta.5

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.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generates a premium gradient spinner HTML string for use in SDK UI overlays
3
+ * Matches Solana brand colors (purple to cyan gradient)
4
+ */
5
+ export declare function createSpinnerHTML(): string;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Generates a premium gradient spinner HTML string for use in SDK UI overlays
3
+ * Matches Solana brand colors (purple to cyan gradient)
4
+ */
5
+ export function createSpinnerHTML() {
6
+ return `
7
+ <div style="display: flex; align-items: center; justify-content: center; padding: 20px;">
8
+ <div style="
9
+ width: 64px;
10
+ height: 64px;
11
+ border: 4px solid transparent;
12
+ border-radius: 50%;
13
+ background: linear-gradient(#0f172a, #0f172a) padding-box, linear-gradient(135deg, #a78bfa 0%, #60a5fa 50%, #14b8a6 100%) border-box;
14
+ animation: spin 0.8s linear infinite;
15
+ position: relative;
16
+ " aria-label="Loading">
17
+ <div style="
18
+ position: absolute;
19
+ top: 50%;
20
+ left: 50%;
21
+ transform: translate(-50%, -50%);
22
+ width: 48px;
23
+ height: 48px;
24
+ border-radius: 50%;
25
+ background: #0f172a;
26
+ "></div>
27
+ </div>
28
+ </div>
29
+ <style>
30
+ @keyframes spin {
31
+ from { transform: rotate(0deg); }
32
+ to { transform: rotate(360deg); }
33
+ }
34
+ </style>
35
+ `;
36
+ }
package/dist/verify.js CHANGED
@@ -1,9 +1,12 @@
1
+ // The public treasury address is provided via the environment variable VITE_TREASURY_ADDRESS.
2
+ // This address is used by the SDK to direct fee payments to the platform's treasury.
1
3
  import { DEFAULT_CONFIG } from './types';
2
4
  import { Transaction, SystemProgram, LAMPORTS_PER_SOL, PublicKey, TransactionInstruction, ComputeBudgetProgram } from '@solana/web3.js';
3
5
  import { Camera } from './camera';
4
6
  import { computeFaceHash, generateSalt, toHex } from './hashing/facehash';
5
7
  import { generateChallengeSequence } from './liveness/challenges';
6
8
  import { getPlatformPublicKey, getProtocolFee } from './security';
9
+ import { createSpinnerHTML } from './ui/spinner';
7
10
  // Lazy getter to avoid top-level PublicKey construction before polyfills load
8
11
  let _memoProgramId = null;
9
12
  function getMemoProgramId() {
@@ -205,7 +208,7 @@ export async function verifyHost18Plus(options) {
205
208
  // Load Models
206
209
  if (options.onChallenge)
207
210
  options.onChallenge('Loading models...');
208
- // Show loading screen
211
+ // Show loading screen with premium spinner
209
212
  if (options.uiMountEl) {
210
213
  options.uiMountEl.innerHTML = `
211
214
  <div style="position: relative; height: 100%; width: 100%; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(15, 23, 42, 0.85);">
@@ -213,15 +216,11 @@ export async function verifyHost18Plus(options) {
213
216
  <div style="font-size: 24px; font-weight: 600; background: linear-gradient(to right, #e2e8f0, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 32px; letter-spacing: -0.01em;">
214
217
  Initializing Neural Engine...
215
218
  </div>
216
- <div style="width: 240px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; margin: 0 auto; position: relative;">
217
- <div style="position: absolute; top: 0; left: 0; height: 100%; width: 100%; background: linear-gradient(90deg, transparent, #3b82f6, transparent); animation: shimmer 1.5s infinite;">
218
- </div>
219
- </div>
219
+ ${createSpinnerHTML()}
220
220
  </div>
221
221
  </div>
222
222
  <style>
223
223
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
224
- @keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
225
224
  </style>
226
225
  `;
227
226
  }
@@ -655,15 +654,12 @@ export async function verifyHost18Plus(options) {
655
654
  To record your verification on-chain, a minimal protocol fee of <b>${protocolFeeSol} SOL</b> is required.<br>
656
655
  Please approve the transaction in your wallet.
657
656
  </div>
658
- <div style="display: flex; align-items: center; justify-content: center; gap: 12px; color: #60a5fa; font-weight: 600;">
659
- <div style="width: 16px; height: 16px; border: 2px solid #60a5fa; border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite;"></div>
657
+ ${createSpinnerHTML()}
658
+ <div style="color: #60a5fa; font-weight: 600; margin-top: 16px;">
660
659
  Waiting for signature...
661
660
  </div>
662
661
  </div>
663
662
  </div>
664
- <style>
665
- @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
666
- </style>
667
663
  `;
668
664
  }
669
665
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solana-age-verify-sdk",
3
- "version": "2.0.0-beta.4",
3
+ "version": "2.0.0-beta.5",
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",