{"id":34007244,"url":"https://github.com/iconation/icon-sdk-php","last_synced_at":"2026-04-10T10:02:43.386Z","repository":{"id":46259907,"uuid":"168852598","full_name":"iconation/icon-sdk-php","owner":"iconation","description":" ICON SDK for PHP (Unofficial)","archived":false,"fork":false,"pushed_at":"2023-07-24T00:38:04.000Z","size":121,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-14T22:53:01.822Z","etag":null,"topics":["icon","icx","php","sdk"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iconation.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2019-02-02T16:38:32.000Z","updated_at":"2024-09-27T19:35:15.000Z","dependencies_parsed_at":"2022-09-04T13:50:16.525Z","dependency_job_id":null,"html_url":"https://github.com/iconation/icon-sdk-php","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/iconation/icon-sdk-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iconation%2Ficon-sdk-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iconation%2Ficon-sdk-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iconation%2Ficon-sdk-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iconation%2Ficon-sdk-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iconation","download_url":"https://codeload.github.com/iconation/icon-sdk-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iconation%2Ficon-sdk-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31637748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["icon","icx","php","sdk"],"created_at":"2025-12-13T11:02:32.179Z","updated_at":"2026-04-10T10:02:43.378Z","avatar_url":"https://github.com/iconation.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg \n    src=\"https://iconation.team/images/very_small.png\" \n    width=\"120px\"\n    alt=\"ICONation logo\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eICON SDK for PHP\u003c/h1\u003e\n\n [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n \nThis is an SDK to communicate with the ICON blockchain, built for PHP.\n\nDisclaimer: I cannot guarantee optimal performance of this software.\nIt is provided as is and without any assurances. Use it at your own risk.\n\nFeatures\n--------\nFully or partially supports all Iconservice functions, IRC-2 tokens and IISS calls.\n\nRequirements \u0026 Installation\n--------\nMake sure you're using \u003e=php7.2. Then check if you already have or install the required php extensions:\n\n```shell script\napt install php-curl php-xml php-gmp php-bcmath\n```\n\nRequire the package in the `composer.json` file in your project:\n```shell script\ncomposer require iconation/icon-sdk-php --no-dev\n```\nTesting\n--------\n\n```shell script\napt install php-mbstring\ncomposer install\ncomposer test\n```\n\nUsage\n--------\n#### Iconservice:\n* icx_getLastBlock\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n\n$res = $iconservice-\u003egetLastBlock();\n```\n* icx_getBlockByHeight\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n\n$res = $iconservice-\u003egetBlockByHeight('0x3');\n```\n* icx_getBlockByHash\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n\n$res = $iconservice-\u003egetBlockByHash('0x123986e1c834632f6e65915c249d81cd01453ec915e3370d364d6df7be5e6c03');\n```\n* icx_call\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n\n$score = \"cx9ab3078e72c8d9017194d17b34b1a47b661945ca\";\n$params = new stdClass();\n$params-\u003emethod = \"balanceOf\";\n$params-\u003eparams = new stdClass();\n$params-\u003eparams-\u003e_owner = \"hx70e8eeb5d23ab18a828ec95f769db6d953e5f0fd\";\n\n$res = $iconservice-\u003ecall($score, $params);\n```\n* icx_getBalance\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n\n$res = $iconservice-\u003egetBalance('hx70e8eeb5d23ab18a828ec95f769db6d953e5f0fd');\n```\n* icx_getScoreApi\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n\n$score = \"cx9ab3078e72c8d9017194d17b34b1a47b661945ca\";\n$res = $iconservice-\u003egetBalance($score);\n```\n* icx_getTotalSupply\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n\n$res = $iconservice-\u003egetTotalSupply();\n```\n* icx_getTransactionResult\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n\n$txHash = '0xb89690b7598e07c286db87f05c1ee4cfc1cf915bf061007ac3404a42dc4979e9';\n\n$res = $iconservice-\u003egetTransactionResult($txHash);\n```\n* icx_getTransactionByHash\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n\n$txHash = '0xb89690b7598e07c286db87f05c1ee4cfc1cf915bf061007ac3404a42dc4979e9';\n\n$res = $iconservice-\u003egetTransactionByHash($txHash);\n```\n* ise_getStatus\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n\n$keys = ['lastBlock'];\n\n$res = $iconservice-\u003egetStatus($keys);\n```\n* icx_sendTransaction\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n\n$private_key = \"3468ea815d8896ef4552f10768caf2660689b965975c3ec2c1f5fe84bc3a77a5\"; //Sender's private key\n$from = \"hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160\";\n$to = \"hxf8689d6c4c8f333651469fdea2ac59a18f6c242d\";\n$value = \"0x2386f26fc10000\"; // = 0.01 ICX\n\n$res = $iconservice-\u003esend($from, $to, $value, $private_key);\n```\n* message\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n\n$private_key = \"3468ea815d8896ef4552f10768caf2660689b965975c3ec2c1f5fe84bc3a77a5\"; //Sender's private key\n$from = \"hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160\";\n$to = \"hxf8689d6c4c8f333651469fdea2ac59a18f6c242d\";\n$message = \"Your message goes here\"; // = 0.01 ICX\n\n$res = $iconservice-\u003emessage($from, $to, $private_key, $message);\n```\n### IRC-2:\n* name\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\nuse iconation\\IconSDK\\IconService\\IRC2;\n\n$contract = 'cx8901ee4f6df58bd437de0e66c9dd3385ba4c2328';\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n$irc2 = new IRC2($contract, $iconservice);\n\n$res = $irc2-\u003ename();\n```\n* symbol\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\nuse iconation\\IconSDK\\IconService\\IRC2;\n\n$contract = 'cx8901ee4f6df58bd437de0e66c9dd3385ba4c2328';\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n$irc2 = new IRC2($contract, $iconservice);\n\n$res = $irc2-\u003esymbol();\n```\n* decimals\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\nuse iconation\\IconSDK\\IconService\\IRC2;\n\n$contract = 'cx8901ee4f6df58bd437de0e66c9dd3385ba4c2328';\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n$irc2 = new IRC2($contract, $iconservice);\n\n$res = $irc2-\u003edecimals();\n```\n* totalSupply\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\nuse iconation\\IconSDK\\IconService\\IRC2;\n\n$contract = 'cx8901ee4f6df58bd437de0e66c9dd3385ba4c2328';\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n$irc2 = new IRC2($contract, $iconservice);\n\n$res = $irc2-\u003etotalSupply();\n```\n* balanceOf\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\nuse iconation\\IconSDK\\IconService\\IRC2;\n\n$contract = 'cx8901ee4f6df58bd437de0e66c9dd3385ba4c2328';\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n$irc2 = new IRC2($contract, $iconservice);\n\n$account = 'hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160';\n\n$res = $irc2-\u003ebalanceOf($account);\n```\n* transfer\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\nuse iconation\\IconSDK\\IconService\\IRC2;\n\n$contract = 'cx8901ee4f6df58bd437de0e66c9dd3385ba4c2328';\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n$irc2 = new IRC2($contract, $iconservice);\n\n$from = 'hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160';\n$to = 'hxf8689d6c4c8f333651469fdea2ac59a18f6c242d';\n$value = '1';\n$privateKey = '3468ea815d8896ef4552f10768caf2660689b965975c3ec2c1f5fe84bc3a77a5';\n\n$res = $irc2-\u003etransfer($from, $to, $value, $privateKey);\n```\n\n\n### IISS:\n* setStake\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\nuse iconation\\IconSDK\\IISS\\IISS;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n$iiss = new IISS($iconservice);\n\n$value = 0.5; //Stake 0.5 ICX\n$from = \"hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160\";\n$private_key = \"3468ea815d8896ef4552f10768caf2660689b965975c3ec2c1f5fe84bc3a77a5\"; //Staker's private key\n\n$res = $iiss-\u003esetStake($value, $from, $private_key);\n```\n* getStake\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\nuse iconation\\IconSDK\\IISS\\IISS;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n$iiss = new IISS($iconservice);\n\n$address = \"hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160\";\n\n$res = $iiss-\u003egetStake($address);\n```\n* setDelegation\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\nuse iconation\\IconSDK\\IISS\\IISS;\nuse iconation\\IconSDK\\IISS\\Delegation;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n$iiss = new IISS($iconservice);\n\n$delegation1 = new Delegation(\"hxec79e9c1c882632688f8c8f9a07832bcabe8be8f\", \"0x2c68af0bb140000\");\n$delegation1 = $delegation1-\u003egetDelegationObject();\n\n$delegation2 = new Delegation(\"hxd3be921dfe193cd49ed7494a53743044e3376cd3\", \"0x2c68af0bb140000\");\n$delegation2 = $delegation2-\u003egetDelegationObject();\n\n$delegations = array(\n                $delegation1, \n                $delegation2\n               );\n$private_key = \"3468ea815d8896ef4552f10768caf2660689b965975c3ec2c1f5fe84bc3a77a5\"; //Staker's private key\n$from = \"hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160\";\n\n$res = $iiss-\u003esetDelegation($delegations, $from, $private_key);\n```\n* getDelegation\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\nuse iconation\\IconSDK\\IISS\\IISS;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n$iiss = new IISS($iconservice);\n\n$address = \"hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160\";\n\n$res = $iiss-\u003egetDelegation($address);\n```\n* claimIScore\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\nuse iconation\\IconSDK\\IISS\\IISS;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n$iiss = new IISS($iconservice);\n\n$private_key = \"3468ea815d8896ef4552f10768caf2660689b965975c3ec2c1f5fe84bc3a77a5\"; //Staker's private key\n$from = \"hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160\";\n\n$res = $iiss-\u003eclaimIScore($from, $private_key);\n```\n* queryIScore\n```php\nuse iconation\\IconSDK\\IconService\\IconService;\nuse iconation\\IconSDK\\IISS\\IISS;\n\n$iconservice = new IconService('https://ctz.solidwallet.io/api/v3');\n$iiss = new IISS($iconservice);\n\n$address = \"hx8dc6ae3d93e60a2dddf80bfc5fb1cd16a2bf6160\";\n\n$res = $iiss-\u003equeryIScore($address);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficonation%2Ficon-sdk-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficonation%2Ficon-sdk-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficonation%2Ficon-sdk-php/lists"}