# Path: pypeerassets/exceptions.py
# class UnsupportedNetwork(Exception):
#     '''This network is not suppored by pypeerassets.'''
# 
# Path: pypeerassets/pa_constants.py
# def param_query(name: str) -> PAParams:
# 
# Path: pypeerassets/networks.py
# class PeercoinTxOut(TxOut):
#     def get_dust_threshold(self, size_to_relay_fee) -> float:
# def net_query(name: str) -> Constants:


from abc import ABC, abstractmethod
from decimal import Decimal
from btcpy.structs.address import Address, InvalidAddress
from pypeerassets.exceptions import UnsupportedNetwork
from pypeerassets.pa_constants import PAParams, param_query
from pypeerassets.networks import Constants, net_query
import urllib.request
'''Common provider class with basic features.'''





class Provider(ABC):

    net = ""

    headers = {"User-Agent": "pypeerassets"}

    @staticmethod
    def _netname(name: str) -> dict:
        '''resolute network name,
        required because some providers use shortnames and other use longnames.'''

        try:
            long = net_query(name).name
            short = net_query(name).shortname
        except AttributeError:

# Path: pypeerassets/exceptions.py
# class UnsupportedNetwork(Exception):
#     '''This network is not suppored by pypeerassets.'''
# 
# Path: pypeerassets/pa_constants.py
# def param_query(name: str) -> PAParams:
# 
# Path: pypeerassets/networks.py
# class PeercoinTxOut(TxOut):
#     def get_dust_threshold(self, size_to_relay_fee) -> float:
# def net_query(name: str) -> Constants:


# Path: pypeerassets/provider/common.py
from abc import ABC, abstractmethod
from decimal import Decimal
from btcpy.structs.address import Address, InvalidAddress
from pypeerassets.exceptions import UnsupportedNetwork
from pypeerassets.pa_constants import PAParams, param_query
from pypeerassets.networks import Constants, net_query
import urllib.request

'''Common provider class with basic features.'''





class Provider(ABC):

    net = ""

    headers = {"User-Agent": "pypeerassets"}

    @staticmethod
    def _netname(name: str) -> dict:
        '''resolute network name,
        required because some providers use shortnames and other use longnames.'''

        try:
            long = net_query(name).name
            short = net_query(name).shortname
        except AttributeError:

            raise UnsupportedNetwork('''This blockchain network is not supported by the pypeerassets, check networks.py for list of supported networks.''')