Git Product home page Git Product logo

binancemanager's Introduction

BinanceManager

v1.0.9

This is a Java Based library useful to work with Binance's API service.

Implementation

Add the JitPack repository to your build file

Gradle

  • Add it in your root build.gradle at the end of repositories
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  • Add the dependency
dependencies {
	implementation 'com.github.N7ghtm4r3:BinanceManager:1.0.9'
}

Maven

  • Add it in your root build.gradle at the end of repositories
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
  • Add the dependency
<dependency>
    <groupId>com.github.N7ghtm4r3</groupId>
    <artifactId>BinanceManager</artifactId>
    <version>1.0.9</version>
</dependency>

๐Ÿ›  Skills

  • Java

Endpoints managers available

  • Wallet (Signed manager)
  • Market Data (NO-Signed manager)
  • Spot Account/Trade (Signed manager)
  • Margin Account/Trade (Signed manager)

The other endpoints managers will be gradually released

Usage/Examples

No-Signed Managers

// with automatic research for a workly basepoint
try {
    BinanceMarketManager binanceMarketManager = new BinanceMarketManager();
} catch (Exception e) {
    e.printStackTrace();
}

// choose basepoint manually (index from 0 to 3)
try {
    BinanceMarketManager binanceMarketManager = new BinanceMarketManager(BinanceManager.BASE_ENDPOINTS.get(0));
} catch (Exception e) {
    e.printStackTrace();
}

Signed Managers (requests with apiKey)

// with automatic research for a workly basepoint
try {
    BinanceSpotManager binanceSpotManager = new BinanceSpotManager("yourApiKey", "yourSecretKey");
} catch (Exception e) {
    e.printStackTrace();
}

// choose basepoint manually (index from 0 to 3)
try {
    BinanceSpotManager binanceSpotManager = new BinanceSpotManager(BinanceManager.BASE_ENDPOINTS.get(0), "yourApiKey", "yourSecretKey");
} catch (Exception e) {
    e.printStackTrace();
}

Responses

In this example manager is NO signed type manager, but is the same for signed type managers

  • String: will return response formatted as {@link String} object
try {
    System.out.println(binanceMarketManager.getPriceTicker("BTCBUSD"));
} catch (Exception e) {
    e.printStackTrace();
}
  • JSON: will return response formatted as JSON (JSONObject or JSONArray)
try {
    System.out.println(binanceMarketManager.getJSONPriceTicker("BTCBUSD"));
} catch (Exception e) {
    e.printStackTrace();
}
  • Custom-object: will return response formatted as custom object provided by library
try {
    System.out.println(binanceMarketManager.getObjectPriceTicker("BTCBUSD"));
} catch (Exception e) {
    e.printStackTrace();
}
  • Primitives: some requests will return primitive types like boolean, long, double
// it return long type es. 151596910325
try {
    System.out.println(binanceMarketManager.getTimestamp());
} catch (Exception e) {
    e.printStackTrace();
}

Errors handling

try {
    System.out.println(binanceMarketManager.getTimestamp());
} catch (Exception e) {
    System.out.println(binanceMarketManager.getErrorResponse());
    //or
    binanceMarketManager.printErrorResponse(); 
}
/* NOTE: if is not a request error will appear: "Error is not in api request, check out your code"
  and you will have to work on your code to manage error*/

Authors

Support

If you need help using the library or encounter any problems or bugs, please contact us via the following links:

Thank you for your help!

Badges

Twitter

Donations

If you want support project and developer with crypto: 0x5f63cc6d13b16dcf39cd8083f21d50151efea60e

If you want support project and developer with PayPal

Copyright ยฉ 2022 Tecknobit

binancemanager's People

Contributors

n7ghtm4r3 avatar

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.