Class JCoinbaseClientFactory
public abstract class JCoinbaseClientFactory
extends java.lang.Object
JCoinbaseClient
objects
This class allows you to build new JCoinbaseClient instances by calling the build(String, String, String, long, boolean)
method
-
Constructor Summary
Constructors Constructor Description JCoinbaseClientFactory()
-
Method Summary
Modifier and Type Method Description static JCoinbaseClient
build(java.lang.String apiKey, java.lang.String secret, java.lang.String apiVersion, long timeout, boolean threadSafe)
Return a newJCoinbaseClient
instance configured with the given parameters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
JCoinbaseClientFactory
public JCoinbaseClientFactory()
-
-
Method Details
-
build
public static JCoinbaseClient build(java.lang.String apiKey, java.lang.String secret, java.lang.String apiVersion, long timeout, boolean threadSafe)Return a newJCoinbaseClient
instance configured with the given parameters.
You should always use this method to build new JCoinbaseClient objects.
Also note that the 'apiKey', 'secret' and 'apiVersion' params are optional so you can set these params to null. However, you will only be able to access the public data of coinbase in this case. So, if you want to access protected data such as accounts or transactions, you should provide an api key and a secret.
If you do not already have an api key, please follow this link to create a new one
Note that you can create a JCoinbaseClient object as a safe thread singleton by passing true for the 'threadSafe' param. This will keep the same instance for each call of this method with 'threadSafe = true', but it is also more resource intensive. If you do not want the JCoinbaseClient to be a thread safe singleton, simply set the 'threadSafe' parameter to false for each call. This will return a new instance each time you call this method
- Parameters:
apiKey
- your coinbase api key defined in your coinbase accountsecret
- your coinbase api secret given by coinbase when creating your api key in your account settingsapiVersion
- the api version defined in your coinbase setting. For mor information please take a look at your coinbase api settingstimeout
- the desired timeout for each http request made to the coinbase api in seconds. The minimum value is 1 second.threadSafe
- define if the returned instance should be a thread safe singleton or not. In most cases, you can set it to false.- Returns:
- a new
JCoinbaseClient
configured with the given parameters
-