Bloxy API

Kotlin & Java Library for all available Bloxy.info API endpoints

License

License

GroupId

GroupId

com.github.goodforgod
ArtifactId

ArtifactId

bloxy-api
Last Version

Last Version

1.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

Bloxy API
Kotlin & Java Library for all available Bloxy.info API endpoints
Project URL

Project URL

https://github.com/GoodforGod/bloxy-api
Source Code Management

Source Code Management

https://github.com/GoodforGod/bloxy-api/tree/master

Download bloxy-api

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.goodforgod/bloxy-api/ -->
<dependency>
    <groupId>com.github.goodforgod</groupId>
    <artifactId>bloxy-api</artifactId>
    <version>1.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.goodforgod/bloxy-api/
implementation 'com.github.goodforgod:bloxy-api:1.2.1'
// https://jarcasting.com/artifacts/com.github.goodforgod/bloxy-api/
implementation ("com.github.goodforgod:bloxy-api:1.2.1")
'com.github.goodforgod:bloxy-api:jar:1.2.1'
<dependency org="com.github.goodforgod" name="bloxy-api" rev="1.2.1">
  <artifact name="bloxy-api" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.goodforgod', module='bloxy-api', version='1.2.1')
)
libraryDependencies += "com.github.goodforgod" % "bloxy-api" % "1.2.1"
[com.github.goodforgod/bloxy-api "1.2.1"]

Dependencies

runtime (4)

Group / Artifact Type Version
org.jetbrains : annotations jar 13.0
com.beust : klaxon jar 5.0.5
org.jetbrains.kotlin : kotlin-reflect jar 1.3.31
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.31

Project Modules

There are no modules declared in this project.

⚙️ Bloxy Api

travis Maintainability codecov

Kotlin & Java Library for all available Bloxy API endpoints.

Bloxy.info is a source of open, reliable, verifiable and objective data about the blockchain.

Readme Web Page

Dependency 🚀

Library depends on Klaxon so jcenter repository is required.

Gradle

repositories {
    jcenter()
}
 
dependencies {
    compile 'com.github.goodforgod:bloxy-api:1.2.1'
}

Maven

<repositories>
    <repository>
        <id>jcenter</id>
        <url>https://jcenter.bintray.com/</url>
    </repository>
</repositories>
 
<dependencies>
    <dependency>
        <groupId>com.github.goodforgod</groupId>
        <artifactId>bloxy-api</artifactId>
        <version>1.2.1</version>
    </dependency>
</dependencies>

Content

Getting Started

All you need to start is just to get API key to Bloxy, key will be in the email (login link)

Bloxy Client in Java

BloxyApi api = new BloxyApi("YourApiKey");

Bloxy Client in Kotlin

val api = BloxyApi("YourApiKey")

Java Project Dependency

In case you are using library in Java project and have ParseException's, mostly its Klaxon missing some kotlin dependencies. Try to manually add kotlin stdlib.

Maven

<dependencies>
    <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-stdlib-jdk8</artifactId>
        <version>1.3.31</version> // Or your version
    </dependency>
</dependencies>

Gradle

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.31" // Or your version
}

Custom HttpClient

In case you need to set custom timeout, custom headers or better implementation for HttpClient, just implement IHttpClient by your self or initialize it with your values.

Java

Supplier<IHttpClient> supplier = () -> new HttpClient(10000, 40000);
BloxyApi api = new BloxyApi("YourApiKey", supplier);

Kotlin

val supplier = Supplier { HttpClient(10000, 40000) }
val api = BloxyApi("YourApiKey", supplier)

API Modules

Library supports all API modules with all endpoints support for each module:

  • Address
  • DApp
  • MakerDAO
  • Smart Contract
  • DEX
  • Money Flow
  • Token
  • Tokensale
  • dYdX
  • Livepeer
  • Transaction
  • Maltego

API Examples

Below there are examples for some API modules.

You can read about all API available here at Bloxy

Smart Contract Api

Java

BloxyApi api = new BloxyApi("YourApiKey");
Balance balance = api.getContract().methods("0xd26114cd6ee289accf82350c8d8487fedb8a0c07");

Kotlin

val api = BloxyApi("YourApiKey")
val balance = api.contract.methods("0xd26114cd6ee289accf82350c8d8487fedb8a0c07")

DEX Api

Java

BloxyApi api = new BloxyApi("YourApiKey");
List<DexProtocol> protocols = api.getDex().protocols();

Kotlin

val api = BloxyApi("YourApiKey")
val protocols = api.dex.protocols()

DApp Api

Java

BloxyApi api = new BloxyApi("YourApiKey");
List<DAppStats> appStats = api.getDapp().statistics();

Kotlin

val api = BloxyApi("YourApiKey")
val appStats = api.dapp.statistics()

Version History

1.2.1 - Base URL for API changed.

1.2.0 - Token, Contract new endpoints introduced.

1.1.0 - Address, Transaction, Dex, Token, MoneyFlow, TokenSale APIs enchanted, tests were reinforced

1.0.4 - Livepeer & dYdY & Maltego API modules support.

1.0.3 - DApp, MakerDAO API support & Address API extension support.

1.0.2 - Contract API support.

1.0.1 - Gradle/Kotlin dependency publish issue, BasicProvider getOffset fix, HttpClient decoding support, javadoc improvements.

1.0.0 - Initial project with all API functionality, with tests coverage for all cases.

License

This project is licensed under the MIT - see the LICENSE file for details.

Versions

Version
1.2.1
1.2.0
1.1.0
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0