getTransactionMessageComputeUnitLimit
Returns the compute unit limit currently set on a transaction message, or undefined if none is
set.
This function works with all transaction versions:
- V1: Reads from the transaction message's
config.computeUnitLimit. - Legacy / V0: Searches the instructions for a
SetComputeUnitLimitinstruction and decodes its value.
Parameters
| Parameter | Type | Description |
|---|---|---|
transactionMessage | TransactionMessage | The transaction message to inspect. |
Returns
number | undefined
The compute unit limit, or undefined if none is set.