Why do we need private key to connect to TronGrid API?

I’m looking at the code to transfer tokens via TronGrid and it shows the below.

  const tronWeb = new TronWeb({
    fullHost: url,
    headers: { "TRON-PRO-API-KEY": AppKey },
    privateKey: privateKey,
  });

Is this the private key to my wallet?

7 Likes

yes, in case you need to sign txs

3 Likes

Ok, I’m assuming this is optional. Anyway, thank you for your reply.

4 Likes

Do you know how to use tron in react

We are using tronweb and tronlink to connect our react frontend to Tron blockchain

Ok. I have used metamask BTTC testnet in react project