Giter Club home page Giter Club logo

huobi-java-api's Introduction

huobi-java-api

huobi Restful api java client.

RELEASE LOG

Configuration

环境切换

设置api host,用于在测试,正式和Mock环境切换

HuobiConfig.API_HOST="api.huobi.pro"
HuobiConfig.REST_API_UR="https://api.huobi.pro"
HuobiConfig.WS_API_URL="wss://api.huobi.pro:443/ws"
  1. HuobiConfig.AutoReconnect 是否开启断线重连,默认 true; WebSocketListener onClosing 时调用,若为true,除手动关闭以外都去重连。
  2. HuobiConfig.ReconnectOnFailure 失败时是否重连,默认false。初次订阅时或连上一段时间后都有可能触发,故此,调试时设置成false,保证参数正确运行时设为true。
  3. HuobiConfig.ReconnectOnExpired 超时时是否重连,默认true。服务器ping多次未回应时触发。

How to configure unit test

  1. make dir src/test/resources/, make dir as Test Resource Root

  2. create file config.properties.

    #sample
    #apiKey=e8d23f3b-92721ba8-7b804c0f-xxxx
    #apiSecret=bd14ad47-fe8f8ed9-bf3e32df-xxxx

需要鉴权的WebSocket

这类 web socket目前不支持 okhttp所以引入了 Java-WebSocket ,逻辑在HuobiApiAuthWebSocketClient 中。 等huobi兼容后移除该依赖。

huobi-java-api's People

Contributors

chengjk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

huobi-java-api's Issues

mvn install 后 target里找不到.jar

mvn install 后 target里找不到.jar .

以下是terminal output:

yus-MacBook-Pro:huobi-java-api yuzhou$ mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.huobi.api:huobi-java-api >--------------------
[INFO] Building huobi-java-api 20190118.1-1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ huobi-java-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/yuzhou/huobi-java-api/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ huobi-java-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 72 source files to /Users/yuzhou/huobi-java-api/target/classes
[INFO] /Users/yuzhou/huobi-java-api/src/main/java/com/huobi/api/client/impl/HuobiApiWebSocketListener.java: Some input files use unchecked or unsafe operations.
[INFO] /Users/yuzhou/huobi-java-api/src/main/java/com/huobi/api/client/impl/HuobiApiWebSocketListener.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ huobi-java-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/yuzhou/huobi-java-api/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ huobi-java-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/yuzhou/huobi-java-api/target/test-classes
[INFO] /Users/yuzhou/huobi-java-api/src/test/java/com/huobi/api/client/impl/HuobiApiWebSocketClientImplTest.java: /Users/yuzhou/huobi-java-api/src/test/java/com/huobi/api/client/impl/HuobiApiWebSocketClientImplTest.java uses or overrides a deprecated API.
[INFO] /Users/yuzhou/huobi-java-api/src/test/java/com/huobi/api/client/impl/HuobiApiWebSocketClientImplTest.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ huobi-java-api ---
[INFO] Surefire report directory: /Users/yuzhou/huobi-java-api/target/surefire-reports


T E S T S

Running com.huobi.api.client.impl.HuobiApiWebSocketClientImplTest

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.