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
1.3.0
1.2.9
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.9
1.1.8
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0a2
1.0.0a1
1.0.0
0.9.9
0.9.8
0.9.7
0.9.6
0.9.5
0.9.4
0.9.35
0.9.34
0.9.33
0.9.32
0.9.31
0.9.30
0.9.3
0.9.29
0.9.28
0.9.27
0.9.25
0.9.22
0.9.21
0.9.20
0.9.19
0.9.18
0.9.17
0.9.16
0.9.15
0.9.14
0.9.13
0.9.12
0.9.11
0.9.10
0.13.9
0.13.8
0.13.7
0.13.6
0.13.5
0.13.4
0.13.3
0.13.2
0.13.13
0.13.12
0.13.11
0.13.10
0.13.1
0.13.0
0.12.7
0.12.6
0.12.5
0.12.4
0.12.3
0.12.2
0.12.1
0.12.0
0.11.9
0.11.8
0.11.7
0.11.6
0.11.5
0.11.4
0.11.3
0.11.20
0.11.2
0.11.19
0.11.18
0.11.17
0.11.16
0.11.15
0.11.14
0.11.13
0.11.12
0.11.11
0.11.10
0.11.1
0.11.0
0.10.3
0.10.2
0.10.1
0.10.0
توضیحات
Library for interfacing with a Substrate node
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | substrate-interface-1.8.1 |
| نام | substrate-interface |
| نسخه کتابخانه | 1.8.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Stichting Polkascan (Polkascan Foundation) |
| ایمیل نویسنده | info@polkascan.org |
| آدرس صفحه اصلی | https://github.com/polkascan/py-substrate-interface |
| آدرس اینترنتی | https://pypi.org/project/substrate-interface/ |
| مجوز | - |
# Python Substrate Interface
[](https://github.com/JAMdotTech/py-polkadot-sdk/actions?query=workflow%3A%22Run+unit+tests%22)
[](https://pypi.org/project/substrate-interface/)
[](https://pypi.org/project/substrate-interface/)
[](https://github.com/JAMdotTech/py-polkadot-sdk/blob/master/LICENSE)
## Description
This library specializes in interfacing with a [Substrate](https://substrate.io/) node; querying storage, composing extrinsics,
SCALE encoding/decoding and providing additional convenience methods to deal with the features and metadata of
the Substrate runtime.
## Documentation
* [Library documentation](https://jamdottech.github.io/py-polkadot-sdk/)
* [Metadata documentation for Polkadot and Kusama ecosystem runtimes](https://jamdottech.github.io/py-polkadot-metadata-docs/)
## Installation
```bash
pip install substrate-interface
```
## Initialization
Using embedded light client
```python
substrate = SubstrateInterface(chainspec="polkadot_asset_hub", relay_chainspecs=["polkadot"])
```
Using node RPC endpoint
```python
substrate = SubstrateInterface(url="ws://127.0.0.1:9944")
```
After connecting certain properties like `ss58_format` will be determined automatically by querying the RPC node. At
the moment this will work for most `MetadataV14` and above runtimes like Polkadot, Kusama, Acala, Moonbeam. For
older or runtimes under development the `ss58_format` (default 42) and other properties should be set manually.
## Quick usage
### Balance information of an account
```python
result = substrate.query('System', 'Account', ['F4xQKRUagnSGjFqafyhajLs94e7Vvzvr8ebwYJceKpr8R7T'])
print(result.value['data']['free']) # 635278638077956496
```
### Create balance transfer extrinsic
```python
call = substrate.compose_call(
call_module='Balances',
call_function='transfer',
call_params={
'dest': '5E9oDs9PjpsBbxXxRE9uMaZZhnBAV38n2ouLB28oecBDdeQo',
'value': 1 * 10**12
}
)
keypair = Keypair.create_from_uri('//Alice')
extrinsic = substrate.create_signed_extrinsic(call=call, keypair=keypair)
receipt = substrate.submit_extrinsic(extrinsic, wait_for_inclusion=True)
print(f"Extrinsic '{receipt.extrinsic_hash}' sent and included in block '{receipt.block_hash}'")
```
## Contact and Support
For questions, please see the [Substrate StackExchange](https://substrate.stackexchange.com/questions/tagged/python) or [Github Discussions](https://github.com/JAMdotTech/py-polkadot-sdk/discussions).
## License
https://github.com/JAMdotTech/py-polkadot-sdk/blob/master/LICENSE
نیازمندی
| مقدار | نام |
|---|---|
| - | websocket-client<2,>=0.57.0 |
| - | base58<3,>=1.0.3 |
| - | certifi>=2019.3.9 |
| - | idna<4,>=2.1.0 |
| - | requests<3,>=2.21.0 |
| - | xxhash<4,>=1.3.0 |
| - | ecdsa<1,>=0.17.0 |
| - | eth-keys<1,>=0.2.1 |
| - | eth_utils<6,>=1.3.0 |
| - | pycryptodome<4,>=3.11.0 |
| - | PyNaCl<2,>=1.0.1 |
| - | scalecodec<1.3,>=1.2.10 |
| - | py-sr25519-bindings<1,>=0.2.0 |
| - | py-ed25519-zebra-bindings<2,>=1.0 |
| - | py-bip39-bindings<1,>=0.1.9 |
| - | smoldot-light<1,>=0.1.0 |
| xtr | coverage; |
| xtr | pytest; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| <4,>=3.7 | Python |
نحوه نصب
نصب پکیج whl substrate-interface-1.8.1:
pip install substrate-interface-1.8.1.whl
نصب پکیج tar.gz substrate-interface-1.8.1:
pip install substrate-interface-1.8.1.tar.gz