PHPackages                             selaz/solana-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. selaz/solana-php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

selaz/solana-php-sdk
====================

Solana PHP SDK

01.9kPHP

Since Sep 28Pushed 2y agoCompare

[ Source](https://github.com/selaz/solana-php-sdk)[ Packagist](https://packagist.org/packages/selaz/solana-php-sdk)[ RSS](/packages/selaz-solana-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Solana PHP SDK
==============

[](#solana-php-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2cb8129fd953776647df4a47ab281c5fd5c3d7da63431a323eb6c4b2b91976ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7469676874656e636f2f736f6c616e612d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tightenco/solana-php-sdk)[![GitHub Tests Action Status](https://github.com/verze-app/solana-php-sdk/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/verze-app/solana-php-sdk/actions?query=workflow%3Arun-tests+branch%3Amain)

---

⚠️ **As of May 2023, this package is up for adoption again!** Feel free to ping . Sadly we never got around to accomplish what we wanted at Verze, so we no longer work on the project and therefore this package is looking for new hands to work on it. Use at your own risk. Verze will *not* provide any support for this package as it exists right now; please don't email us expecting any support.

---

Simple PHP SDK for Solana.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require tightenco/solana-php-sdk
```

Usage
-----

[](#usage)

### Using the Solana simple client

[](#using-the-solana-simple-client)

You can use the `Connection` class for convenient access to API methods. Some are defined in the code:

```
use Tighten\SolanaPhpSdk\Connection;
use Tighten\SolanaPhpSdk\SolanaRpcClient;

// Using a defined method
$sdk = new Connection(new SolanaRpcClient(SolanaRpcClient::MAINNET_ENDPOINT));
$accountInfo = $sdk->getAccountInfo('4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA');
var_dump($accountInfo);
```

For all the possible methods, see the [API documentation](https://docs.solana.com/developing/clients/jsonrpc-api).

### Directly using the RPC client

[](#directly-using-the-rpc-client)

The `Connection` class is just a light convenience layer on top of the RPC client. You can, if you want, use the client directly, which allows you to work with the full `Response` object:

```
use Tighten\SolanaPhpSdk\SolanaRpcClient;

$client = new SolanaRpcClient(SolanaRpcClient::MAINNET_ENDPOINT);
$accountInfoResponse = $client->call('getAccountInfo', ['4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA']);
$accountInfoBody = $accountInfoResponse->json();
$accountInfoStatusCode = $accountInfoResponse->getStatusCode();
```

### Transactions

[](#transactions)

Here is working example of sending a transfer instruction to the Solana blockchain:

```
$client = new SolanaRpcClient(SolanaRpcClient::DEVNET_ENDPOINT);
$connection = new Connection($client);
$fromPublicKey = KeyPair::fromSecretKey([...]);
$toPublicKey = new PublicKey('J3dxNj7nDRRqRRXuEMynDG57DkZK4jYRuv3Garmb1i99');
$instruction = SystemProgram::transfer(
    $fromPublicKey->getPublicKey(),
    $toPublicKey,
    6
);

$transaction = new Transaction(null, null, $fromPublicKey->getPublicKey());
$transaction->add($instruction);

$txHash = $connection->sendTransaction($transaction, $fromPublicKey);
```

Note: This project is in alpha, the code to generate instructions is still being worked on `$instruction = SystemProgram::abc()`

Roadmap
-------

[](#roadmap)

1. Borsh serialize and deserialize.
2. Improved documentation.
3. Build out more of the Connection, SystemProgram, TokenProgram, MetaplexProgram classes.
4. Improve abstractions around working with binary data.
5. Optimizations:
    1. Leverage PHP more.
    2. Better cache `$recentBlockhash` when sending transactions.
6. Suggestions? Open an issue or PR :D

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Matt Stauffer](https://github.com/mattstauffer) (Original creator)
- [Zach Vander Velden](https://github.com/exzachlyvv) (Metadata wizard)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/60a10991a9de0956065be5839a37480393fb914725e0b0e60172d3f5c263be61?d=identicon)[Selaz](/maintainers/Selaz)

---

Top Contributors

[![exzachlyvv](https://avatars.githubusercontent.com/u/46034847?v=4)](https://github.com/exzachlyvv "exzachlyvv (41 commits)")[![mattstauffer](https://avatars.githubusercontent.com/u/151829?v=4)](https://github.com/mattstauffer "mattstauffer (22 commits)")[![neverything](https://avatars.githubusercontent.com/u/368120?v=4)](https://github.com/neverything "neverything (12 commits)")[![gabrielkoerich](https://avatars.githubusercontent.com/u/1981726?v=4)](https://github.com/gabrielkoerich "gabrielkoerich (4 commits)")[![ComradePashka](https://avatars.githubusercontent.com/u/15798005?v=4)](https://github.com/ComradePashka "ComradePashka (3 commits)")[![selaz](https://avatars.githubusercontent.com/u/1086350?v=4)](https://github.com/selaz "selaz (2 commits)")[![slawomir-pryczek](https://avatars.githubusercontent.com/u/7211190?v=4)](https://github.com/slawomir-pryczek "slawomir-pryczek (2 commits)")[![miguilimzero](https://avatars.githubusercontent.com/u/35383529?v=4)](https://github.com/miguilimzero "miguilimzero (1 commits)")[![hnassr](https://avatars.githubusercontent.com/u/9513214?v=4)](https://github.com/hnassr "hnassr (1 commits)")

### Embed Badge

![Health badge](/badges/selaz-solana-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/selaz-solana-php-sdk/health.svg)](https://phpackages.com/packages/selaz-solana-php-sdk)
```

###  Alternatives

[prism-php/relay

A Prism tool for interacting with MCP servers

15236.1k3](/packages/prism-php-relay)[ruafozy/mersenne-twister

Pure-PHP Mersenne Twister

221.4M12](/packages/ruafozy-mersenne-twister)[writecrow/lemmatizer

A non-part-of-speech lemmatizer tool

13183.1k2](/packages/writecrow-lemmatizer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
