Skip to main content

A python SDK for Starknet

Project description

starknet.py

Starknet SDK for Python

codecov pypi build docs license stars starkware

📘 Documentation

⚙️ Installation

Installation varies between operating systems.

See our documentation on complete instructions

▶️ Example usage

Asynchronous API

This is the recommended way of using the SDK.

from starknet_py.contract import Contract
from starknet_py.net.full_node_client import FullNodeClient

contract = await Contract.from_address(
    address="0x06689f1bf69af5b8e94e5ab9778c885b37c593d1156234eb423967621f596e73",
    client=FullNodeClient(node_url="https://your.node.url"),
)
(value,) = await contract.functions["get_balance"].call()

Synchronous API

You can access synchronous world with _sync postfix.

from starknet_py.contract import Contract
from starknet_py.net.full_node_client import FullNodeClient

contract = Contract.from_address_sync(
    address="0x06689f1bf69af5b8e94e5ab9778c885b37c593d1156234eb423967621f596e73",
    client=FullNodeClient(node_url="https://your.node.url"),
)
(value,) = contract.functions["get_balance"].call_sync()

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_unbroken-0.24.4.tar.gz (92.5 kB view details)

Uploaded Source

Built Distribution

starknet_py_unbroken-0.24.4-py3-none-any.whl (138.6 kB view details)

Uploaded Python 3

File details

Details for the file starknet_py_unbroken-0.24.4.tar.gz.

File metadata

  • Download URL: starknet_py_unbroken-0.24.4.tar.gz
  • Upload date:
  • Size: 92.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.5 Linux/6.10.6-200.fc40.x86_64

File hashes

Hashes for starknet_py_unbroken-0.24.4.tar.gz
Algorithm Hash digest
SHA256 11f78eda4d5dd4ee9a4a780256f69577a2e56cf10acd0f5fcfa41bdb2e550658
MD5 1f05a7229c2573079615d01a7bb6ceb4
BLAKE2b-256 077f55c7314719db78766f50a7c6df4f65f2b4f2fd33ed8623ad175cae7a54bf

See more details on using hashes here.

File details

Details for the file starknet_py_unbroken-0.24.4-py3-none-any.whl.

File metadata

File hashes

Hashes for starknet_py_unbroken-0.24.4-py3-none-any.whl
Algorithm Hash digest
SHA256 628f529c89126f5b84eb07cad79b465bcb5e29cc58f7a3da84b1c7e51bfa71fd
MD5 0d16eae3702e088b8f3e593d4c5d4614
BLAKE2b-256 54d68036f74d3ebb1e5787359d25c284e1aa57969f41057b49e3ec8f9096aa17

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page