Exemplo n.º 1
0
    def __call__(self, response, **kwargs):

        # Virtual prices
        instance = kwargs.get('instance')

        response.marketPrices.lastRefresh = bftimezone.fromTimestamp(response.marketPrices.lastRefresh)

        if instance.productId != bfglobals.freeApiId and \
               instance.MinBets[instance.currency].rateGBP is not None:
            # In the freeApi there is no rateGBP and the virtualPrices can't
            # be calculated exactly as in the web site, so we can't come down here
            requestArgs = kwargs.get('requestArgs')
            if requestArgs.get('_virtualPrices', False):
                bfvirtual.VirtualPrices(response.marketPrices,
                                        instance.MinBets['GBP'].minimumStake,
                                        instance.MinBets[instance.currency].rateGBP)
Exemplo n.º 2
0
    def __call__(self, response, **kwargs):
        exchangeId = kwargs.get('exchangeId')

        # Embed the exchangeId in the answer, since this is a must for betting
        response.market.exchangeId = exchangeId
        response.market.lastRefresh = bftimezone.fromTimestamp(response.market.lastRefresh)