updateOrAppendSetComputeUnitPriceInstruction
Updates the first SetComputeUnitPrice instruction in a transaction message
with the given micro-Lamports, or appends a new instruction if none exists.
A function of the current value can be provided instead of a static value.
Example
Type Parameters
| Type Parameter |
|---|
TTransactionMessage extends Readonly<{ instructions: readonly Instruction<string, readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[]>[]; version: TransactionVersion; }> |
Parameters
| Parameter | Type | Description |
|---|---|---|
microLamports | MicroLamports | (previousMicroLamports) => MicroLamports | The new compute unit price, or a function that takes the previous price and returns the new one. |
transactionMessage | TTransactionMessage | The transaction message to update. |
Returns
TTransactionMessage