PHPackages                             kilvn/geth-token-jsonrpc-php-client - 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. kilvn/geth-token-jsonrpc-php-client

ActiveLibrary[API Development](/categories/api)

kilvn/geth-token-jsonrpc-php-client
===================================

token API client lib for communication with geth (go-ethereum) node.

1.0.1(5y ago)012MITPHPPHP &gt;= 7.4

Since Sep 28Pushed 5y agoCompare

[ Source](https://github.com/kilvn/geth-token-jsonrpc-php-client)[ Packagist](https://packagist.org/packages/kilvn/geth-token-jsonrpc-php-client)[ RSS](/packages/kilvn-geth-token-jsonrpc-php-client/feed)WikiDiscussions master Synced 3w ago

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

ETH Contact For PHP Json-Rpc API
================================

[](#eth-contact-for-php-json-rpc-api)

forked from [wax-api](https://github.com/waxio/wax-api)

This class allows anyone to send or receive WAX easily from PHP. It can be used either on the command line, or in a web server. It will work on PHP 5.6 or higher.

To get started, you will need these PHP modules:

- bcmath
- curl

You will also need to install [Geth](https://geth.ethereum.org/downloads/) and enable its JSON-RPC API.

Due to precision concerns, all amounts are represented as strings. For example, 1.2345 WAX will be returned as `"1.2345"`.

Install
=======

[](#install)

```
composer require kilvn/geth-token-jsonrpc-php-client
```

Demos
=====

[](#demos)

There are some demos available under demo/

Usage
=====

[](#usage)

```
use Kilvn\GethTokenJsonRpcPhpClient;

$wax = new Wax($rpcHost, $rpcPort [, $trimTrailingZeroes, $timeout]);
$wax->setContract($contract_address, $contract_decimals);
```

- `$rpcHost` - This should be the host where your Geth JSON-RPC is available, e.g. `"127.0.0.1"`, Or you can use someone else's node, such as: `https://mainnet.infura.io/v3/xxxx`, In this case, you need to pass in an empty string as `$rpcPort`, because this method does not need to tell what the interface port is
- `$rpcPort` - This should be the port where your Geth JSON-RPC is available. This is optional and defaults to `8545` or empty string
- `$contract_address` Contract address, you must tell the contract location to make the api work properly
- `$contract_decimals` The number of decimal places when the contract is released, The type must be of type int
- `$trimTrailingZeroes` - If true, then WAX balances and amounts will have trailing zeroes removed
- `$timeout` The time for curl to send request timeout, the default is 60 seconds

Instantiates a new `Wax` instance.

### getChecksumAddress($address)

[](#getchecksumaddressaddress)

- `$address` - The WAX address that you wish to checksum

Returns the address you input, with capitalization in the standard [EIP-55](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md) format.

### verifyAddressValid($address)

[](#verifyaddressvalidaddress)

- `$address` - The WAX address that you wish to validate

Verifies that the address you input is valid by making sure its checksum checks out. If it does not have a case-checksum, simply returns true. Returns `true` or `false`.

### getPeerCount()

[](#getpeercount)

Gets and returns the number of peers connected to your `Geth`.

### getSyncStatus()

[](#getsyncstatus)

Gets and returns an array containing your `Geth`'s sync status, or `null` if it's not syncing.

### getBlockNumber()

[](#getblocknumber)

Gets and returns the number of the highest block your `Geth` has.

### getAddresses()

[](#getaddresses)

Gets and returns an array of all addresses with private keys stored by your `Geth`.

### getWaxBalance($address)

[](#getwaxbalanceaddress)

- `$address` - The address whose WAX balance you're interested in

Gets and returns the WAX balance of a particular address, which doesn't need to be your own. The return is a string.

### sendWax($fromAddress, $toAddress, $amount)

[](#sendwaxfromaddress-toaddress-amount)

- `$fromAddress` - The address from which you want to send WAX
- `$toAddress` - The address to which you want to send WAX
- `$amount` - The amount of WAX you want to send, as a string (e.g. "1.23456")

Sends some WAX from an address you control to another address immediately. Returns the hash of the resulting transaction.

The address must be unlocked. You can automatically unlock addresses using the Geth command line.

### createNewPendingTransactionFilter()

[](#createnewpendingtransactionfilter)

Creates a new filter in Geth for pending transactions. Get the new transactions using `getNewWaxTransactions`. Returns a string containing the filter's ID.

### getNewWaxTransactions($filterId)

[](#getnewwaxtransactionsfilterid)

- `$filterId` - The ID of the filter you wish to receive data from

Returns an array containing transaction data for every new WAX transaction that has been broadcast since you last called `getNewWaxTransactions` for this `$filterId`. Each array element contains the same elements as `getTransactionByHash`.

### getTransactionByHash($hash)

[](#gettransactionbyhashhash)

- `$hash` - The hash of the transaction you want details for

Returns an array containing these elements:

- `fromAddress` - The address which sent the WAX
- `toAddress` - The address which received the WAX
- `amount` - The amount of WAX transacted
- `hash` - The hash of the transaction
- `blockHash` - The hash of the block in which the transaction was included
- `blockNumber` - The number of the block in which the transaction was included
- `gas` - The amount of gas used to send this transaction
- `gasPrice` - The price in wei of gas for this transaction
- `confirmations` - How many confirmations this transaction has

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% 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 ~0 days

Total

2

Last Release

2104d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16423601?v=4)[Amazing Watermelon](/maintainers/kilvn)[@kilvn](https://github.com/kilvn)

---

Top Contributors

[![kilvn](https://avatars.githubusercontent.com/u/16423601?v=4)](https://github.com/kilvn "kilvn (12 commits)")[![DoctorMcKay](https://avatars.githubusercontent.com/u/1538723?v=4)](https://github.com/DoctorMcKay "DoctorMcKay (1 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kilvn-geth-token-jsonrpc-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/kilvn-geth-token-jsonrpc-php-client/health.svg)](https://phpackages.com/packages/kilvn-geth-token-jsonrpc-php-client)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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