import os

ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
BIP39_DIR = os.path.normpath(os.path.join(ROOT_DIR, 'bip39_word_list'))
SIGHASH_ALL = 0x00000001
SIGHASH_NONE = 0x00000002
SIGHASH_SINGLE = 0x00000003
MAX_HEX = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
MAX_DEC = 115792089237316195423570985008687907852837564279074904382605163141518161494337
ZERO_BYTE = (b'\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
             b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
             b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
PREFIX_0 = b'\x00'
PREFIX_1 = b'\x01'
PREFIX_2 = b'\x02'
PREFIX_3 = b'\x03'
PREFIX_4 = b'\x04'
PREFIX_5 = b'\x05'
PREFIX_6 = b'\x06'
PREFIX_7 = b'\x07'
PREFIX_8 = b'\x08'
PREFIX_9 = b'\x09'
PREFIX_80 = b'\x80'
PREFIX_LIST = [PREFIX_0, PREFIX_1, PREFIX_2, PREFIX_3, PREFIX_4, PREFIX_5, PREFIX_6, PREFIX_7, PREFIX_8, PREFIX_9, PREFIX_80]
MAINNET_SEGWIT_ADDRESS_BYTE_PREFIX = b'\x03\x03\x00\x02\x03'

WIF_UNCOMPRESSED_PREFIX = '5'
WIF_COMPRESSED_PREFIX = 'K'
WIF_COMPRESSED_PREFIX_2 = 'L'

WIF_PREFIX = [WIF_UNCOMPRESSED_PREFIX, WIF_COMPRESSED_PREFIX, WIF_COMPRESSED_PREFIX_2]
BASE58_CHARS = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
MAINNET_PREFIX = b'\x80'

