PHPackages                             gxchain/gxclient - 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. gxchain/gxclient

ActiveLibrary[API Development](/categories/api)

gxchain/gxclient
================

A client to interact with gxchain implemented in PHP

v1.0.5(6y ago)3362MITPHP

Since Mar 8Pushed 6y ago2 watchersCompare

[ Source](https://github.com/gxchain/gxclient-php)[ Packagist](https://packagist.org/packages/gxchain/gxclient)[ Docs](https://github.com/gxchain/gxclient-php)[ RSS](/packages/gxchain-gxclient/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (10)Versions (7)Used By (0)

gxclient-php
============

[](#gxclient-php)

A client to interact with gxchain implemented in PHP

 [![](https://raw.githubusercontent.com/gxchain/gxips/master/assets/images/task-gxclient.png)](https://raw.githubusercontent.com/gxchain/gxips/master/assets/images/task-gxclient.png) [![](https://raw.githubusercontent.com/gxchain/gxips/master/assets/images/task-gxclient-en.png)](https://raw.githubusercontent.com/gxchain/gxips/master/assets/images/task-gxclient-en.png)

Supported Versions
==================

[](#supported-versions)

PHP7.0 x64

Install
=======

[](#install)

You can install this library via Composer:

```
composer require gxchain/gxclient

```

APIs
====

[](#apis)

- [Keypair API](#keypair-api)
- [Chain API](#chain-api)
- [Faucet API](#faucet-api)
- [Account API](#account-api)
- [Asset API](#asset-api)
- [Contract API](#contract-api)
- [Staking API](#staking-api)

Constructors
------------

[](#constructors)

```
//init GXClient
new GXClient($private_key, $account_id_or_name, $entry_point);
```

Keypair API
-----------

[](#keypair-api)

```
//generate key pair locally
function generateKey(String $brainKey);
//export public key from private key
function privateToPublic(String $privateKey);
//check if public key is valid
function isValidPublic(String $publicKey);
//check if private key is valid
function isValidPrivate(String $privateKey);
```

Chain API
---------

[](#chain-api)

```
//get current blockchain id
function getChainID();
//get dynamic global properties
function getDynamicGlobalProperties();
//get block object
function getObject(String $object_id);
//get block objects
function getObjects(Array $object_ids);
// get block by block height
function getBlock(Integer $blockHeight);
//send transfer request to entryPoint node
function transfer(String $to, String $memo, String $amount_asset, Boolean $broadcast, String $fee_paying_asset);
//vote for accounts
function vote(Array $accounts, String $fee_paying_asset, Boolean $broadcast);
//broadcast transaction
function broadcast(Object $tx)
```

Faucet API
----------

[](#faucet-api)

```
//register gxchain account
function register(String $account, String $activeKey, String $ownerKey, String $memoKey, String $faucet);
```

Account API
-----------

[](#account-api)

```
// get account info by account name
function getAccount(String $account_name);
//get account_ids by public key
function getAccountByPublicKey(String $publicKey);
//get account balances by account name
function getAccountBalances(String $account_name);
```

Asset API
---------

[](#asset-api)

```
//get asset info by symbol
function getAsset(String $symbol);
```

Contract API
------------

[](#contract-api)

```
// call smart contract method
function callContract(String $contract_name, String $method_name, Object $params, String $amount_asset, Boolean $broadcast, String $fee_paying_asset);
// create smart contract method
function createContract(String $contract_name, String $code, Object $abi, String $vm_type, String $vm_version, Boolean $broadcast, String $fee_paying_asset);
// update smart contract method
function updateContract(String $contract_name, String $newOwner, String $code, Object $abi, Boolean $broadcast, String $fee_paying_asset);
//get contract table by contract_name
function getContractTable(String $contract_name)
//get contract abi by contract_name
function getContractABI(String $contract_name)
public List getContractTable(String contractName);
//get contract table objects
function getTableObjects(String $contract_name, String $table_name, Integer $start, Integer $limit)
```

Staking API
-----------

[](#staking-api)

```
// get staking programs method
function getStakingPrograms();
// create staking method
function createStaking(String $to, Number $amount, String program_id, Boolean $broadcast, Array $options);
// update staking method
function updateStaking(String $to, String $staking_id, Boolean $broadcast, Array $options);
// claim staking method
function claimStaking(String $staking_id, Boolean $broadcast, Array $options)
```

Usage
=====

[](#usage)

```
require "vendor/autoload.php";

use GXChain\GXClient\GXClient;

$client = new GXClient();

$keyPair = $client->generateKey();

echo(json_encode($keyPair));
```

For more examples, please refer to the examples directory.

Other
=====

[](#other)

- It's very welcome for developers to translate this project into different programing languages
- We are looking forward to your pull requests

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~31 days

Recently: every ~38 days

Total

6

Last Release

2467d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/90efa60df79dd100255ae85f0eef20c89f4e49a2ef88eba0e584dff42fe30577?d=identicon)[xLogic](/maintainers/xLogic)

---

Top Contributors

[![kilmas](https://avatars.githubusercontent.com/u/15965206?v=4)](https://github.com/kilmas "kilmas (6 commits)")[![lanhaoxiang](https://avatars.githubusercontent.com/u/3286465?v=4)](https://github.com/lanhaoxiang "lanhaoxiang (4 commits)")[![xlogiccc](https://avatars.githubusercontent.com/u/24650108?v=4)](https://github.com/xlogiccc "xlogiccc (3 commits)")[![xzshinan](https://avatars.githubusercontent.com/u/7299894?v=4)](https://github.com/xzshinan "xzshinan (2 commits)")

---

Tags

phpapisdkcryptorpcblockchaingxcgxclient

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/gxchain-gxclient/health.svg)

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[manamine/php-eos-rpc-sdk

PHP SDK for the EOS RPC API

187.5k](/packages/manamine-php-eos-rpc-sdk)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[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)
