I want to fetch a token's program account but I don't know the program id. I only have the token mint address. Is it possible to get it? Thanks in advance.
Here is an example. It fetches the program account from Raydium with a specific token mint address.
const accounts = await solanaConnection.getProgramAccounts(
RAYDIUM_LIQUIDITY_PROGRAM_ID_V4,
{
commitment: "confirmed",
filters: [
{
dataSize: LIQUIDITY_STATE_LAYOUT_V4.span,
},
{
memcmp: {
offset: LIQUIDITY_STATE_LAYOUT_V4.offsetOf('baseMint'),
bytes: specificTokenMint,
},
},
],
}
);