Retrieve TransHistory. :TODO: Return could be abstracted in a fashion similar to UserTrades and
also used in additional service for BitStamp exchange.

@param params
@return Map of transaction id to WexTransHistoryResult
329164
public Map<Long, WexTransHistoryResult> getTransHistory(WexTransHistoryParams params)
      throws ExchangeException, IOException {

    Long offset = null;
    Long count = null;
    Long startId = null;
    Long endId = null;
    WexAuthenticated.SortOrder sort = WexAuthenticated.SortOrder.DESC;
    Long startTime = null;
    Long endTime = null;

    if (params instanceof TradeHistoryParamPaging) {
      TradeHistoryParamPaging pagingParams = params;
      Integer pageLength = pagingParams.getPageLength();
      Integer pageNumber = pagingParams.getPageNumber();
      if (pageNumber == null) {
        pageNumber = 0;
      }

      if (pageLength != null) {
        count = pageLength.longValue();
        offset = (long) (pageLength * pageNumber);
      } else {
        offset = pageNumber.longValue();
      }
    }

    if (params instanceof TradeHistoryParamsIdSpan) {
      TradeHistoryParamsIdSpan idParams = params;
      startId = nullSafeToLong(idParams.getStartId());
      endId = nullSafeToLong(idParams.getEndId());
    }

    if (params instanceof TradeHistoryParamsTimeSpan) {
      TradeHistoryParamsTimeSpan timeParams = params;
      startTime = nullSafeUnixTime(timeParams.getStartTime());
      endTime = nullSafeUnixTime(timeParams.getEndTime());
    }

    if (params instanceof WexTransHistoryParams) {
      sort = params.getSortOrder();
    }

    Map<Long, WexTransHistoryResult> resultMap =
        getBTCETransHistory(offset, count, startId, endId, sort, startTime, endTime);

    return resultMap;
  }
674048
@Override
  public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {
    Long limit = null;
    CurrencyPair currencyPair = null;
    Long offset = null;
    TradeHistoryParamsSorted.Order sort = null;
    if (params instanceof TradeHistoryParamPaging) {
      limit = Long.valueOf(((TradeHistoryParamPaging) params).getPageLength());
    }
    if (params instanceof TradeHistoryParamCurrencyPair) {
      currencyPair = ((TradeHistoryParamCurrencyPair) params).getCurrencyPair();
    }
    if (params instanceof TradeHistoryParamOffset) {
      offset = ((TradeHistoryParamOffset) params).getOffset();
    }
    if (params instanceof TradeHistoryParamsSorted) {
      sort = ((TradeHistoryParamsSorted) params).getOrder();
    }
    CryptonitUserTransaction[] txs =
        getCryptonitUserTransactions(
            limit, currencyPair, offset, sort == null ? null : sort.toString());
    return CryptonitAdapters.adaptTradeHistory(txs);
  }
1330911
public BitZUserHistoryResult getUserHistoryEntrustSheet(
      String coinFrom,
      String coinTo,
      Integer type,
      Integer page,
      Integer pageSize,
      String startTime,
      String endTime)
      throws IOException {
    page = page == null ? 1 : page;
    pageSize = pageSize == null ? 100 : pageSize;
    if (type == null) {
      return bitz.getUserHistoryEntrustSheet(
          apiKey,
          getTimeStamp(),
          nonce,
          signer,
          coinFrom,
          coinTo,
          page,
          pageSize,
          startTime,
          endTime);
    }
    return bitz.getUserHistoryEntrustSheet(
        apiKey,
        getTimeStamp(),
        nonce,
        signer,
        coinFrom,
        coinTo,
        type,
        page,
        pageSize,
        startTime,
        endTime);
  }
