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.gateway_client import GatewayClient

contract = await Contract.from_address(
    address="0x06689f1bf69af5b8e94e5ab9778c885b37c593d1156234eb423967621f596e73",
    client=GatewayClient("testnet"),
)
(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.gateway_client import GatewayClient

contract = Contract.from_address_sync(
    address="0x06689f1bf69af5b8e94e5ab9778c885b37c593d1156234eb423967621f596e73",
    client=GatewayClient("testnet"),
)
(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

brine_starknet_py-0.18.7.tar.gz (78.1 kB view details)

Uploaded Source

Built Distribution

brine_starknet_py-0.18.7-py3-none-any.whl (120.8 kB view details)

Uploaded Python 3

File details

Details for the file brine_starknet_py-0.18.7.tar.gz.

File metadata

  • Download URL: brine_starknet_py-0.18.7.tar.gz
  • Upload date:
  • Size: 78.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.8.16 Linux/6.2.0-37-generic

File hashes

Hashes for brine_starknet_py-0.18.7.tar.gz
Algorithm Hash digest
SHA256 f817f408b4e87493d57af50925a447d86e28faf3beb9756b27865ae980cd4cff
MD5 5285cb0257a07d8f088a222e862fc688
BLAKE2b-256 814af69c6601fc0ec325b3d6bab09fbb496f08c1ae1e53bcef52f5b25b906f97

See more details on using hashes here.

File details

Details for the file brine_starknet_py-0.18.7-py3-none-any.whl.

File metadata

  • Download URL: brine_starknet_py-0.18.7-py3-none-any.whl
  • Upload date:
  • Size: 120.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.8.16 Linux/6.2.0-37-generic

File hashes

Hashes for brine_starknet_py-0.18.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e85e1ee3117bd3576c1dc26d1c1b1d57aa05843596ca9a4cd2319d6d2ad30ae9
MD5 7f8b4b53c46163493b65719d79f2680d
BLAKE2b-256 68ffd98db61ceaa8fb9a297b8f3881bf33ee7b69154bdef32a0af31acb5dfe81

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