Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 def handle_confirm(self, confirm):
     offer = remove_offer(id=confirm['id'], message_id=confirm['trade-id'])
     trades.append(offer)
     return 'Trade succesful!'
Пример #4
0
 def handle_confirm(self, confirm):
     offer = remove_offer(id=confirm["id"], message_id=confirm["trade-id"])
     trades.append(offer)
     return "Trade succesful!"