New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

async-substrate-interface

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-substrate-interface

Asyncio library for interacting with substrate. Mostly API-compatible with py-substrate-interface

1.0.7
PyPI
Maintainers
1

Async Substrate Interface

This project provides an asynchronous interface for interacting with Substrate-based blockchains. It is based on the py-substrate-interface project.

Additionally, this project uses bt-decode instead of py-scale-codec for faster SCALE decoding.

Installation

To install the package, use the following command:

pip install async-substrate-interface

Usage

Here are examples of how to use the sync and async inferfaces:

from async_substrate_interface import SubstrateInterface

def main():
    substrate = SubstrateInterface(
        url="wss://rpc.polkadot.io"
    )
    with substrate:
        result = substrate.query(
            module='System',
            storage_function='Account',
            params=['5CZs3T15Ky4jch1sUpSFwkUbYEnsCfe1WCY51fH3SPV6NFnf']
        )

        print(result)

main()
import asyncio
from async_substrate_interface import AsyncSubstrateInterface

async def main():
    substrate = AsyncSubstrateInterface(
        url="wss://rpc.polkadot.io"
    )
    async with substrate:
        result = await substrate.query(
            module='System',
            storage_function='Account',
            params=['5CZs3T15Ky4jch1sUpSFwkUbYEnsCfe1WCY51fH3SPV6NFnf']
        )

        print(result)

asyncio.run(main())

Contributing

Contributions are welcome! Please open an issue or submit a pull request to the staging branch.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or inquiries, please join the Bittensor Development Discord server: Church of Rao.

Keywords

substrate

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts