from .environment import network, Network

# satoshis in 1 coin
COIN = 100 if network() == Network.NEX else 100_000_000

# signature types
SIGHASH_ALL_IN = 0
SIGHASH_FIRSTN_IN = 1 << 4
SIGHASH_THIS_IN = 2 << 4

SIGHASH_ALL_OUT = 0
SIGHASH_FIRSTN_OUT = 1
SIGHASH_TWO_OUT = 2

# Some common sighashes
SIGHASH_ALL = 0
SIGHASH_NONE = bytes([SIGHASH_ALL_IN | SIGHASH_FIRSTN_OUT, 0])
SIGHASH_ANYONECANPAY = SIGHASH_THIS_IN | SIGHASH_ALL_OUT

BTCBCH_SIGHASH_ALL = 1
BTCBCH_SIGHASH_NONE = 2
BTCBCH_SIGHASH_SINGLE = 3
BTCBCH_SIGHASH_FORKID = 0x40
BTCBCH_SIGHASH_ANYONECANPAY = 0x80

# test peer
TEST_PEER_SUBVERSION = b"/python-mininode-tester:0.0.3/"
TEST_PEER_VERSION = 80003  # past bip-152 for compactblocks
