Download the PHP package nova-carnivore/bolt11-php without Composer

On this page you can find all versions of the php package nova-carnivore/bolt11-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 bolt11-php

bolt11-php

PHP Version CI PHPStan Level Psalm Level Latest Version

Modern PHP 8.3+ BOLT 11 Lightning Network invoice encoder/decoder. Full spec compliance, production-ready.

Features

Installation

Requirements

Quick Start

Decode an Invoice

Encode an Invoice

Sign an Invoice

Amount Helpers

API Reference

Decoder::decode(string $paymentRequest): Invoice

Decodes a BOLT 11 payment request string into an Invoice object. Handles both lowercase and UPPERCASE invoices.

Encoder::encode(...): Invoice

Creates an unsigned invoice. Parameters:

Parameter Type Default Description
network Network Network::Bitcoin Target network
satoshis ?int null Amount in satoshis
millisatoshis ?string null Amount in millisatoshis
tags array<Tag> [] Tagged fields
timestamp ?int null Unix timestamp (defaults to now)

Signer::sign(Invoice $invoice, string $privateKeyHex): Invoice

Signs an unsigned invoice with a secp256k1 private key.

Invoice (Value Object)

Property Type Description
complete bool Whether the invoice is fully signed
prefix string Full HRP (e.g. lnbc2500u)
network ?Network Bitcoin network enum
satoshis ?int Amount in satoshis
millisatoshis ?string Amount in millisatoshis
timestamp int Unix timestamp
payeeNodeKey ?string Compressed public key (hex)
signature string 64-byte compact signature (hex)
recoveryFlag int Signature recovery flag (0-3)
tags array<Tag> All tagged fields
paymentRequest ?string Full bech32-encoded string

Tag Factory Methods

Enums

BOLT 11 Spec Compliance

All 12 official test vectors pass:

# Test Status
1 Donation (any amount) โœ…
2 $3 coffee (2500ยต, 60s expiry) โœ…
3 UTF-8 description (ใƒŠใƒณใ‚ปใƒณใ‚น 1ๆฏ) โœ…
4 Hashed description (20m) โœ…
5 Testnet with P2PKH fallback โœ…
6 Mainnet with P2PKH + route hints โœ…
7 Feature bits (8, 14, 99) โœ…
8 Uppercase invoice โœ…
9 Metadata (0x01fafaf0) โœ…
10 Pico-BTC amount (9678785340p) โœ…
11 High-S signature recovery โœ…
12 Unknown tags (silently ignored) โœ…

Supported Tagged Fields

Code Letter Field Supported
1 p payment_hash โœ…
16 s payment_secret โœ…
13 d description โœ…
27 m metadata โœ…
19 n payee node key โœ…
23 h description_hash โœ…
6 x expiry โœ…
24 c min_final_cltv_expiry โœ…
9 f fallback address โœ…
3 r route hints โœ…
5 9 feature bits โœ…

Exception Handling

Development

Architecture

License

MIT โ€” see LICENSE.


All versions of bolt11-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-gmp Version *
paragonie/ecc 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 nova-carnivore/bolt11-php contains the following files

Loading the files please wait ...