kapi2289 / vulcan-api

Unofficial UONET+ e-register API
https://vulcan-api.readthedocs.io/
MIT License
72 stars 17 forks source link

RuntimeWarning: coroutine 'Account.register' was never awaited #81

Closed edikiuspro closed 3 years ago

edikiuspro commented 3 years ago
f.write(account.as_json)

AttributeError: 'coroutine' object has no attribute 'as_json' sys:1: RuntimeWarning: coroutine 'Account.register' was never awaited

Antoni-Czaplicki commented 3 years ago

Please show full code

edikiuspro commented 3 years ago

@Antoni-Czaplicki from vulcan import Keystore,Account,Vulcan import asyncio import json with open("keystore.json") as f: keystore = Keystore.load(json.load(f)) account=Account.register(keystore,"token","symbol","pin") with open("account.json", "w") as f: f.write(account.as_json) json.dump(account.as_dict, f)

edikiuspro commented 3 years ago

Okay i fixed it with account=asyncio.get_event_loop().run_until_complete(Account.register(keystore,"token","stmbol","pin"))

kuba2k2 commented 3 years ago

This is not the way you should use coroutines. Please, read the docs (introduction pages) to use the coroutines as appropriate.

https://vulcan-api.readthedocs.io/en/latest/getting-started/01-info.html