Update app.py
Browse files
app.py
CHANGED
|
@@ -22,6 +22,7 @@ from sqlalchemy.orm import sessionmaker, relationship
|
|
| 22 |
from werkzeug.security import generate_password_hash, check_password_hash
|
| 23 |
|
| 24 |
import openai
|
|
|
|
| 25 |
|
| 26 |
# ========================
|
| 27 |
# Streamlit Configuration UI
|
|
@@ -51,7 +52,10 @@ elif db_type == "PostgreSQL":
|
|
| 51 |
# Blockchain Configuration
|
| 52 |
st.sidebar.subheader("π Blockchain Configuration")
|
| 53 |
BLOCKCHAIN_NODE_URL = st.sidebar.text_input("Blockchain Node URL", value="https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID")
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
| 55 |
PRIVATE_KEY = st.sidebar.text_input("Blockchain Account Private Key", type="password")
|
| 56 |
|
| 57 |
# OpenAI Configuration
|
|
@@ -385,7 +389,7 @@ if authentication_status:
|
|
| 385 |
# Mint Token via API
|
| 386 |
token_address = user.blockchain_address
|
| 387 |
token_contract = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" # Example token address (USDC)
|
| 388 |
-
balance =
|
| 389 |
mint_success, mint_response = blockchain.mint_token_via_api(token_address, token_contract, balance)
|
| 390 |
if mint_success:
|
| 391 |
st.success("β
Token minted successfully via API!")
|
|
@@ -626,7 +630,7 @@ if authentication_status:
|
|
| 626 |
---
|
| 627 |
*Embark on this transformative journey with **CITIBANK DEMO BUSINESS INC** to redefine the synergy between AI and blockchain, creating an unparalleled decentralized economy.*
|
| 628 |
""")
|
| 629 |
-
|
| 630 |
# ========================
|
| 631 |
# Background Task for Verification
|
| 632 |
# ========================
|
|
|
|
| 22 |
from werkzeug.security import generate_password_hash, check_password_hash
|
| 23 |
|
| 24 |
import openai
|
| 25 |
+
from web3 import Web3 # Added import for Web3
|
| 26 |
|
| 27 |
# ========================
|
| 28 |
# Streamlit Configuration UI
|
|
|
|
| 52 |
# Blockchain Configuration
|
| 53 |
st.sidebar.subheader("π Blockchain Configuration")
|
| 54 |
BLOCKCHAIN_NODE_URL = st.sidebar.text_input("Blockchain Node URL", value="https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID")
|
| 55 |
+
|
| 56 |
+
# Hardcoded Smart Contract Address (Removed sidebar input)
|
| 57 |
+
CONTRACT_ADDRESS = "0xYourSmartContractAddress" # π Replace with your actual smart contract address
|
| 58 |
+
|
| 59 |
PRIVATE_KEY = st.sidebar.text_input("Blockchain Account Private Key", type="password")
|
| 60 |
|
| 61 |
# OpenAI Configuration
|
|
|
|
| 389 |
# Mint Token via API
|
| 390 |
token_address = user.blockchain_address
|
| 391 |
token_contract = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" # Example token address (USDC)
|
| 392 |
+
balance = "100" # As per the provided cURL command, adjust as needed
|
| 393 |
mint_success, mint_response = blockchain.mint_token_via_api(token_address, token_contract, balance)
|
| 394 |
if mint_success:
|
| 395 |
st.success("β
Token minted successfully via API!")
|
|
|
|
| 630 |
---
|
| 631 |
*Embark on this transformative journey with **CITIBANK DEMO BUSINESS INC** to redefine the synergy between AI and blockchain, creating an unparalleled decentralized economy.*
|
| 632 |
""")
|
| 633 |
+
|
| 634 |
# ========================
|
| 635 |
# Background Task for Verification
|
| 636 |
# ========================
|