Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/utxo-one/lnd-php

PHP SDK for LND
https://github.com/utxo-one/lnd-php

bitcoin lightning lightning-network lnd php8 rest rest-api sdk sdk-php

Last synced: 2 months ago
JSON representation

PHP SDK for LND

Awesome Lists containing this project

README

        

## PHP-LND (ALPHA RELEASE)

A PHP SDK for the LND implementation of the Lightning Network

### Installation

```
composer require utxo-one/lnd-php
```

### Usage

```php
use UtxoOne\LndPhp\Services\LightningService;

// Initialize an LND Instance.
$lightningService = new LightningService(
host: $this->host,
port: $this->port,
macaroonHex: $this->macaroonHex,
tlsCertificat: $this->tlsCertificate,
);

// Execute a command. ie getinfo
$nodeInfo = $lightningService->getInfo();

// Get the results
$nodeInfo->getVersion();
$nodeInfo->getCommitHash();
$nodeInfo->getIdentityPubkey();
$nodeInfo->getAlias();
$nodeInfo->getNumPendingChannels();
$nodeInfo->getNumActiveChannels();
$nodeInfo->getNumPeers();
$nodeInfo->getBlockHash();
$nodeInfo->getBlockHeight();
$nodeInfo->getUris();
$nodeInfo->getBestHeaderTimestamp();
$nodeInfo->isSyncedToChain();
$nodeInfo->isTestnet();
$nodeInfo->requiresHtlcInterceptor();
```

### Available Methods

```php
// Lightning Service
$lightningService->getInfo();
$lightningService->abandonChannel();
$lightningService->addInvoice();
$lightningService->bakeMacaroon();
$lightningService->batchOpenChannel();
$lightningService->channelAcceptor();
$lightningService->channelBalance();
$lightningService->checkMacaroonPermissions();
$lightningService->closeChannel();
$lightningService->closedChannels();
$lightningService->lookupInvoice();
$lightningService->sendCoins();
$lightningService->sendMany();
$lightningService->getInfo();

// WalletKit Service
$walletKitService->nextAddr();
$walletKitService->listAddresses();
$walletKitService->listUnspent();
```