PHPackages                             nebulas/neb.php - 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. nebulas/neb.php

ActiveLibrary[API Development](/categories/api)

nebulas/neb.php
===============

Nebulas sdk implemented with PHP

0.0.2(8y ago)271417[4 issues](https://github.com/nebulasio/neb.php/issues)MITPHPPHP ^7.1

Since May 30Pushed 7y ago3 watchersCompare

[ Source](https://github.com/nebulasio/neb.php)[ Packagist](https://packagist.org/packages/nebulas/neb.php)[ RSS](/packages/nebulas-nebphp/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (6)Versions (4)Used By (0)

neb.php
=======

[](#nebphp)

neb.php is the Nebulas compatible PHP API. Users can sign/send transactions and deploy/call smart contract with it.

Requirements
------------

[](#requirements)

neb.php requires the following:

- PHP 7.1 or higher
- ext/gmp, (you may need to edit php.ini file to turn it on)
- ext/curl
- ext/scrypt, refer  or [pecl](https://pecl.php.net/package/scrypt)

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

[](#installation)

You can install this library via Composer:

```
composer require nebulas/neb.php
```

Or add this in your composer.json:

```
"require": {
    "nebulas/neb.php": "0.0.2"
}

```

And also you can clone this repo or download it as zip file. Then don't forget to run `composer install` under the project root to have the dependencies installed.

Usage
-----

[](#usage)

please refer to [examples](/example) to learn how to use neb.php.

#### Account

[](#account)

```
use Nebulas\Core\Account;

$account = Account::newAccount();
//$account = new Account();     //This is the same as above
$addr = $account->getAddressString(); //such as "n1HUbJZ45Ra5jrRqWvfVaRMiBMB3CACGhqc"
$keyStore = $account->toKey();  //Please save your keyStore(json) in to file and keep it safe
```

#### API

[](#api)

```
use Nebulas\Rpc\HttpProvider;
use Nebulas\Rpc\Neb;

$neb = new Neb(new HttpProvider("https://testnet.nebulas.io"));

$api = $neb->api;
echo $api->getAccountState("n1H2Yb5Q6ZfKvs61htVSV4b1U2gr2GA9vo6"), PHP_EOL;;
echo $api->getTransactionReceipt("8b98a5e4a27d2744a6295fe71e4f138d3e423ced11c81e201c12ac8379226ad1"), PHP_EOL;
```

#### Transaction

[](#transaction)

```
use Nebulas\Rpc\Neb;
use Nebulas\Rpc\HttpProvider;
use Nebulas\Core\Account;
use Nebulas\Core\Transaction;
use Nebulas\Core\TransactionBinaryPayload;
use Nebulas\Core\TransactionCallPayload;

$neb = new Neb();
$neb->setProvider(new HttpProvider("https://testnet.nebulas.io"));

$keyJson = '{"version":4,"id":"814745d0-9200-42bd-a4df-557b2d7e1d8b","address":"n1H2Yb5Q6ZfKvs61htVSV4b1U2gr2GA9vo6","crypto":{"ciphertext":"fb831107ce71ed9064fca0de8d514d7b2ba0aa03aa4fa6302d09fdfdfad23a18","cipherparams":{"iv":"fb65caf32f4dbb2593e36b02c07b8484"},"cipher":"aes-128-ctr","kdf":"scrypt","kdfparams":{"dklen":32,"salt":"dddc4f9b3e2079b5cc65d82d4f9ecf27da6ec86770cb627a19bc76d094bf9472","n":4096,"r":8,"p":1},"mac":"1a66d8e18d10404440d2762c0d59d0ce9e12a4bbdfc03323736a435a0761ee23","machash":"sha3256"}}';
$password = 'passphrase';

$from = Account:: fromKey($keyJson, $password);

//get nonce value
$resp = $neb->api->getAccountState($fromAddr);
$respObj = json_decode($resp);
$nonce = $respObj->result->nonce;

//make new transaction
$chainId = 1001;
$to = "n1H2Yb5Q6ZfKvs61htVSV4b1U2gr2GA9vo6";
$tx = new Transaction($chainId, $from, $to, $value = "0", $nonce + 1 );
$tx->hashTransaction();
$tx->signTransaction();

//send transaction
$result = $neb->api->sendRawTransaction($tx->toProtoString());
```

Join in!
--------

[](#join-in)

We are happy to receive bug reports, fixes, documentation enhancements, and other improvements.

Please report bugs via the [github issue](https://github.com/nebulasio/neb.php/issues).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.6% 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 ~6 days

Total

2

Last Release

2942d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5339324?v=4)[nebulas](/maintainers/nebulas)[@Nebulas](https://github.com/Nebulas)

---

Top Contributors

[![yupnano](https://avatars.githubusercontent.com/u/5012612?v=4)](https://github.com/yupnano "yupnano (35 commits)")[![lanmerry](https://avatars.githubusercontent.com/u/10560382?v=4)](https://github.com/lanmerry "lanmerry (2 commits)")

---

Tags

apiblockchainnebulasnebulas-php-apiphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nebulas-nebphp/health.svg)

```
[![Health](https://phpackages.com/badges/nebulas-nebphp/health.svg)](https://phpackages.com/packages/nebulas-nebphp)
```

###  Alternatives

[google/gax

Google API Core for PHP

267116.3M528](/packages/google-gax)[googleads/google-ads-php

Google Ads API client for PHP

3508.5M11](/packages/googleads-google-ads-php)[clarifai/clarifai-php-grpc

Clarifai PHP gRPC client

1229.3k](/packages/clarifai-clarifai-php-grpc)[temporal/sdk

Temporal SDK

4102.7M22](/packages/temporal-sdk)[google/grpc-gcp

gRPC GCP library for channel management

184110.9M6](/packages/google-grpc-gcp)[google/common-protos

Google API Common Protos for PHP

175112.8M67](/packages/google-common-protos)

PHPackages © 2026

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