@ton/ton (JavaScript SDK) for address derivation. This is critical for cross-platform consistency in wallet interactions.ext-sodium and ext-bcmath), making it easy to integrate into Laravel without heavyweight dependencies.blockchain-context-bundle suggests seamless integration with Laravel’s service container, enabling dependency injection for WalletV4R2, Address, and WalletRpcInterface.getSeqno + sendBoc) allows TPMs to swap between TonCenter, custom nodes, or test doubles without modifying business logic.@ton/ton, reducing risk of on-chain mismatches.toncenter-client-php). This adds minor risk if the chosen RPC provider has downtime or rate limits.@ton/ton reduce this concern.RPC Strategy:
toncenter-client-php adapter simplifies integration.Transaction Lifecycle:
Error Handling:
Scaling:
Testing:
ext-sodium, ext-bcmath) align perfectly with Laravel’s ecosystem. No additional PHP extensions are required beyond standard Laravel setups.WalletV4R2, Address, and WalletRpcInterface as Laravel services for dependency injection.$this->app->bind(WalletRpcInterface::class, function ($app) {
return new TonCenterRpcClient(config('ton.rpc_key'));
});
blockchain-context-bundle to centralize TON-related services (wallets, RPC clients, mnemonic handling) and reduce boilerplate.Phase 1: Core Integration
composer require amashukov/ton-wallet-php amashukov/toncenter-client-php
TonCenterRpc) for WalletRpcInterface.Phase 2: Laravel Service Wrapping
TonWalletService) to encapsulate wallet operations:
class TonWalletService {
public function __construct(
private WalletV4R2 $wallet,
private WalletRpcInterface $rpc
) {}
public function sendTransfer(Address $to, string $amount): string {
$messages = [new InternalMessage($to, $amount, false)];
return $this->wallet->sendTransfer($this->rpc, $messages);
}
}
AppServiceProvider.Phase 3: RPC and Error Handling
retry helper).Phase 4: Advanced Use Cases
@ton/ton byte-for-byte, ensuring compatibility with existing TON wallets and tools.UQ..., EQ...) and raw (workchain:hex) formats, reducing friction with frontend integrations.amashukov/ton-cell-php for Cell/BOC handling, which is a dependency and thus pre-integrated.sodium, bcmath) are installed.Amashukov\TonCrypto\Mnemonic).@ton/ton or a TON explorer.amashukov/ton-cell-php and amashukov/ton-crypto-php for updates, as they are core dependencies.toncenter-client-php, watch for TonCenter API changes (e.g., rate limits, endpoint updates).@ton/ton or a TON explorer.ton-cli or a TON testnet.| Failure Scenario | Impact
How can I help you explore Laravel packages today?