-
Notifications
You must be signed in to change notification settings - Fork 51
把脚本中间的函数修改了下,可以避免上链过程出现意外后,脚本直接退出 #2
Copy link
Copy link
Open
Description
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);
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels