如何使用图书馆@solana/web3.js计算交易费?我找到了接口这里,但我不知道如何使用它
发布于 2022-03-01 22:30:54
给定一条消息,您可以在getFeeForMessage()
上使用Connection
API。
const transaction = new Transaction(/* ... */);
const response = await connection.getFeeForMessage(
transaction.compileMessage(),
'confirmed',
);
const feeInLamports = response.value;
https://stackoverflow.com/questions/71287491
复制相似问题