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.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
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.15.2.tar.gz
(109.5 kB
view details)
File details
Details for the file starknet_py-0.15.2.tar.gz.
File metadata
- Download URL: starknet_py-0.15.2.tar.gz
- Upload date:
- Size: 109.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88a9e64f30fd54df0d7cfb913fd6bb0ba99f533f6117b8723a05838f0dfc42da
|
|
| MD5 |
fe810502c8fdb134ccdc85dbcba544a1
|
|
| BLAKE2b-256 |
cb989c5b8a9ea84614d8d2c26ba815d955f207e8b60a4e15f128c634ef3d5ec7
|