This is a simple CRA app with TypeScript and Solana wallet connection through wallet-adapter
Includes:
- Typescript
- CRA
- Solana wallet adapter
yarn start
or
npm run start
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()
);
swap out useWallet
with useAnchorWallet
in MyWallet.tsx
MIT