Skip to main content

A python SDK for StarkNet

Project description

StarkNet SDK for Python

codecov pypi build docs license stars starkware

📘 Documentation

⚙️ Installation

To install this package run

pip install

or using Poetry:

poetry add

▶️ Example usage

Asynchronous API

This is the recommended way of using the SDK.

from starknet_py.contract import Contract
from import Client

key = 1234
contract = await Contract.from_address("0x01336fa7c870a7403aced14dda865b75f29113230ed84e3a661f7af70fe83e7b", Client("testnet"))
invocation = await contract.functions["set_value"].invoke(key, 7)
await invocation.wait_for_acceptance()

(saved,) = await contract.functions["get_value"].call(key) # 7

Synchronous API

You can access synchronous world with _sync postfix.

from starknet_py.contract import Contract
from import Client

key = 1234
contract = Contract.from_address_sync("0x01336fa7c870a7403aced14dda865b75f29113230ed84e3a661f7af70fe83e7b", Client("testnet"))
invocation = contract.functions["set_value"].invoke_sync(key, 7)

(saved,) = contract.functions["get_value"].call_sync(key) # 7

For more examples click here.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starknet_py-0.10.2a0.tar.gz (94.2 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page