Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Correct the type of getComputeUnitEstimateForTransactionMessage #2905

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rare-goats-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@solana/web3.js-experimental': patch
---

Fixed the type of `config` on `getComputeUnitEstimateForTransactionMessage`. It is now optional and does not include `transactionMessage`.
5 changes: 4 additions & 1 deletion packages/library/src/compute-limit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ type ComputeUnitEstimateForTransactionMessageFactoryConfig = Readonly<{
}>;
type ComputeUnitEstimateForTransactionMessageFunction = (
transactionMessage: CompilableTransactionMessage | (ITransactionMessageWithFeePayer & TransactionMessage),
config: Omit<Parameters<typeof getComputeUnitEstimateForTransactionMessage_INTERNAL_ONLY_DO_NOT_EXPORT>[0], 'rpc'>,
config?: Omit<
Parameters<typeof getComputeUnitEstimateForTransactionMessage_INTERNAL_ONLY_DO_NOT_EXPORT>[0],
'rpc' | 'transactionMessage'
>,
) => Promise<number>;

export function getComputeUnitEstimateForTransactionMessageFactory({
Expand Down