In react native I am getting this error : [SyntaxError: No identifiers allowed directly after numeric literal]
There is no stack shown. How do I even begin debugging this without any call stack?
Here is my App.tsx file. When I comment out getOrCreateAssociatedTokenAccount line the error goes away. When I uncomment getOrCreateAssociatedTokenAccount line the error comes back :-
import * as web3 from '@solana/web3.js';
import * as spl from "@solana/spl-token";
import React, {useRef} from 'react';
import {SafeAreaView, ScrollView, StatusBar, Text, TouchableOpacity} from 'react-native';
import {Header} from './components';
import {AccountProvider, ConnectionProvider} from './providers';
import {Wallet} from './screens';
export const App = () => {
const scrollViewRef = useRef<null | ScrollView>(null);
const onPress = async() => {
console.log("=============== inside press function ============")
const connectionCluster = new web3.Connection(web3.clusterApiUrl('devnet'));
// const userPublicKey = "7pJNAtZAnuHSEa5s2ixHC9bEgkoVnTTEBUg3xuTXSaLC"; // app wallet address
// const userPublicKey = "Dd77w197tyyst5wXYXUHVCbWBYyWbTdBBHecpqLD6z16"; // second account address
let myAppWalletSecretKey = new Uint8Array([63,187,34,85,159,44,110,254,116,129,35,146,244,255,155,211,149,242,54,58,203,80,192,19,201,245,83,120,199,209,45,200,244,225,78,38,107,204,74,92,219,98,200,117,166,582,120,165,111,161,190,47,129,123,66,42,89,147,160,212,184,123,133,213])
const TokenAddress = new web3.PublicKey("8hhtxFeTfwjxM6E5CCMyAwAD2FyYPhFltkw7NG1kCXcD"); // address of the token
const recipientAddress = new web3.PublicKey("Dd77w197tyyst5wXYXUHVabWBYyWbTdBzHecpqLD6z16"); // address of person who is receiving
const senderKeypair = web3.Keypair.fromSecretKey(myAppWalletSecretKey); // account of the person who is sending
// When I comment out below line the error goes away.
// When I uncomment below line the error comes back
const addRecipientToAcct = await spl.getOrCreateAssociatedTokenAccount(
connectionCluster,
senderKeypair,
TokenAddress,
recipientAddress
);
}
return (
<>
<SafeAreaView>
<TouchableOpacity
style={{backgroundColor: 'red'}}
onPress={onPress}
>
<Text>Press Here</Text>
</TouchableOpacity>
</SafeAreaView>
</>
);
};
export default App;
How do I even begin debugging this without any call stack?