Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add get_libraries method #49

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

yungwine
Copy link
Contributor

@yungwine yungwine commented Dec 4, 2023

Example code to check that everything works:

import requests
import asyncio

from pytonlib import TonlibClient


ton_config_url = 'https://newton-blockchain.github.io/global.config.json'
ton_config = requests.get(ton_config_url).json()


from pathlib import Path
Path('/tmp/ton_keystore').mkdir(parents=True, exist_ok=True)
client = TonlibClient(ls_index=0, # choose LiteServer to connect
                      config=ton_config,
                      keystore='/tmp/ton_keystore',
                      verbosity_level=3)


async def main():
    await client.init()

    result = await client.get_libraries(['wkUmK4wrzl6fzSPKM04dVfqW1M5pqigX3tcXzvy6P3M='])
    print(result)

    await client.close()


asyncio.run(main())

@dungeon-master-666 dungeon-master-666 merged commit 9c6d7d9 into toncenter:main Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants