decompileTransactionConfig

function decompileTransactionConfig(
    configMask,
    configValues,
): V1TransactionConfig;

Decodes the compiled configMask and configValues of a version 1 compiled transaction message into a V1TransactionConfig.

Use this to read a v1 transaction's compute budget without decompiling the whole message via decompileTransactionMessage.

Parameters

ParameterTypeDescription
configMasknumberThe bitmask indicating which config fields are present.
configValuesCompiledTransactionConfigValue[]The config values, ordered by mask bit.

Returns

V1TransactionConfig

The decoded config, containing only the fields present in the mask.

Throws

Throws SOLANA_ERROR__TRANSACTION__INVALID_CONFIG_MASK_PRIORITY_FEE_BITS if only one of the two priority fee bits is set.

Throws

Throws SOLANA_ERROR__TRANSACTION__INVALID_CONFIG_VALUE_KIND if a value's kind does not match the field it is decoded into.

Example

const compiledMessage = getCompiledTransactionMessageDecoder().decode(messageBytes);
if (compiledMessage.version === 1) {
    const { computeUnitLimit, priorityFeeLamports } = decompileTransactionConfig(
        compiledMessage.configMask,
        compiledMessage.configValues,
    );
}

On this page