1. Go to this page and download the library: Download xrplwin/unlreportreader library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use XRPLWin\UNLReportReader\UNLReportReader;
$reader = new UNLReportReader('https://xahau-test.net');
//ledger start, ledger end
$response = $reader->fetchRange(6100000, 6200000); //array
//this will return null if ledger_index is out of range
$response = $reader->fetchSingle(9873344);
if($response === null) {
//Incomplete result
}
$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
}
$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
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.