Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 705 Bytes

README.md

File metadata and controls

34 lines (23 loc) · 705 Bytes

lightning-strike-client-js

PHP client for the Lightning Strike REST API.

Install

$ composer install blockstream/lightning-strike-client

Use

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

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

echo "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');

Test

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

License

MIT