[英]Uncaught (in promise) Error: Transaction fee payer required
I get this error when I try to execute this using phantom wallet and react app当我尝试使用幻像钱包执行此操作并响应应用程序时出现此错误
const transferTransaction = new Transaction()
.add(SystemProgram.transfer({
fromPubkey: alice.publicKey,
toPubkey: feePayer.publicKey,
lamports: lamportsToSend
}))
const network = "https://api.devnet.solana.com";
const connection = new Connection(network);
const transaction = new Transaction();
transferTransaction.recentBlockhash = (await connection.getRecentBlockhash()).blockhash;
const { signature } = await window.solana.signAndSendTransaction(transferTransaction);
await connection.confirmTransaction(signature);
i fixed it by transferTransaction.feePayer = alice.publicKey;
我通过
transferTransaction.feePayer = alice.publicKey;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.