refactor: text encoder over buffer

Addresses comment from copilot
This commit is contained in:
Quazia 2025-05-22 17:30:01 -04:00
parent 65496acc55
commit 0aaec3495a
No known key found for this signature in database

View File

@ -457,9 +457,9 @@ function SignSolanaMessage({ signMessage }: { signMessage?: (message: Uint8Array
if (!signMessage) {
throw new Error('no Solana signMessage');
}
const input = Buffer.from("Hello from Solana!", "utf8");
const input = new TextEncoder().encode("Hello from Solana!");
const signatureBytes = await signMessage(input);
const signature = Buffer.from(signatureBytes).toString("base64");
const signature = btoa(String.fromCharCode(...signatureBytes));
setSignature(signature);
setSignError(undefined);
} catch (e) {