cra-template-solana

0.10.0 • Public • Published

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!

Readme

Keywords

none

Package Sidebar

Install

npm i cra-template-solana

Weekly Downloads

1

Version

0.10.0

License

MIT

Unpacked Size

46.6 kB

Total Files

33

Last publish

Collaborators

  • sultandilaram
  • rockstar_sb