Skip to main content
Version: 11.x

Function: toTransactionVersion()

toTransactionVersion(defaultVersion, providedVersion?): ETransactionVersion3

Defined in: src/utils/stark/index.ts:482

Convert input versions to ETransactionVersion or throw an error. Returns providedVersion if specified, otherwise returns defaultVersion.

Parameters​

defaultVersion​

BigNumberish

The default transaction version to use if providedVersion is not specified

providedVersion?​

BigNumberish

Optional transaction version that takes precedence if provided

Returns​

ETransactionVersion3

The transaction version - either providedVersion if specified or defaultVersion

Throws​

If either version is not a valid ETransactionVersion

Example​

const result = stark.toTransactionVersion("0x3", stark.toFeeVersion(3));
// result = "0x100000000000000000000000000000003"