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:
@@ -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({
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user