PK stored in secret env
This commit is contained in:
@ -38,6 +38,9 @@ import re
|
||||
from typing import List, Dict, Any, Tuple
|
||||
|
||||
load_dotenv()
|
||||
# Load secret environment variables
|
||||
load_dotenv('.env.secret')
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
ENV_FILE = '.env'
|
||||
@ -773,7 +776,12 @@ async def follow_move(move):
|
||||
|
||||
if your_balance >= amount_to_swap:
|
||||
try:
|
||||
private_key = Keypair.from_bytes(base58.b58decode(os.getenv("PK")))
|
||||
pk_b58 = os.getenv("PK")
|
||||
if not pk_b58:
|
||||
logging.error("Private key not found. Can not sign transactions without private key.")
|
||||
return
|
||||
|
||||
private_key = Keypair.from_bytes(base58.b58decode(pk_b58))
|
||||
async_client = AsyncClient(SOLANA_WS_URL)
|
||||
jupiter = Jupiter(async_client, private_key)
|
||||
|
||||
|
Reference in New Issue
Block a user