cryptothree / crypto-address-validator
A library for validating crypto currency addresses.
v1.0.1
2024-12-26 01:18 UTC
Requires
- php: ^8.2
- ext-bcmath: *
- ext-gmp: *
- ext-sodium: *
- laravel/framework: >=v7.0.0|>=v10.0.0
- olifanton/typed-arrays: ^1.0
- paragonie/sodium_compat: ^2.0
- spomky-labs/cbor-php: ^3.0
Requires (Dev)
- laravel/pint: ^1.18
- phpunit/phpunit: ~8.0
This package is auto-updated.
Last update: 2025-02-26 01:43:18 UTC
README
A PHP library for validating cryptocurrency addresses. Currently, supports 14 chains.
This library is a fork of Merkeleon/php-cryptocurrency-address-validation.
Installation
composer require cryptothree/crypto-address-validator
Supported Cryptocurrencies(Chains)
Symbol | Chain | Note |
---|---|---|
ADA | Cardano | ... |
BCH | Bitcoin Cash | ... |
BSC | BNB Beacon Chain | ... |
BTC | Bitcoin | ... |
DASH | Dashcoin | ... |
DOGE | Dogecoin | ... |
EOS | EOS | ... |
ETH | Ethereum | Compatible with all EVM chains, support non-checksum address |
LTC | Litecoin | ... |
SOL | Solana | Only on-curve address can pass the validation |
TON | Ton | Only support user-friendly address |
TRX | Tron | ... |
XRP | Ripple | ... |
ZEC | Zcash | ... |
Usage
use Cryptothree\CryptoAddressValidator\Enums\CurrencyEnum; use Cryptothree\CryptoAddressValidator\CryptoAddressValidator; // create a validator instance $validator = CryptoAddressValidator::make(CurrencyEnum::BTC); // can also pass a chain symbol string to the constructor $validator = CryptoAddressValidator::make('BTC'); $result = $validator->isValid('1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2'); // or testnet $result = $validator->testnet()->isValid('tb1q27dglj7x4l34mj7j2x7e6fqsexk6vf8kew6qm0');