solana-age-verify-sdk 2.0.0-beta.10 → 2.0.0-beta.12

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.
Files changed (2) hide show
  1. package/dist/verify.js +30 -10
  2. package/package.json +1 -1
package/dist/verify.js CHANGED
@@ -8,13 +8,6 @@ import { generateChallengeSequence } from './liveness/challenges';
8
8
  import { getPlatformPublicKey, getProtocolFee } from './security';
9
9
  import { createSpinnerHTML } from './ui/spinner';
10
10
  // Lazy getter to avoid top-level PublicKey construction before polyfills load
11
- let _memoProgramId = null;
12
- function getMemoProgramId() {
13
- if (!_memoProgramId) {
14
- _memoProgramId = new PublicKey('MemoSq4gqABAXib96qFbncnscymPme7yS4AtGf4Vb7');
15
- }
16
- return _memoProgramId;
17
- }
18
11
  export async function verifyHost18Plus(options) {
19
12
  const config = { ...DEFAULT_CONFIG, ...options.config };
20
13
  // Cooldown & Retry Check
@@ -703,16 +696,43 @@ export async function verifyHost18Plus(options) {
703
696
  const memoText = `Solana-Age-Registry | ${statusStr} | HASH: ${facehash} | ${verifiedAt}`;
704
697
  // Step 3: Memo Instruction
705
698
  try {
699
+ // DEBUG: Log all keys to identify the culprit
700
+ console.log('--- KEY DEBUG START ---');
701
+ console.log('Wallet Key (base58):', fromPubkey?.toBase58 ? fromPubkey.toBase58() : 'INVALID_OBJ');
702
+ console.log('Platform Key (base58):', platformPubKey?.toBase58 ? platformPubKey.toBase58() : 'INVALID_OBJ');
703
+ let cleanFromKey;
704
+ try {
705
+ cleanFromKey = new PublicKey(fromPubkey.toBase58());
706
+ }
707
+ catch (e) {
708
+ throw new Error(`Invalid Wallet Key: ${e.message}`);
709
+ }
710
+ let cleanPlatformKey;
711
+ try {
712
+ cleanPlatformKey = new PublicKey(platformPubKey.toBase58());
713
+ }
714
+ catch (e) {
715
+ throw new Error(`Invalid Platform Key: ${e.message}`);
716
+ }
717
+ let cleanMemoId;
718
+ try {
719
+ cleanMemoId = new PublicKey('MemoSq4gqABAXib96qFbncnscymPme7yS4AtGf4Vb7');
720
+ }
721
+ catch (e) {
722
+ throw new Error(`Invalid Memo Program ID: ${e.message}`);
723
+ }
724
+ console.log('Keys reconstructed successfully.');
706
725
  transaction.add(new TransactionInstruction({
707
726
  keys: [
708
- { pubkey: fromPubkey, isSigner: true, isWritable: false },
709
- { pubkey: platformPubKey, isSigner: true, isWritable: false }
727
+ { pubkey: cleanFromKey, isSigner: true, isWritable: false },
728
+ { pubkey: cleanPlatformKey, isSigner: false, isWritable: false }
710
729
  ],
711
- programId: getMemoProgramId(),
730
+ programId: cleanMemoId,
712
731
  data: new TextEncoder().encode(memoText),
713
732
  }));
714
733
  }
715
734
  catch (e) {
735
+ console.error('Memo Instruction Construction Failed:', e);
716
736
  throw new Error(`Memo Instruction Failed: ${e.message}`);
717
737
  }
718
738
  const { blockhash } = await options.connection.getLatestBlockhash();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solana-age-verify-sdk",
3
- "version": "2.0.0-beta.10",
3
+ "version": "2.0.0-beta.12",
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",