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
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.5.tar.gz
(78.1 kB
view hashes)
Built Distribution
Close
Hashes for brine_starknet_py-0.18.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2ef85679505e55eec42f76f97af3a332bc98b0f4cae6958ce56ebb5f6582459 |
|
MD5 | 268e50bb5eaf7c7f994abf748e22b20c |
|
BLAKE2b-256 | bed087f248fe82853d6d9f1849bd16b3526f7b26cd3fa82f0d6a0c29b83a71e0 |