code: def history(ctx, account, limit, type, csv, exclude, raw):
      
      from bitsharesbase.operations import getOperationNameForId
  
      t = [["#", "time (block)", "operation", "details"]]
  
      for a in account:
          account = Account(a, bitshares_instance=ctx.bitshares)
          for b in account.history(limit=limit, only_ops=type, exclude_ops=exclude):
              block = BlockHeader(b["block_num"])
              row = [
                  b["id"],
                  "%s (%s)" % (block.time(), b["block_num"]),
                  "{} ({})".format(getOperationNameForId(b["op"][0]), b["op"][0]),
                  pprintOperation(b) if not raw else json.dumps(b, indent=4),
              ]
              t.append(row)
      print_table(t)
docs: Show history of an account