mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-11-17 00:28:56 -05:00
refactor: text encoder over buffer
Addresses comment from copilot
This commit is contained in:
parent
65496acc55
commit
0aaec3495a
@ -457,9 +457,9 @@ function SignSolanaMessage({ signMessage }: { signMessage?: (message: Uint8Array
|
|||||||
if (!signMessage) {
|
if (!signMessage) {
|
||||||
throw new Error('no Solana 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 signatureBytes = await signMessage(input);
|
||||||
const signature = Buffer.from(signatureBytes).toString("base64");
|
const signature = btoa(String.fromCharCode(...signatureBytes));
|
||||||
setSignature(signature);
|
setSignature(signature);
|
||||||
setSignError(undefined);
|
setSignError(undefined);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user