Awesome
<div align="center"> <img src="https://raw.githubusercontent.com/software-mansion/starknet.py/master/graphic.png" alt="starknet.py"/> </div> <h2 align="center">Starknet SDK for Python</h2> <div align="center"> </div>📘 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.