Spaces:
Runtime error
Runtime error
File size: 1,496 Bytes
de3835e 31b70a7 de3835e f486ddd de3835e 84285c7 d29d196 de3835e e34ce10 d29d196 de3835e d29d196 de3835e f486ddd d29d196 f486ddd f0b944c f486ddd de3835e d29d196 f486ddd d29d196 f486ddd d29d196 |
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 39 40 41 42 43 44 45 46 47 48 49 50 |
import streamlit as st
import string
import secrets
user_name = []
user_token = []
user_balance = []
count = len(user_name)
def generate_api_token(length):
characters = string.ascii_letters + string.digits
api_token = ''.join(secrets.choice(characters) for _ in range(length))
return api_token
st.sidebar.title("KVI Crypto", help="IT IS FAKE!! Just for research")
st.sidebar.write("New crypto money")
name = st.sidebar.text_input("Enter name")
create = st.sidebar.button("Create wallet")
tok_inp = st.sidebar.text_input("Enter token to login")
login = st.sidebar.button("Login")
account, deposit, price = st.tabs(["Account", "Deposit", "Price"])
price_value = 587
if create:
new_user_token = generate_api_token(16)
user_name.append(name)
user_token.append(new_user_token)
user_balance.append(0)
index = count
balance = user_balance[index]
account.write(f"Your token: {new_user_token}. Remember it or copy!!")
account.header(f"Your balance: {balance}")
elif login:
if tok_inp in user_token:
innd = user_token.index(tok_inp)
balance = user_balance[innd]
name = user_name[innd]
account.write(f"Your token: {tok_inp}")
account.header(f"Your balance: {balance}")
deposit.subheader("Deposit money to wallet.")
how_much = deposit.number_input("Enter how much")
user_balance[innd] += how_much
price.header(f"Current KVI Crypto price is {price_value}$") |