Skip to content
⚡️ OpenNode.co Java Client
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/main/java/org/brunocvcunha/opennode/api
.gitignore
.travis.yml
LICENSE
README.md
pom.xml

README.md

opennode-java

Apache License Build Status Maven Central Coverage Status

⚡️ OpenNode.co Java Client.

Download

Download the latest JAR or grab via Maven:

<dependency>
  <groupId>org.brunocvcunha.opennode-java</groupId>
  <artifactId>opennode-java</artifactId>
  <version>1.2</version>
</dependency>

or Gradle:

compile 'org.brunocvcunha.opennode-java:opennode-java:1.2'

Snapshots of the development version are available in Sonatype's snapshots repository.

Supported Operations & Examples

Create the Client

        OpenNodeService service = OpenNodeServiceFactory.buildClient("{api_token}");

Create a Charge

        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

    OpenNodeCharge charge = service.getCharge("{charge_id"}).execute().body().getData();
    System.out.println(charge.getDescription() + " - " + charge.getAmount() + " - " + charge.getStatus());

List Charges

    OpenNodeResponse<List<OpenNodeCharge>> 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

opennode-java requires at minimum Java 8.

You can’t perform that action at this time.