getTransactionMessageComputeUnitPrice
Returns the compute unit price currently set on a legacy or v0 transaction message, or
undefined if none is set.
This searches the instructions for a SetComputeUnitPrice instruction and decodes its value.
The value represents the price in micro-lamports per compute unit.
Type Parameters
| Type Parameter |
|---|
TTransactionMessage extends TransactionMessage & object |
Parameters
| Parameter | Type | Description |
|---|---|---|
transactionMessage | TTransactionMessage | The legacy or v0 transaction message to inspect. |
Returns
bigint | undefined
The compute unit price in micro-lamports per compute unit, or undefined if none is set.
Example
See
- setTransactionMessageComputeUnitPrice
- getTransactionMessagePriorityFeeLamports for v1 transactions.