# Path: pypeerassets/networks.py
# def net_query(name: str) -> Constants:
#     '''Find the NetworkParams for a network by its long or short name. Raises
#     UnsupportedNetwork if no NetworkParams is found.
#     '''
# 
#     for net_params in networks:
#         if name in (net_params.name, net_params.shortname,):
#             return net_params
# 
#     raise UnsupportedNetwork


from hashlib import sha256
from typing import Union
from os import urandom
from btcpy.structs.crypto import PublicKey, PrivateKey
from btcpy.structs.transaction import MutableTransaction, TxOut
from btcpy.structs.sig import P2pkhSolver
from pypeerassets.networks import net_query





class Kutil:

    def __init__(self, network: str, privkey: bytearray=None, from_string: str=None,
                 from_wif: str=None) -> None:
        '''
           High level helper class for handling public key cryptography.

           : privkey - privatekey bytes
           : from_wif - <WIF> import private key from your wallet in WIF format
           : from_bytes - import private key in binary format
           : network - specify network [ppc, tppc, btc]
           : from_string - specify seed (string) to make the privkey from
           '''

        self.network = network

# Path: pypeerassets/networks.py
# def net_query(name: str) -> Constants:
#     '''Find the NetworkParams for a network by its long or short name. Raises
#     UnsupportedNetwork if no NetworkParams is found.
#     '''
# 
#     for net_params in networks:
#         if name in (net_params.name, net_params.shortname,):
#             return net_params
# 
#     raise UnsupportedNetwork


# Path: pypeerassets/kutil.py
from hashlib import sha256
from typing import Union
from os import urandom
from btcpy.structs.crypto import PublicKey, PrivateKey
from btcpy.structs.transaction import MutableTransaction, TxOut
from btcpy.structs.sig import P2pkhSolver
from pypeerassets.networks import net_query






class Kutil:

    def __init__(self, network: str, privkey: bytearray=None, from_string: str=None,
                 from_wif: str=None) -> None:
        '''
           High level helper class for handling public key cryptography.

           : privkey - privatekey bytes
           : from_wif - <WIF> import private key from your wallet in WIF format
           : from_bytes - import private key in binary format
           : network - specify network [ppc, tppc, btc]
           : from_string - specify seed (string) to make the privkey from
           '''

        self.network = network

        self.constants = net_query(self.network)