Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 731 Bytes

README.md

File metadata and controls

35 lines (23 loc) · 731 Bytes

lightning-strike-client-js

PHP client for the Lightning Strike REST API.

Install

$ composer require elementsproject/lightning-strike-client-php

Use

<?php
$strike = new LightingStrikeClient('http://localhost:8009');

// Create invoice
$invoice = $strike->invoice(/*msatoshi*/ 50, /*metadata*/ [ 'customer' => 'Satoshi', 'products' => [ 'potato', 'chips' ]]);

tell_user("to pay, send $invoice->msatoshi milli-satoshis with rhash $invoice->rhash, or copy the BOLT11 payment request: $invoice->payreq");

// Fetch invoice by id
$invoice = $strike->fetch('m51vlVWuIKGumTLbJ1RPb');

TODO: document missing methods

Test

$ STRIKE_URL=http://localhost:8009 phpunit test

License

MIT