solana-developers / solana-cookbook

https://solanacookbook.com/
619 stars 344 forks source link

[Request]Get transaction history for a wallet addrss #390

Open alarrieux opened 2 years ago

Loverboylove commented 2 years ago

👌

UjjwalGupta49 commented 2 years ago

Can be done using Solscan API

import { useWallet } from "@solana/wallet-adapter-react";
const { publicKey } = useWallet();

try {
      fetch(`https://public-api.solscan.io/account/transactions?account=${publicKey}&limit=50`)
        .then((response) => response.json())
        .then((data) => console.log(data));
    } catch (error) {
        console.log(error)
    }
alarrieux commented 2 years ago

@UjjwalGupta49 looking to use alchemy or quicknode

UjjwalGupta49 commented 2 years ago

You can change with API url and send GET request accordingly.