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.18.1.tar.gz
(74.4 kB
view details)
File details
Details for the file starknet_py-0.18.1.tar.gz
.
File metadata
- Download URL: starknet_py-0.18.1.tar.gz
- Upload date:
- Size: 74.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29be5df177569684dbafd9a398be770c8fb044aaa1e27a9847052d89af3f2d30 |
|
MD5 | 5826623e4e4fbb71a42291ae79c645a3 |
|
BLAKE2b-256 | 3689fbddc6f26c275e1b2ba552d3a86caab6db23b6b1e6cf32ff97664c9231f9 |