def handle_trade(self, trade): id, trade_id = get_public_bytestring(), trade['trade-id'] offer = get_offer(id=id, message_id=trade_id) if offer: offers.remove(offer) trades.append(offer) return create_confirm(recipient=trade['id'], trade_id=trade_id) else: return create_cancel(recipient=trade['id'], trade_id=trade_id)
def handle_trade(self, trade): id, trade_id = get_public_bytestring(), trade["trade-id"] offer = get_offer(id=id, message_id=trade_id) if offer: offers.remove(offer) trades.append(offer) return create_confirm(recipient=trade["id"], trade_id=trade_id) else: return create_cancel(recipient=trade["id"], trade_id=trade_id)
def handle_confirm(self, confirm): offer = remove_offer(id=confirm['id'], message_id=confirm['trade-id']) trades.append(offer) return 'Trade succesful!'
def handle_confirm(self, confirm): offer = remove_offer(id=confirm["id"], message_id=confirm["trade-id"]) trades.append(offer) return "Trade succesful!"