TransactionVersion

Enum representing the transaction version byte. Used internally for serializing and deserializing transactions, ensuring transactions can't be replayed on other networks. Similar in purpose to ChainId.


Usage

import { TransactionVersion } from '@stacks/network';

if (network.transactionVersion === TransactionVersion.Mainnet) {
  console.log('Mainnet transaction version');
}

Reference Linkarrow-up-right


Definition

enum TransactionVersion {
  Mainnet = 0x00,
  Testnet = 0x80,
}

Values

Value
Number
Description

Mainnet

0x00

Transaction version byte for mainnet

Testnet

0x80

Transaction version byte for testnet (also used by devnet and mocknet)

Last updated

Was this helpful?