"""SIP-005 protocol constants for Stacks transactions."""

# Transaction versions
TX_VERSION_MAINNET = 0x00
TX_VERSION_TESTNET = 0x80

# Chain IDs
CHAIN_ID_MAINNET = 0x00000001
CHAIN_ID_TESTNET = 0x80000000

# Authorization types
AUTH_TYPE_STANDARD = 0x04
AUTH_TYPE_SPONSORED = 0x05

# Hash mode for spending conditions
SINGLE_SIG_SPENDING_CONDITION = 0x00  # P2PKH

# Payload types
PAYLOAD_TYPE_TOKEN_TRANSFER = 0x00
PAYLOAD_TYPE_SMART_CONTRACT = 0x01
PAYLOAD_TYPE_CONTRACT_CALL = 0x02

# Anchor modes
ANCHOR_MODE_ON_CHAIN = 0x01
ANCHOR_MODE_OFF_CHAIN = 0x02
ANCHOR_MODE_ANY = 0x03

# Post-condition modes
POST_CONDITION_MODE_DENY = 0x01
POST_CONDITION_MODE_ALLOW = 0x02

# Clarity type IDs
CLARITY_TYPE_UINT = 0x01
CLARITY_TYPE_BUFFER = 0x02
CLARITY_TYPE_STANDARD_PRINCIPAL = 0x05
CLARITY_TYPE_CONTRACT_PRINCIPAL = 0x06
CLARITY_TYPE_OPTIONAL_NONE = 0x09
CLARITY_TYPE_OPTIONAL_SOME = 0x0A

# Principal type IDs (within address serialization)
PRINCIPAL_TYPE_STANDARD = 0x05
PRINCIPAL_TYPE_CONTRACT = 0x06

# Memo max length (bytes)
MEMO_MAX_LENGTH = 34

# Signature length (65 bytes: 1 recovery + 32 r + 32 s)
SIGNATURE_LENGTH = 65

# Address versions for c32check
ADDRESS_VERSION_MAINNET_SINGLE_SIG = 22  # P2PKH mainnet
ADDRESS_VERSION_TESTNET_SINGLE_SIG = 26  # P2PKH testnet
ADDRESS_VERSION_MAINNET_MULTI_SIG = 20   # P2SH mainnet
ADDRESS_VERSION_TESTNET_MULTI_SIG = 21   # P2SH testnet
