PHPackages                             make-software/casper-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. [API Development](/categories/api)
4. /
5. make-software/casper-php-sdk

ActiveLibrary[API Development](/categories/api)

make-software/casper-php-sdk
============================

PHP 7.4+ library for interacting with Casper blockchain node RPC API.

1.4.1(1y ago)101.9k9[2 issues](https://github.com/make-software/casper-php-sdk/issues)[2 PRs](https://github.com/make-software/casper-php-sdk/pulls)Apache-2.0PHPPHP &gt;=7.4CI passing

Since Jun 24Pushed 4mo ago7 watchersCompare

[ Source](https://github.com/make-software/casper-php-sdk)[ Packagist](https://packagist.org/packages/make-software/casper-php-sdk)[ RSS](/packages/make-software-casper-php-sdk/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (6)Dependencies (3)Versions (9)Used By (0)

casper-php-sdk
==============

[](#casper-php-sdk)

The PHP SDK allows developers to interact with the Casper Network using PHP. This page covers different examples of using the SDK.

Install
-------

[](#install)

```
composer require make-software/casper-php-sdk

```

Usage
-----

[](#usage)

### Creating RpcClient

[](#creating-rpcclient)

Create `RpcClient` by passing node url and headers (optional) to constructor

```
$nodeUrl = 'http://127.0.0.1:7777';
$headers = array('Authorization' => 'Bearer 6ae6c8b31f09df244019ffef60c274e4'); // Optional

$client = new Casper\Rpc\RpcClient($nodeUrl, $headers);
```

### RPC call examples

[](#rpc-call-examples)

You can find all RpcClient methods on the [RpcClientAPI page](docs/API/RpcClientAPI.md). Here you can see a several of examples of using RpcClient. All examples below are supposed to be ran against the Testnet

#### Get deploy by deploy hash

[](#get-deploy-by-deploy-hash)

```
$deploy = $client->getDeploy('fa815fc43c38da30f6ab4e5a6c8a1b31f09df2bf4b344019ffef60c1270d4e49');

$deployHeader = $deploy->getHeader();
$creationTime = $deployHeader->getTimestamp();
```

#### Get auction state information

[](#get-auction-state-information)

```
$auctionState = $client->getAuctionState();

$stateRootHash = $auctionState->getStateRootHash();
$blockHeight = $auctionState->getBlockHeight();
```

#### Get peers from the network

[](#get-peers-from-the-network)

```
$peers = $client->getPeers();

foreach ($peers as $peer) {
    ...
}
```

#### Get the latest block information

[](#get-the-latest-block-information)

```
$latestBlock = $client->getLatestBlock();
$latestBlockHash = $latestBlock->getHash();
```

More examples
-------------

[](#more-examples)

- [Key management](docs/Example/KeyManagement.md)
- [Sending a Transfer](docs/Example/SendingTransfer.md)
- CEP78
    - [Install](docs/Example/CEP78/Install.md)
    - [Mint](docs/Example/CEP78/Mint.md)

API
---

[](#api)

### RpcClient

[](#rpcclient)

- [RpcClient](docs/API/RpcClientAPI.md#Constructor)
- [putDeploy](docs/API/RpcClientAPI.md#Put-deploy)
- [getDeploy](docs/API/RpcClientAPI.md#Get-deploy)
- [getBlockByHash](docs/API/RpcClientAPI.md#Get-block-by-hash)
- [getBlockByHeight](docs/API/RpcClientAPI.md#Get-block-by-height)
- [getLatestBlock](docs/API/RpcClientAPI.md#Get-the-latest-block)
- [getPeers](docs/API/RpcClientAPI.md#Get-peers)
- [getStatus](docs/API/RpcClientAPI.md#Get-status)
- [getAuctionState](docs/API/RpcClientAPI.md#Get-auction-state)
- [getStateRootHash](docs/API/RpcClientAPI.md#Get-state-root-hash)
- [getAccount](docs/API/RpcClientAPI.md#Get-account)
- [getAccountBalance](docs/API/RpcClientAPI.md#Get-account-balance)
- [getAccountBalanceUrefByAccountHash](docs/API/RpcClientAPI.md#Get-account-balance-URef-by-account-hash)
- [getAccountBalanceUrefByPublicKey](docs/API/RpcClientAPI.md#Get-account-balance-URef-by-public-key)
- [getBlockState](docs/API/RpcClientAPI.md#Get-block-state)
- [getBlockTransfers](docs/API/RpcClientAPI.md#Get-block-transfers)
- [getEraSummaryBySwitchBlockHash](docs/API/RpcClientAPI.md#Get-era-summary-by-switch-block-hash)
- [getEraSummaryBySwitchBlockHeight](docs/API/RpcClientAPI.md#Get-era-summary-by-switch-block-height)
- [getDictionaryItemByURef](docs/API/RpcClientAPI.md#Get-dictionary-item)
- [getGlobalStateByBlock](docs/API/RpcClientAPI.md#Get-global-state-by-block)
- [getGlobalStateByStateRootHash](docs/API/RpcClientAPI.md#Get-global-state-by-state-root-hash)
- [queryBalance](docs/API/RpcClientAPI.md#Query-balance)
- [getChainspecInfo](docs/API/RpcClientAPI.md#Get-chainspec-info)
- [speculativeExecution](docs/API/RpcClientAPI.md#Speculative-execution)

### DeployService

[](#deployservice)

- [makeDeploy](docs/API/DeployServiceAPI.md#Make-deploy)
- [signDeploy](docs/API/DeployServiceAPI.md#Sign-deploy)
- [validateDeploy](docs/API/DeployServiceAPI.md#Validate-deploy)
- [getDeploySize](docs/API/DeployServiceAPI.md#Get-deploy-size)

### ContractService

[](#contractservice)

- [ContractService](docs/API/ContractServiceAPI.md#Constructor)
- [createInstallDeploy](docs/API/ContractServiceAPI.md#Create-Install-deploy)
- [install](docs/API/ContractServiceAPI.md#Install)
- [createCallEntryPointDeploy](docs/API/ContractServiceAPI.md#Create-CallEntryPoint-deploy)
- [callEntryPoint](docs/API/ContractServiceAPI.md#Call-entrypoint)

Entities
--------

[](#entities)

- [Account](docs/Entity/Account.md)
- [AuctionState](docs/Entity/AuctionState.md)
- [Block](docs/Entity/Block.md)
- [Deploy](docs/Entity/Deploy.md)
- [EraSummary](docs/Entity/EraSummary.md)
- [Transfer](docs/Entity/Transfer.md)

Testing
-------

[](#testing)

Run the following command from the project directory.

**Replace `http://127.0.0.1:7777` by the any Testnet node url before running**

```
export CASPER_PHP_SDK_TEST_NODE_URL="http://127.0.0.1:7777" && php vendor/bin/phpunit tests
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance56

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.9% 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 ~189 days

Recently: every ~179 days

Total

6

Last Release

480d ago

### Community

Maintainers

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

---

Top Contributors

[![RomanovSci](https://avatars.githubusercontent.com/u/4564289?v=4)](https://github.com/RomanovSci "RomanovSci (19 commits)")[![mrkara](https://avatars.githubusercontent.com/u/9937631?v=4)](https://github.com/mrkara "mrkara (7 commits)")[![ihor](https://avatars.githubusercontent.com/u/490943?v=4)](https://github.com/ihor "ihor (6 commits)")[![mssteuer](https://avatars.githubusercontent.com/u/142457?v=4)](https://github.com/mssteuer "mssteuer (2 commits)")

---

Tags

blockchaincasper-networkphpsdksdkrpcnodeblockchaincasper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/make-software-casper-php-sdk/health.svg)

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

###  Alternatives

[manamine/php-eos-rpc-sdk

PHP SDK for the EOS RPC API

187.5k](/packages/manamine-php-eos-rpc-sdk)[blocktrail/blocktrail-sdk

The BlockTrail PHP SDK, for integration of Bitcoin functionality through the BlockTrail API

4921.1k3](/packages/blocktrail-blocktrail-sdk)[mocking-magician/coinbase-pro-sdk

Library for coinbase pro API calls

223.2k](/packages/mocking-magician-coinbase-pro-sdk)[hardcastle/xrpl_php

PHP SDK / Client for the XRP Ledger

129.7k5](/packages/hardcastle-xrpl-php)

PHPackages © 2026

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