soneso / stellar-php-sdk
Stellar PHP SDK for the Stellar Network
Installs: 46 119
Dependents: 4
Suggesters: 0
Security: 0
Stars: 39
Watchers: 12
Forks: 20
Open Issues: 2
pkg:composer/soneso/stellar-php-sdk
Requires
- php: >=8.0
- ext-bcmath: *
- ext-gmp: *
- christian-riesen/base32: ~1.6
- guzzlehttp/guzzle: ^7.3
- paragonie/sodium_compat: ^2.5.0
- phpseclib/phpseclib: ^3.0
- yosymfony/toml: ~1.0
Requires (Dev)
- league/uri: 7.5.1
- phpdocumentor/phpdocumentor: ^3.9
- phpunit/phpunit: ~10.0
Suggests
- ext-pcntl: Required for process forking in streaming integration tests (Unix only)
- dev-main
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.8
- 1.8.7
- 1.8.6
- 1.8.5
- 1.8.4
- 1.8.3
- 1.8.2
- 1.8.1
- 1.8.0
- 1.8.0beta2
- 1.8.0beta1
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.2
- 1.6.1
- 1.6.0
- 1.6.0beta2
- 1.6.0beta1
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.9
- 1.3.8
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.7.4
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.0
- 0.0.1
- dev-pcntl
- dev-sac
- dev-doc-next
- dev-sep-53
- dev-add-ci-pipeline
- dev-test-improvement
- dev-sep-45-support
- dev-soroban_20.0.0_prep
This package is not auto-updated.
Last update: 2026-02-10 13:26:17 UTC
README
Build and sign Stellar transactions, query Horizon, and interact with Soroban smart contracts via RPC. Communicate with anchors and external services using built-in support for 18 SEPs.
Installation
composer require soneso/stellar-php-sdk
Requires PHP 8.0+.
Quick examples
Send a payment
Transfer XLM between accounts:
$payment = (new PaymentOperationBuilder($receiverId, Asset::native(), '100'))->build(); $tx = (new TransactionBuilder($account))->addOperation($payment)->build(); $tx->sign($senderKeyPair, Network::testnet()); $sdk->submitTransaction($tx);
Trust an asset
Enable your account to receive a token (like USDC):
$asset = Asset::createNonNativeAsset('USDC', $issuerAccountId); $trustOp = (new ChangeTrustOperationBuilder($asset))->build(); $tx = (new TransactionBuilder($account))->addOperation($trustOp)->build(); $tx->sign($accountKeyPair, Network::testnet()); $sdk->submitTransaction($tx);
Call a smart contract
Invoke a Soroban contract method:
$client = SorobanClient::forClientOptions(new ClientOptions( sourceAccountKeyPair: $keyPair, contractId: 'CABC...', network: Network::testnet(), rpcUrl: 'https://soroban-testnet.stellar.org' )); $result = $client->invokeMethod('hello', [XdrSCVal::forSymbol('World')]);
For complete walkthroughs, see the documentation.
Documentation
| Guide | Description |
|---|---|
| Quick start | Your first transaction in 15 minutes |
| Getting started | Keys, accounts, and fundamentals |
| SDK usage | Transactions, operations, Horizon queries, streaming |
| Soroban | Smart contract deployment and interaction |
| SEPs | Anchor integration, authentication, KYC, etc. |
Compatibility
Feedback
If you're using this SDK, feedback helps improve it:
Contributing
See CONTRIBUTING.md for guidelines.
License
Apache 2.0. See LICENSE.