Cobinhood Java Rx Client
Java/Android client for Cobinhood Exchange API.
- Very easy to understand and get started.
- Complete implementation of the Cobinhood API and soon WebSockets.
- API results deserialized to concrete objects for ease of usage.
- Includes a ready to go test project with all possible API calls, just provide your API Key and start testing.
Add this in your root build.gradle
file (not your module build.gradle
file):
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Add this to your module's build.gradle
file:
dependencies {
...
compile 'com.github.jd-alexander:cobinhood.java:v0.2'
}
}
In order to use signed methods you need to create a Cobinhood account, if you already have one, go to your account and create a new API private key.
Create an instance of the ApiClient which receive the following parameters:
- ApiKey - Key used to authenticate within the API.
- Logging Interceptor (Optional) - Allows you to pass interceptors to OKHttp.
cobinhoodService = new CobinhoodApi.Builder()
.setLoggingInterceptor(logging)
.setAccessToken("ApiKey")
.build();
Get system time as Unix timestamp.
Parameter | Type | Example |
---|---|---|
none | - | - |
Single<Response<Date>>
cobinhoodService.getSystemTime().subscribe(dateResponse -> {
});
Shown above is a Consumer that has been converted into a lambda expression.
Get system info.
Parameter | Type | Example |
---|---|---|
none | - | - |
Single<Response<SystemInformation>>
cobinhoodService.getSystemInformation().subscribe(new Consumer<Response<SystemInformation>>() {
@Override
public void accept(Response<SystemInformation> systemInformationResponse) throws Exception {
}
});
Above is a Consumer in it's full form.
All of the other methods follow this design where an observable of type Single is returned that you can subscribe to for results. To see a list of a parameters for the different methods simply use the intellisense within Android Studio or IntelliJ and if you have any other concerns about the API you can check the API documentation.
Cobinhood.Java is open-sourced software licensed under the MIT license
Please read and follow our Code of Conduct.