コード例 #1
0
 def back_by_price():
     keys = bytes(32)
     values = bytes(8 + 4)
     if eoslib.back(exchange, exchange, table_asks, keys, 1, 1, values) > 0:
         ask = Ask()
         ask.seller = OrderID(keys[:16])
         ask.price = uint128(keys[16:])
         result = struct.unpack('QI', values)
         ask.quantity = result[0]
         ask.expiration = result[1]
         return ask
     return None
コード例 #2
0
 def back_by_price():
     keys = bytes(32)
     values = bytes(8 + 4)
     if eoslib.back(exchange, exchange, table_bids, keys, 1, 1, values) > 0:
         bid = Bid()
         bid.buyer = OrderID(keys[:16])
         bid.price = uint128(keys[16:])
         result = struct.unpack('QI', values)
         bid.quantity = result[0]
         bid.expiration = result[1]
         return bid
     return None