catchain/ton-address
Composer 安装命令:
composer require catchain/ton-address
包简介
Utility functions for working with TON blockchain addresses
README 文档
README
This package contains some PHP utility functions for working with TON blockchain addresses.
Installation
composer require catchain/ton-address
Usage
Checking address validity:
use Catchain\Ton\Address\Address; Address::isValid('EQB/tWkYGPdyPxqz8TXjVaSTKfr1gOOPqOez4d07vHFqUMuk'); // >>> true Address::isValid('this-is-definitely-not-an-address'); // >>> false
Creating Address object:
$address = Address::parse('-1:811ced271f8f449cb51eb5920090b92cb200b20f07170676e9db6fbe9da516cf'); // or in any other format: $address = Address::parse('Uf+BHO0nH49EnLUetZIAkLkssgCyDwcXBnbp22++naUWz5id');
Object structure:
Catchain\Ton\Address\Address {
+wc: -1,
+hashPart: b"ü\x1CÝ'\x1FÅD£Á\x1EÁÆ\0É╣,▓\0▓\x0F\x07\x17\x06vÚ█o¥ØÑ\x16¤",
+isTestOnly: true,
+isBounceable: true,
+isUserFriendly: true,
+isUrlSafe: true,
}
Serializing to string (arguments are self-explanatory):
$address->toString( userFriendly: true, urlSafe: true, bounceable: true, testOnly: false, ); // >>> Ef-BHO0nH49EnLUetZIAkLkssgCyDwcXBnbp22--naUWz8VY
Serializing to the long format:
$address->toString(userFriendly: false); // >>> -1:811ced271f8f449cb51eb5920090b92cb200b20f07170676e9db6fbe9da516cf
By default the object is serialized to the same format that it was created from:
Address::parse('Uf+BHO0nH49EnLUetZIAkLkssgCyDwcXBnbp22++naUWz5id')->toString(); // >>> Uf+BHO0nH49EnLUetZIAkLkssgCyDwcXBnbp22++naUWz5id Address::parse('kf-BHO0nH49EnLUetZIAkLkssgCyDwcXBnbp22--naUWz37S')->toString(); // >>> kf-BHO0nH49EnLUetZIAkLkssgCyDwcXBnbp22--naUWz37S
catchain/ton-address 适用场景与选型建议
catchain/ton-address 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14.4k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2022 年 12 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 catchain/ton-address 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 catchain/ton-address 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 14.4k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-26