Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bvolpato/opennode-java
:zap: OpenNode.co Java Client
https://github.com/bvolpato/opennode-java
bitcoin lightning lnd opennode payments
Last synced: about 1 month ago
JSON representation
:zap: OpenNode.co Java Client
- Host: GitHub
- URL: https://github.com/bvolpato/opennode-java
- Owner: bvolpato
- License: apache-2.0
- Created: 2019-03-02T19:54:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-15T22:43:28.000Z (about 1 year ago)
- Last Synced: 2024-04-14T02:55:04.341Z (7 months ago)
- Topics: bitcoin, lightning, lnd, opennode, payments
- Language: Java
- Homepage:
- Size: 27.3 KB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
opennode-java
========[![Apache License](http://img.shields.io/badge/license-ASL-blue.svg)](https://github.com/brunocvcunha/opennode-java/blob/master/LICENSE)
[![Build Status](https://travis-ci.org/brunocvcunha/opennode-java.svg)](https://travis-ci.org/brunocvcunha/opennode-java)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.brunocvcunha.opennode-java/opennode-java/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.brunocvcunha.opennode-java/opennode-java)
[![Coverage Status](https://coveralls.io/repos/github/brunocvcunha/opennode-java/badge.svg?branch=master)](https://coveralls.io/github/brunocvcunha/opennode-java?branch=master):zap: OpenNode.co Java Client.
Download
--------Download [the latest JAR][1] or grab via Maven:
```xmlorg.brunocvcunha.opennode-java
opennode-java
1.3```
or Gradle:
```groovy
compile 'org.brunocvcunha.opennode-java:opennode-java:1.3'
```Snapshots of the development version are available in [Sonatype's `snapshots` repository][snap].
Supported Operations & Examples
--------#### Create the Client
```java
OpenNodeService service = OpenNodeServiceFactory.buildClient("{api_token}");
```#### Create a Charge
```java
OpenNodeCreateCharge createCharge = OpenNodeCreateCharge.builder()
.orderId("ABCDEF-100")
.description("OpenNode Java Client")
.amount(1)
.currency(OpenNodeCurrency.USD) // default is satoshis
.build();
OpenNodeCharge createdCharge = service.createCharge(createCharge).execute().body().getData();
System.out.println("Created charge with ID: " + createdCharge.getId() + ". Invoice: " + createdCharge.getLightningInvoice().getPayreq());
```#### Get a Charge by ID
```java
OpenNodeCharge charge = service.getCharge("{charge_id"}).execute().body().getData();
System.out.println(charge.getDescription() + " - " + charge.getAmount() + " - " + charge.getStatus());
```#### List Charges
```java
OpenNodeResponse> charges = service.listCharges().execute().body();
for (OpenNodeCharge charge : charges.getData()) {
System.out.println(charge.getDescription() + " - " + charge.getAmount() + " - " + charge.getStatus());
}
```Want to tip a few satoshis? [tippin.me/@bruflow](https://tippin.me/@bruflow)
opennode-java requires at minimum Java 8.
[1]: https://search.maven.org/remote_content?g=org.brunocvcunha.opennode-java&a=opennode-java&v=LATEST
[snap]: https://oss.sonatype.org/content/repositories/snapshots/