use the non deprecated prioritization fee ix
This commit is contained in:
parent
068fad98f7
commit
65a31bcd5c
|
@ -23,10 +23,7 @@ export async function sendTransaction(
|
|||
const payer = (provider as AnchorProvider).wallet;
|
||||
|
||||
if (opts.prioritizationFee) {
|
||||
ixs = [
|
||||
createComputeBudgetIx(opts.prioritizationFee, 200_000 * ixs.length + 1),
|
||||
...ixs,
|
||||
];
|
||||
ixs = [createComputeBudgetIx(opts.prioritizationFee), ...ixs];
|
||||
}
|
||||
|
||||
const message = MessageV0.compile({
|
||||
|
@ -103,12 +100,10 @@ export async function sendTransaction(
|
|||
}
|
||||
|
||||
export const createComputeBudgetIx = (
|
||||
prioritizationFee: number,
|
||||
units: number,
|
||||
microLamports: number,
|
||||
): TransactionInstruction => {
|
||||
const computeBudgetIx = ComputeBudgetProgram.requestUnits({
|
||||
additionalFee: prioritizationFee,
|
||||
units,
|
||||
const computeBudgetIx = ComputeBudgetProgram.setComputeUnitPrice({
|
||||
microLamports,
|
||||
});
|
||||
return computeBudgetIx;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue