raydium-sdk icon indicating copy to clipboard operation
raydium-sdk copied to clipboard

how to listen pair created

Open Kinco4TC opened this issue 1 year ago • 1 comments

Hi. I want to know the raidum pair create first time. How can I get that.

Kinco4TC avatar Jan 07 '24 07:01 Kinco4TC

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",
);

rvdende avatar Jan 21 '24 09:01 rvdende