{"id":15068526,"url":"https://github.com/make-software/casper-php-sdk","last_synced_at":"2025-10-14T06:38:27.719Z","repository":{"id":39405569,"uuid":"406937464","full_name":"make-software/casper-php-sdk","owner":"make-software","description":"PHP SDK to interact with the Casper Network nodes via RPC","archived":false,"fork":false,"pushed_at":"2025-02-14T08:37:48.000Z","size":436,"stargazers_count":9,"open_issues_count":2,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-10T18:03:24.157Z","etag":null,"topics":["blockchain","casper-network","php","sdk"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/make-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-15T22:07:58.000Z","updated_at":"2025-01-23T12:23:12.000Z","dependencies_parsed_at":"2023-11-28T15:45:41.735Z","dependency_job_id":"6f584053-dc3c-4628-b5db-78bd7c01dabb","html_url":"https://github.com/make-software/casper-php-sdk","commit_stats":{"total_commits":116,"total_committers":7,"mean_commits":"16.571428571428573","dds":"0.18103448275862066","last_synced_commit":"631c35187ba2ae3968d418a02ba2f18925d29e16"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/make-software/casper-php-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/make-software%2Fcasper-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/make-software%2Fcasper-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/make-software%2Fcasper-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/make-software%2Fcasper-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/make-software","download_url":"https://codeload.github.com/make-software/casper-php-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/make-software%2Fcasper-php-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261897003,"owners_count":23226648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["blockchain","casper-network","php","sdk"],"created_at":"2024-09-25T01:37:57.735Z","updated_at":"2025-10-14T06:38:22.682Z","avatar_url":"https://github.com/make-software.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# casper-php-sdk\nThe PHP SDK allows developers to interact with the Casper Network using PHP. This page covers different examples of using the SDK.\n\n## Install\n```\ncomposer require make-software/casper-php-sdk\n```\n\n## Usage\n### Creating RpcClient\nCreate `RpcClient` by passing node url and headers (optional) to constructor\n```php\n$nodeUrl = 'http://127.0.0.1:7777';\n$headers = array('Authorization' =\u003e 'Bearer 6ae6c8b31f09df244019ffef60c274e4'); // Optional\n\n$client = new Casper\\Rpc\\RpcClient($nodeUrl, $headers);\n```\n\n### RPC call examples\nYou can find all RpcClient methods on the [RpcClientAPI page](docs/API/RpcClientAPI.md). Here you can see a several of examples of using RpcClient. All examples below are supposed to be ran against the Testnet\n\n#### Get deploy by deploy hash\n```php\n$deploy = $client-\u003egetDeploy('fa815fc43c38da30f6ab4e5a6c8a1b31f09df2bf4b344019ffef60c1270d4e49');\n\n$deployHeader = $deploy-\u003egetHeader();\n$creationTime = $deployHeader-\u003egetTimestamp();\n```\n\n#### Get auction state information\n```php\n$auctionState = $client-\u003egetAuctionState();\n\n$stateRootHash = $auctionState-\u003egetStateRootHash();\n$blockHeight = $auctionState-\u003egetBlockHeight();\n```\n\n#### Get peers from the network\n```php\n$peers = $client-\u003egetPeers();\n\nforeach ($peers as $peer) {\n    ...\n}\n```\n\n#### Get the latest block information\n```php\n$latestBlock = $client-\u003egetLatestBlock();\n$latestBlockHash = $latestBlock-\u003egetHash();\n```\n\n## More examples\n- [Key management](docs/Example/KeyManagement.md)\n- [Sending a Transfer](docs/Example/SendingTransfer.md)\n- CEP78\n    - [Install](docs/Example/CEP78/Install.md)\n    - [Mint](docs/Example/CEP78/Mint.md)\n\n## API\n### RpcClient\n- [RpcClient](docs/API/RpcClientAPI.md#Constructor)\n- [putDeploy](docs/API/RpcClientAPI.md#Put-deploy)\n- [getDeploy](docs/API/RpcClientAPI.md#Get-deploy)\n- [getBlockByHash](docs/API/RpcClientAPI.md#Get-block-by-hash)\n- [getBlockByHeight](docs/API/RpcClientAPI.md#Get-block-by-height)\n- [getLatestBlock](docs/API/RpcClientAPI.md#Get-the-latest-block)\n- [getPeers](docs/API/RpcClientAPI.md#Get-peers)\n- [getStatus](docs/API/RpcClientAPI.md#Get-status)\n- [getAuctionState](docs/API/RpcClientAPI.md#Get-auction-state)\n- [getStateRootHash](docs/API/RpcClientAPI.md#Get-state-root-hash)\n- [getAccount](docs/API/RpcClientAPI.md#Get-account)\n- [getAccountBalance](docs/API/RpcClientAPI.md#Get-account-balance)\n- [getAccountBalanceUrefByAccountHash](docs/API/RpcClientAPI.md#Get-account-balance-URef-by-account-hash)\n- [getAccountBalanceUrefByPublicKey](docs/API/RpcClientAPI.md#Get-account-balance-URef-by-public-key)\n- [getBlockState](docs/API/RpcClientAPI.md#Get-block-state)\n- [getBlockTransfers](docs/API/RpcClientAPI.md#Get-block-transfers)\n- [getEraSummaryBySwitchBlockHash](docs/API/RpcClientAPI.md#Get-era-summary-by-switch-block-hash)\n- [getEraSummaryBySwitchBlockHeight](docs/API/RpcClientAPI.md#Get-era-summary-by-switch-block-height)\n- [getDictionaryItemByURef](docs/API/RpcClientAPI.md#Get-dictionary-item)\n- [getGlobalStateByBlock](docs/API/RpcClientAPI.md#Get-global-state-by-block)\n- [getGlobalStateByStateRootHash](docs/API/RpcClientAPI.md#Get-global-state-by-state-root-hash)\n- [queryBalance](docs/API/RpcClientAPI.md#Query-balance)\n- [getChainspecInfo](docs/API/RpcClientAPI.md#Get-chainspec-info)\n- [speculativeExecution](docs/API/RpcClientAPI.md#Speculative-execution)\n\n### DeployService\n- [makeDeploy](docs/API/DeployServiceAPI.md#Make-deploy)\n- [signDeploy](docs/API/DeployServiceAPI.md#Sign-deploy)\n- [validateDeploy](docs/API/DeployServiceAPI.md#Validate-deploy)\n- [getDeploySize](docs/API/DeployServiceAPI.md#Get-deploy-size)\n\n### ContractService\n- [ContractService](docs/API/ContractServiceAPI.md#Constructor)\n- [createInstallDeploy](docs/API/ContractServiceAPI.md#Create-Install-deploy)\n- [install](docs/API/ContractServiceAPI.md#Install)\n- [createCallEntryPointDeploy](docs/API/ContractServiceAPI.md#Create-CallEntryPoint-deploy)\n- [callEntryPoint](docs/API/ContractServiceAPI.md#Call-entrypoint)\n\n## Entities\n- [Account](docs/Entity/Account.md)\n- [AuctionState](docs/Entity/AuctionState.md)\n- [Block](docs/Entity/Block.md)\n- [Deploy](docs/Entity/Deploy.md)\n- [EraSummary](docs/Entity/EraSummary.md)\n- [Transfer](docs/Entity/Transfer.md)\n\n## Testing\nRun the following command from the project directory. \n\n**Replace `http://127.0.0.1:7777` by the any Testnet node url before running**\n```shell\nexport CASPER_PHP_SDK_TEST_NODE_URL=\"http://127.0.0.1:7777\" \u0026\u0026 php vendor/bin/phpunit tests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmake-software%2Fcasper-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmake-software%2Fcasper-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmake-software%2Fcasper-php-sdk/lists"}