No project description provided
Project description
✨🐍 starknet.py
StarkNet SDK for Python
📘 Documentation
▶️ Example usage
Asynchronous API
This is the recommended way of using the SDK.
from starknet.contract import Contract
from starknet.net.client import Client
key = 1234
contract = await Contract.from_address("0x01336fa7c870a7403aced14dda865b75f29113230ed84e3a661f7af70fe83e7b", Client("testnet"))
invocation = await contract.functions["set_value"].invoke(key, 7)
await invocation.wait_for_acceptance()
(saved,) = await contract.functions["get_value"].call(key) # (7)
Synchronous API
You can access synchronous world with _sync
postfix.
from starknet.contract import Contract
from starknet.net.client import Client
key = 1234
contract = Contract.from_address_sync("0x01336fa7c870a7403aced14dda865b75f29113230ed84e3a661f7af70fe83e7b", Client("testnet"))
invocation = contract.functions["set_value"].invoke_sync(key, 7)
invocation.wait_for_acceptance_sync()
(saved,) = contract.functions["get_value"].call_sync(key) # 7
See more 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.1.0a0.tar.gz
(71.6 kB
view hashes)
Built Distribution
Close
Hashes for starknet.py-0.1.0a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b23065c3ff8c0e46bb19dd15836d356268a8feb57d354249fe899b57f4cb701 |
|
MD5 | 21aa2d248f1f2a396e6bffce09123e0e |
|
BLAKE2b-256 | e690bbf165c86736b3d2c7b2a1e8360f82881dce8ccdccfa8254012f1fe52370 |