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 = ( "

" "Ocean Protocol | " "Ocean Python Library | " "Algovera" "

" ) interface = gr.Interface( fn=greet, inputs="text", outputs="text", title="Ocean Token Calculator", description=description, article=article, theme="huggingface", ) interface.launch()