Skip to content

sultandilaram/cra-template-solana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React - Solana Template

Solana and Anchor template for Create React App. This template generates Scaffold to develop Solana/Anchor Dapp frontend in React. It has built in utils for developing an efficient web3 frontend on react.

Note: We are currently testing this template, you might encounter some bugs. Please open an issue if you do so, We will get to you ASAP.

Built-In Hooks

Basic Hooks

useConfig Gives the programmed/global configurations object that you have set up in config.ts
useApi Gives the four basic API methods (GET, POST, PUT, DEL) wrapped with axios and useAuth and all basic headers
useAuth Gives the functions to login and logout while storing the auth token in localStorage
useLocalStorage Works as useState while storing the state in localStorage

Web3 Hooks

useRpc Select, Store and Retrieve rpc from localStorage and the list setup in config.ts
useProvider Gives the AnchorProvider, Connection and Wallet object along with some necessory functions such as sendAllTransactionsInBatches
useAnchorPagination Allows you to paginate through the accounts, loads the chain data faster

Helper Functions

MerkleTree Sometimes it's hard to verify large amount of data on-chain, that's where MerkleTree helps

Error Avoidance

While developing a web3 app, there are a lot of errors that can be avoided by using the right tools. This template has built in tools to avoid some of the common errors.

Usage

Create your app with create-react-app command

yarn create react-app my-app --template solana
yarn start

Contributing

Contributions, issues and feature requests are welcome.

Show your support

Give a ⭐️ if this project helped you!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published