PHPackages                             xrplwin/unlreportreader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. xrplwin/unlreportreader

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

xrplwin/unlreportreader
=======================

Fetches and parses UNLReports on Xahau network.

v1.0.6(2y ago)184MITPHPPHP ^8.1.0

Since Sep 30Pushed 2y agoCompare

[ Source](https://github.com/XRPLWin/UNLReportReader)[ Packagist](https://packagist.org/packages/xrplwin/unlreportreader)[ Docs](https://github.com/XRPLWin)[ GitHub Sponsors](https://github.com/zgrguric)[ RSS](/packages/xrplwin-unlreportreader/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (8)Used By (0)

[![main workflow](https://github.com/XRPLWin/UNLReportReader/actions/workflows/main.yml/badge.svg)](https://github.com/XRPLWin/UNLReportReader/actions/workflows/main.yml/badge.svg)[![GitHub license](https://camo.githubusercontent.com/33e3588cfb766be416e695599ef5a08d8c7cc8e8caa8e4d93089efb5233ef482/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f5852504c57696e2f554e4c5265706f7274526561646572)](https://github.com/XRPLWin/UNLReportReader/blob/main/LICENSE)[![Total Downloads](https://camo.githubusercontent.com/043045501571e7585973ba3edd62ba4826382593e5d2b497041131ca3b1e99e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7872706c77696e2f756e6c7265706f72747265616465722e7376673f7374796c653d666c6174)](https://packagist.org/packages/xrplwin/unlreportreader)

UNLReport Reader
================

[](#unlreport-reader)

Fetches UNLReports on Xahau network.

This is PHP package where you can provide flag ledger and script will parse and return final validator report. For requested ledger\_index script will return final UNLReport state for that ledger\_index.

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- [Composer](https://getcomposer.org/)

Installation
------------

[](#installation)

```
composer require xrplwin/unlreportreader

```

Ranges
------

[](#ranges)

When fetching ledger index report data, each ledger index % 256 is flag ledger. **At flag ledger UNLReport is still not applied**, UNLReport is applied from next ledger (next 256 ledgers including last flag ledger). See table below to understand ranges when querying specific ledger index.

Viewing ledger\_indexApplied fromApplied to.........256 (flag)1256.........510 (flag-2)257512511 (flag-1)257512512 (flag)257512513 (flag+1)513768514 (flag+2)513768.........Usage sample
------------

[](#usage-sample)

```
use XRPLWin\UNLReportReader\UNLReportReader;

$reader = new UNLReportReader('https://xahau-test.net');

$response = $reader->fetchSingle(6873344); //?array
/*
array [
    "flag_ledger_index" => 6873344
    "flag_ledger_close_time" => 748969761
    "report_range" => [6873089,6873344]
    "import_vlkey" => "E1..."
    "active_validators" => array [
        0 => array:2 [
            "?Account" => "r2..."
            "PublicKey" => "E2..."
        ]
        1 => array:2 [
            "?Account" => "r3..."
            "PublicKey" => "E3..."
        ], ...
    ]
]
*/

# response below will return report for ledger range: (6873345-256) to 6873344
$response = $reader->fetchSingle(6873342);
$response = $reader->fetchSingle(6873343);
$response = $reader->fetchSingle(6873344); //flag ledger
# response below will return report for ledger range: 6873345 to (6873344+256)
$response = $reader->fetchSingle(6873345);
$response = $reader->fetchSingle(6873346);
// ...
```

### Fetching multiple reports

[](#fetching-multiple-reports)

This is more optimized way to fetch multiple reports than doing loop and using `fetchSingle()`, since this script uses Promises to asynchronously query node in batches, default batch limit is 10 but can be configured manually.

```
use XRPLWin\UNLReportReader\UNLReportReader;

//this will set async batch limit to 5 (down from default 10)
$reader = new UNLReportReader('https://xahau-test.net',['async_batch_limit' => 5]);

$forward = true;
$limit = 2;
$response = $reader->fetchMulti(6873340, $forward, $limit); //array

//Ledger index "6873340" is between 6873345 and 6873600

/*
SAMPLE RESPONSE:
array:2 [
  0 => array:4 [
    "flag_ledger_index" => 6873344
    "flag_ledger_close_time" => 748969761
    "report_range" => array:2 [
      0 => 6873345
      1 => 6873600
    ]
    "import_vlkey" => "ED264807102805220DA0F312E71FC2C69E1552C9C5790F6C25E3729DEB573D5860"
    "active_validators" => array:7 [
      0 => array:2 [
        "Account" => "rGhk2uLd8ShzX2Zrcgn8sQk1LWBG4jjEwf"
        "PublicKey" => "ED3ABC6740983BFB13FFD9728EBCC365A2877877D368FC28990819522300C92A69"
      ]
      1 => array:2 [
        "Account" => "rnr4kwS1VkJhvjVRuq2fbWZtEdN2HbpVVu"
        "PublicKey" => "ED49F82B2FFD537F224A1E0A10DEEFC3C25CE3882979E6B327C9F18603D21F0A22"
      ]
      2 => array:2 [
        "Account" => "rJupFrPPYgUNFBdoSqhMEJ22hiHKiZSHXQ"
        "PublicKey" => "ED79EB0F6A9F01A039235E536D19F812B55ACF540C9E22CF62C271E0D42BFF5174"
      ]
      3 => array:2 [
        "Account" => "roUo3ygV92bdhfE1v9LGpPETXvJv2kQv5"
        "PublicKey" => "ED93B2BE467CAD2F9F56FB3A82BDFF17F84B09E34232DDE8FAF2FC72382F142655"
      ]
      4 => array:2 [
        "Account" => "rGsa7f4arJ8JE9ok9LCht6jCu5xBKUKVMq"
        "PublicKey" => "ED96F581FED430E8CBE1F08B37408857001D4118D49FBB594B0BE007C2DBFFD367"
      ]
      5 => array:2 [
        "Account" => "r3htgPchiR2r8kMGzPK3Wfv3WTrpaRKjtU"
        "PublicKey" => "EDCF31B8F683345E1C49B4A1D85BF2731E55E7D6781F3D4BF45EE7ADF2D2FB3402"
      ]
      6 => array:2 [
        "Account" => "rfQtB8m51sdbWgcmddRX2mMjMpSxzX1AGr"
        "PublicKey" => "EDDF197FC59A7FAA09EB1AD60A4638BA6201DD51497B5C08A1745115098E229E0E"
      ]
    ]
  ]
  1 => array:4 [
    "flag_ledger_index" => 6873600
    "flag_ledger_close_time" => 748970540
    "report_range" => array:2 [
      0 => 6873601
      1 => 6873856
    ]
    "import_vlkey" => "ED264807102805220DA0F312E71FC2C69E1552C9C5790F6C25E3729DEB573D5860"
    "active_validators" => array:7 [
      0 => array:2 [
        "Account" => "rGhk2uLd8ShzX2Zrcgn8sQk1LWBG4jjEwf"
        "PublicKey" => "ED3ABC6740983BFB13FFD9728EBCC365A2877877D368FC28990819522300C92A69"
      ]
      1 => array:2 [
        "Account" => "rnr4kwS1VkJhvjVRuq2fbWZtEdN2HbpVVu"
        "PublicKey" => "ED49F82B2FFD537F224A1E0A10DEEFC3C25CE3882979E6B327C9F18603D21F0A22"
      ]
      2 => array:2 [
        "Account" => "rJupFrPPYgUNFBdoSqhMEJ22hiHKiZSHXQ"
        "PublicKey" => "ED79EB0F6A9F01A039235E536D19F812B55ACF540C9E22CF62C271E0D42BFF5174"
      ]
      3 => array:2 [
        "Account" => "roUo3ygV92bdhfE1v9LGpPETXvJv2kQv5"
        "PublicKey" => "ED93B2BE467CAD2F9F56FB3A82BDFF17F84B09E34232DDE8FAF2FC72382F142655"
      ]
      4 => array:2 [
        "Account" => "rGsa7f4arJ8JE9ok9LCht6jCu5xBKUKVMq"
        "PublicKey" => "ED96F581FED430E8CBE1F08B37408857001D4118D49FBB594B0BE007C2DBFFD367"
      ]
      5 => array:2 [
        "Account" => "r3htgPchiR2r8kMGzPK3Wfv3WTrpaRKjtU"
        "PublicKey" => "EDCF31B8F683345E1C49B4A1D85BF2731E55E7D6781F3D4BF45EE7ADF2D2FB3402"
      ]
      6 => array:2 [
        "Account" => "rfQtB8m51sdbWgcmddRX2mMjMpSxzX1AGr"
        "PublicKey" => "EDDF197FC59A7FAA09EB1AD60A4638BA6201DD51497B5C08A1745115098E229E0E"
      ]
    ]
  ]
]
*/
```

### Fetching multiple reports between ledgers

[](#fetching-multiple-reports-between-ledgers)

```
use XRPLWin\UNLReportReader\UNLReportReader;

$reader = new UNLReportReader('https://xahau-test.net');

//ledger start, ledger end
$response = $reader->fetchRange(6100000, 6200000); //array
```

### Checking ledger edge (incomplete results)

[](#checking-ledger-edge-incomplete-results)

When checking ledger edge, eg. you requested ledger index that does not yet exists this is how will you check existance:

**For single ledger**

```
//this will return null if ledger_index is out of range
$response = $reader->fetchSingle(9873344);
if($response === null) {
  //Incomplete result
}
```

**For multiple ledgers**

```
$requested_limit = 10;
//this will return less results than requested if some or all ledgers are out of range
$response = $reader->fetchMulti(9873344,true,$requested_limit);
if(count($response) != $requested_limit) {
  //Incomplete result
}
```

**For range**

```
$fromLedgerIndex = 6100000;
$toLedgerIndex = 6200000;

//this will give you exact limit that will be sent to ->fetchMulti() method
$calculated_limit = UNLReportReader::calcNumFlagsBetweenLedgers(
  UNLReportFlagLedger::nextOrCurrent($fromLedgerIndex),
  UNLReportFlagLedger::nextOrCurrent($toLedgerIndex)
);
$response = $reader->fetchRange($fromLedgerIndex, $toLedgerIndex); //array
if(count($response) != $calculated_limit) {
  //Incomplete result
}
```

Special thanks
--------------

[](#special-thanks)

[@richardAH](https://github.com/richardAH) - Thank you 🙏 for in-depth explanation and support.
[@dangell7](https://github.com/dangell7) - Thank you 🙏 for great insight.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

7

Last Release

955d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/02b0ccc19f65ae6ac53ec11a802ad35565047f862eeccde3a7291917920f9160?d=identicon)[xrplwin](/maintainers/xrplwin)

---

Top Contributors

[![zgrguric](https://avatars.githubusercontent.com/u/108837406?v=4)](https://github.com/zgrguric "zgrguric (24 commits)")

---

Tags

phpcomposerparserpackagereporttransactionxrpxrplxahauunlreportxahaudunldunl

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xrplwin-unlreportreader/health.svg)

```
[![Health](https://phpackages.com/badges/xrplwin-unlreportreader/health.svg)](https://phpackages.com/packages/xrplwin-unlreportreader)
```

###  Alternatives

[shuchkin/simplexlsx

Parse and retrieve data from Excel XLSx files. MS Excel 2007 workbooks PHP reader.

1.8k3.8M21](/packages/shuchkin-simplexlsx)[shuchkin/simplexls

Parse and retrieve data from old format Excel XLS files. MS Excel 97 workbooks PHP reader.

212588.3k2](/packages/shuchkin-simplexls)[avadim/fast-excel-reader

Lightweight and very fast XLSX Excel Spreadsheet Reader in PHP

104608.4k6](/packages/avadim-fast-excel-reader)[shuchkin/simplecsv

Parse and retrieve data from CSV files. Export data to CSV.

5192.4k](/packages/shuchkin-simplecsv)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
