NEWTON

NEWTON


Popular tags

    How to use await in StarkNet.py?

    Asked

    30 days ago

    14

    views


    0

    Hey, the docs always use await before methods, but when I try to run those scripts I get an error.

    Anyone could help?

      starknetpystarknet_py

    0xa483...6765fa

    asked

    30 days ago


    1 answers

    0

    Accepted answer

    Hey! Just use asyncio library!

    The easiest way of using it (from the docs):

    import asyncio
    
    async def main():
        print('Hello ...')
        await asyncio.sleep(1)
        print('... World!')
    
    asyncio.run(main())
    

    Put your code inside an async function and run it with the asyncio.run

    war-in

    answered

    30 days ago

    Your answer

    NEWTON

    NEWTON