867383
protected History[] constructHistory(BasicNameValuePair[] params) throws Exception {
        String uri = HISTORY + uriEncode(_profileName);

        try {
            JSONObject response = new JSONObject(doGet(uri, params));
            JSONArray historyArray = response.getJSONArray("history");
            history = new History[historyArray.length()];

            for (int i = 0; i < historyArray.length(); i++) {
                history[i] = new History();
                JSONObject jsonHistory = historyArray.getJSONObject(i);
                if (jsonHistory == null) {
                    continue;
                }

                if (!jsonHistory.isNull("id")) {
                    history[i].setId(jsonHistory.getInt("id"));
                }
                if (!jsonHistory.isNull("profileId")) {
                    history[i].setProfileId(jsonHistory.getInt("profileId"));
                }
                if (!jsonHistory.isNull("clientUUID")) {
                    history[i].setClientUUID(jsonHistory.getString("clientUUID"));
                }
                if (!jsonHistory.isNull("createdAt")) {
                    history[i].setCreatedAt(jsonHistory.getString("createdAt"));
                }
                if (!jsonHistory.isNull("requestType")) {
                    history[i].setRequestType(jsonHistory.getString("requestType"));
                }
                if (!jsonHistory.isNull("requestURL")) {
                    history[i].setRequestURL(jsonHistory.getString("requestURL"));
                }
                if (!jsonHistory.isNull("requestParams")) {
                    history[i].setRequestParams(jsonHistory.getString("requestParams"));
                }
                if (!jsonHistory.isNull("requestPostData")) {
                    history[i].setRequestPostData(jsonHistory.getString("requestPostData"));
                }
                if (!jsonHistory.isNull("requestHeaders")) {
                    history[i].setRequestHeaders(jsonHistory.getString("requestHeaders"));
                }
                if (!jsonHistory.isNull("responseCode")) {
                    history[i].setResponseCode(jsonHistory.getString("responseCode"));
                }
                if (!jsonHistory.isNull("responseHeaders")) {
                    history[i].setResponseHeaders(jsonHistory.getString("responseHeaders"));
                }
                if (!jsonHistory.isNull("responseContentType")) {
                    history[i].setResponseContentType(jsonHistory.getString("responseContentType"));
                }
                if (!jsonHistory.isNull("originalRequestURL")) {
                    history[i].setOriginalRequestURL(jsonHistory.getString("originalRequestURL"));
                }
                if (!jsonHistory.isNull("originalRequestParams")) {
                    history[i].setOriginalRequestParams(jsonHistory.getString("originalRequestParams"));
                }
                if (!jsonHistory.isNull("originalRequestPostData")) {
                    history[i].setOriginalRequestPostData(jsonHistory.getString("originalRequestPostData"));
                }
                if (!jsonHistory.isNull("originalRequestHeaders")) {
                    history[i].setOriginalRequestHeaders(jsonHistory.getString("originalRequestHeaders"));
                }
                if (!jsonHistory.isNull("originalResponseCode")) {
                    history[i].setOriginalResponseCode(jsonHistory.getString("originalResponseCode"));
                }
                if (!jsonHistory.isNull("originalResponseHeaders")) {
                    history[i].setOriginalResponseHeaders(jsonHistory.getString("originalResponseHeaders"));
                }
                if (!jsonHistory.isNull("originalResponseContentType")) {
                    history[i].setResponseContentType(jsonHistory.getString("originalResponseContentType"));
                }
                if (!jsonHistory.isNull("modified")) {
                    history[i].setModified(jsonHistory.getBoolean("modified"));
                }
                if (!jsonHistory.isNull("requestBodyDecoded")) {
                    history[i].setRequestBodyDecoded(jsonHistory.getBoolean("requestBodyDecoded"));
                }
                if (!jsonHistory.isNull("responseBodyDecoded")) {
                    history[i].setResponseBodyDecoded(jsonHistory.getBoolean("responseBodyDecoded"));
                }
                if (!jsonHistory.isNull("extraInfo")) {
                    history[i].setExtraInfoFromString(jsonHistory.getString("extraInfo"));
                }
                /**
                 * To get the json responseData make a call specifically using the id
                 */

                int id = history[i].getId();
                String idUri = uri + "/" + id;
                JSONObject historyId = new JSONObject(doGet(idUri, null));

                String responseData = historyId.getJSONObject("history").getString("responseData");
                history[i].setResponseData(responseData);
                String originalResponseData = historyId.getJSONObject("history").getString("originalResponseData");
                history[i].setOriginalResponseData(originalResponseData);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return history;
    }
744040
private static Map<String, Object> convert(
        final Map<CharSequence, Object> params) {
        final Map<String, Object> map = new HashMap<>(params.size());
        for (final Map.Entry<CharSequence, Object> ent : params.entrySet()) {
            map.put(ent.getKey().toString(), ent.getValue());
        }
        return map;
    }
471656
@Override
    public List<Revision> getMatrixHistory(final int start, final int limit) throws StoreException {
        return delegate.getMatrixHistory(start, limit);
    }
358834
public Map<String, String> getParamMap(String params) {
    Map<String, String> result = new HashMap<String, String>();
    String[] paramlist = params.split("&");
    for (int i = 0; i < paramlist.length; i++) {
      String[] parts = paramlist[i].split("=");
      if (parts.length == 2)
        result.put(parts[0], parts[1]);
    }
    return result;
  }
1024732
protected String buildBridgeURL(GetSnapshotHistoryTaskParameters taskParams) {
        int pageNumber = taskParams.getPageNumber();
        if (pageNumber < SnapshotConstants.DEFAULT_HISTORY_PAGE_NUMBER) {
            pageNumber = SnapshotConstants.DEFAULT_HISTORY_PAGE_NUMBER;
        }
        int pageSize = taskParams.getPageSize();
        if (pageSize < SnapshotConstants.MIN_HISTORY_PAGE_SIZE ||
            pageSize > SnapshotConstants.MAX_HISTORY_PAGE_SIZE) {
            pageSize = SnapshotConstants.MAX_HISTORY_PAGE_SIZE;
        }
        String snapshotId = taskParams.getSnapshotId();

        return MessageFormat.format(
            "{0}/snapshot/{1}/history?page={2}&pageSize={3}",
            buildBridgeBaseURL(),
            snapshotId,
            String.valueOf(pageNumber),
            String.valueOf(pageSize));
    }
685315
@Override
    protected Object[] convertParameters(Object[] params) {
        List<Object> converted = getBinding().getKeyBinding().getKeyParameters(Arrays.asList(params));
        return converted.toArray(new Object[converted.size()]);
    }
4785
public Collection<KeyTransaction> list(List<String> queryParams)
    {
        return HTTP.GET("/v2/key_transactions.json", null, queryParams, KEY_TRANSACTIONS).get();
    }
108552
def getTradeHistory(pair, connection=None, info=None, count=None):
    """"""

    if info is not None:
        info.validate_pair(pair)

    if connection is None:
        connection = common.BTCEConnection()

    response = connection.makeJSONRequest("/api/3/trades/%s" % pair)
    if type(response) is not dict:
        raise TypeError("The response is not a dict.")

    history = response.get(pair)
    if type(history) is not list:
        raise TypeError("The response is a %r, not a list." % type(history))

    result = []

    # Limit the number of items returned if requested.
    if count is not None:
        history = history[:count]

    for h in history:
        h["pair"] = pair
        t = Trade(**h)
        result.append(t)
    return result
464435
@Override
  public UserTrades getTradeHistory(TradeHistoryParams params)
      throws ExchangeException, IOException {

    CurrencyPair pair = ((TradeHistoryParamCurrencyPair) params).getCurrencyPair();
    List<GateioTrade> userTrades = getGateioTradeHistory(pair).getTrades();

    return GateioAdapters.adaptUserTrades(userTrades);
  }
386952
@RequestMapping(value = "/api/history/{profileIdentifier}/{id}", method = RequestMethod.GET)
    public
    @ResponseBody
    HashMap<String, Object> getHistoryForId(Model mode, @PathVariable String profileIdentifier, @PathVariable Integer id,
                                            @RequestParam(value = "format", required = false) String formatted) {
        HashMap<String, Object> returnData = new HashMap<String, Object>();
        History history = HistoryService.getInstance().getHistoryForID(id);
        if (formatted != null) {
            try {
                if (formatted.equals("formattedAll")) {
                    history.setFormattedResponseData(history.getResponseData());
                    history.setFormattedOriginalResponseData(history.getOriginalResponseData());
                } else if (formatted.equals("formattedModified")) {
                    history.setFormattedResponseData(history.getResponseData());
                } else if (formatted.equals("formattedOriginal")) {
                    history.setFormattedOriginalResponseData(history.getOriginalResponseData());
                }
                returnData.put("history", history);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else {
            returnData = new HashMap<String, Object>();
            returnData.put("history", HistoryService.getInstance().getHistoryForID(id));
        }

        return returnData;
    }
698118
@GET
    @Path("{id}/history/{start: " + DATE_REGEX + "}-{end: " + DATE_REGEX + "}")
    public Response fetchHistory(@PathParam("id") URI_ID id,
                                 @PathParam("start") Timestamp start,
                                 @PathParam("end") Timestamp end) throws Exception {
        return super.fetchHistory(id, start, end);
    }
370229
public int getInvoicesCount(final QueryParams params) {
        FluentCaseInsensitiveStringsMap map = doHEAD(Invoices.INVOICES_RESOURCE, params);
        return Integer.parseInt(map.getFirstValue(X_RECORDS_HEADER_NAME));
    }
458640
public Integer getTransactionsCount(final QueryParams params) {
        FluentCaseInsensitiveStringsMap map = doHEAD(Transactions.TRANSACTIONS_RESOURCE, params);
        return Integer.parseInt(map.getFirstValue(X_RECORDS_HEADER_NAME));
    }
675106
public function getPurchaseHistoryURI($params = array()) {
        $default_params = array(
            'client_id' => $this->getClientID(),
            'response_type' => 'code',
            'redirect_uri' => $this->getCurrentURI(),
        );
        if ($this->xiti) {
            $default_params['xiti_json'] = $this->getXitiConfiguration();
        }
        $default_params['v'] = self::VERSION;
        return $this->getUrl('www', 'account/purchasehistory', array_merge($default_params, $params));
    }