Solana tools and software
2 subscribers
17 photos
14 files
51 links
Shipping Solana software for everyone — devs, degens, and even the ones trying to rug. I see you. 👀⚡️
Download Telegram
C:\Users\Samsung\Documents\wallet-exchange\backend> node server.js
◇ injected env (5) from .env // tip: ⌘ custom filepath { path: '/custom/path/.env' }
🔍 Checking Supabase credentials...
URL: Found
Key: Found
Supabase client initialized successfully
C:\Users\Samsung\Documents\wallet-exchange\backend\config\email.js:12
const verificationLink = http://localhost:3000/verify-email?token=;
^

SyntaxError: Unexpected token ':'
at wrapSafe (node:internal/modules/cjs/loader:1763:18)
at Module._compile (node:internal/modules/cjs/loader:1804:20)
at Object..js (node:internal/modules/cjs/loader:1961:10)
at Module.load (node:internal/modules/cjs/loader:1553:32)
at Module._load (node:internal/modules/cjs/loader:1355:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at Module.require (node:internal/modules/cjs/loader:1576:12)
at require (node:internal/modules/helpers:153:16)
at Object.<anonymous> (C:\Users\Samsung\Documents\wallet-exchange\backend\routes\auth.js:4:35)
at Module._compile (node:internal/modules/cjs/loader:1830:14)

Node.js v24.15.0
const verificationLink = http://localhost:3000/verify-email?token=${verificationToken};
ALTER TABLE users ADD COLUMN email_verified BOOLEAN DEFAULT FALSE;
ALTER TABLE users ADD COLUMN verification_token VARCHAR(255);
SELECT email, email_verified, verification_token FROM users ORDER BY created_at DESC LIMIT 5;
const sgMail = require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_API_KEY);

const sendVerificationEmail = async (email, verificationToken) => {
const verificationLink = http://192.168.x.x:3000/verify-email?token=${verificationToken};

const msg = {
to: email,
from: 'noreply@walletpro.app',
templateId: process.env.SENDGRID_TEMPLATE_ID,
dynamicTemplateData: {
verificationLink: verificationLink,
},
};

try {
await sgMail.send(msg);
console.log(' Email sent via SendGrid');
return true;
} catch (error) {
console.error(' SendGrid error:', error);
return false;
}
};

module.exports = { sendVerificationEmail };
SENDGRID_API_KEY=SG.xxx...
SENDGRID_TEMPLATE_ID=d-xxx...
npm install @sendgrid/mail
from: process.env.SENDGRID_FROM_EMAIL,
const API_URL = 'http://localhost:5000/api/transactions';

export const createTransaction = async (userId, transactionData) => {
try {
const response = await fetch(${API_URL}/create, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
userId,
...transactionData,
}),
});
const data = await response.json();
return data;
} catch (error) {
console.error('Create transaction error:', error);
return { error: error.message };
}
};

export const getUserTransactions = async (userId) => {
try {
const response = await fetch(${API_URL}/user/${userId});
const data = await response.json();
return data.transactions || [];
} catch (error) {
console.error('Get transactions error:', error);
return [];
}
};

export const deleteTransaction = async (transactionId) => {
try {
const response = await fetch(${API_URL}/${transactionId}, {
method: 'DELETE',
});
const data = await response.json();
return data;
} catch (error) {
console.error('Delete transaction error:', error);
return { error: error.message };
}
};
const API_URL = 'http://localhost:5000/api/transactions';

export const createTransaction = async (userId, transactionData) => {
try {
const response = await fetch(`${API_URL}/create`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
userId,
...transactionData,
}),
});
const data = await response.json();
return data;
} catch (error) {
console.error('Create transaction error:', error);
return { error: error.message };
}
};

export const getUserTransactions = async (userId) => {
try {
const response = await fetch(`${API_URL}/user/${userId}`);
const data = await response.json();
return data.transactions || [];
} catch (error) {
console.error('Get transactions error:', error);
return [];
}
};

export const deleteTransaction = async (transactionId) => {
try {
const response = await fetch(`${API_URL}/${transactionId}`, {
method: 'DELETE',
});
const data = await response.json();
return data;
} catch (error) {
console.error('Delete transaction error:', error);
return { error: error.message };
}
};
Create transaction error: TypeError: fetch failed
Create transaction error: Could not find the 'fee' column of 'transactions' in the schema cache
ALTER TABLE transactions ADD COLUMN fee NUMERIC;
Create transaction error: Could not find the 'from_amount' column of 'transactions' in the schema cache
ALTER TABLE transactions ADD COLUMN from_crypto VARCHAR(20);
ALTER TABLE transactions ADD COLUMN from_amount NUMERIC;
ALTER TABLE transactions ADD COLUMN to_crypto VARCHAR(20);
ALTER TABLE transactions ADD COLUMN to_amount NUMERIC;
ALTER TABLE transactions ADD COLUMN recipient VARCHAR(255);
Create transaction error: invalid input syntax for type uuid: "special_josef"