A simple CRA app with TypeScript and Solana wallet connection through wallet-adapter

This is a simple CRA app with TypeScript and Solana wallet connection through wallet-adapter

Includes:

  • Typescript
  • CRA
  • Solana wallet adapter
screenshot

Run:

or

How do I sign transactions??

Create your transaction as usual and use wallet.signTransaction():

const transaction = new web3.Transaction({ feePayer: wallet.publicKey });
transaction.add(instruction1);
transaction.add(instruction2);

await wallet.signTransaction(transaction);
const transactionHash = await web3.sendAndConfirmRawTransaction(
    connection,
    transaction.serialize()
);

If you use anchor

swap out useWallet with useAnchorWallet in MyWallet.tsx

License

MIT

Source: https://github.com/dvcrn/solana-react-quickstart?ref=reactjsexample.com

Default image
Lingaraj Senapati
Hey There! I am Lingaraj Senapati, the Co-founder of lingarajtechhub.com My skills are Freelance, Web Developer & Designer, Corporate Trainer, Digital Marketer & Youtuber.
Articles: 253

Newsletter Updates

Enter your email address below to subscribe to our newsletter