Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from ocean_lib.config import Config | |
| from ocean_lib.ocean.ocean import Ocean | |
| from ocean_lib.web3_internal.wallet import Wallet | |
| import os | |
| config = Config('config.ini') | |
| ocean = Ocean(config) | |
| def greet(private_key): | |
| wallet = Wallet(ocean.web3, private_key, transaction_timeout=20, block_confirmations=config.block_confirmations) | |
| return wallet.address | |
| description = ( | |
| "This demo calculate the number of tokens in your wallet using the Ocean Python library. " | |
| ) | |
| article = ( | |
| "<p style='text-align: center'>" | |
| "<a href='https://oceanprotocol.com/' target='_blank'>Ocean Protocol</a> | " | |
| "<a href='https://github.com/oceanprotocol/ocean.py' target='_blank'>Ocean Python Library</a> | " | |
| "<a href='https://www.algovera.ai' target='_blank'>Algovera</a>" | |
| "</p>" | |
| ) | |
| interface = gr.Interface( | |
| fn=greet, | |
| inputs="text", | |
| outputs="text", | |
| title="Ocean Token Calculator", | |
| description=description, | |
| article=article, | |
| theme="huggingface", | |
| ) | |
| interface.launch() |