Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sbouclier/kraken-java-api-client
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: synapticloopltd/kraken-java-api-client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 9 commits
  • 46 files changed
  • 3 contributors

Commits on Mar 11, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7b2143a View commit details

Commits on May 4, 2019

  1. Copy the full SHA
    c737154 View commit details

Commits on Nov 7, 2019

  1. Copy the full SHA
    8253b39 View commit details

Commits on Jan 29, 2020

  1. Copy the full SHA
    dce0297 View commit details

Commits on Apr 8, 2021

  1. Merge pull request #1 from davidepianca98/master

    Merge into master branch
    synapticloop authored Apr 8, 2021
    Copy the full SHA
    8a08ca5 View commit details
  2. initial move to gradle build

    synapticloop committed Apr 8, 2021
    Copy the full SHA
    e0b88cd View commit details
  3. code cleanup

    synapticloop committed Apr 8, 2021
    Copy the full SHA
    1b7cb1b View commit details
  4. bumped version number

    synapticloop committed Apr 8, 2021
    Copy the full SHA
    a1fee96 View commit details
  5. added in jitpack.io package manager

    synapticloop committed Apr 8, 2021
    Copy the full SHA
    52c5184 View commit details
Showing with 2,665 additions and 1,924 deletions.
  1. +146 −0 .gitignore
  2. +42 −0 build.gradle
  3. BIN gradle/wrapper/gradle-wrapper.jar
  4. +5 −0 gradle/wrapper/gradle-wrapper.properties
  5. +185 −0 gradlew
  6. +89 −0 gradlew.bat
  7. +2 −2 pom.xml
  8. +5 −0 settings.gradle
  9. +178 −176 src/main/java/com/github/sbouclier/HttpApiClient.java
  10. +59 −51 src/main/java/com/github/sbouclier/HttpApiClientFactory.java
  11. +140 −140 src/main/java/com/github/sbouclier/HttpJsonClient.java
  12. +546 −417 src/main/java/com/github/sbouclier/KrakenAPIClient.java
  13. +19 −17 src/main/java/com/github/sbouclier/KrakenApiException.java
  14. +31 −28 src/main/java/com/github/sbouclier/KrakenApiMethod.java
  15. +12 −12 src/main/java/com/github/sbouclier/input/InfoInput.java
  16. +16 −16 src/main/java/com/github/sbouclier/input/Interval.java
  17. +35 −0 src/main/java/com/github/sbouclier/result/AddStandardOrderResult.java
  18. +117 −115 src/main/java/com/github/sbouclier/result/AssetPairsResult.java
  19. +18 −18 src/main/java/com/github/sbouclier/result/AssetsInformationResult.java
  20. +112 −106 src/main/java/com/github/sbouclier/result/ClosedOrdersResult.java
  21. +12 −12 src/main/java/com/github/sbouclier/result/LedgersInformationResult.java
  22. +27 −29 src/main/java/com/github/sbouclier/result/OHLCResult.java
  23. +101 −101 src/main/java/com/github/sbouclier/result/OpenOrdersResult.java
  24. +50 −50 src/main/java/com/github/sbouclier/result/OpenPositionsResult.java
  25. +1 −2 src/main/java/com/github/sbouclier/result/OrderBookResult.java
  26. +94 −94 src/main/java/com/github/sbouclier/result/OrdersInformationResult.java
  27. +21 −22 src/main/java/com/github/sbouclier/result/RecentSpreadResult.java
  28. +21 −21 src/main/java/com/github/sbouclier/result/RecentTradeResult.java
  29. +37 −37 src/main/java/com/github/sbouclier/result/Result.java
  30. +7 −7 src/main/java/com/github/sbouclier/result/ResultWithLastId.java
  31. +11 −11 src/main/java/com/github/sbouclier/result/ServerTimeResult.java
  32. +106 −106 src/main/java/com/github/sbouclier/result/TickerInformationResult.java
  33. +41 −41 src/main/java/com/github/sbouclier/result/TradeBalanceResult.java
  34. +11 −11 src/main/java/com/github/sbouclier/result/TradeVolumeResult.java
  35. +54 −49 src/main/java/com/github/sbouclier/result/TradesHistoryResult.java
  36. +40 −36 src/main/java/com/github/sbouclier/result/TradesInformationResult.java
  37. +30 −0 src/main/java/com/github/sbouclier/result/WithdrawInfoResult.java
  38. +41 −0 src/main/java/com/github/sbouclier/result/WithdrawStatusResult.java
  39. +27 −24 src/main/java/com/github/sbouclier/result/common/LedgerInformation.java
  40. +10 −10 src/main/java/com/github/sbouclier/result/common/OrderDirection.java
  41. +20 −20 src/main/java/com/github/sbouclier/result/common/OrderType.java
  42. +24 −24 src/main/java/com/github/sbouclier/utils/Base64Utils.java
  43. +43 −43 src/main/java/com/github/sbouclier/utils/ByteUtils.java
  44. +31 −31 src/main/java/com/github/sbouclier/utils/CryptoUtils.java
  45. +47 −44 src/main/java/com/github/sbouclier/utils/StreamUtils.java
  46. +1 −1 src/test/java/com/github/sbouclier/KrakenApiMethodTest.java
146 changes: 146 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -7,3 +7,149 @@
.DS_Store

src/main/java/com/github/sbouclier/Example.java


# Created by https://www.toptal.com/developers/gitignore/api/macos,eclipse,java,gradle
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,eclipse,java,gradle

### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# PyDev specific (Python IDE for Eclipse)
*.pydevproject

# CDT-specific (C/C++ Development Tooling)
.cproject

# CDT- autotools
.autotools

# Java annotation processor (APT)
.factorypath

# PDT-specific (PHP Development Tools)
.buildpath

# sbteclipse plugin
.target

# Tern plugin
.tern-project

# TeXlipse plugin
.texlipse

# STS (Spring Tool Suite)
.springBeans

# Code Recommenders
.recommenders/

# Annotation Processing
.apt_generated/
.apt_generated_test/

# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet

# Uncomment this line if you wish to ignore the project description file.
# Typically, this file would be tracked if it contains build/dependency configurations:
#.project

### Eclipse Patch ###
# Spring Boot Tooling
.sts4-cache/

### Java ###
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Gradle ###
.gradle
build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

### Gradle Patch ###
**/build/

# End of https://www.toptal.com/developers/gitignore/api/macos,eclipse,java,gradle

42 changes: 42 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* This file was generated by the Gradle 'init' task.
*/

plugins {
id 'java'
id 'maven-publish'
}

repositories {
mavenLocal()
maven { url = uri('https://repo.maven.apache.org/maven2/') }
maven { url = uri('https://maven.pkg.github.com/') }
maven { url 'https://jitpack.io' }
}

dependencies {
implementation 'org.apache.commons:commons-lang3:3.6'
implementation 'org.apache.httpcomponents:httpclient:4.5.3'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.8.9'

testImplementation 'junit:junit:4.12'
testImplementation 'org.hamcrest:hamcrest-library:1.3'
testImplementation 'org.mockito:mockito-core:2.23.4'
}

group = 'synapticloop.kraken-java-api-client'
version = '1.1.0'
description = 'kraken-java-api-client'
java.sourceCompatibility = JavaVersion.VERSION_1_8

publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
185 changes: 185 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn () {
echo "$*"
}

die () {
echo
echo "$*"
echo
exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

exec "$JAVACMD" "$@"
Loading