Open martincik opened 3 months ago
Bumping this as recent solana network congestion is causing minting to be very flaky
i had this problem too and this worked for me as a temporary fix to add a priority fee. changed RpcClient.cjs and RpcClient.mjs in dist/ and patched with npx patch-package
async sendTransaction(transaction, sendOptions = {}, signers = []) {
const prepared = await this.prepareTransaction(transaction, signers);
const modifyComputeUnits = ComputeBudgetProgram.setComputeUnitLimit({
units: 1000000
});
const addPriorityFee = ComputeBudgetProgram.setComputeUnitPrice({
microLamports: 1
});
prepared.transaction.instructions.unshift(addPriorityFee);
prepared.transaction.instructions.unshift(modifyComputeUnits);
transaction = prepared.transaction;
signers = prepared.signers;
const defaultFeePayer = this.getDefaultFeePayer();
if (!transaction.feePayer && defaultFeePayer) {
transaction.feePayer = defaultFeePayer.publicKey;
signers = [defaultFeePayer, ...signers];
}
transaction = await this.signTransaction(transaction, signers);
const rawTransaction = transaction.serialize();
try {
return await this.metaplex.connection.sendRawTransaction(rawTransaction, sendOptions);
} catch (error) {
throw this.parseProgramError(error, transaction);
}
}
Hi team,
This is our code for creating collection with Metaplex foundation JS SDK:
How do I modify this code to add priority fees for Solana? Thanks.