lessmore92 / php-ripple-address-codec
Library for encoding and decoding XRP Ledger addresses and seeds.
Installs: 21 248
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: >7
- lessmore92/base-x: v1.0.4
- lessmore92/buffer: v1.0.0
README
Fully ported 'ripple-address-codec' from JS to PHP
Installation
composer require lessmore92/php-ripple-address-codec
Docs
This package is fully same to main repository, so docs is same. Main Doc
Usage Sample
require_once "vendor/autoload.php"; $api = new \Lessmore92\RippleAddressCodec\RippleAddressCodec(); echo $api->classicAddressToXAddress("rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf", 4294967295) . "\n"; // XVLhHMPHU98es4dbozjVtdWzVrDjtV18pX8yuPT7y4xaEHi echo $api->classicAddressToXAddress("r3SVzk8ApofDJuVBPKdmbbLjWGCCXpBQ2g", 123, true) . "\n"; // T7oKJ3q7s94kDH6tpkBowhetT1JKfcfdSCmAXbS75iATyLD test address var_dump($api->xAddressToClassicAddress('XVLhHMPHU98es4dbozjVtdWzVrDjtV18pX8yuPT7y4xaEHi')); /* * result array(3) { ["classicAddress"]=> string(34) "rGWrZyQqhTp9Xu7G5Pkayo7bXjH4k4QYpf" ["tag"]=> int(4294967295) ["test"]=> bool(false) } */ var_dump($api->isValidXAddress('XVLhHMPHU98es4dbozjVtdWzVrDjtV18pX8yuPT7y4xaEHi')); //true var_dump($api->isValidClassicAddress('r3SVzk8ApofDJuVBPKdmbbLjWGCCXpBQ2g')); //true