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


Release history Release notifications | RSS feed

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

Uploaded Source

File details

Details for the file starknet_py-0.24.0.tar.gz.

File metadata

  • Download URL: starknet_py-0.24.0.tar.gz
  • Upload date:
  • Size: 91.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for starknet_py-0.24.0.tar.gz
Algorithm Hash digest
SHA256 5c670942daff0e132ff276fe68c951f9cc5c7bc19b239acb4383be44bc55267e
MD5 b9c388057a20714e0c30bcf9d6eb9278
BLAKE2b-256 15f57ddd8e8cd926bf5a45676fd6ef9ab9fe9f1c008b35f09d72d8397e358f7a

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