I try to sign a text and I get this error.
const anchorWallet = useAnchorWallet();
const MEMO_PROGRAM_ADDRESS = "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr";
const MEMO_PROGRAM_ID = new PublicKey(MEMO_PROGRAM_ADDRESS);
const onTestSign = async () => {
if (!anchorWallet) return;
const tx = new Transaction();
tx.add(
new TransactionInstruction({
programId: MEMO_PROGRAM_ID,
keys: [],
data: Buffer.from("hello world", "utf8"),
})
);
tx.feePayer = anchorWallet.publicKey;
tx.recentBlockhash = Keypair.generate().publicKey.toString();
await anchorWallet.signTransaction(tx);
};
Again Above code works well on localhost, but when I test on the live server I got the above error.
Live: https://solana-web2-auth.vercel.app/
Thanks