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:
parent
03a7b6d063
commit
33156cc249
|
|
@ -99,7 +99,7 @@ class FolkMapViewer extends HTMLElement {
|
|||
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 }));
|
||||
const q = this.searchQuery.toLowerCase();
|
||||
return this.providers.map((p, i) => ({ provider: p, index: i }))
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ async function main() {
|
|||
console.log(" Wallet:", account.address);
|
||||
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ export class EncryptIDKeyManager {
|
|||
const masterKeyMaterial = await crypto.subtle.deriveBits(
|
||||
{
|
||||
name: 'PBKDF2',
|
||||
salt: salt,
|
||||
salt: salt as BufferSource,
|
||||
iterations: 600000,
|
||||
hash: 'SHA-256',
|
||||
},
|
||||
|
|
@ -296,7 +296,7 @@ export class EncryptIDKeyManager {
|
|||
// For now, we'll create a placeholder using the seed hash
|
||||
// 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);
|
||||
|
||||
// Multicodec prefix for Ed25519 public key: 0xed01
|
||||
|
|
@ -369,7 +369,7 @@ export async function encryptData(
|
|||
if (typeof data === 'string') {
|
||||
plaintext = new TextEncoder().encode(data).buffer;
|
||||
} else if (data instanceof Uint8Array) {
|
||||
plaintext = data.buffer;
|
||||
plaintext = data.buffer as ArrayBuffer;
|
||||
} else {
|
||||
plaintext = data;
|
||||
}
|
||||
|
|
@ -400,7 +400,7 @@ export async function decryptData(
|
|||
return crypto.subtle.decrypt(
|
||||
{
|
||||
name: 'AES-GCM',
|
||||
iv: encrypted.iv,
|
||||
iv: encrypted.iv as BufferSource,
|
||||
},
|
||||
key,
|
||||
encrypted.ciphertext
|
||||
|
|
@ -434,7 +434,7 @@ export async function signData(
|
|||
if (typeof data === 'string') {
|
||||
dataBuffer = new TextEncoder().encode(data).buffer;
|
||||
} else if (data instanceof Uint8Array) {
|
||||
dataBuffer = data.buffer;
|
||||
dataBuffer = data.buffer as ArrayBuffer;
|
||||
} else {
|
||||
dataBuffer = data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ export class WalletStore {
|
|||
|
||||
const blob: PersistedBlob = {
|
||||
c: bufferToBase64url(encrypted.ciphertext),
|
||||
iv: bufferToBase64url(encrypted.iv.buffer),
|
||||
iv: bufferToBase64url(encrypted.iv.buffer as ArrayBuffer),
|
||||
};
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ export async function authenticatePasskey(
|
|||
userId: response.userHandle
|
||||
? bufferToBase64url(response.userHandle)
|
||||
: '',
|
||||
prfOutput: prfOutput,
|
||||
prfOutput: prfOutput as ArrayBuffer | undefined,
|
||||
signature: response.signature,
|
||||
authenticatorData: response.authenticatorData,
|
||||
};
|
||||
|
|
@ -426,7 +426,7 @@ export async function startConditionalUI(
|
|||
userId: response.userHandle
|
||||
? bufferToBase64url(response.userHandle)
|
||||
: '',
|
||||
prfOutput: prfResults?.first,
|
||||
prfOutput: prfResults?.first as ArrayBuffer | undefined,
|
||||
signature: response.signature,
|
||||
authenticatorData: response.authenticatorData,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue