0

I am getting the error : [SyntaxError: No identifiers allowed directly after numeric literal]

Actually I am using @solana/web3.js and @solana/spl-token libraries.

/*
param is

{"amount": "1", "mintAddress": "8hhtxFeTfwjxM6E5CCMyAwAD2FyYPhFptkd7NG1kCXcD", 
"network": "devnet", "privateKey": [63, 187, 34, 85, 159, 44, 110, 254, 116, 129, 35, 
146, 244, 255, 155, 211, 159, 242, 54, 58, 203, 80, 192, 199, 201, 245, 83, 120, 199, 
209, 45, 200, 244, 225, 78, 38, 107, 204, 74, 92, 219, 98, 200, 117, 166, 82, 140, 165, 
121, 161, 190, 47, 129, 123, 66, 42, 89, 147, 160, 22, 184, 133, 113, 213], 
"toAddress": "Dd77w197tyyst5wXYXUHVCbWBYyWbTdBBHecpqLD6z16"}
*/

    const connectionCluster = new web3.Connection(web3.clusterApiUrl('devnet'));

    const TokenAddress = new web3.PublicKey(param.mintAddress);     
    const recipientAddress = new web3.PublicKey(param.toAddress);   
    const senderKeypair = web3.Keypair.fromSecretKey(param.privateKey); 

    const txSigner: web3.Signer = {
      publicKey: senderKeypair.publicKey,
      secretKey: senderKeypair.secretKey
    }

    // getting error in below line
    // No identifiers allowed directly after numeric literal
    const addRecipientTokenAccount = await spl.getOrCreateAssociatedTokenAccount(  
        connectionCluster,
        txSigner,
        TokenAddress,
        recipientAddress
    

getOrCreateAssociatedTokenAccount() definition can be seen here: https://solana-labs.github.io/solana-program-library/token/js/modules.html#getOrCreateAssociatedTokenAccount

I am doing everything right (I believe). I have checked several times, but still don't know why the error is coming at build time. When I comment out the line getOrCreateAssociatedTokenAccount - error goes away.

The problem is the error does not show any stack trace - it says no stack

0 Answers0