def bitcoin_withdraw(self, addr): s = ServiceProxy(settings.BITCOIN_SERVER_URL) return s.sendfrom(self.username, addr, self.bitcoin_balance())
def bitcoin_pay(self, amount=0.0, frm=None, to=None): s = ServiceProxy(settings.BITCOIN_SERVER_URL) to_address = self.bitcoin_address(to) if isinstance(amount, decimal.Decimal): amount = float(amount) return s.sendfrom(frm or self.username, to_address, amount)['result']