Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lessmore92/php-ripple-address-codec
Address encoding/decoding for the XRP Ledger
https://github.com/lessmore92/php-ripple-address-codec
decoding encoding x-address xaddress xrp-ledger xrpl
Last synced: about 2 months ago
JSON representation
Address encoding/decoding for the XRP Ledger
- Host: GitHub
- URL: https://github.com/lessmore92/php-ripple-address-codec
- Owner: lessmore92
- License: mit
- Created: 2021-01-11T11:28:08.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-11T15:18:52.000Z (over 1 year ago)
- Last Synced: 2024-10-24T17:54:21.003Z (3 months ago)
- Topics: decoding, encoding, x-address, xaddress, xrp-ledger, xrpl
- Language: PHP
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-ripple-address-codec
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](https://github.com/ripple/ripple-address-codec)### Usage Sample
```php
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 addressvar_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```