A python SDK for Starknet
Project description
Starknet SDK for Python
📘 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.19.0a0.tar.gz
(77.0 kB
view details)
File details
Details for the file starknet_py-0.19.0a0.tar.gz
.
File metadata
- Download URL: starknet_py-0.19.0a0.tar.gz
- Upload date:
- Size: 77.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78d9892008815eb7a7ecbb1178cd9299f0c4ca00658d75d1a78024a5281be74d |
|
MD5 | f2b829ec6e9768f10f58f20c0da010e0 |
|
BLAKE2b-256 | 719f82671f7c929ad65c77c6018b0d2b2e0da9cc172974a1134fbd76eb3e4cb2 |