ваше сообщение коммита

This commit is contained in:
2025-04-22 17:41:05 +03:00
parent aa263189e9
commit 7b6d23b1ca
11 changed files with 3011 additions and 708 deletions

View File

@@ -25,9 +25,16 @@ export const TOKEN_CONTRACTS = {
};
// Получение балансов токенов
export const fetchTokenBalances = async () => {
export const fetchTokenBalances = async (address = null) => {
try {
const response = await api.get('/api/tokens/balances');
let url = '/api/tokens/balances';
if (address) {
url += `?address=${encodeURIComponent(address)}`;
console.log(`Fetching token balances for specific address: ${address}`);
} else {
console.log('Fetching token balances for session user');
}
const response = await api.get(url);
return response.data;
} catch (error) {
console.error('Error fetching token balances:', error);