All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.knowm.xchange.gdax.service.GDAXBasePollingService Maven / Gradle / Ivy

There is a newer version: 4.3.8
Show newest version
package org.knowm.xchange.gdax.service;

import org.knowm.xchange.Exchange;
import org.knowm.xchange.gdax.GDAX;
import org.knowm.xchange.service.BaseExchangeService;
import org.knowm.xchange.service.polling.BasePollingService;

import si.mazi.rescu.ParamsDigest;
import si.mazi.rescu.RestProxyFactory;

/**
 * Created by Yingzhe on 4/6/2015.
 */
public class GDAXBasePollingService extends BaseExchangeService implements BasePollingService {

  protected final T coinbaseEx;
  protected final ParamsDigest digest;

  protected final String apiKey;
  protected final String passphrase;

  protected GDAXBasePollingService(Class type, Exchange exchange) {

    super(exchange);
    this.coinbaseEx = RestProxyFactory.createProxy(type, exchange.getExchangeSpecification().getSslUri());
    this.digest = GDAXDigest.createInstance(exchange.getExchangeSpecification().getSecretKey());

    this.apiKey = exchange.getExchangeSpecification().getApiKey();
    this.passphrase = (String) exchange.getExchangeSpecification().getExchangeSpecificParametersItem("passphrase");
  }

  protected String getTimestamp() {
    return String.valueOf(System.currentTimeMillis() / 1000);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy