Skip to content

microlancer/lightning-php

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

lightning-php

PHP interface for the elements/c-lightning RPC API

Installation

composer require thorie7912/lightning-php:^1.0

Usage

$lightningApi = new \Lightning\LightningApi();
$lightningApi->setRpcFile("/home/user/.lightning/lightning-rpc");

// Get info

$json = $lightningApi->getInfo();
echo json_encode($json, JSON_PRETTY_PRINT);

// Pay invoice

$invoice = "ln123xyz...";
$json = $lightningApi->pay($invoice);
echo json_encode($json, JSON_PRETTY_PRINT);

// Create invoice

$msatoshi = 50000;
$label = "Some label";
$description = "Some description";
$json = $lightningApi->createinvoice($msatoshi, $label, $description);
echo json_encode($json, JSON_PRETTY_PRINT);

About

PHP interface for the elements/c-lightning RPC API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages