Skip to content

Commit

Permalink
increase margin of error and rename fetchEstimatePriorityFees
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpmitsch committed Mar 20, 2024
1 parent c64eae0 commit 86e04c4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/libs/sdk/spec/solana/solanaClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('solana client', () => {
recordingName: 'solana-client-fetchEstimatePriorityFees',
},
async () => {
await expect(solana.fetchEstimatePriorityFees()).resolves
await expect(solana.getPriorityFeeEstimates()).resolves
.toMatchInlineSnapshot(`
Object {
"id": 1,
Expand Down
6 changes: 3 additions & 3 deletions packages/libs/sdk/src/solana/solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class Solana {

transaction.add(computeUnitPriceInstruction);
if (units) {
units = Math.ceil(units * 1.05); // margin of error
units = Math.ceil(units * 1.1); // margin of error
transaction.add(ComputeBudgetProgram.setComputeUnitLimit({ units }));
}
transaction.recentBlockhash = recentBlockhash.blockhash;
Expand All @@ -85,7 +85,7 @@ export class Solana {
}

// Get the priority fee averages based on fee data from the latest blocks
async fetchEstimatePriorityFees(
async getPriorityFeeEstimates(
args: EstimatePriorityFeesParams = {}
): Promise<PriorityFeeResponseData> {
const payload: PriorityFeeRequestPayload = {
Expand Down Expand Up @@ -119,7 +119,7 @@ export class Solana {
private async createDynamicPriorityFeeInstruction(
feeType: PriorityFeeLevels = 'medium'
) {
const { result } = await this.fetchEstimatePriorityFees({});
const { result } = await this.getPriorityFeeEstimates({});
const priorityFee = result.per_compute_unit[feeType];
const priorityFeeInstruction = ComputeBudgetProgram.setComputeUnitPrice({
microLamports: priorityFee,
Expand Down
Binary file removed quicknode-sdk-1.0.0-beta.1.tgz
Binary file not shown.

0 comments on commit 86e04c4

Please sign in to comment.