To query data on Solana, you'll need an API endpoint to connect with the network. You're welcome to use public nodes but they are too slow so I recomment to use Paid nodes, such as those provided by QuickNode.
Sign up for free here.https://dashboard.quicknode.com/endpoints/new
Make sure to launch your node under the Solana Mainnet.
In your Endpoint page, copy "HTTP Provider" and paste it to the .env
file.
-
Node.js
If you don’t have Node.js installed, install it from here.
Use the LTS (long time support) variant. If you want to check if node has been installed successfully, go open the cmd and type
node -v
. If everything is ok, you should see something like v20.11.0 -
Typescript
Run the following command in the cmd.
npm install -g typescript
This will install Typescript globally. In the same manner, if you want to check for Typescript being installed, type
tsc -v
in the cmd and you should get back something like Version 5.3.3.Then, install typescript execution engine.
npm install -g ts-node
-
Navigate into the project directory and then install dependencies.
npm install
-
Run the app:
npm run main
-
Get Tokens Balance
After running the app, input 1.
1. Get Tokens Balance.
-
Get NFTs Balance
After running the app, input 2.
2. Get NFTs Balance.
-
Get Tokens Transfer History
After running the app, input 3.
3. Get Tokens Transfer History.