PHPackages                             starknet-php/starknet.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. starknet-php/starknet.php

ActiveLibrary[API Development](/categories/api)

starknet-php/starknet.php
=========================

PHP sdk that allows you to interact with StarkNet L2 network

12173[1 issues](https://github.com/Starknet-php/starknet.php/issues)PHP

Since Dec 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Starknet-php/starknet.php)[ Packagist](https://packagist.org/packages/starknet-php/starknet.php)[ RSS](/packages/starknet-php-starknetphp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

starknet.php ✨🐘
===============

[](#starknetphp-)

### starknet.php is a PHP sdk that allows you to interact with StarkNet from a PHP application.

[](#starknetphp-is-a-php-sdk-that-allows-you-to-interact-with-starknet-from-a-php-application)

 [![starkware](https://camo.githubusercontent.com/1ae5f0a2e031442c4caa6de329fdb3fe2e74dd5a98c23b0904fe076db6e531ed/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706f77657265645f62792d537461726b576172652d6e617679)](https://starkware.co) [![License](https://camo.githubusercontent.com/5e0abb27bc77af909f6e0c7cd00eee168f348ba6cbde1d3b1bcb5789c20477fd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c61636b)](https://github.com/Starknet-php/starknet.php/blob/main/LICENSE.md)

> This project is a work-in-progress. Code and documentation are currently under development and are subject to change

Install
-------

[](#install)

> **Requires [PHP 8.0+](https://php.net/releases/)**

Install `starknet.php` via the [Composer](https://getcomposer.org/) package manager:

```
composer require starknet-php/starknet.php
```

Usage
-----

[](#usage)

The following code can be used with a public and private key to create a signer

```
$wallet_address = '0x0006be19b8a602c2013deb97e2ad12b358d2f3fb2e3d4c1e96f047cb68fd8a8' // your wallet address
$pk = '' // your private key
$network = 'testnet' // can be testnet || mainnet
$signer = new Signer($pk, $network, $wallet_address);
```

The following code can be used to interact with a contract

```
$contract = '0x07394cbe418daa16e42b87ba67372d4ab4a5df0b05c6e554d158458ce245bc10' // the contract address to interact with
$method = Stark::getSelectorFromName('transfer') // the method to call
$calldata = ['0x060eb76c275ce5188b9e30b212776a68e037674331437fc028b072102b6fe181', '1200000000000000000', '0'] // the parameters to call with [to, amount, max]
$signer->addTransaction([
        'type'                 => 'INVOKE_FUNCTION',
        'contract_address' => $contract,
        'entry_point_selector' => $method,
        'calldata'             => $calldata,
    ]);
```

Testing
-------

[](#testing)

Tests were created using the pest testing package. To call tests run

```
./vendor/bin/pest
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for more details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Zac Whittaker](https://github.com/zascii)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4222e4f5c6f2be9328bd29f9235c2398a5727e86380035712dd52366733896fa?d=identicon)[ZacWhittaker](/maintainers/ZacWhittaker)

---

Top Contributors

[![zascii](https://avatars.githubusercontent.com/u/49066988?v=4)](https://github.com/zascii "zascii (18 commits)")

### Embed Badge

![Health badge](/badges/starknet-php-starknetphp/health.svg)

```
[![Health](https://phpackages.com/badges/starknet-php-starknetphp/health.svg)](https://phpackages.com/packages/starknet-php-starknetphp)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M452](/packages/google-gax)

PHPackages © 2026

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