PHPackages                             iconation/icon-sdk-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. iconation/icon-sdk-php

ActiveLibrary[API Development](/categories/api)

iconation/icon-sdk-php
======================

SDK to communicate with the ICON blockchain

v1.2.2(4y ago)620.3k↓33.3%1MITPHPPHP &gt;=7.2CI failing

Since Jul 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/iconation/icon-sdk-php)[ Packagist](https://packagist.org/packages/iconation/icon-sdk-php)[ RSS](/packages/iconation-icon-sdk-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (14)Used By (0)

 [![ICONation logo](https://camo.githubusercontent.com/936c80171f3d89ec6f51ba00ef3715bcf83aef6f3d5b1dc69b9c809fc6574741/68747470733a2f2f69636f6e6174696f6e2e7465616d2f696d616765732f766572795f736d616c6c2e706e67)](https://camo.githubusercontent.com/936c80171f3d89ec6f51ba00ef3715bcf83aef6f3d5b1dc69b9c809fc6574741/68747470733a2f2f69636f6e6174696f6e2e7465616d2f696d616765732f766572795f736d616c6c2e706e67)

ICON SDK for PHP
================

[](#icon-sdk-for-php)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

This is an SDK to communicate with the ICON blockchain, built for PHP.

Disclaimer: I cannot guarantee optimal performance of this software. It is provided as is and without any assurances. Use it at your own risk.

Features
--------

[](#features)

Fully or partially supports all Iconservice functions, IRC-2 tokens and IISS calls.

Requirements &amp; Installation
-------------------------------

[](#requirements--installation)

Make sure you're using &gt;=php7.2. Then check if you already have or install the required php extensions:

```
apt install php-curl php-xml php-gmp php-bcmath
```

Require the package in the `composer.json` file in your project:

```
composer require iconation/icon-sdk-php --no-dev
```

Testing
-------

[](#testing)

```
apt install php-mbstring
composer install
composer test
```

Usage
-----

[](#usage)

#### Iconservice:

[](#iconservice)

- icx\_getLastBlock

```
use iconation\IconSDK\IconService\IconService;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');

$res = $iconservice->getLastBlock();
```

- icx\_getBlockByHeight

```
use iconation\IconSDK\IconService\IconService;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');

$res = $iconservice->getBlockByHeight('0x3');
```

- icx\_getBlockByHash

```
use iconation\IconSDK\IconService\IconService;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');

$res = $iconservice->getBlockByHash('0x123986e1c834632f6e65915c249d81cd01453ec915e3370d364d6df7be5e6c03');
```

- icx\_call

```
use iconation\IconSDK\IconService\IconService;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');

$score = "cx9ab3078e72c8d9017194d17b34b1a47b661945ca";
$params = new stdClass();
$params->method = "balanceOf";
$params->params = new stdClass();
$params->params->_owner = "hx70e8eeb5d23ab18a828ec95f769db6d953e5f0fd";

$res = $iconservice->call($score, $params);
```

- icx\_getBalance

```
use iconation\IconSDK\IconService\IconService;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');

$res = $iconservice->getBalance('hx70e8eeb5d23ab18a828ec95f769db6d953e5f0fd');
```

- icx\_getScoreApi

```
use iconation\IconSDK\IconService\IconService;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');

$score = "cx9ab3078e72c8d9017194d17b34b1a47b661945ca";
$res = $iconservice->getBalance($score);
```

- icx\_getTotalSupply

```
use iconation\IconSDK\IconService\IconService;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');

$res = $iconservice->getTotalSupply();
```

- icx\_getTransactionResult

```
use iconation\IconSDK\IconService\IconService;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');

$txHash = '0xb89690b7598e07c286db87f05c1ee4cfc1cf915bf061007ac3404a42dc4979e9';

$res = $iconservice->getTransactionResult($txHash);
```

- icx\_getTransactionByHash

```
use iconation\IconSDK\IconService\IconService;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');

$txHash = '0xb89690b7598e07c286db87f05c1ee4cfc1cf915bf061007ac3404a42dc4979e9';

$res = $iconservice->getTransactionByHash($txHash);
```

- ise\_getStatus

```
use iconation\IconSDK\IconService\IconService;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');

$keys = ['lastBlock'];

$res = $iconservice->getStatus($keys);
```

- icx\_sendTransaction

```
use iconation\IconSDK\IconService\IconService;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');

$private_key = "3468ea815d8896ef4552f10768caf2660689b965975c3ec2c1f5fe84bc3a77a5"; //Sender's private key
$from = "hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160";
$to = "hxf8689d6c4c8f333651469fdea2ac59a18f6c242d";
$value = "0x2386f26fc10000"; // = 0.01 ICX

$res = $iconservice->send($from, $to, $value, $private_key);
```

- message

```
use iconation\IconSDK\IconService\IconService;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');

$private_key = "3468ea815d8896ef4552f10768caf2660689b965975c3ec2c1f5fe84bc3a77a5"; //Sender's private key
$from = "hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160";
$to = "hxf8689d6c4c8f333651469fdea2ac59a18f6c242d";
$message = "Your message goes here"; // = 0.01 ICX

$res = $iconservice->message($from, $to, $private_key, $message);
```

### IRC-2:

[](#irc-2)

- name

```
use iconation\IconSDK\IconService\IconService;
use iconation\IconSDK\IconService\IRC2;

$contract = 'cx8901ee4f6df58bd437de0e66c9dd3385ba4c2328';
$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');
$irc2 = new IRC2($contract, $iconservice);

$res = $irc2->name();
```

- symbol

```
use iconation\IconSDK\IconService\IconService;
use iconation\IconSDK\IconService\IRC2;

$contract = 'cx8901ee4f6df58bd437de0e66c9dd3385ba4c2328';
$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');
$irc2 = new IRC2($contract, $iconservice);

$res = $irc2->symbol();
```

- decimals

```
use iconation\IconSDK\IconService\IconService;
use iconation\IconSDK\IconService\IRC2;

$contract = 'cx8901ee4f6df58bd437de0e66c9dd3385ba4c2328';
$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');
$irc2 = new IRC2($contract, $iconservice);

$res = $irc2->decimals();
```

- totalSupply

```
use iconation\IconSDK\IconService\IconService;
use iconation\IconSDK\IconService\IRC2;

$contract = 'cx8901ee4f6df58bd437de0e66c9dd3385ba4c2328';
$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');
$irc2 = new IRC2($contract, $iconservice);

$res = $irc2->totalSupply();
```

- balanceOf

```
use iconation\IconSDK\IconService\IconService;
use iconation\IconSDK\IconService\IRC2;

$contract = 'cx8901ee4f6df58bd437de0e66c9dd3385ba4c2328';
$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');
$irc2 = new IRC2($contract, $iconservice);

$account = 'hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160';

$res = $irc2->balanceOf($account);
```

- transfer

```
use iconation\IconSDK\IconService\IconService;
use iconation\IconSDK\IconService\IRC2;

$contract = 'cx8901ee4f6df58bd437de0e66c9dd3385ba4c2328';
$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');
$irc2 = new IRC2($contract, $iconservice);

$from = 'hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160';
$to = 'hxf8689d6c4c8f333651469fdea2ac59a18f6c242d';
$value = '1';
$privateKey = '3468ea815d8896ef4552f10768caf2660689b965975c3ec2c1f5fe84bc3a77a5';

$res = $irc2->transfer($from, $to, $value, $privateKey);
```

### IISS:

[](#iiss)

- setStake

```
use iconation\IconSDK\IconService\IconService;
use iconation\IconSDK\IISS\IISS;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');
$iiss = new IISS($iconservice);

$value = 0.5; //Stake 0.5 ICX
$from = "hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160";
$private_key = "3468ea815d8896ef4552f10768caf2660689b965975c3ec2c1f5fe84bc3a77a5"; //Staker's private key

$res = $iiss->setStake($value, $from, $private_key);
```

- getStake

```
use iconation\IconSDK\IconService\IconService;
use iconation\IconSDK\IISS\IISS;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');
$iiss = new IISS($iconservice);

$address = "hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160";

$res = $iiss->getStake($address);
```

- setDelegation

```
use iconation\IconSDK\IconService\IconService;
use iconation\IconSDK\IISS\IISS;
use iconation\IconSDK\IISS\Delegation;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');
$iiss = new IISS($iconservice);

$delegation1 = new Delegation("hxec79e9c1c882632688f8c8f9a07832bcabe8be8f", "0x2c68af0bb140000");
$delegation1 = $delegation1->getDelegationObject();

$delegation2 = new Delegation("hxd3be921dfe193cd49ed7494a53743044e3376cd3", "0x2c68af0bb140000");
$delegation2 = $delegation2->getDelegationObject();

$delegations = array(
                $delegation1,
                $delegation2
               );
$private_key = "3468ea815d8896ef4552f10768caf2660689b965975c3ec2c1f5fe84bc3a77a5"; //Staker's private key
$from = "hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160";

$res = $iiss->setDelegation($delegations, $from, $private_key);
```

- getDelegation

```
use iconation\IconSDK\IconService\IconService;
use iconation\IconSDK\IISS\IISS;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');
$iiss = new IISS($iconservice);

$address = "hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160";

$res = $iiss->getDelegation($address);
```

- claimIScore

```
use iconation\IconSDK\IconService\IconService;
use iconation\IconSDK\IISS\IISS;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');
$iiss = new IISS($iconservice);

$private_key = "3468ea815d8896ef4552f10768caf2660689b965975c3ec2c1f5fe84bc3a77a5"; //Staker's private key
$from = "hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160";

$res = $iiss->claimIScore($from, $private_key);
```

- queryIScore

```
use iconation\IconSDK\IconService\IconService;
use iconation\IconSDK\IISS\IISS;

$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');
$iiss = new IISS($iconservice);

$address = "hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160";

$res = $iiss->queryIScore($address);
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 96.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 ~83 days

Recently: every ~128 days

Total

11

Last Release

1657d ago

Major Versions

v0.1.4 → v1.0.02020-06-08

PHP version history (2 changes)v0.1.0PHP &gt;=7.1

v1.1.0PHP &gt;=7.2

### Community

Maintainers

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

---

Top Contributors

[![mitsosf](https://avatars.githubusercontent.com/u/15949934?v=4)](https://github.com/mitsosf "mitsosf (56 commits)")[![Spl3en](https://avatars.githubusercontent.com/u/3105948?v=4)](https://github.com/Spl3en "Spl3en (2 commits)")

---

Tags

iconicxphpsdkiconicx

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/iconation-icon-sdk-php/health.svg)

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

###  Alternatives

[iexbase/tron-api

A PHP API for interacting with Tron (Trx)

437136.9k8](/packages/iexbase-tron-api)[drlecks/simple-web3-php

Web3 library in PHP

7641.6k2](/packages/drlecks-simple-web3-php)[hardcastle/xrpl_php

PHP SDK / Client for the XRP Ledger

129.7k5](/packages/hardcastle-xrpl-php)[fenguoz/tron-api

A PHP API for interacting with Tron (Trx)

1146.8k3](/packages/fenguoz-tron-api)[takpesar/tron

A PHP library to create Tron wallet addresses and manage wallets using the Tron API

183.2k](/packages/takpesar-tron)

PHPackages © 2026

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