https://github.com/pmlopes/vertx-blockapps-rest
https://github.com/pmlopes/vertx-blockapps-rest
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pmlopes/vertx-blockapps-rest
- Owner: pmlopes
- Created: 2018-04-23T14:12:23.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-25T14:11:45.000Z (about 8 years ago)
- Last Synced: 2025-02-25T17:36:52.023Z (over 1 year ago)
- Language: Java
- Size: 65.4 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BlockApps Vert.x REST API
This is a simple wrapper around the REST API provided by BlockApps in order to facilitate
the development of Dapps to be run on a JVM environment.
## Usage
Add to your pom:
```xml
xyz.jetdrone
blockapps.ba
0.0.1-SNAPSHOT
```
In your Application verticle create an instance of the API you'd like to use:
```java
var strato = StratoAPI.create(vertx, "http://localhost/strato-api");
// get the last 15 transactions
strato.getLastTransaction(15, res -> {
if (res.succeeded()) {
System.out.println(res.result().encodePrettily());
}
});
```
This library is polyglot, which means that you can use any of the alternatives:
* Kotlin
* Rx
* Rx2
* Groovy
* Ruby
* JavaScript
For example to use the RXified API you can do:
```java
StratoAPI.create(vertx, "http://localhost/strato-api")
// get the last 15 transactions
.rxGetLastTransaction(15)
.subscribe(json -> {
System.out.println(json.encodePrettily());
});
```
## Future improvements
The current API uses raw JSON types, a nice addition would be to apply Schema information to these JSON types.