Example #1
0
 def marketData(self, market=None, type=None):
     if not market and not type:
         return rp.Parse(url='/markets', type='get')
     elif market:
         if not type:
             return rp.Parse(url='/markets/' + market, type='get')
         else:
             return rp.Parse(url='/markets/' + market + '/' + type, type='get')
Example #2
0
 def cancelOrder(self, market=None):
     if market:
         self.report.notice(content="Cancelling all orders at " + market)
         return rp.Parse(url='/orders/' + market , type='delete', auth='true')
         pass
     else:
         self.report.notice(content="Cancelling all orders.")
         return rp.Parse(url='/orders', type='delete', auth='true')
     pass
Example #3
0
    def createOrder(self, type=None, amount=None, price=None, market=None):
        if type and amount and price and market:
            if amount <= '0.0001':
                self.report.error(content="Amount has to be larger than 0.")
            if price <= '0.01':
                self.report.error(content="Price has to be larger than 0.")

            obj = {
                'market': market,
                'amount': str(amount),
                'price': str(price),
                'type': type
            }
            self.report.notice(content="Placing order: " + str(obj))
            rp.Parse(url='/orders', data=obj, type='post', auth='true')
        else:
            self.report.error(content="Missing critical information, e.g: order type, amount or price")
Example #4
0
    def history(self, data=None, year=None, month=None, market=None):
        if data:
            if data == 'deposit':
                return rp.Parse(url='/deposit/history',
                                type='get',
                                auth='true')

            if data == 'orders':
                if not market:
                    return rp.Parse(url='/history/orders',
                                    type='get',
                                    auth='true')
                else:
                    return rp.Parse(url='/history/orders/' + market,
                                    type='get',
                                    auth='true')

            if data == 'trades' or data == 'transactions':
                if year and month:
                    return rp.Parse(url='/history/' + data + '/' + month +
                                    '/' + year,
                                    type='get',
                                    auth='true')

                elif year:
                    return rp.Parse(url='/history/' + data + '/' + year,
                                    type='get',
                                    auth='true')

                elif not year and not month:
                    return rp.Parse(url='/history/' + data,
                                    type='get',
                                    auth='true')
        else:
            self.report.error(
                content="Missing data type: orders, trades or transactions")
            pass
Example #5
0
 def getTime(self):
     return rp.Parse(url='/time', type='get')
Example #6
0
 def history(self, market=None):
     if market:
         return rp.Parse(url='/orders/' + market + '/history', type='get', auth='true')
     else:
         return rp.Parse(url='/orders/history', type='get', auth='true')
Example #7
0
 def orderList(self, market=None):
     if market:
         return rp.Parse(url='/orders/' + market, type='get', auth='true')
     else:
         return rp.Parse(url='/orders/', type='get', auth='true')
Example #8
0
 def addresses(self):
     return rp.Parse(url='/deposit/address', type='get', auth='true')