fix: Update trading API routes for enhanced functionality

API Route Improvements:
- Enhanced execute-dex route for better DEX trade execution
- Improved validation route for comprehensive trade validation
- Better error handling and response formatting
- Supporting infrastructure for Jupiter-style trading interface

These changes complement the new chart trading interface with more robust backend processing.
This commit is contained in:
mindesbunister
2025-07-16 16:21:43 +02:00
parent ffa3c5c8e1
commit fb8d361020
2 changed files with 2 additions and 2 deletions

View File

@@ -66,7 +66,7 @@ export async function POST(request) {
console.log('🔍 Validating wallet balance before DEX trade...')
try {
const validationResponse = await fetch('http://localhost:3001/api/trading/validate', {
const validationResponse = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000'}/api/trading/validate`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({

View File

@@ -10,7 +10,7 @@ export async function POST(request) {
// Fetch real wallet balance from the wallet API
let walletBalance
try {
const walletResponse = await fetch('http://localhost:3001/api/wallet/balance')
const walletResponse = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000'}/api/wallet/balance`)
const walletData = await walletResponse.json()
if (walletData.success && walletData.wallet) {