XYPRESS
  • OVERVIEW
  • INTRODUCTION
  • FEATURES
  • Features
    • WALLET METRICS
  • FUNCTIONS
Powered by GitBook
On this page
  1. Features

WALLET METRICS

To check your wallet's performance on XYPRESS, simply:

  1. Visit xypress.fun.

  2. Paste your Solana wallet address into the designated input field.

import axios from "axios";

interface WalletData {
  totalProfit: number;
  winRate: number;
  totalSolanaHoldings: number;
  realizedProfit7Days: number;
}

interface Activity {
  transactionHash: string;
  type: string; 
  date: string;
}


export const fetchSolanaBalance = async (walletAddress: string): Promise<number> => {
  const response = await axios.get(`https://api.mainnet-beta.solana.com`, {
    params: {
      method: "getBalance",
      params: [walletAddress],
    },
  });

  return response.data.result.value; 
};


export const fetchRecentActivity = async (walletAddress: string): Promise<Activity[]> => {
  const response = await axios.get(`https://api.mainnet-beta.solana.com`, {
    params: {
      method: "getConfirmedSignaturesForAddress2",
      params: [walletAddress],
    },
  });

  return response.data.result.map((activity: any) => ({
    transactionHash: activity.signature,
    type: activity.type,
    date: new Date(activity.blockTime * 1000).toISOString(),
  }));
};
PreviousFEATURESNextFUNCTIONS

Last updated 2 months ago

Page cover image