Environment Variables Config

Environment Configuration

Example .env File

iniCopyEdit# Required API keys and configurations
PRIVATE_KEYPAIR=<YOUR_PRIVATE_KEYPAIR>   # Replace with your private keypair for deployment
OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>    # Replace with your OpenAI API key
RPC_ENDPOINT=https://api.mainnet-beta.solana.com  # Replace with your RPC endpoint URL

# Trade parameters
ACTION=buy          # Set to "buy" or "sell"
MINT=<YOUR_TOKEN_MINT_ADDRESS>  # Replace with the token contract address
AMOUNT=10000        # Replace with the amount of SOL or tokens to trade

# Debugging
NODE_DEBUG=module 

Note: Replace all placeholders (e.g., <YOUR_PRIVATE_KEYPAIR>, <YOUR_OPENAI_API_KEY>) with your actual credentials before using the file.


How to Use Environment Variables

  1. Add the .env file to your project root: Ensure that this file is kept private and never committed to a public repository.

  2. Automatic loading with dotenv: The framework automatically loads these variables at runtime using the dotenv package.


Dependencies

Below is a list of the key dependencies used in this framework, along with their versions and primary purpose.

Dependency

Version

Purpose

@solana/web3.js

^1.98.0

Solana blockchain interaction.

dotenv

^16.4.7

Secure management of environment variables.

supabase

^11.1.0

Supabase SDK for authentication and database integration.

node-fetch

^3.3.2

Lightweight module to make HTTP requests.

form-data

^4.0.1

Handling form data in HTTP requests.

openai

^4.77.3

Integration with OpenAI’s GPT models for AI-based functionalities.

bs58

^6.0.0

Base58 encoding and decoding for working with Solana data structures.


Development Dependencies

Dependency

Version

Purpose

typescript

^5.7.3

Enables static typing and type-checking in JavaScript.

ts-node

^10.9.2

Allows TypeScript code to run directly in Node.js.

@types/node-fetch

^2.6.12

Type definitions for node-fetch library.

tsconfig-paths

^4.2.0

Resolves paths for TypeScript configuration.


By following this guide, you can configure your environment, manage credentials securely, and understand how the dependencies integrate into the framework.

Last updated