raydium-sdk
raydium-sdk copied to clipboard
how to listen pair created
Hi. I want to know the raidum pair create first time. How can I get that.
I'm having some success with:
const connection = new Connection(YOUR_SOLANA_RPC_URL);
connection.onLogs(
new PublicKey("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"), // RAYDIUM_PUBLIC_KEY
(pr) => {
const { logs, err, signature } = pr;
if (err) return;
if (logs && logs.some((log) => log.includes("initialize2"))) {
console.log("Signature for 'initialize2':", signature);
// use connection.getParsedTransaction here to get more info.
}
},
"finalized",
);