rckprtr/pumpdotfun-sdk

Issue with createAndBuy Function: Stuck at sendTx After Switching to Blob for CreateTokenMetadata

Closed this issue · 3 comments

I noticed that CreateTokenMetadata no longer has filePath; instead, it now uses a Blob. Even after modifying this, the createAndBuy function still doesn't work. It seems to get stuck at the sendTx function.

util.js:

image

Info:
package.json:
"pumpdotfun-sdk": "^1.3.2"
devnet & mainnet

Code sample:

token_meta_data.json:

{
  "name": "TESTTOK",
  "symbol": "TESTTOK",
  "description": "My awesome token",
  "file": "./images/token_image.jpeg",
  "twitter": "@ttokentest",
  "telegram": "@ttokentest",
  "website": "https://ttokentest.net"
} 

index.js:

const tokenMetaDataPath = path.join(__dirname, '..', 'config', 'token_meta_data.json');
const createTokenMetadata = JSON.parse(fs.readFileSync(tokenMetaDataPath, 'utf-8'));
const imagePath = path.join(__dirname, '..', 'images', 'token_image.jpeg');
const imageBuffer = fs.readFileSync(imagePath);
const imageBlob = new Blob([imageBuffer], { type: 'image/jpeg' });

const tokenMetadata = {
  ...createTokenMetadata,
  file: imageBlob
};

const SLIPPAGE_BASIS_POINTS = 500n;
const BUY_SOL_AMOUNT = 500000000n;
const result = await sdk.createAndBuy(OWNER, mintKeypair, tokenMetadata, BUY_SOL_AMOUNT, SLIPPAGE_BASIS_POINTS);

I think devnet has been down? Trying to figure it out also.

Mainnet seems to be working, but the transactions are painfully slow. I've tried passing 'processed', 'finalized' to both commitment and finality, but that doesn't seem to do the trick...

I think devnet has been down? Trying to figure it out also.

I think it is down...

image