** How to check the launch/mint date of tokens(SPL) created on solana network?**is there any way to check on any SOLANA explorer ?
2 Answers
Step 1: imports
const {
Connection,
PublicKey,
clusterApiUrl
} = require("@solana/web3.js");
const moment = require('moment');
Step 2: function
const firstTimestamp = async () => {
const mintID = new PublicKey("BrsE4BdXip29GLE8DqxqhzAiDVEW7LYzxWAabdfLLb3f");
const connection = new Connection(clusterApiUrl("devnet"));
const txList = await connection.getSignaturesForAddress(mintID, {});
const unixTime = txList[txList.length-1].blockTime;
const oldestTxTimestamp = moment.unix(unixTime).format("MM/DD/YYYY,h:mm:ss a")
console.log(oldestTxTimestamp);
return oldestTxTimestamp;
}
-
Unfortunately this requires you to loop through all the tx to find the first one :`(– JustinCommented Dec 13, 2023 at 1:04
-
it doesn't work if you have more than 1000 transaction, because getSignaturesForAddress return the last 1000 transactions by default. you can change this limit but it's between 1 and 1000– ioriCommented Jan 13 at 13:39
You may use some service providing access to indexed db like dune.com and make a query like this.
SELECT
*
FROM solana.account_activity
WHERE
address = {{ address }}
ORDER BY
block_time
LIMIT 1
-
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.– Community BotCommented Mar 8 at 20:34