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

key = 1234
contract = await Contract.from_address(
    address="0x01336fa7c870a7403aced14dda865b75f29113230ed84e3a661f7af70fe83e7b",
    client=GatewayClient("testnet"),
)
(value,) = await contract.functions["get_value"].call(key)

Synchronous API

You can access synchronous world with _sync postfix.

from starknet_py.contract import Contract
from starknet_py.net.gateway_client import GatewayClient

key = 1234
contract = Contract.from_address_sync(
    address="0x01336fa7c870a7403aced14dda865b75f29113230ed84e3a661f7af70fe83e7b",
    client=GatewayClient("testnet"),
)
(value,) = contract.functions["get_value"].call_sync(key)

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.13.0a0.tar.gz (95.0 kB view details)

Uploaded Source

File details

Details for the file starknet_py-0.13.0a0.tar.gz.

File metadata

  • Download URL: starknet_py-0.13.0a0.tar.gz
  • Upload date:
  • Size: 95.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for starknet_py-0.13.0a0.tar.gz
Algorithm Hash digest
SHA256 5a530505e42121b8c039e7ccb6c5cea3c5cb77a4c4f9058433b1cab8c57765fe
MD5 0cb275d1a14469e2c689dd492c7aa3d3
BLAKE2b-256 75c05af1d25b0e53c2540b46a3c6b86a9bea6c573c4db52de293507a5ec72c55

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