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;
|
const payer = (provider as AnchorProvider).wallet;
|
||||||
|
|
||||||
if (opts.prioritizationFee) {
|
if (opts.prioritizationFee) {
|
||||||
ixs = [
|
ixs = [createComputeBudgetIx(opts.prioritizationFee), ...ixs];
|
||||||
createComputeBudgetIx(opts.prioritizationFee, 200_000 * ixs.length + 1),
|
|
||||||
...ixs,
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const message = MessageV0.compile({
|
const message = MessageV0.compile({
|
||||||
|
@ -103,12 +100,10 @@ export async function sendTransaction(
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createComputeBudgetIx = (
|
export const createComputeBudgetIx = (
|
||||||
prioritizationFee: number,
|
microLamports: number,
|
||||||
units: number,
|
|
||||||
): TransactionInstruction => {
|
): TransactionInstruction => {
|
||||||
const computeBudgetIx = ComputeBudgetProgram.requestUnits({
|
const computeBudgetIx = ComputeBudgetProgram.setComputeUnitPrice({
|
||||||
additionalFee: prioritizationFee,
|
microLamports,
|
||||||
units,
|
|
||||||
});
|
});
|
||||||
return computeBudgetIx;
|
return computeBudgetIx;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue