# Path: zaifbot/rules/rule.py
# class Rule:
#     pass
# 
# Path: zaifbot/exchange/action.py
# def Action(action):
#     for cls in _TradeAction.__subclasses__():
#         if isinstance(action, str):
#             if cls.is_my_action(action):
#                 return cls(action)
#             continue
# 
#         if isinstance(action, _TradeAction):
#             return action
# 
#     raise ValueError('illegal argument')
# 
# Path: zaifbot/exchange/currency_pairs.py
# class CurrencyPair:
#     _lock = Lock()
#     _instances = {}
# 
#     def __new__(cls, name):
#         with cls._lock:
#             name = str(name)
#             if cls._instances.get(name, None) is None:
#                 cls._instances[name] = super().__new__(cls)
#         return cls._instances[name]
# 
#     def __init__(self, name):
#         self._name = str(name)
#         self._info = _ZaifCurrencyPairsInfo()[self._name]
# 
#     def __str__(self):
#         return self._name
# 
#     @property
#     def name(self):
#         return self._name
# 
#     @property
#     def info(self):
#         return self._info
# 
#     @property
#     def is_token(self):
#         return self._info['is_token']


from zaifbot.rules.rule import Rule
from zaifbot.exchange.action import Action
from zaifbot.exchange.currency_pairs import CurrencyPair


class Entry(Rule):
    def __init__(self, currency_pair, amount, action='bid', name=None):
        self.currency_pair = CurrencyPair(currency_pair)
        self.amount = amount

# Path: zaifbot/rules/rule.py
# class Rule:
#     pass
# 
# Path: zaifbot/exchange/action.py
# def Action(action):
#     for cls in _TradeAction.__subclasses__():
#         if isinstance(action, str):
#             if cls.is_my_action(action):
#                 return cls(action)
#             continue
# 
#         if isinstance(action, _TradeAction):
#             return action
# 
#     raise ValueError('illegal argument')
# 
# Path: zaifbot/exchange/currency_pairs.py
# class CurrencyPair:
#     _lock = Lock()
#     _instances = {}
# 
#     def __new__(cls, name):
#         with cls._lock:
#             name = str(name)
#             if cls._instances.get(name, None) is None:
#                 cls._instances[name] = super().__new__(cls)
#         return cls._instances[name]
# 
#     def __init__(self, name):
#         self._name = str(name)
#         self._info = _ZaifCurrencyPairsInfo()[self._name]
# 
#     def __str__(self):
#         return self._name
# 
#     @property
#     def name(self):
#         return self._name
# 
#     @property
#     def info(self):
#         return self._info
# 
#     @property
#     def is_token(self):
#         return self._info['is_token']


# Path: zaifbot/rules/entry/base.py
from zaifbot.rules.rule import Rule
from zaifbot.exchange.action import Action
from zaifbot.exchange.currency_pairs import CurrencyPair



class Entry(Rule):
    def __init__(self, currency_pair, amount, action='bid', name=None):
        self.currency_pair = CurrencyPair(currency_pair)
        self.amount = amount

        self.action = Action(action)