async function getMySwapHistory() {
try {
// Gets history for the client's own wallet
const history = await client.getUserSwaps();
console.log('My swap history:', history.swaps);
} catch (error) {
console.error('Failed to get my swap history:', error);
}
}
async function getAnyUserSwapHistory(userPublicKey: string) {
try {
const history = await client.getUserSwaps(userPublicKey, {
limit: 50,
sort: "timestampDesc",
});
console.log(`History for ${userPublicKey}:`, history.swaps);
} catch(error) {
console.error('Failed to get user swap history:', error);
}
}