Spaces:
Runtime error
Runtime error
File size: 1,048 Bytes
19e145e 8b20f20 238dfcb 8b20f20 19e145e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
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(
greet,
"text",
[
gr.outputs.Textbox(label="Public Key")
],
title="Ocean Token Calculator",
description=description,
article=article,
theme="huggingface",
)
interface.launch() |