Download the PHP package sandermuller/laravel-solana-sdk without Composer
On this page you can find all versions of the php package sandermuller/laravel-solana-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sandermuller/laravel-solana-sdk
More information about sandermuller/laravel-solana-sdk
Files in sandermuller/laravel-solana-sdk
Package laravel-solana-sdk
Short Description Laravel wrapper for sandermuller/solana-php-sdk — service provider, facades, env-driven config, and artisan commands for Solana RPC.
License MIT
Homepage https://github.com/SanderMuller/laravel-solana-sdk
Informations about the package laravel-solana-sdk
Laravel Solana SDK
Laravel wrapper around sandermuller/solana-php-sdk — service
provider, facades, env-driven config, and artisan commands so you can
call Solana RPC from a Laravel app without wiring containers yourself.
Contents
- Requirements
- Install
- Configuration
- Facades
- Multi-endpoint transport
- Confirming transactions on the queue
- PubSub / WebSocket
- Artisan commands
- Testing
- Upgrading
- Changelog
- Contributing
- Security
- Credits
- License
Requirements
- PHP
^8.3 - Laravel
^11.0 || ^12.0 || ^13.0 ext-sodium(transitively required by the core SDK)
Install
The service provider auto-discovers. Publish the config if you want to customise defaults:
Configuration
config/solana-sdk.php exposes four knobs:
SOLANA_NETWORK accepts mainnet, mainnet-beta, testnet, devnet
(also main, test, dev). The RPC endpoint is derived from the
Network enum in the core SDK.
Facades
Solana proxies the typed Connection API (~60 RPC methods covering
~80 % of the Solana JSON-RPC spec — accounts, blocks, slots, signatures,
tokens, supply, stake, vote, inflation). SolanaRpc proxies the raw
SolanaRpcClient for calls the typed facade does not yet cover.
Both bindings are also reachable via plain DI:
Programs, builders, signers
The core SDK ships first-class program builders (SystemProgram,
SplTokenProgram, Token2022Program, MemoProgram, StakeProgram,
VoteProgram, AddressLookupTableProgram, ComputeBudgetProgram,
MetaplexProgram, AnchorIdl, …), a sanitize-safe
TransactionBuilder, a Util\PriorityFee helper, and a
Contracts\MessageSigner interface (with Signing\InMemoryMessageSigner
as the local adapter). Use them directly — no wrapping required:
Multi-endpoint transport
Set SOLANA_RPC_URL (and optionally SOLANA_RPC_URL_FALLBACK) to route
through your own RPC provider with automatic retry + fallback. Leave
both unset to keep the public-endpoint default.
For more elaborate setups (custom auth headers, multiple fallbacks)
publish the config and edit transport directly — the wrapper hands
the array straight to SanderMuller\SolanaPhpSdk\Rpc\TransportFactory.
Confirming transactions on the queue
This wrapper ships SanderMuller\LaravelSolanaSdk\Queue\ConfirmTransactionJob
out of the box. Dispatch it after sendTransaction so the long-tail
confirmation phase becomes a background job that fires
TransactionConfirmed / TransactionExpired events (the event classes
live in the SDK):
Listen for SanderMuller\SolanaPhpSdk\Events\TransactionConfirmed and
SanderMuller\SolanaPhpSdk\Events\TransactionExpired in EventServiceProvider
(events are SDK-side; only the Job moved to this wrapper).
PubSub / WebSocket
SolanaPubSubClient is bound transient against the configured network,
so you can typehint it directly:
Artisan commands
| Command | Purpose |
|---|---|
solana:balance {address} |
Print SOL balance + lamports |
solana:airdrop {address} {sol=1} |
Request devnet/testnet airdrop |
solana:account {address} |
Dump raw account info JSON |
solana:tx {signature} |
Look up a transaction by signature |
solana:health |
RPC health + version |
solana:tokens {owner} |
List SPL token accounts owned by an address |
solana:fees {addresses?*} |
Recent prioritization fee samples |
Disable all bundled commands with SOLANA_COMMANDS_ENABLED=false (they
hit live RPC; production may want them off).
Testing
Stubbing RPC in tests
Call Solana::fake() to swap the bound SolanaRpcClient for the core
SDK's InMemoryRpcStub so the SDK never hits the network:
Wire the core Pest expectations (toBeConfirmed, toHaveCustomCode,
toBeInstructionError) once from tests/Pest.php:
The wrapper's own test suite runs against Orchestra Testbench with the package provider auto-registered. Network-dependent tests are not shipped — facade unit tests just verify resolution + container shape.
Upgrading
See UPGRADING.md.
Changelog
See CHANGELOG.md. Updated automatically on release publish.
Contributing
PRs welcome. Run the local gauntlet before opening one:
The package is intentionally a thin wrapper — net-new RPC methods,
program builders, and DTOs belong in
sandermuller/solana-php-sdk. The wrapper only adds Laravel
glue (@method lines on the Solana facade, env-driven config keys,
container bindings, solana:* commands). See
CLAUDE.md for the full scope rules.
Security
See SECURITY.md.
Credits
License
The MIT License (MIT). See LICENSE.
All versions of laravel-solana-sdk with dependencies
sandermuller/solana-php-sdk Version ^0.2.0
illuminate/console Version ^11.0||^12.0||^13.0
illuminate/contracts Version ^11.0||^12.0||^13.0
illuminate/support Version ^11.0||^12.0||^13.0