The Solana Token Scanner is a tool designed to interact with the Solana blockchain to fetch and display information about specific tokens. It provides detailed metadata about tokens, including their liquidity in USD and the latest buy transactions. This tool is especially useful for developers and users who need to monitor token activity on the Solana network.
- Fetch Token Metadata: Retrieves and displays details such as token name, symbol, and liquidity in USD.
- Latest Buy Transaction: Identifies and shows the most recent buy transaction for a specified token, including details like sender, recipient, and amount.
- Configurable Connection: Easily connects to different Solana RPC URLs by adjusting environment settings.
- Node.js: Ensure you have Node.js installed. You can download it from nodejs.org.
- NestJS: The application is built with the NestJS framework. You can learn more and install it from nestjs.com.
-
Clone the Repository
git clone https://github.com/just2102/Solana-Token-Scanner.git cd Solana-Token-Scanner
-
Install Dependencies
yarn
-
Configure Environment Variables
Create a
.env
file in the root directory and add your Solana RPC URL:SOLANA_URL=https://api.mainnet-beta.solana.com
-
Run the Application
To start the application and fetch token information, use:
yarn start:dev
-
Fetch Token Information
You can fetch token details by sending a GET request to the
/token
endpoint. For example:curl -X GET http://localhost:3000/token/<TOKEN_ADDRESS>
Replace
<TOKEN_ADDRESS>
with the actual token address you want to query. -
Example Command
curl -X GET http://localhost:3000/token/EXAMPLE_TOKEN_ADDRESS
This will return a JSON response with token liquidity in USD and the latest buy transaction details.
-
GET /token: Fetches metadata and the latest buy transaction for a specified token.
-
Parameters:
token
(required): The public key of the token.
-
Response:
{ "liquidity": 12345.67, "latestBuyTx": { "hash": "3G76Hx...", "slot": 12345678, "sender": "8F8A9V...", "recipient": "9G9B9C...", "amount": "100.00", "dapp": "4K7L5M..." } }
-
GetTokenResponseDto
: Data transfer object for returning token metadata and the latest buy transaction.ScreenerResponse
: Interface for handling the response from the external API providing token data.LatestTx
: Interface for the details of the latest buy transaction.
SOLANA_URL
: Set this to your desired Solana RPC URL to connect to the Solana blockchain network.
-
Fork the Repository
-
Create a New Branch
git checkout -b feature/your-feature-name
-
Commit Your Changes
git commit -m 'Add some feature'
-
Push to the Branch
git push origin feature/your-feature-name
-
Create a Pull Request