Download the PHP package amashukov/blockchain-address-php without Composer
On this page you can find all versions of the php package amashukov/blockchain-address-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amashukov/blockchain-address-php
More information about amashukov/blockchain-address-php
Files in amashukov/blockchain-address-php
Package blockchain-address-php
Short Description Typed on-chain address value objects for EVM and TON with structural equality.
License MIT
Homepage https://github.com/AndreyMashukov/blockchain-address-php
Informations about the package blockchain-address-php
amashukov/blockchain-address-php
Typed on-chain address Value Objects for EVM and TON — parse once, compare structurally, never pass a raw string again.
An address Value Object layer for multi-chain PHP applications. Every address is parsed and validated at construction, so an invalid one cannot exist as an instance, and comparison is structural rather than textual — which matters because the same address has several legitimate spellings on both TON and EVM.
Features
- Parse-at-the-boundary —
fromString()throws on anything malformed,tryFromString()returnsnull. A constructed instance is always a valid address. - Structural
eq()— comparison is by identity, not spelling. A TON address is equal to itself across bounceable / non-bounceable / url-safe forms; an EVM address is equal across EIP-55 checksum casing.strtolower($a) === strtolower($b)is wrong on TON and this exists to stop you writing it. - Cross-chain safe —
eq()between two different chain types isfalse, never a coincidental match. - Composite addresses —
Erc20Address(contract + token) andJettonAddress(contract + master + wallet) carry the several identifiers those standards actually need, instead of passing three loose strings alongside each other.
Why amashukov/blockchain-address-php
Raw address strings are the classic source of silent cross-chain bugs: a TON address compared case-insensitively matches the wrong account, an EIP-55 checksummed address fails a === against its lowercase form, and an ERC-20 transfer built from "the address" sends to the token contract instead of the recipient. Making the address a type moves all of that to construction time, where it fails loudly.
Installation
Usage
Testing
License
MIT — see LICENSE.