async function logMemo(message) {
try {
let tx = new Transaction();
await tx.add(
new TransactionInstruction({
keys: [{ pubkey: keypair.publicKey, isSigner: true, isWritable: true }],
data: Buffer.from(message, "utf-8"),
programId: new PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),
})
)
let result = await sendAndConfirmTransaction(SOLANA_CONNECTION, tx, [keypair]);
console.log("complete: ", https://solscan.io/tx/${result});
return result;
} catch (error) {
console.error("Error in logMemo:", error.message);
}
}
async function logMemo(message) {
try {
let tx = new Transaction();
await tx.add(
new TransactionInstruction({
keys: [{ pubkey: keypair.publicKey, isSigner: true, isWritable: true }],
data: Buffer.from(message, "utf-8"),
programId: new PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),
})
)
let result = await sendAndConfirmTransaction(SOLANA_CONNECTION, tx, [keypair]);
console.log("complete: ", https://solscan.io/tx/${result});
return result;
} catch (error) {
console.error("Error in logMemo:", error.message);
}
}