Download the PHP package amashukov/lnd-client-php without Composer

On this page you can find all versions of the php package amashukov/lnd-client-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lnd-client-php

amashukov/lnd-client-php

Typed LND (Lightning Network Daemon) REST client in pure PHP — invoices, payments, channel management and backups over any PSR-18 client, with millisatoshi amounts kept exact as bcmath numeric-strings.

CI PHPStan L8 Latest Version PHP

An LND client in pure PHP speaking the node's REST gateway, built on any PSR-18 HTTP client. It covers the surface a custodial service actually needs: mint an invoice, watch it settle, pay a BOLT11, track that payment to a verdict, read channel and wallet balances, and drive channel lifecycle (open, close, fee policy, static backup) from an operator panel rather than lncli over ssh.

Features

Installation

Requires PHP >= 8.3 and ext-bcmath.

Usage

Paying an invoice, with a hard cap on routing fees:

Settling a payment safely

sendPayment() returning is not the end of the story, and neither is it throwing. The only authority on whether money moved is trackPayment():

If sendPayment() throws LndUnavailableException, the HTLC may still be in flight. Treat that as unresolved and let the next poll decide. Mapping it to failure and re-sending is how a custodial service double-pays.

Channel operations

Backups

exportChannelBackup() returns the multi-channel static backup blob. It is the only artefact that can recover funds from a lost node — and it is worthless if the recovered node is later started from stale channel state. Store it off-box, encrypted and versioned; never run two daemons against one state directory.

Value objects

Class Notes
Msat Millisatoshi as a bcmath numeric-string. fromString / fromInt / fromSat / fromBtc / zero; add, sub (throws rather than going negative), mulBps, comparisons. toSat() throws on a sub-satoshi remainder.
LnInvoice paymentHash (lowercase hex), bolt11, state, amountMsat, amountPaidMsat, expiresAt(), isExpiredAt(). LnInvoice::absent() for "no such invoice".
LnPayment state, feeMsat (actual routing fee paid), failureReason, preimage. isInFlight() is true for anything not terminal, including unknown.
LnChannel capacityMsat, localBalanceMsat, remoteBalanceMsat, active, pendingHtlcs, plus localShareBps() / inboundShareBps() for threshold alerts.
LnChannelBalance, LnWalletBalance Off-chain and on-chain balances.
LnNodeInfo alias, blockHeight, syncedToChain, isHealthy().
LnChannelPoint Funding txid + output index; renders as txid:index.
LnChannelBackup The SCB blob and how many channels it covers.

Exceptions

LndUnavailableException extends LndException, so one catch (LndException) covers both — but the distinction matters: LndUnavailableException means transient, retry (transport failure or HTTP 5xx), while a plain LndException carries an error the node itself reported, with getLndCode().

Testing

Contract tests read recorded LND responses from tests/fixtures/*.json and assert the value objects decode them exactly, so a change in the node's wire format fails a test rather than surfacing as a wrong balance in production.


All versions of lnd-client-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
ext-bcmath Version *
psr/clock Version ^1.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.1
psr/http-message Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package amashukov/lnd-client-php contains the following files

Loading the files please wait ...