Skip to content

Commit

Permalink
enabled maven central distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCookieLab committed Jun 12, 2018
1 parent 4db415b commit c064c18
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 37 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# poloniex-api-java
Java API client for the Poloniex exchange with focus on simplicity and usability.

### Maven configuration

PoloniexClient is available on [Maven Central](http://search.maven.org/#search). You just have to add the following repository to your `pom.xml` file.

```xml
<repository>
<id>sonatype snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
```
The current snapshot version is `1.1.1-SNAPSHOT` from the [master](https://github.com/TheCookieLab/poloniex-api-java) branch.
```xml
<dependency>
<groupId>com.github.thecookielab</groupId>
<artifactId>PoloniexClient</artifactId>
<version>1.1.1-SNAPSHOT</version>
</dependency>
```

Using this client is as simple as instantiating a new PoloniexExchangeService with your Poloniex API Key and API Secret as constructor parameters:

```java
Expand Down
100 changes: 99 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.cf</groupId>
<groupId>com.github.thecookielab</groupId>
<artifactId>PoloniexClient</artifactId>
<version>1.1.1-SNAPSHOT</version>
<packaging>jar</packaging>

<developers>
<developer>
<name>David Pang</name>
</developer>
<developer>
<name>Cheolhee Han</name>
</developer>
</developers>

<licenses>
<license>
<name>MIT License</name>
<comments>All source code is under the MIT license.</comments>
</license>
</licenses>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<profiles>

<!-- Only when performing a release (i.e. not for snapshots) -->
<profile>
<id>sonatype-oss-release</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Artifact signing -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
</profile>

</profiles>

<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down
15 changes: 0 additions & 15 deletions src/main/java/com/cf/client/WSSClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,10 @@ public WSSClient(String url) throws Exception {
subscriptions = new HashMap<>();
}

/**
* *
*
* @param subscription
* @param subscriptionMessageHandler
*/
public void addSubscription(PoloniexWSSSubscription subscription, IMessageHandler subscriptionMessageHandler) {
this.subscriptions.put(subscription, subscriptionMessageHandler);
}

/**
* *
*
* @param runTimeInMillis The subscription time expressed in milliseconds.
* The minimum runtime is 1 minute.
* @throws InterruptedException
* @throws IOException
* @throws java.net.URISyntaxException
*/
public void run(long runTimeInMillis) throws InterruptedException, IOException, URISyntaxException {

final PoloniexWSSClientRouter router = new PoloniexWSSClientRouter(uri, subscriptions.entrySet().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public List<String> returnAllMarkets() {
* depending on parameter includeZeroBalances
*
* @param includeZeroBalances The includeZeroBalances
* @return Map<String, PoloniexCompleteBalance>
* @return Map of String, PoloniexCompleteBalance
*/
@Override
public Map<String, PoloniexCompleteBalance> returnBalance(boolean includeZeroBalances) {
Expand Down Expand Up @@ -292,8 +292,8 @@ public List<PoloniexOrderTrade> returnOrderTrades(String orderNumber) {
* Places a sell order in a given market
*
* @param currencyPair Examples: USDT_ETH, USDT_BTC, BTC_ETH
* @param sellPrice
* @param amount
* @param sellPrice the sell price
* @param amount the amount to sell
* @param fillOrKill Will either fill in its entirety or be completely
* aborted
* @param immediateOrCancel Order can be partially or completely filled, but
Expand Down Expand Up @@ -324,8 +324,8 @@ public PoloniexOrderResult sell(String currencyPair, BigDecimal sellPrice, BigDe
* Places a buy order in a given market
*
* @param currencyPair Examples: USDT_ETH, USDT_BTC, BTC_ETH
* @param buyPrice
* @param amount
* @param buyPrice the buy price
* @param amount the amount to buy
* @param fillOrKill Will either fill in its entirety or be completely
* aborted
* @param immediateOrCancel Order can be partially or completely filled, but
Expand Down Expand Up @@ -355,7 +355,7 @@ public PoloniexOrderResult buy(String currencyPair, BigDecimal buyPrice, BigDeci
* *
* Cancels an order you have placed in a given market
*
* @param orderNumber
* @param orderNumber order identifier on the exchange
* @return true if successful, false otherwise
*/
@Override
Expand Down
15 changes: 0 additions & 15 deletions src/main/java/com/cf/client/poloniex/PoloniexLendingService.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,6 @@ public List<PoloniexLendingHistory> returnLendingHistory(int hours, int limit)
return lendingHistory;
}

/**
* @param currency
* @param amount
* @param lendingRate
* @param duration
* @param autoRenew
* @return
*/
@Override
public PoloniexLendingResult createLoanOffer(String currency, BigDecimal amount, BigDecimal lendingRate, int duration, boolean autoRenew)
{
Expand All @@ -94,10 +86,6 @@ public PoloniexLendingResult createLoanOffer(String currency, BigDecimal amount,
return result;
}

/**
* @param orderNumber
* @return
*/
@Override
public PoloniexLendingResult cancelLoanOffer(String orderNumber)
{
Expand All @@ -117,9 +105,6 @@ public PoloniexLendingResult cancelLoanOffer(String orderNumber)
return result;
}

/**
* @return
*/
@Override
public PoloniexActiveLoanTypes returnActiveLoans()
{
Expand Down

0 comments on commit c064c18

Please sign in to comment.