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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: starknet_py_unbroken-0.24.5.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.5.tar.gz
Algorithm Hash digest
SHA256 489cd0cb69f5d5880a33dad5c172739d2e0bc42662571ed9491e8bc780677ce4
MD5 77db124f93916035a6b8ab063ae01c01
BLAKE2b-256 09948f27b6a91d53d959ea0e67a7fdac6c524dd237a13a3631a88e901711974a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for starknet_py_unbroken-0.24.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8e968170a45223894bec16001bae41cf39d4e3848d141632fa80153249ce6739
MD5 9116065703196c1566de3439f91b0cf6
BLAKE2b-256 3a364707c3684b91de130dc6914f2d68b20ea3e57d51d1c3a976bdb027910836

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