fix: resolve all pre-existing tsc --noEmit errors (10 errors across 5 files)

- folk-map-viewer.ts: remove explicit return type, let TS infer
- test-x402.ts: cast account as any (test script, readContract unused)
- key-derivation.ts: cast Uint8Array at WebCrypto boundaries (BufferSource/ArrayBuffer)
- wallet-store.ts: cast .buffer as ArrayBuffer
- webauthn.ts: cast PRF output as ArrayBuffer | undefined

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-02 14:48:37 -08:00
parent 03a7b6d063
commit 33156cc249
5 changed files with 10 additions and 10 deletions

View File

@ -99,7 +99,7 @@ class FolkMapViewer extends HTMLElement {
this.renderDemo(); this.renderDemo();
} }
private getFilteredProviders(): { provider: typeof this.providers[0]; index: number }[] { private getFilteredProviders() {
if (!this.searchQuery.trim()) return this.providers.map((p, i) => ({ provider: p, index: i })); if (!this.searchQuery.trim()) return this.providers.map((p, i) => ({ provider: p, index: i }));
const q = this.searchQuery.toLowerCase(); const q = this.searchQuery.toLowerCase();
return this.providers.map((p, i) => ({ provider: p, index: i })) return this.providers.map((p, i) => ({ provider: p, index: i }))

View File

@ -59,7 +59,7 @@ async function main() {
console.log(" Wallet:", account.address); console.log(" Wallet:", account.address);
const client = new x402Client(); const client = new x402Client();
client.register("eip155:84532", new ExactEvmScheme(account)); client.register("eip155:84532", new ExactEvmScheme(account as any));
const paidFetch = wrapFetchWithPayment(fetch, client); const paidFetch = wrapFetchWithPayment(fetch, client);

View File

@ -115,7 +115,7 @@ export class EncryptIDKeyManager {
const masterKeyMaterial = await crypto.subtle.deriveBits( const masterKeyMaterial = await crypto.subtle.deriveBits(
{ {
name: 'PBKDF2', name: 'PBKDF2',
salt: salt, salt: salt as BufferSource,
iterations: 600000, iterations: 600000,
hash: 'SHA-256', hash: 'SHA-256',
}, },
@ -296,7 +296,7 @@ export class EncryptIDKeyManager {
// For now, we'll create a placeholder using the seed hash // For now, we'll create a placeholder using the seed hash
// TODO: Use @noble/ed25519 for proper Ed25519 key generation // TODO: Use @noble/ed25519 for proper Ed25519 key generation
const publicKeyHash = await crypto.subtle.digest('SHA-256', seed); const publicKeyHash = await crypto.subtle.digest('SHA-256', seed as BufferSource);
const publicKeyBytes = new Uint8Array(publicKeyHash).slice(0, 32); const publicKeyBytes = new Uint8Array(publicKeyHash).slice(0, 32);
// Multicodec prefix for Ed25519 public key: 0xed01 // Multicodec prefix for Ed25519 public key: 0xed01
@ -369,7 +369,7 @@ export async function encryptData(
if (typeof data === 'string') { if (typeof data === 'string') {
plaintext = new TextEncoder().encode(data).buffer; plaintext = new TextEncoder().encode(data).buffer;
} else if (data instanceof Uint8Array) { } else if (data instanceof Uint8Array) {
plaintext = data.buffer; plaintext = data.buffer as ArrayBuffer;
} else { } else {
plaintext = data; plaintext = data;
} }
@ -400,7 +400,7 @@ export async function decryptData(
return crypto.subtle.decrypt( return crypto.subtle.decrypt(
{ {
name: 'AES-GCM', name: 'AES-GCM',
iv: encrypted.iv, iv: encrypted.iv as BufferSource,
}, },
key, key,
encrypted.ciphertext encrypted.ciphertext
@ -434,7 +434,7 @@ export async function signData(
if (typeof data === 'string') { if (typeof data === 'string') {
dataBuffer = new TextEncoder().encode(data).buffer; dataBuffer = new TextEncoder().encode(data).buffer;
} else if (data instanceof Uint8Array) { } else if (data instanceof Uint8Array) {
dataBuffer = data.buffer; dataBuffer = data.buffer as ArrayBuffer;
} else { } else {
dataBuffer = data; dataBuffer = data;
} }

View File

@ -256,7 +256,7 @@ export class WalletStore {
const blob: PersistedBlob = { const blob: PersistedBlob = {
c: bufferToBase64url(encrypted.ciphertext), c: bufferToBase64url(encrypted.ciphertext),
iv: bufferToBase64url(encrypted.iv.buffer), iv: bufferToBase64url(encrypted.iv.buffer as ArrayBuffer),
}; };
try { try {

View File

@ -329,7 +329,7 @@ export async function authenticatePasskey(
userId: response.userHandle userId: response.userHandle
? bufferToBase64url(response.userHandle) ? bufferToBase64url(response.userHandle)
: '', : '',
prfOutput: prfOutput, prfOutput: prfOutput as ArrayBuffer | undefined,
signature: response.signature, signature: response.signature,
authenticatorData: response.authenticatorData, authenticatorData: response.authenticatorData,
}; };
@ -426,7 +426,7 @@ export async function startConditionalUI(
userId: response.userHandle userId: response.userHandle
? bufferToBase64url(response.userHandle) ? bufferToBase64url(response.userHandle)
: '', : '',
prfOutput: prfResults?.first, prfOutput: prfResults?.first as ArrayBuffer | undefined,
signature: response.signature, signature: response.signature,
authenticatorData: response.authenticatorData, authenticatorData: response.authenticatorData,
}; };