updateOrAppendSetComputeUnitLimitInstruction
Updates the first SetComputeUnitLimit
instruction in a transaction message
with the given units, 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 IInstruction <string , readonly (IAccountLookupMeta <string , string > | IAccountMeta <string >)[]>[]; version : TransactionVersion ; }> |
Parameters
Parameter | Type | Description |
---|---|---|
units | number | (previousUnits ) => number | The new compute unit limit, or a function that takes the previous compute unit limit and returns the new limit. |
transactionMessage | TTransactionMessage | The transaction message to update. |
Returns
TTransactionMessage