code: function parseAccountOrder(address: string, order: Object): Object {
    const direction = (order.flags & flags.Sell) === 0 ? 'buy' : 'sell'
    const takerGetsAmount = parseAmount(order.taker_gets)
    const takerPaysAmount = parseAmount(order.taker_pays)
    const quantity = (direction === 'buy') ? takerPaysAmount : takerGetsAmount
    const totalPrice = (direction === 'buy') ? takerGetsAmount : takerPaysAmount
  
    // note: immediateOrCancel and fillOrKill orders cannot enter the order book
    // so we can omit those flags here
    const specification = utils.removeUndefined({
      direction: direction,
      quantity: quantity,
      totalPrice: totalPrice,
      passive: ((order.flags & flags.Passive) !== 0) || undefined,
      // rippled currently does not provide "expiration" in account_offers
      expirationTime: utils.parseTimestamp(order.expiration)
    })
  
    const makerExchangeRate = order.quality ?
        utils.adjustQualityForZXC(order.quality.toString(),
          takerGetsAmount.currency, takerPaysAmount.currency) :
        computeQuality(takerGetsAmount, takerPaysAmount)
    const properties = {
      maker: address,
      sequence: order.seq,
      makerExchangeRate: makerExchangeRate
    }
  
    return {specification, properties}
  }
docs: rippled 'account_offers' returns a different format for orders than 'tx' the flags are also different