exec() or FFI).@ton/core (TypeScript), ensuring compatibility with TON’s canonical wire format.ext-gmp for big integers), making it easy to add to Laravel via Composer.Builder and Slice classes provide an intuitive, chainable interface for constructing/parsing TLB-encoded data, aligning well with Laravel’s expressive syntax.Boc::encode() support means Laravel can generate valid TON BOCs for API calls (e.g., to toncenter.com or ton.org endpoints).AddressData is minimal, it can be extended or paired with amashukov/ton-wallet-php for full address parsing/formatting.| Risk Area | Mitigation Strategy |
|---|---|
| Big Integer Handling | Requires ext-gmp (not enabled by default in some PHP setups). Document this clearly. |
| TON Protocol Changes | Package is tied to @ton/core v15. Monitor TON SDK updates for breaking changes. |
| Performance | PHP may be slower than TypeScript for heavy TON operations. Benchmark against Node.js. |
| Error Handling | Uses RuntimeException for malformed TLB. Ensure Laravel’s error handler logs these. |
| Testing Coverage | Low stars/dependents suggest unproven reliability. Write integration tests with real TON contracts. |
ton CLI, @ton/core) entirely, or supplement them?ext-gmp feasible for the deployment environment? If not, explore alternatives (e.g., bcmath for big integers).Builder, Slice, and Boc classes for dependency injection.TonCell) to simplify common operations (e.g., TonCell::buildTransfer()).php artisan ton:build-cell).bocs table with wire_bytes column) for auditing or replayability.toncenter.com/sendBoc).@ton/core to verify byte parity.TonCellService) to wrap the package’s functionality.ton-cli) with PHP-native code.@ton/core v15. If TON releases a breaking change, the package may need updates.SendBocJob).TonMessageParsed).ext-gmp in php.ini and verify with php -m | grep gmp.composer require amashukov/ton-cell-php.TonCellService to abstract the package’s API.config/app.php providers/services.TonMessageValidator).toncenter-client-php for RPC calls).Builder/Slice operations.ext-gmp), reducing maintenance overhead.@ton/core updates that may break byte parity.RuntimeExceptions from malformed TLB parsing for debugging.ext-gmp missing → Provide clear error messages and installation steps.amashukov/ton-wallet-php for address-related support.ext-gmp is fast, but test with large values (e.g., 256-bit numbers).| Failure Scenario | Mitigation |
|---|---|
| Malformed TLB Input | Validate inputs early (e.g., reject oversized cells in API requests). |
| BOC Size Exceeds Limits | Split large BOCs into multiple cells or use external storage. |
| TON Network Issues | Implement retries with exponential backoff for API calls (e.g., toncenter). |
PHP ext-gmp Errors |
Fallback to bcmath for non-critical paths or document requirements clearly. |
| Package Abandonment | Fork the repo or migrate to an alternative (e.g., PHP-FFI with @ton/core). |
TonCellService.How can I help you explore Laravel packages today?