Categories
Solana

icoPage.tsx:47 Error minting tokens: RangeError: Maximum call stack size exceeded

I keep getting this error when I call my function to mint tokens

 const TOKEN_OWNER = process.env.NEXT_PUBLIC_SOL_TOKEN_OWNER_KEY_PAIR || '' const TOKEN_MINT_ADDRESS = new PublicKey(address.address) || '' const ownerArray = Uint8Array.from(TOKEN_OWNER.split(',').map(Number)) const OWNER: Keypair = Keypair.fromSecretKey(ownerArray) // console.log(ownerArray) const handleMint = async (e: any) => { e.preventDefault(); if (!publicKey) { setStatus('Please connect your wallet first.'); return; } setStatus('Minting tokens...'); try { await mintTokensForUser( TOKEN_MINT_ADDRESS, OWNER, publicKey, connection ); setStatus('Tokens minted successfully!'); } catch (error:any) { console.error('Error minting tokens:', error); setStatus(`Error minting tokens: ${error.message}`); } }; this is my mint token function 

submitted by /u/Icy_Ad_6803
[link] [comments]

Join The SmashBotAI Telegram Community Now! Get trade alerts, smashable token trade ideas, and more!

https://t.me/smashbotcommunity

Start Trading Now:

SmashBotAI Telegram Bot

Claim Your $SMASH Airdrop Now!

Join The SmashBotAI Telegram Community Now! Get trade alerts, smashable token trade ideas, and more! https://t.me/smashbotcommunity

Start Trading Now:
SmashBotAI Telegram Bot

Claim Your $SMASH Airdrop Now!

Categories