rckprtr / pumpdotfun-sdk

PumpDotFun SDK
MIT License
197 stars 81 forks source link

How can I buy token created by someone on pumpfun? #26

Closed tayyabwahid closed 2 months ago

tayyabwahid commented 2 months ago

Let's say ABC is my wallet that has some sols. This is the token URL https://pump.fun/BivBq2jUr4zd9XvH683Dzm814mJ3VMECpoUb2byEpump. How can I create a mint keypair from the existing token?

const mint = getOrCreateKeypair(KEYS_FOLDER, "mint");

Like in this line of code, you generate a new mint for creating the new token. But in my case, I want to buy a token created by someone else.

rckprtr commented 2 months ago

Yes, the mint of the token is let mint = new Publickey('BivBq2jUr4zd9XvH683Dzm814mJ3VMECpoUb2byEpump') so just purchase that token at that address.

tayyabwahid commented 2 months ago

Here is one more question: I made a buy transaction that took too long with default parameters like slippage and priorities. How I can make it up fast and how much cost it will effects?

Screenshot 2024-07-20 at 2 12 12 AM