PHPackages                             he426100/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. he426100/solana-php-sdk

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

he426100/solana-php-sdk
=======================

Solana PHP SDK

0.0.7(3y ago)0973[1 PRs](https://github.com/he426100/solana-php-hyperf/pulls)MITPHPPHP ^7.4 || ~8.0

Since Jul 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/he426100/solana-php-hyperf)[ Packagist](https://packagist.org/packages/he426100/solana-php-sdk)[ Docs](https://github.com/tighten/solana-php-sdk)[ RSS](/packages/he426100-solana-php-sdk/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (15)Versions (8)Used By (0)

Hyperf solana-php-sdk
=====================

[](#hyperf-solana-php-sdk)

移植自 solana-php-sdk 组件（[solana-php-sdk](https://github.com/verze-app/solana-php-sdk)）

Simple PHP SDK for Solana.

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

[](#installation)

You can install the package via composer:

```
composer require he426100/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 He426100\SolanaPhpSdk\Connection;
use He426100\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 He426100\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]);
```

### Token Transactions

[](#token-transactions)

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

```
$client = new SolanaRpcClient(SolanaRpcClient::DEVNET_ENDPOINT);
$connection = new Connection($client);
$fromPublicKey = KeyPair::fromSecretKey([...]);
$toPublicKey = new PublicKey('J3dxNj7nDRRqRRXuEMynDG57DkZK4jYRuv3Garmb1i99');
$mint = new PublicKey(...);

$source = SplTokenProgram::getAssociatedTokenAccount($mint, $fromPublicKey->getPublicKey())['address'];
$destination = SplTokenProgram::getAssociatedTokenAccount($mint, $toPublicKey->getPublicKey())['address'];

$instruction = SplTokenProgram::transfer(
    new PublicKey($source),
    new PublicKey($destination),
    $fromPublicKey->getPublicKey(),
    $mint,
    1,
    0
);

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

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

发送nft代码来自 [verze-app/solana-php-sdk#21](https://github.com/verze-app/solana-php-sdk/issues/21)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 53.2% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~3 days

Total

7

Last Release

1423d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f496f5618977a1eeb3f64de28aa1a130e33c0c3f847043177f7496916cc8eecf?d=identicon)[he426100](/maintainers/he426100)

---

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 (8 commits)")[![gabrielkoerich](https://avatars.githubusercontent.com/u/1981726?v=4)](https://github.com/gabrielkoerich "gabrielkoerich (4 commits)")[![hnassr](https://avatars.githubusercontent.com/u/9513214?v=4)](https://github.com/hnassr "hnassr (1 commits)")[![miguilimzero](https://avatars.githubusercontent.com/u/35383529?v=4)](https://github.com/miguilimzero "miguilimzero (1 commits)")

---

Tags

phpsdkblockchaintightencosolsolana-php-sdksolana

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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